update_document
Update an existing Sanity document by providing instructions for AI to modify its content. Optionally specify field paths or create a versioned update.
Instructions
Update an existing document or version with AI-generated content based on instructions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| async | No | Set to true for background processing when updating multiple documents for better performance. | |
| paths | No | Target field paths for the instruction. Specifies fields to update. Should always be set if you want to update specific fields. If not set, targets the whole document. ie: ["field", "array[_key=="key"]"] | |
| schemaId | No | Schema manifest ID from dataset manifest, not document type. Get from context or listSchemaIdsTool | sanity.workspace.schema.default |
| releaseId | No | Optional release ID for creating versioned documents. If provided, the document will be created under the specified release version instead of as a draft | |
| documentId | Yes | The ID of the document to update | |
| instruction | Yes | Instruction for AI to update the document content |