document_action
Publish, unpublish, or delete documents in Sanity by specifying the action type and document ID.
Instructions
Perform document actions like publishing, unpublishing, or deleting documents
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"actionType": "<actionType>",
"publishedId": "<publishedId>"
},
"name": "document_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| versionId | No | ID of the draft document to publish (with drafts. prefix) | |
| actionType | Yes | Type of document action to perform | |
| publishedId | Yes | ID of the published document (without drafts. prefix) | |
| includeDrafts | No | Array of draft document IDs to include in deletion |