Agents
Agent Jobs
GET /api/v1/jobs/:jobId and POST /api/v1/jobs/:jobId/cancel — poll and cancel an async agent run.
Get a job
Returns the current state of an async job created by POST /run-async.
GET /api/v1/jobs/{jobId}Path parameters
| Parameter | Type | Description |
|---|---|---|
jobId | string (UUID) | The job ID returned by run-async. |
Response
200 OK
{
"jobId": "9c4e2a1b-...",
"agentId": "3f9c...",
"status": "completed",
"createdAt": 1732550123,
"startedAt": 1732550124,
"completedAt": 1732550131,
"result": { "content": "...", "sessionId": "...", "metrics": { "...": "..." } },
"error": null
}| Field | Description |
|---|---|
status | queued, running, completed, failed, timeout, or cancelled. |
startedAt / completedAt | Unix timestamps (seconds), or null until reached. |
result | The run's result — only populated when status is completed. null for every other status, including while it's still running. |
error | The failure message — only populated when status is failed or timeout. null otherwise. |
Keep polling while status is queued or running; stop once it's completed, failed, timeout, or cancelled. See Recommended polling interval.
Cancel a job
Cancels an async job before it finishes.
POST /api/v1/jobs/{jobId}/cancelPath parameters
| Parameter | Type | Description |
|---|---|---|
jobId | string (UUID) | The job to cancel. |
Behaviour
- Queued job — removed from the queue before it ever starts running.
- Running job — the in-flight agent run is cancelled the same way
DELETE /agents/:agentId/runs/:runIdcancels a synchronous run. - Already terminal (
completed,failed,timeout, or alreadycancelled) — this endpoint is idempotent. It returns200with the job's actual current status, unchanged. Cancelling a finished job is not an error.
Response
200 OK
{ "jobId": "9c4e2a1b-...", "status": "cancelled" }Or, if the job had already reached a terminal state before the cancel request arrived:
{ "jobId": "9c4e2a1b-...", "status": "completed" }Errors
| Status | error | When |
|---|---|---|
404 | job_not_found | No job with that ID exists for your organization/project — on both endpoints. This includes jobs that exist but belong to a different tenant — Elizon returns 404, not 403, so a job ID never confirms another tenant's job exists. |
Example
curl https://api.elizon.com/api/v1/jobs/9c4e2a1b-... \
-H "X-API-Key: elz_your_key_here"
curl -X POST https://api.elizon.com/api/v1/jobs/9c4e2a1b-.../cancel \
-H "X-API-Key: elz_your_key_here"