Using authenticated requests for exporting private data in Sanity Studio.
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!!
Jun 9, 2023, 9:04 AM
If your dataset it public, you can export any documents on a root path (meaning there’s no
) 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.