Skip to content

Instantly share code, notes, and snippets.

@3200pro
Created July 25, 2022 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3200pro/3a08e4157bdd506b070342241683675e to your computer and use it in GitHub Desktop.
Save 3200pro/3a08e4157bdd506b070342241683675e to your computer and use it in GitHub Desktop.
Mutate Data Sanity.io (Add Post)
// Test process of adding a post to the dataset
curl 'https://<PROJECT>.api.sanity.io/v2021-06-07/data/mutate/<DATASET>' \
-H "Authorization: Bearer <TOKEN>" \
-H 'Content-Type: application/json' \
--data-binary '{"mutations":[{ "create": {"_id": "postTestID","title": "Test Title","_type": "site.post"} }]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment