User Management

Change a member's system role and custom roles

Changed on

Changes an active human member's workspace system role by email. Send member, editor, or admin. Optional customRoleIds replaces that member's custom roles. Omit it to keep them, except when the new role is admin, which clears custom roles and extra permissions. The call is authorized by the workspace API key's USER_MANAGEMENT_API scope and does not run as the person who created the key.

post/user-management/v1/update-user-role

Request

  • Base URL
    https://api.langdock.com
  • URL
    https://api.langdock.com/user-management/v1/update-user-role
  • Auth
    HTTP bearer

Request body

emailstring email required

Email address of the active workspace member

role'member' | 'editor' | 'admin' required

Workspace system role. Values are lowercase.

customRoleIdsstring[]

Custom role UUIDs from GET /user-management/v1/roles. Omit the field to keep the member's current custom roles, except when role is admin. Send a list, including an empty list, to replace them. At most 15 IDs. Duplicate IDs count toward that limit and are applied once. System role names are not accepted.

Example request

{
  "email": "user@example.com",
  "role": "editor",
  "customRoleIds": [
    "33333333-3333-4333-8333-333333333333"
  ]
}

Response

Role updated successfully

status'success' required

Always "success" when the role is updated

emailstring email required

Email address of the updated member

role'member' | 'editor' | 'admin' required

System role after the update

customRoleIdsstring[] required

Custom role IDs assigned to the member after this call, ordered by when each role was assigned. Empty after a promotion to admin.

Example response

{
  "status": "success",
  "email": "user@example.com",
  "role": "editor",
  "customRoleIds": [
    "33333333-3333-4333-8333-333333333333"
  ]
}

Changes