🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Adding and unpublishing documents using the Sanity JS API client.

3 replies
Last updated: Apr 23, 2020
I'm adding a doc through the js sanity api client and it's published automatically is there some way to add it without publishing it?
Apr 20, 2020, 3:01 AM
Is there a way to even unpublish using the js sanity api client?
Apr 20, 2020, 7:31 AM
Hi Zane, there is a way to add a document without publishing it, which is by prefixing the id with
drafts.
. More info in this thread for example: https://sanity-io-land.slack.com/archives/C9Z7RC3V1/p1587097360221800
Apr 20, 2020, 9:39 AM
user M
Nice thanks!
Apr 23, 2020, 5:08 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?