Locations
Manage Users
We have dedicated endpoints to help you manage which users should have access to which locations. Keep in mind that the owner
and developer
roles will always have access to all locations. Only admin
and user
roles can be scoped to specific locations.
Add and remove users to and from a location
This endpoint enables management of user access to a specific location, supporting both individual and bulk user operations.
Request Parameters
URL Parameters
location_id
(required): The unique identifier of the location, prefixed withloc_
Request Body
The endpoint supports three modes of operation:
- Additive Mode (
add/remove
)- Specify users to add or remove while maintaining existing assignments.
- Can be used simultaneously for adding and removing different users
- Bulk Assignment (
users
)- Provide a complete list of users to add.
- Combines with existing user assignments.
- Replacement Mode (
overwrite: true
)- Replaces all existing user assignments with the new list
Some validations
The endpoint implements several validation measures:
- Organization Validation:
- All specified users must belong to the location's organization.
- Invalid user IDs return a 400 error with details.
- Protected Users:
- Organization owners cannot be removed from locations.
- Attempts to remove owners return a 401 error.
- Operation Validation:
- Users cannot be in both add and remove lists.
- Empty operations return a 400 error.
- Duplicate user IDs are automatically removed.
Example Request
Error Handling
The endpoint provides specific error responses for common issues:
- Invalid Users
- Protected Users
Add One User
This endpoint provides the ability for adding a single user to a location. While the bulk user management endpoint can handle all scenarios, this endpoint offers a more semantically appropriate method for single-user operations.
Delete Users
Delete Many Users
You'll be able to delete many users at once by providing an array of user IDs in the request body.
Delete One User
You can delete a single user from a location using just the URL scheme with the location ID and user UD.