Skip to content
Back to the app

Agents API ​

Run one step ​

POST /api/agents/execute runs one agent step and answers when it has finished.

FieldTypeRequiredMeaning
agent_typestringyesThe agent's id, e.g. hiring, crm, manufacturing, comm_ar_reconciliation
task_payloadobjectThe agent's input. step selects a step where the agent has several; userInputs takes the agent's run-form fields by key
simulatebooleanA 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 ​

FieldMeaning
successWhether the step produced a result
dataThe step's result. Usually summary, findings, metrics, items, recommendations, missing_information, confidence; it varies by agent
agent_type, run_id, timestampIdentifiers
simulatedtrue for a sample result
degradedPresent when the agent could not reach a system it expected to. Treat figures as model-derived
planThe agent's plan for this request: routing, the topic it was routed to, the steps it follows, the tool actions for it and handoffTo
declinedPresent when the agent refused the request before running (reason: outside_remit, handoffTo). Nothing ran and nothing was charged
quotaYour run quota after this call
billingarchetype, 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.

Served from this deployment. No page view leaves it.