canonical: https://jentic.com/apis/sanity.io/sanity-scheduling

# Sanity Scheduling API (deprecated)

The Sanity Scheduling API publishes or unpublishes documents in a Sanity dataset at a set UTC time, and can also publish or unpublish a batch of documents immediately in one transaction. Each schedule carries a name, an executeAt timestamp, a publish or unpublish action, and the document IDs it targets, and moves through the scheduled, executing, succeeded, and cancelled states. Schedules can be listed and filtered, renamed or retimed, cancelled before they run, or run straight away. Sanity marks this API as deprecated and recommends Content Releases for new work, and it requires a Growth or higher plan.

## For AI agents

Schedule Sanity documents to publish or unpublish at a UTC time, list and cancel pending schedules, or publish a batch of documents now. Deprecated by Sanity in favour of Content Releases.

## Scope

Does not edit document content, manage Content Releases, or query datasets. Use for timed and batch publishing or unpublishing of Sanity documents only.

## Capabilities

- Schedule one or more published document IDs to publish or unpublish at an executeAt time in UTC
- List a dataset's schedules filtered by documentIds, state, action, or author, with offset and limit paging
- Cancel a pending schedule by setting its state to cancelled, or change its name, description, documents, or executeAt
- Run one or more scheduled publish schedules immediately by passing comma-separated schedule IDs
- Publish or unpublish a batch of documents in a single transaction and get back its transaction ID
- Guard a publish with ifRevisionId so it only runs if the document's _rev still matches

## Use cases

### AI agent coordinating a content launch

An agent preparing a launch searches Jentic for 'schedule a Sanity document to publish', loads the createSchedule operation, and books the landing page and announcement post to go live together at a UTC executeAt time. Before the launch it lists schedules with state scheduled to confirm the booking, and the Sanity token is injected at call time rather than passed to the agent.

Example prompt: POST `/schedules/{projectId}/{dataset}` for dataset production with name 'Launch', action publish, executeAt 2077-12-25T07:45:00.000Z, and documents [{documentId: 'launch-page'}, {documentId: 'launch-post'}]

### Time-limited promotions

A seasonal promotion page should disappear when the offer ends. A schedule with the unpublish action and an executeAt in UTC takes the document down at the right moment, and if the offer is extended the schedule can be retimed through the update operation or cancelled while it is still in the scheduled state.

Example prompt: PATCH `/schedules/{projectId}/{dataset}/{scheduleId}` for the summer-sale schedule with executeAt 2077-09-01T00:00:00.000Z

### Immediate batch publish

Some changes need to go out together right now. The publishDocuments operation takes an array of document IDs, optionally each with an ifRevisionId, and publishes them in one transaction, returning a transaction ID to track. Draft IDs starting with drafts. are rejected, so the request names the published IDs.

Example prompt: POST `/publish/{projectId}/{dataset}` for dataset production with [{documentId: 'post-123'}, {documentId: 'post-124'}] and report the returned transaction ID

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/schedules/{projectId}/{dataset}` | Create a publish or unpublish schedule |
| GET | `/schedules/{projectId}/{dataset}` | List and filter schedules |
| GET | `/schedules/{projectId}/{dataset}/{scheduleId}` | Get a schedule by ID |
| PATCH | `/schedules/{projectId}/{dataset}/{scheduleId}` | Update or cancel a schedule |
| POST | `/schedules/{projectId}/{dataset}/{scheduleId}/publish` | Run publish schedules immediately |
| POST | `/publish/{projectId}/{dataset}` | Publish documents in one transaction |
| POST | `/unpublish/{projectId}/{dataset}` | Unpublish documents in one transaction |

## Key resources

- **Schedules** — A timed publish or unpublish of documents, with name, executeAt, action, and state
- **Documents** — Published document IDs targeted by a schedule, with optional ifRevisionId
- **Transactions** — The transactionId returned by an immediate publish or unpublish

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 68 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 55 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 57 / 100
- **View full report:** https://jentic.com/apis/sanity.io/sanity-scheduling/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Sanity Scheduling API by hand means templating the project ID and apiVersion into the host, sending a bearer token, formatting executeAt as UTC with a Z suffix, and staying under per-project limits. Through Jentic you install once, import it from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Sanity puts the project ID and dataset in the URL path (`/schedules/{projectId}/{dataset}`), so a rule can pin your agent to one dataset and the operations you pick. You choose the operations it may call, so immediate ones like publishDocuments or unpublishDocuments are not included unless you add them.
- **Credential handling:** Your Sanity token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'schedule a Sanity document to publish' or 'cancel a Sanity schedule', and Jentic returns the matching operation, such as createSchedule or updateSchedule, with its input schema.

## Related APIs

- **Sanity Actions API** — Publish, unpublish, and edit documents through document actions
- **Sanity HTTP API** — Query and mutate the documents that schedules publish
- **Contentful API** — Headless CMS with its own content management API
- **Storyblok API** — Headless CMS for managing and publishing stories

## FAQ

### What authentication does the Sanity Scheduling API use?

Per its OpenAPI spec, the Sanity Scheduling API uses a bearer token in the Authorization header on every operation, and the token needs permission to publish the documents involved. Through Jentic the Sanity token is stored by your own instance and attached at call time, so it stays out of the agent's context.

### Is the Sanity Scheduling API deprecated?

Yes. The spec title marks it as deprecated, and Sanity recommends Content Releases for scheduling coordinated updates across multiple documents. The endpoints still describe publishing and unpublishing on a schedule, and the API is available on Growth or higher plans.

### What are the rate limits for the Sanity Scheduling API?

The OpenAPI spec states 100 requests per minute per project and 1,000 requests per hour per project, with 429 Too Many Requests returned past those limits. Check https://www.sanity.io/docs for any changes.

### How do I cancel a scheduled publish in Sanity?

Call the updateSchedule operation on the schedule and set state to cancelled. Only schedules in the scheduled state can be cancelled, completed schedules cannot be cancelled, and a cancelled schedule cannot change state again.

### Is there a Sanity MCP server?

You don't need an MCP server to give your agent the Sanity Scheduling API. Jentic connects it directly from the API Directory: import it, store your Sanity token once, and your agent calls the schedule operations when it needs them.

### How do I schedule a Sanity document to publish through Jentic?

Search Jentic for 'schedule a Sanity document to publish', load the createSchedule operation, and execute POST `/schedules/{projectId}/{dataset}` with documents, a name, and an executeAt time in UTC with a Z suffix. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the Sanity Scheduling API?

Yes. Allow only the list, get, and create schedule operations under `/schedules/abc123/staging`, and the agent can book and check publishes for the staging dataset while immediate publishing and schedule changes stay outside its rule. Every call it makes is logged.
