Skip to main content
POST
Change a member's system role
This endpoint changes an active human member’s workspace system role by email. Send member, editor, or admin. Custom roles are not part of this endpoint. 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

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Prerequisites

  • API Key with the USER_MANAGEMENT_API scope
  • The API key must be created by a workspace admin

Behavior

  • Not an active human member? Returns 404 (unknown email, invited, deactivated, service account, or another workspace).
  • Last remaining admin? Returns 400 with code: "BAD_REQUEST".
  • Repeating the member’s current role succeeds.
  • Email matching is case-insensitive. Role values are lowercase: member, editor, admin. ADMIN returns 400.
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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Body

application/json
email
string<email>
required

Email address of the active workspace member

Example:

"user@example.com"

role
enum<string>
required

Workspace system role. Values are lowercase.

Available options:
member,
editor,
admin
Example:

"editor"

Response

Role updated successfully

status
enum<string>
required

Always "success" when the role is updated

Available options:
success
Example:

"success"

email
string<email>
required

Email address of the updated member

Example:

"user@example.com"

role
enum<string>
required

System role after the update

Available options:
member,
editor,
admin
Example:

"editor"