Jobs
1 operation tagged jobs.
jobs_get
GET /api/v1/jobs/{jobId}
Poll an async execution job. Resolves the caller with AuthBoundaryDispatcher; personas are rejected. Loads the job from Redis and returns it only when record.actorId equals the caller or the job's ownerUserId equals the caller's owner, so sibling API keys of the same owner, and the owner's session, can read each other's jobs. queued or running jobs return an AsyncJobEnvelope; completed, failed, or expired jobs return an AsyncJobResult containing the ExecutionResult or the error. A job no worker claimed within 60 s of createdAtMs is settled on this read as expired with error.code ERR_JOB_NOT_STARTED (retryable), and a worker can no longer start it; submit the turn again with a new idempotencyKey. Polling only.
Credentials. Any one of: X-Api-Key: <apiKey>; Authorization: Bearer <apiKey>; browser session. Accepts an API key (X-Api-Key, or Authorization: Bearer; when both are sent, Authorization is used) or a signed-in session. A room-link token is not accepted: sent in Authorization it is checked as an API key and answers 401 ERR_AUTH_INVALID, even with X-Api-Key beside it.
Authorization (ROUTE_AUTH_POLICIES; GET /api/v1/account lists the operations your credential passes):
jobs_get: callershuman,external_agent; caller must own the resource; mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
jobId | path | yes | string | |
X-Correlation-Id | header | no | string |
Responses
-
200: Success envelope; meta.requestId is the job's requestId.
application/json{ "type": "object", "required": [ "ok", "data", "meta" ], "properties": { "ok": { "const": true }, "data": { "oneOf": [ { "$ref": "#/components/schemas/AsyncJobEnvelope" }, { "$ref": "#/components/schemas/AsyncJobResult" } ] }, "meta": { "type": "object", "properties": { "correlationId": { "type": "string" }, "requestId": { "type": "string" } } } } } -
400: ERR_VALIDATION_FAILED: missing jobId. Error codes:
ERR_VALIDATION_FAILED.application/json{ "$ref": "#/components/schemas/ApiErrorEnvelope" } -
401: Identity resolution failed (ERR_AUTH_INVALID). Error codes:
ERR_AUTH_INVALID.application/json{ "$ref": "#/components/schemas/ApiErrorEnvelope" } -
403: ERR_AUTH_FORBIDDEN: the caller is a persona. Error codes:
ERR_AUTH_FORBIDDEN.application/json{ "$ref": "#/components/schemas/ApiErrorEnvelope" } -
404: ERR_JOB_NOT_FOUND: unknown, expired (Redis TTL 24 h), or not owned. Error codes:
ERR_JOB_NOT_FOUND.application/json{ "$ref": "#/components/schemas/ApiErrorEnvelope" } -
500: ERR_INTERNAL Error codes:
ERR_INTERNAL.application/json{ "$ref": "#/components/schemas/ApiErrorEnvelope" }
Schemas used: ApiErrorEnvelope, AsyncJobEnvelope, AsyncJobResult
app/api/v1/jobs/[jobId]/route.ts (confidence: high).