Jobs

ReferenceUpdated June 14, 2026

Jobs

Poll the status of a generic asynchronous job. Several endpoints return a job descriptor (202 Accepted) and defer the actual work to the background — use this endpoint to follow it to completion. For the general async pattern, see Conventions → Async jobs.

Derived vs. enqueued. Most jobs are processed by the generic worker. Some long-running operations (campaign build steps, workspace regenerate) instead report derived status computed from live resource readiness when you poll — they behave identically to the caller. Batch generation does not use this endpoint; poll the list instead (see Lists).


Get job status

GET /api/v1/jobs/:id

Returns the current state of an async job in the API key's workspace.

Path parameters

ParameterTypeDescription
idstring (UUID)Job ID (from the 202 response of an async operation).

Example request

curl -X GET "https://app.machfive.io/api/v1/jobs/JOB_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200 OK)

{
  "id": "job-uuid",
  "type": "workspace.import.document",
  "status": "completed",
  "progress": null,
  "result": { "status": "completed", "fields_updated": 7 },
  "error": null,
  "created_at": "2026-06-14T12:00:00.000Z",
  "updated_at": "2026-06-14T12:01:30.000Z"
}
FieldTypeDescription
idstring (UUID)Job ID.
typestringJob type (e.g. workspace.import.document, workspace.regenerate, campaign.build).
statusstringpending, processing, completed, or failed.
progressnumber | nullOptional progress indicator (if reported).
resultobject | nullJob-specific result payload when completed.
errorstring | nullError detail when the job status is failed.
created_at / updated_atstringTimestamps (ISO 8601).

Note on import-job failures. Some jobs (notably workspace.import.document) finish with job status: "completed" even when the underlying work did not succeed — the outcome is carried in result.status. For these, check result.status (e.g. "failed") and result.error/result.fields_updated rather than the top-level status/error fields (which stay completed/null).

Error responses

StatusErrorDescription
401UNAUTHORIZEDMissing or invalid API key.
404NOT_FOUNDJob not found in this workspace.
500INTERNAL_ERRORServer error.