Jobs API reference

Reference documentation for the Jobs HTTP endpoint.

The Jobs API lets you monitor processes running inside Sanity's infrastructure, such as dataset copy jobs.

Authentication

All requests must be authenticated.

Base API server URL

Sanity API base URL

https://api.sanity.io/{apiVersion}

Variables

  • apiVersionstringdefault: "v2021-06-07"

    API version

Endpoints

Job status

get/jobs/{jobId}

Get the status of a job.

Path parameters

Responses

200

Returns the status of the job.

Listen for job updates

get/jobs/{jobId}/listen

Each job has a /listen endpoint that lets you monitor its status programmatically. While you're listening, the endpoint sends event data at intervals with updates on the status of your job.

The stream sends the following events. The data of each event is a JSON object.

  • welcome: The first event on the stream. Contains a listener_id.
  • job: Contains the job's job_id, state, and progress (0 to 100). When the job reaches a terminal state (completed, failed, terminating, or terminated), the endpoint sends a final job event with progress set to 100 and closes the stream.
  • channel_error: Sent when an error occurs, such as an unknown job ID, or when the stream has been open for 12 hours. Contains an error message.
  • disconnect: Sent after channel_error, before the stream closes. Contains a reason.

After the stream opens, the endpoint reports errors as events, not as HTTP status codes. If the job is deleted while you're listening, the stream closes without sending an event.

Path parameters

Responses

200

Streams job status events.

  • string (binary)
Examplestext/event-stream
event: welcome
data: {"listener_id":"ladaicdbdo"}

event: job
data: {"job_id":"jacsfsmnxp","state":"running","progress":60}

event: job
data: {"job_id":"jacsfsmnxp","state":"completed","progress":100}
sanity.ioAll Systems Operational© Sanity 2026
Change site theme