Sanity
Available Tools
List CORS origins allowed to call the project’s API from a browser.
Whitelist an origin (e.g., https://example.com) to call the API from a browser.
Remove a CORS origin by its numeric ID. Use list_cors_origins to find IDs.
List all datasets in a project with their ACL mode and creation time.
Create a new dataset in a project. Name must be lowercase alphanumeric with ’_’ or ’-’.
Update a dataset’s ACL mode to ‘public’ or ‘private’.
Delete a dataset permanently. All documents inside are removed. This cannot be undone.
Run a GROQ query over a dataset. Use bound $params for user input. Supports pagination via GROQ slicing like [0…100].
Fetch one or more documents by ID, bypassing any CDN cache. Use query_documents to discover IDs.
Create a new document. The document must include a ‘_type’ field. If ‘_id’ is omitted, Sanity assigns one.
Create a document, or fully replace an existing document with the same _id. Use get_document first to check existence.
Apply a partial update (set / unset / inc / dec / setIfMissing) to an existing document. Use query_documents to find…
Delete a document by ID. For drafts, prefix the ID with ‘drafts.’. This cannot be undone.
Retrieve a document’s state at a specific revision or point in time. Provide either ‘revision’ or ‘time’.
List all Sanity projects the authenticated user is a member of.
Get details for a specific Sanity project. Uses project_id from credentials if not provided.
Update a project’s display name, studio host, or metadata. Use list_projects to find valid IDs.
List feature flags enabled for a project, such as private datasets or scheduled publishing.
Validate Sanity API token and project ID by fetching the configured project.
List all webhooks configured for a project.
Get a webhook’s full configuration including filter, projection, and headers.
Create a webhook that fires on document create/update/delete events matching a GROQ filter.
Update a webhook’s configuration. Only provided fields are changed.
Delete a webhook permanently. Use list_webhooks to find IDs.
List delivery attempts for a webhook including HTTP status codes. Use offset from page_info for the next page.