Elizon Docs
Teams

Team Jobs

GET /api/v1/team-jobs/:jobId and POST /api/v1/team-jobs/:jobId/cancel — poll and cancel an async team run.

Why /team-jobs/, not /jobs/

Team jobs live under /team-jobs/:jobId, a different path from the agent job endpoints at /jobs/:jobId. This is deliberate: /jobs/:jobId is already registered for agent async jobs, and a server can't register two different handlers for the same method and path. /team-jobs/:jobId avoids that collision while keeping the same resource-scoped-job convention the agent path already uses.

Get a job

Returns the current state of an async job created by POST /run-async.

GET /api/v1/team-jobs/{jobId}

Path parameters

ParameterTypeDescription
jobIdstring (UUID)The job ID returned by run-async.

Response

200 OK

{
  "jobId": "9c4e2a1b-...",
  "teamId": "3f9c...",
  "status": "completed",
  "createdAt": 1732550123,
  "startedAt": 1732550124,
  "completedAt": 1732550131,
  "result": {
    "content": "...",
    "sessionId": "...",
    "userId": "...",
    "metrics": {
      "inputTokens": 12,
      "outputTokens": 9,
      "latencyMs": 842,
      "model": null,
      "failoverUsed": false
    },
    "messages": null
  },
  "error": null
}
FieldDescription
statusqueued, running, completed, failed, timeout, or cancelled.
startedAt / completedAtUnix timestamps (seconds), or null until reached.
resultThe run's result — only populated when status is completed. null for every other status, including while it's still running. Same content/sessionId/userId/metrics/messages shape as /run-sync's responsemessages is null unless the original request set include_messages: true.
errorThe 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/team-jobs/{jobId}/cancel

Path parameters

ParameterTypeDescription
jobIdstring (UUID)The job to cancel.

Behaviour

  • Queued job — removed from the queue before it ever starts running.
  • Running job — the in-flight team run is cancelled the same way DELETE /teams/:teamId/runs/:runId cancels a synchronous run.
  • Already terminal (completed, failed, timeout, or already cancelled) — this endpoint is idempotent. It returns 200 with 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

StatuserrorWhen
404job_not_foundNo 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/team-jobs/9c4e2a1b-... \
  -H "X-API-Key: elz_your_key_here"

curl -X POST https://api.elizon.com/api/v1/team-jobs/9c4e2a1b-.../cancel \
  -H "X-API-Key: elz_your_key_here"