Scheduling API reference
Reference documentation for the Scheduling HTTP endpoints.
The Scheduling API allows you to schedule documents using the legacy scheduling feature.
This API is deprecated
The Scheduling API was officially deprecated with the release of Scheduled Drafts. We suggest using Scheduled Drafts alongside the Actions API, or moving to Content Releases.
Authentication
- All requests must be authenticated.
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 `scheduled` state can be marked as
cancelled. - 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