Talk with Archie
API reference › Utility
Skills › Utility

Approve or Reject a Workflow Item

POST/api/v1/skills/workflows.decide/invoke
Records a decision on a queued item, such as a proposed outbound accounting write waiting for approval. Supply the item_id and the decision (approve, reject or request_changes), with an optional reason. The reply gives the approval_id, the status and the next_step. A workstream task is refused here and is decided through the task decision route.
Body parameters
item_idstring · uuidRequired
UUID of the queued item to decide, such as a proposed accounting write waiting for approval.
decisionenumRequired
The decision to record: approve, reject or request_changes.
approverejectrequest_changes
reasonstring · default
Optional note explaining the decision; it is recorded with an approval and used as the reason on a rejection.
delegated_bystring · uuid
UUID of the person the decision is made on behalf of; accepted for later use and not yet applied to the decision.
Returns

Skill executed successfully

skillstringRequired
Example approve_or_reject
outputobjectRequired
output.stub_fieldsarray of strings
output.warningsarray of strings
output.approval_idstring · uuid
output.statusstring · default
output.next_stepstring
output.notification_sentboolean · default false
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALIDAuthentication required
403PERMISSION.CAPABILITY_DENIEDInsufficient permissions
404SKILL.NOT_FOUNDSkill not found
422VALIDATION.INVALID_FORMATValidation error
429RATE_LIMIT.USERRate limit exceeded
5XXINTERNAL.UNKNOWNInternal server error
curl https://uk.heyarchie.com/api/v1/skills/workflows.decide/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "item_id": "00000000-0000-0000-0000-000000000000",
       "decision": "approve",
       "reason": "string",
       "delegated_by": null
     }'
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workflows.decide",
    item_id="00000000-0000-0000-0000-000000000000",
    decision="approve",
    reason="string",
    delegated_by=None,
)
print(result)
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workflows.decide", {
  "item_id": "00000000-0000-0000-0000-000000000000",
  "decision": "approve",
  "reason": "string",
  "delegated_by": null
});
console.log(result);
Response
{
  "skill": "approve_or_reject",
  "output": {
    "approval_id": "1d5c8b3a-7e92-4f06-b4a1-9c3e6d0f2a78",
    "next_step": "Outbound invoice approved",
    "notification_sent": false,
    "status": "approved"
  },
  "correlation_id": "<string>"
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}

Every response also carries X-Request-ID. Quote it if you write to us about a call.