Agents API
Run one step
POST /api/agents/execute runs one agent step and answers when it has finished.
| Field | Type | Required | Meaning |
|---|---|---|---|
agent_type | string | yes | The agent's id, e.g. hiring, crm, manufacturing, comm_ar_reconciliation |
task_payload | object | The agent's input. step selects a step where the agent has several; userInputs takes the agent's run-form fields by key | |
simulate | boolean | A clearly labelled sample result. No model runs, and it is not metered |
bash
curl -X POST https://changents.ai/api/agents/execute \
-H "Authorization: Bearer $CHANGENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_type": "comm_ar_reconciliation",
"task_payload": {
"step": "invoice_matching",
"userInputs": {
"invoices": [{ "id": "INV-1042", "amount": 1200.00, "currency": "SGD" }],
"payments": [{ "ref": "PAY-88", "amount": 1200.00, "currency": "SGD" }]
}
}
}'Response
| Field | Meaning |
|---|---|
success | Whether the step produced a result |
data | The step's result. Usually summary, findings, metrics, items, recommendations, missing_information, confidence; it varies by agent |
agent_type, run_id, timestamp | Identifiers |
simulated | true for a sample result |
degraded | Present when the agent could not reach a system it expected to. Treat figures as model-derived |
plan | The agent's plan for this request: routing, the topic it was routed to, the steps it follows, the tool actions for it and handoffTo |
declined | Present when the agent refused the request before running (reason: outside_remit, handoffTo). Nothing ran and nothing was charged |
quota | Your run quota after this call |
billing | archetype, creditsCharged, creditBalance |
Each metric has a basis: input, calculated or estimate. Metrics marked input or calculated are checked against your data, and any that cannot be reproduced are relabelled estimate.
When a step needs approval
If the payload sets requiresApproval: true, the first call answers 202:
json
{ "success": false, "status": "pending_approval", "approvalId": "…" }Decide it with POST /api/workflows/approval/{approvalId} (see Workflows), or check it with GET /api/agents/approvals/{id}/status. Then call again with the same payload and approvalId. A call with an approval that is not yet granted answers 403.
Which agents
/developer lists agent types under Agent Types. Agents that are halted for your organisation, or that your organisation's guardrails do not allow, answer 403 with the reason.