Sanity · Arazzo Workflow
Sanity Replace Document Asset
Version 1.0.0
Upload a new image, find the target document, then point it at the new asset.
View Spec
View on GitHub
Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformArazzoWorkflows
Provider
Workflows
replace-document-asset
Swap a document's image to a newly uploaded asset reference.
Uploads a replacement image, confirms the target document exists, and patches its image field to reference the new asset.
1
uploadReplacement
uploadImageAsset
Upload the replacement image and capture its asset document id.
2
findDocument
queryDocumentsPost
Read the target document by id to confirm it exists before patching.
3
patchAsset
mutateDocuments
Patch the document's image field so its asset reference points at the newly uploaded asset.