Manage Users
Manage who can access a Builder Content Space. Use these operations to list users, add existing organization members to a Space, change their roles, and remove them from a Space or from the entire organization.
Authentication and permissions
Listing users with users works with either a private key (bpk) or a personal access token (btk-). Every other operation on this page reads or changes individual membership, so it requires a personal access token. Private keys are rejected.
- Send the token in the
Authorizationheader asBearer btk-.... - Pass the ID of the Space you are working on as the
apiKeyquery parameter, for examplehttps://cdn.builder.io/api/v2/admin?apiKey=YOUR_SPACE_API_KEY. - For mutations, the token owner must be an admin of that Space.
- The roles you can assign are
admin,editor, anddeveloper. - You cannot change your own role or remove yourself with this API.
- Changes take effect immediately. Users do not need to log out.
Get users
Retrieve all users from a Builder Content Space.
Get a user
Retrieve a single user of the Space by ID. The response is null if the user is not a member of the Space. Requires a personal access token.
Add a user to a Space
Add an existing member of the parent organization to a Space with the given role. This is not an invitation flow: the user must already belong to the organization. The apiKey must be a Space, not the root organization or an environment.
Update a user role
Change the role of a user who is already a member of the Space. The apiKey must be a Space, not the root organization or an environment.
Remove a user from a Space
Remove a user from a Space and its environments. If this leaves the user in no organization, their sessions and personal access tokens are also revoked. The apiKey must be a Space, not the root organization or an environment. To offboard a user from everything, use Remove a user from an organization.
Remove a user from an organization
Remove a user from an organization and all of its Spaces. If this leaves the user in no organization, their sessions and personal access tokens are also revoked. Unlike the Space operations, the apiKey query parameter must be the ID of the root organization, not a Space.
What's next
Continue to explore the Admin API documentation or use the GraphQL Explorer to try out these queries with your own Space and Organization. Then, visit the Admin API GraphQL Schema for more details on how to modify your queries.