Call the CHANGENTS.AI API
Time: 20 minutes · Level: Developer
You will create an API key, run one agent step, start a released workflow, follow it to the end, decide an approval from your own system, and receive a signed webhook when it finishes.
The full specification is at /developer (Download the OpenAPI 3.1 specification).
Base URL and authentication
https://changents.ai/api- Sign in and open
/developer. - Create a key. It looks like
cgnt_sk_<clientId>.<secret>and is shown once. Store it in your secret manager. - Send it on every request, in either header:
Authorization: Bearer cgnt_sk_…
X-API-Key: cgnt_sk_…API calls draw on the credits of the key's owner. Buy credit packs and check the balance on /developer.
Errors come back as { "error": "...", "message": "...", "requestId": "..." }. Quote the requestId when you contact support.
| Status | Meaning |
|---|---|
| 400 | The request is missing something or is malformed |
| 401 | No key, or the key is invalid or revoked |
| 402 | Out of credits or run quota |
| 403 | Not allowed, for example a halted agent or a policy refusal |
| 429 | Rate limited. Back off and retry |
1. Run one agent step
POST /api/agents/execute runs one step and answers when it is done.
curl -X POST https://changents.ai/api/agents/execute \
-H "Authorization: Bearer $CHANGENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_type": "hiring",
"task_payload": {
"step": "screen_candidates",
"userInputs": {
"jobTitle": "Senior Data Engineer",
"headcount": 1,
"experienceLevel": "Senior (5–10 yrs)",
"requiredSkills": "Python, Spark, dbt"
}
}
}'agent_typeis the agent's id.hiring,crmandmanufacturingare examples; the list is on/developerunder Agent Types.task_payload.userInputstakes the same fields as the agent's run form in Power House Studio, by key.- Add
"simulate": truefor a clearly labelled sample result. It runs no model and is not metered.
The response is the body itself; there is no extra wrapper around it:
{
"success": true,
"agent_type": "hiring",
"run_id": "…",
"timestamp": "2026-11-07T04:00:00.000Z",
"data": {
"summary": "…",
"findings": [{ "title": "…", "severity": "medium", "detail": "…", "evidence": "…" }],
"metrics": [{ "label": "…", "value": 0, "unit": "", "basis": "input" }],
"recommendations": ["…"],
"missing_information": ["…"],
"confidence": "medium"
},
"billing": { "archetype": "…", "creditsCharged": 0, "creditBalance": 0 }
}data varies by agent. Each metric's basis says whether it came from your input (input), was calculated from it (calculated), or is the model's estimate. Figures marked input or calculated are checked against your data, and any that cannot be reproduced are relabelled estimate. When degraded is present, the agent could not reach a system it expected to read, so treat its figures as model-derived.
2. Start a released workflow
Build and release a workflow in Power House Studio first (see Release a Workflow Safely). Then start it by id:
curl -X POST https://changents.ai/api/workflows/run \
-H "Authorization: Bearer $CHANGENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "YOUR_WORKFLOW_ID",
"useRelease": true,
"inputs": { "jobTitle": "Senior Data Engineer", "headcount": 1,
"experienceLevel": "Senior (5–10 yrs)", "requiredSkills": "Python, Spark, dbt" }
}'{ "success": true, "correlationId": "wf_1793680000000_3c1f9a2b", "status": "running" }The answer is 202; the run carries on on the server. useRelease runs exactly the version a reviewer approved, and answers 409 if the workflow has never been released. You can instead send a whole graph (agentType, nodes, edges, inputs), at most 200 nodes.
3. Follow the run
curl https://changents.ai/api/workflows/runs/$CORRELATION_ID \
-H "Authorization: Bearer $CHANGENTS_API_KEY"The response is { "success": true, "run": { … } }. In run:
| Field | Meaning |
|---|---|
status | running, completed, partial, failed, cancelled or awaiting_approval |
nodes[] | One entry per step: nodeId, nodeTitle, status, result, error, approvalId |
finalResult | The composed result of the run |
degraded[] | Steps that did not finish, and why |
A step's status is pending, running, completed, failed, skipped or awaiting_approval. partial means some branches finished and others did not.
4. Decide approvals from your own system
A run that reaches a human review step stops with status: "awaiting_approval". List what is waiting and decide:
curl https://changents.ai/api/workflows/approvals \
-H "Authorization: Bearer $CHANGENTS_API_KEY"
curl -X POST https://changents.ai/api/workflows/approval/$APPROVAL_ID \
-H "Authorization: Bearer $CHANGENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "decision": "approved", "reason": "Shortlist checked by the hiring manager" }'decision is approved or rejected. The decision is recorded against the key's owner and the run carries on from that step. Unanswered approvals expire after 24 hours unless the agent's charter sets another time.
5. Get told when a run finishes
Polling works, but a webhook is better.
- On
/developer, add a webhook endpoint (anhttpsURL) and subscribe it torun.finished, and toapproval.requiredif you want to know when a run waits. Copy the signing secret (whsec_…); it is shown once. - Choose Send test to receive a
webhook.testevent.
Every delivery is a POST with these headers:
Changents-Signature: t=1793680000,v1=5f2b…
Changents-Event-Id: evt_…
Changents-Event-Type: run.finishedv1 is the hex HMAC-SHA256 of "<t>.<raw body>", keyed with your signing secret. Verify it before you trust the body:
const crypto = require('crypto');
function verify(secret, rawBody, header) {
const parts = Object.fromEntries(header.split(',').map(kv => kv.split('=')));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest();
const given = Buffer.from(parts.v1 || '', 'hex');
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
}import hashlib, hmac, time
def verify(secret: str, raw_body: bytes, header: str) -> bool:
parts = dict(kv.split("=", 1) for kv in header.split(","))
t = int(parts.get("t", "0"))
if not t or abs(time.time() - t) > 300:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))Read the raw body before parsing JSON, reject a timestamp more than five minutes off, and deduplicate on Changents-Event-Id, because a retry reuses it. Payloads carry ids and statuses, not run output. Fetch the run (step 3) when you need the result. All events are listed in Webhooks.
Signed-in sessions (optional)
Some account endpoints, such as GET /api/credits/balance and /api/schedules, take a signed-in session rather than an API key. POST /api/auth/login with email and password returns { success, token, expiresIn, user }. Send token as Authorization: Bearer …. It lasts 24 hours (expiresIn is 86400 seconds), and the refresh token is set as an HttpOnly cookie for POST /api/auth/token/refresh. Login answers 403 until the email address is verified, and asks for a second factor when MFA is on.