Scheduling
The Scheduling API allows you to schedule when documents are published or unpublished in your Sanity dataset.
The Scheduling API is available to users on Growth or higher plans.
Have you checked out Releases?
We recommend Releases as they provide better control and coordination of content updates. With Releases, you can:
- Organize and schedule updates across multiple documents at once.
- Preview and validate changes before they go live.
- Reduce manual effort and risk of conflicting changes.
Rate / API limits
The Scheduling API has the following limits:
- 100 requests per minute per project
- 1000 requests per hour per project
Status and error codes
The API uses standard HTTP status codes:
- 200: Success
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 429: Too Many Requests
Publishing rules
- Documents must exist in the dataset
- Documents must be valid according to their schema
- Documents must not be locked by another user
Specifying dates
All dates must be in UTC format with a Z suffix, corresponding to the UTC+00:00 time zone.
Format: YYYY-MM-DDTHH:mm:ss.sssZ
Example: 2077-12-25T07:45:00.000Z
Schedules and your dataset
- Schedules are created in a specific dataset
- Schedules can only publish/unpublish documents in that dataset
- Schedules can be filtered by dataset
- Schedules can be cancelled before they execute
Other caveats
- Only schedules with a
scheduledstate can be marked ascancelled - It's not possible to cancel already completed schedules
- A schedule cannot have its state changed once in a
cancelledstate - Multiple schedule IDs can be specified as a comma-separated list when running schedules
Note: While you can use the HTTP API endpoint directly, we recommend using a client library if you can.
Base API server URL
Sanity API base URL
https://{projectId}.api.sanity.io/{apiVersion}Variables
- projectIdstringdefault:
"projectId"Project ID
- apiVersionstringdefault:
"v2022-04-01"API version