API Docs
Users Model
Assign Users to Workspaces (and Groups)
12 min
api endpoint documentation /api/users/workspace assign description this endpoint allows you to assign multiple users to one or more workspaces and groups by sending a post request the request body contains user ids, workspace ids, and group ids to establish these assignments endpoint headers accept application/json specifies that the request expects a json response authorization bearer \<jwt token> a json web token (jwt) that authenticates the request replace \<jwt token> with a valid token content type application/json specifies that the request body is in json format request body the request body should be in json format, containing the following fields workspaces array an array of workspace ids to which the users will be assigned userids array an array of user ids to be assigned to the workspaces groups array (optional) an array of group ids to which the users will be assigned within the workspaces example request body method post sends a request to assign the specified users to the specified workspaces and groups example request (node js) response the api will return a json response indicating the success or failure of the operation success response (200) error response (400) or authentication this api requires a valid jwt token for authentication and admin privileges ensure that the token is included in the authorization header as bearer \<jwt token> usage notes this endpoint requires admin privileges to use you can assign multiple users to multiple workspaces in a single request the system will automatically update the user's type based on their permissions if no users are selected, the request will fail with a 400 error if an invalid user id is provided, the request will fail with a 400 error