member, editor, or admin. Pass custom role IDs in customRoleIds to replace that member’s custom roles.
The call is authorized by the workspace API key’s USER_MANAGEMENT_API scope. It does not run as the person who created the key, so it keeps working after that admin leaves the workspace.
Base URL
Prerequisites
- API Key with the
USER_MANAGEMENT_APIscope - The API key must be created by a workspace admin
Behavior
- Omit
customRoleIds? Onmemberoreditor, the member’s current custom roles stay. - Send
customRoleIds? The list replaces those roles.[]removes every custom role. Send at most 15 IDs. Get them from List Roles. Duplicate IDs count toward that limit and are applied once. - An ID in
customRoleIdsis not a UUID, or the list has more than 15 IDs? Returns400and changes nothing. - Unknown, deleted, or another workspace’s custom role? Returns
400withcode: "BAD_REQUEST"and messageUnknown custom role. Nothing is written. - Promote to
admin? Custom roles and extra permissions are removed, even if you omitcustomRoleIds. customRoleIdsis not empty, androleisadmin? Returns400withcode: "BAD_REQUEST"and messageAdmins already have every permission. Custom roles can only be assigned to members and editors.Nothing is written.- Extra permissions on
memberoreditor? They stay. This call cannot set them. - The response
customRoleIdslists the custom roles the member has after the call, ordered by when each role was assigned. - Not an active human member? Returns
404(unknown email, invited, deactivated, service account, or another workspace). - Last remaining admin? Returns
400withcode: "BAD_REQUEST". - Repeating the member’s current role succeeds.
- Email matching is case-insensitive. Role values are lowercase:
member,editor,admin.ADMINreturns400.
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.