Custom HTTP & scripts
Use any HTTP client (curl, scripts, backend jobs) with the Agent API. You need the same Credentials as n8n or Zapier: Agent ID, workspace API key, and your deployment base URL (no trailing slash on the host).Headers on every call
| Header | Value |
|---|---|
X-Agent-Id | Your agent UUID |
X-Api-Key | Your workspace API key |
Content-Type | application/json (for POST) |
Create an approval (curl)
Replace placeholders and run:request_id (use this for polling, even if you did not send request_id in the body). Optional fields (timeout, callback, request_id, …) are documented under POST /v1/approvals.
Poll for the result (curl)
{ "request_id": "...", "status": "pending" }. When resolved, status is no longer pending and the payload includes outcome fields—see GET result and Approval status values.
Callback instead of polling
If you setcallback.url on create, the service POSTs the same JSON as the final poll response when the approval completes. See Callback webhooks.
Errors to handle
- 400
invalid_payload— Fix the JSON; checkissuesif present. - 401 — Wrong agent or API key.
- 403
USAGE_APPROVAL_LIMIT— Plan / usage cap; see Automation limits & billing. - 409
idempotency_conflict— Samerequest_idwith a different payload. - 429
rate_limited— Slow down creates; see Rate limits.
Related
- Agent API — full field reference
- OpenAPI specification — machine-readable description (YAML)
- n8n · Zapier · MCP