Automated decisions
List automated decisions
Decisions the agent took about a person with no one asked: an action it ran because its policy did not ask for a person, or one a rule of the policy refused. Only for actions whose policy has automatedDecision. Decisions that waited for a person are approvals: GET /v2/approvals. Newest first. Filter by caseId to answer a person who asks what was decided about them. Read only and safe to repeat.
Required scope: approvals:read.
query Parameters
limitcursorThe nextCursor of the previous page, with the same filters.
outcomeagentIdcaseIdHeaders
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
List automated decisions › Responses
objecthasMorenextCursorRetrieve an automated decision
What was decided, why (reasonCode and, for a rule, its position), which argument fields it used and whether the person asked for a review. Use it to explain the decision to the person (Ley 21.719, art. 8 bis). Read only and safe to repeat.
Required scope: approvals:read.
path Parameters
id^dec_[0-9A-Za-z]{22}… · requiredThe id of the automated decision (dec_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Retrieve an automated decision › Responses
objectidagentIdcaseIdtoolThe name of the action the agent decided about.
outcomeallowed: the agent ran the action and no person was asked. rejected: a rule of the policy refused it and the action never ran.
reasonCodeWhy: policy_rule (a rule of the policy decided: see ruleIndex) or policy_not_required (the policy did not ask for a person for this call).
ruleIndexThe position (from 0) of the rule that decided this, when reasonCode is policy_rule.
dataSeenThe names of the argument fields the decision used. Never their values. Empty for a noPersist action.
reviewRequestedAtreviewReasonThe point of view the person gave when they asked for the review.
createdAtAsk for a human review of an automated decision
Use it when the person affected by the decision asks for it to be reviewed or wants to give their point of view (Ley 21.719, art. 8 bis). Stores the reason they gave and fires the automated_decision.review_requested webhook so your team can act. It does not undo the decision or run anything. Idempotent: asking twice keeps the first reason and fires the event once. For a decision that waited for a person use POST /v2/approvals/{id}/request-review.
Required scope: approvals:write.
path Parameters
id^dec_[0-9A-Za-z]{22}… · requiredThe id of the automated decision (dec_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Idempotency-KeyMakes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.
Ask for a human review of an automated decision › Request Body optional
reasonThe point of view of the person on the decision, in their words. It is stored with the record, shown in reviewReason and sent in the review_requested event. Do not put anything the person did not say.
Ask for a human review of an automated decision › Responses
objectidagentIdcaseIdtoolThe name of the action the agent decided about.
outcomeallowed: the agent ran the action and no person was asked. rejected: a rule of the policy refused it and the action never ran.
reasonCodeWhy: policy_rule (a rule of the policy decided: see ruleIndex) or policy_not_required (the policy did not ask for a person for this call).
ruleIndexThe position (from 0) of the rule that decided this, when reasonCode is policy_rule.
dataSeenThe names of the argument fields the decision used. Never their values. Empty for a noPersist action.
reviewRequestedAtreviewReasonThe point of view the person gave when they asked for the review.
createdAt