✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Request for an API endpoint to invite users to a project in Sanity.io.

2 replies
Last updated: Feb 28, 2024
I love the API that’s provided for projects — I have script that spins up a new install for each new project we make. One thing I’d love to have, though, would be an endpoint to be able to invite users to a project. It would save a time from having to go in and manually invite all the members of my team after. I spent a few minutes playing with the API today and it sorta seems like this already exists? but it isn’t documented here (https://www.sanity.io/docs/projects-api ) — if it does exist and someone can tell me how to do it, or tell me it doesn’t exist and I shouldn’t keep trying, would love to hear. Thanks!
Feb 28, 2024, 2:50 PM
An API for invitations isn’t documented, but you can send a POST request containing
{ email: String, role: String }
in the body to
<https://api.sanity.io/v2021-06-07/invitations/project/<PROJECT_ID>>
. You will get back a 201 with an
invitationId
on success.
Feb 28, 2024, 3:15 PM
awesome, thanks!
Feb 28, 2024, 3:29 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?