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

Permissions error when running script from terminal in Sanity.io project.

8 replies
Last updated: Feb 28, 2022
I am getting a permissions error while attempting to run a script from terminal:
sanity exec xyz.js
, I’ve never had this before with other projects despite often performing mutations in the same manner.

ClientError: the mutation(s) failed: Insufficient permissions; permission "update" required

I have the administrator role on the account I am logged in with so I don’t see why it should be any different to usual.

Project ID: 

Any support much appreciated

  response: {
    body: { error: [Object] },
    url: '<https://zje7y6w0.api.sanity.io/v2021-08-05/data/mutate/production?tag=sanity.studio&returnIds=true&visibility=sync>',
    method: 'POST',
    headers: {
      'content-type': 'application/json; charset=utf-8',
      'content-length': '299',
      'x-ratelimit-limit-second': '50',
      'ratelimit-limit': '50',
      'ratelimit-remaining': '49',
      'ratelimit-reset': '1',
      'x-ratelimit-remaining-second': '49',
      'x-sanity-shard': 'gcp-eu-w1-01-prod-1018',
      'x-served-by': 'gradient-web-674ff585bd-lbdqz',
      date: 'Mon, 28 Feb 2022 18:07:50 GMT',
      vary: 'Origin',
      xkey: 'project-zje7y6w0, project-zje7y6w0-production',
      via: '1.1 google',
      'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
      connection: 'close'
    statusCode: 403,
    statusMessage: 'Forbidden'
  statusCode: 403,
Feb 28, 2022, 6:11 PM
Hi Simon. I checked your project and this is related to this issue . Mutations are still timing out but you should be able to read at this point. Updates will be added here .
Feb 28, 2022, 6:16 PM
user P
We are showing signs that mutations should be possible again. If you’re able can you please confirm?
Feb 28, 2022, 6:31 PM
We are showing no failed mutations at this point. We’ll keep monitoring but this should now be resolved. Thanks for your patience.
Feb 28, 2022, 6:36 PM
user A
! Thanks for letting me know. I’ve just checked and the insufficient permissions warning still persists; could it be related to something else?
Feb 28, 2022, 7:56 PM
Shoot. I looked up your project and you were on the shard having issues, but I should have looked closer at your error—it doesn’t seem related.
Feb 28, 2022, 7:57 PM
Does it work if you run the script using the
Feb 28, 2022, 8:01 PM
user A
this is what I was missing 🙂 Sorry about that! The 524 errors were throwing me
Feb 28, 2022, 10:20 PM
Glad it’s working! Sorry to have misled you with the focus on the other error.
Feb 28, 2022, 10:21 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?