401 Error: Missing sanity.organization.projects/detach Grant When Transferring Project

3 replies
Last updated: Mar 11, 2024
Hello,I am getting a 401 error when trying to transfer an ownership from one organisation to another. I am an admin for both organisations. Any idea what could be wrong?

error: "Unauthorized"

message: "User is missing required grant sanity.organization.projects/detach on \"onPK83UGl\" to perform this operation"

statusCode: 401
AI Update

The error you're seeing indicates that you're missing a specific organization-level permission needed to transfer projects between organizations. Even though you're an admin in both organizations, the Administrator role alone isn't always sufficient for project transfers.

What's Happening

According to the Plans and Payments documentation, to transfer a project between organizations, your role must include these specific permission grants:

  • sanity.organization.projects.detach (the one you're missing)
  • sanity.project.update

The error message specifically mentions you're lacking the sanity.organization.projects/detach grant on the source organization.

How to Fix This

  1. Verify your organization role: Being a project admin doesn't automatically give you organization-level permissions. You need to be an Administrator at the organization level (not just the project level) in the source organization.

  2. Check in Manage: Go to manage.sanity.io, navigate to the source organization's settings, and verify your role there. You might be a project admin but have a different role at the organization level.

  3. Request proper permissions: If you don't have the Administrator role at the organization level, you'll need someone who does (an organization owner or administrator) to either:

    • Grant you the Administrator role in the organization
    • Perform the transfer on your behalf
  4. Billing rights: The documentation also mentions that if you have billing rights in both organizations, the transfer happens instantly. Otherwise, it requires approval from a billing manager in the receiving organization.

Important Note

This is a security feature - the sanity.organization.projects.detach permission is intentionally restricted because detaching/transferring projects has significant implications for billing and resource management. It ensures that only users with proper organization-level authority can move projects between organizations.

If you continue having issues after verifying your organization-level permissions, I'd recommend reaching out to Sanity support as they can check your specific account permissions.

Show original thread
3 replies
From the error, it looks like you’re not an admin on the
onPK83UGl
org. I checked our end and it looks like that is the case. You’re likely a member of the project and not the org.
user M
That was the case, thanks. I've been added to the org and was able to transfer the project.
Excellent!

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?