How to invite users to a Sanity project via API?
Good news! Yes, the Access API does have an endpoint to create invites, even though it might not have been clearly documented in the Projects API page you were looking at.
According to the Access API documentation, you can create invites using:
POST /v2025-07-11/access/{resourceType}/{resourceId}/invitesFor inviting users to a project, you'd use:
POST https://api.sanity.io/v2025-07-11/access/project/{projectId}/invitesThe request body should include:
email- The email address of the person you're invitingroleNames- An array of role names to assign (like["administrator", "editor", "developer", "contributor", "viewer"])
Here's what a typical request might look like:
const response = await fetch(
`https://api.sanity.io/v2025-07-11/access/project/${projectId}/invites`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'teammate@example.com',
roleNames: ['editor']
})
}
);Required permission: You'll need sanity.project.members.update permission to create invites.
The Access API also has related endpoints for managing invites:
GET /invites- List all invitesDELETE /invites/{inviteId}- Revoke an inviteGET /invites/{token}- Get invite details by tokenPUT /invites/{token}- Accept an invite
So you were right that this functionality exists! It's just under the Access API rather than the Projects API. This should save you a ton of time automating your team onboarding process. You can loop through your team members and fire off invite requests right after spinning up each new project.
Show original thread2 replies
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.