Can't update published document after draft loses "draft." prefix
This sounds like a frustrating issue! The good news is that the draft-to-published ID change you're seeing (draft.123**456 → 123**456) is completely normal Sanity behavior. The problem where you can't update the published document could be caused by a few things:
Most Likely Causes
1. Dataset Read-Only Mode
First thing to check: Is your dataset in read-only mode? This can happen if:
- The dataset was explicitly set to read-only in your project settings
- You're on a plan that has dataset limits and something triggered a lock
- There's a billing/payment issue
Check this at sanity.io/manage → Select your project → Datasets → Look for any read-only indicators or warnings.
2. Permissions/Role Issues
Since you mentioned it works in another dataset but not this one, check the permissions and roles:
- Does the user/token have proper write permissions for this specific dataset?
- Go to sanity.io/manage → Your project → API settings → Tokens (or Members)
- Verify the role has "Update and Create" or "Publish" permissions for this dataset
If you're using custom roles (Enterprise feature), make sure the content resources aren't blocking updates to published documents.
3. Revision ID Conflicts (409 Errors)
If you're getting 409 conflict errors, this relates to optimistic locking and concurrency control. This happens when:
- The document's
_rev(revision ID) has changed since you last fetched it - Multiple clients are trying to update simultaneously
- Your client is using stale data due to eventual consistency
Solution: Refetch the document before updating, or use the ifRevisionID parameter in your mutations to handle conflicts gracefully.
Debugging Steps
Check the browser console/network tab when trying to update - look for 409, 403, 401, or 500 HTTP errors. The specific error code will tell you a lot.
Try updating via the CLI to isolate if it's a Studio vs. API issue:
sanity documents query '*[_id == "123**456"][0]'Then try a patch operation via the CLI to see if you get a more specific error message.
Check dataset settings in Manage for any restrictions or warnings.
Compare dataset configurations between the working and non-working datasets - look at permissions, roles, and any dataset-specific settings.
Check for validation errors - Sometimes schema validation rules can prevent saves, though these usually show clear error messages in Studio.
Additional Considerations
- If you recently migrated or imported data, verify that all document references are valid
- Make sure your Studio version is up to date (
npm outdatedin your studio folder) - Check if there are any custom document actions or workflows that might be interfering
The fact that your CLI import script works in another dataset strongly suggests this is either a permissions issue or a dataset-level configuration problem rather than a bug with the documents themselves.
What to look for specifically: When you try to update the published document, open your browser's developer tools (Network tab) and look at the failed request. The HTTP status code and response body should give you the exact error message that'll point to the root cause.
Let us know what error messages you're seeing - that'll help narrow it down!
Show original thread8 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.