Skip to main content

Replace User Relationship in Multiple Workspaces

PUT/user/{id}/workspaces

Updates a user's role, status, or group assignments across multiple workspaces in one call. This fully replaces the user's workspace memberships — any workspace not included in the request will be removed. Send an empty array to remove the user from all workspaces.

Path Parameters
idstringrequired
UUID of the user.
Request Body
idstringoptional
UUID of the workspace. Either id or name must be provided.
namestringoptional
Name of the workspace. Either id or name must be provided.
rolestringrequired
User's role in the workspace. Accepted values: ADMIN, MEMBER.
statusstringrequired
User's status in the workspace. Accepted values: ACTIVE, ARCHIVED.
groupsarrayoptional
List of groups to assign the user to in this workspace. Each item must have an id (group UUID).
Error Responses
400
Workspace not found, user account inactive, group not found, or invalid group type.
402
User seat limit exceeded.
403
External API disabled, missing EXTERNAL_API license, or invalid Authorization token.
404
User not found.
500
Internal server error (e.g. invalid enum values in request body).
Request
curl -X PUT "https://{your-domain}/api/ext/user/{id}/workspaces" \
  -H "Authorization: Basic <access_token>" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "role": "ADMIN",
      "status": "ACTIVE",
      "groups": [
        { "id": "11111111-1111-1111-1111-111111111111" }
      ]
    },
    {
      "name": "Engineering Workspace",
      "role": "MEMBER",
      "status": "ACTIVE",
      "groups": [
        { "id": "22222222-2222-2222-2222-222222222222" },
        { "id": "33333333-3333-3333-3333-333333333333" }
      ]
    }
  ]'

Response: 200