# Approve or Reject a Workflow Item

> Records a decision on a queued item, such as a proposed outbound accounting write waiting for approval. Supply the itemid and the decision (approve…

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_id string · uuid Required

UUID of the queued item to decide, such as a proposed accounting write waiting for approval.

decision enum Required

The decision to record: approve, reject or request_changes.

approve reject request_changes

reason string · default

Optional note explaining the decision; it is recorded with an approval and used as the reason on a rejection.

delegated_by string · 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

skill string Required

Example approve_or_reject

output object Required

output.stub_fields array of strings

output.warnings array of strings

output.approval_id string · uuid

output.status string · default

output.next_step string

output.notification_sent boolean · default false

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← Search the Knowledge Base Directly](https://heyarchie.com/en-gb/developers/api-reference/utility/search-the-knowledge-base-directly/)

```
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>"
  }
}
```

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