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

Using authenticated requests for exporting private data in Sanity Studio.

1 replies
Last updated: Jun 9, 2023
Hi all! We have a Sanity Studio and we want to utilize the export documents endpoint to extract our data. Do we need to set up OAuth authentication or is there a simpler way to do it with an internal API token?
Thank you!!


user B
Jun 9, 2023, 9:04 AM
If your dataset it public, you can export any documents on a root path (meaning there’s no
.
in their
_id
) without making an authenticated request. If your dataset is private or you want your export to include things like drafts you’ll need to make an authenticated request . This is linked at the bottom of the page in that first link you shared if you want to see it in context.
Jun 9, 2023, 4:03 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?