
Templates
Have a Sanity powered app up and running in minutes with best-practice templates.
Generate, transform, and translate content using large language models. With schema-aware AI-powered responses that integrate with the Content Lake.
Outputs are automatically validated against the content types in your Sanity Studio schema, so responses from the LLM always fit your schema.
Trigger content updates using APIs, scripts, or CI pipelines. No Studio or UI needed, although hooks can easily be integrated into the Studio or UI’s.
Whether you're automating a single field or running updates across your entire dataset, Agent Actions scale with you.
Instead of coding static rules, use structured prompts and live content values to generate meaningful, schema-valid results.
It’s not just AI automation. It’s programmable creativity
Generate, transform, and translate automatically in response to content updates, editorial input, external events or Sanity Functions. Integrate AI into publishing flows without custom integrations or manual steps.
Use LLMs to generate schema-valid content with real context. Combine prompt templates with live values from GROQ, document fields, or external sources. Run synchronously or in the background
client.agent.action.generate({ targetDocument: { operation: 'create', _type: 'movie' }, instruction: `Write a summary for the movie, $movie.`, instructionParams: { movie: { type: 'constant', value: 'Space Jam', }, }, schemaId: 'schemaId' })
Rework content structure, style, or tone without manual work. Ideal for adapting messaging or standardizing imported data at scale.
client.agent.action.transform({ instruction: 'Replace "Your CMS" with "Sanity"', documentId: 'documentId', schemaId: 'default-schema' })
Translate entire documents or specific fields between languages, respecting schema and preserving intent.
client.agent.action.translate({ fromLanguage: { id: 'en-GB',title: 'English' }, toLanguage: { id: 'no-NB', title: 'Norwegian Bokmål' }, styleGuide: 'Preserving formal tone and legal terminology without paraphrasing', documentId: 'documentId', schemaId: 'default-schema' })
It's incredibly easy to push data into Sanity Content Lake from outbound systems. With the Sanity API, I'm not making 10,000 calls to update 10,000 items. I'm making one API call and the whole dataset is updated.
Sign up for Sanity for free and start crafting your first project.
client.agent.action.generate({
targetDocument: {
operation: 'create', _type: 'movie'
},
instruction:
`Write a summary for the movie, $movie.`,
instructionParams: {
movie: {
type: 'constant',
value: 'Space Jam',
},
},
schemaId: 'schemaId'
})
client.agent.action.transform({
instruction: 'Replace "Your CMS" with "Sanity"',
documentId: 'documentId',
schemaId: 'default-schema'
})
client.agent.action.translate({
fromLanguage:
{ id: 'en-GB',title: 'English' },
toLanguage:
{ id: 'no-NB', title: 'Norwegian Bokmål' },
styleGuide: 'Preserving formal tone and legal terminology without paraphrasing',
documentId: 'documentId',
schemaId: 'default-schema'
})