Update a workspace member role
Change the role of an existing workspace member under the role safety rules.
Endpoint
PATCH
/api/v1/workspaces/{workspace_id}/members/{user_id}Authentication
| Operation class | Authentication | Minimum role | API key |
|---|---|---|---|
| dashboard-session-api | Dashboard session cookie; mutations also require X-CX-Request: 1. | admin | Not allowed |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspace_id | path | string | Yes | — |
user_id | path | string | Yes | — |
Request body
application/json request schema
| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
|---|---|---|---|---|---|---|---|
$ | object | PermintaanUbahPeran | — | No | Yes | — | — |
role | string | — | — | No | No | "owner", "admin", "member" | — |
Example
curl --request PATCH 'https://operade.ai/api/v1/workspaces/ws_demo/members/usr_demo' \
--cookie 'cx_session=YOUR_SESSION_COOKIE' \
--header 'X-CX-Request: 1' \
--header 'Content-Type: application/json' \
--data '{"role":"member"}'{
"role": "member"
}Responses
| Status | Description | Content |
|---|---|---|
4XX | Handled client error | application/json: ErrorResponse |
200 | Successful Response | application/json: WorkspaceMemberRoleResponse |
4XX application/json response schema
| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
|---|---|---|---|---|---|---|---|
$ | object | ErrorResponse | — | No | Yes | — | — |
error | object | ErrorItem | — | No | Yes | — | — |
error.code | string | — | — | No | Yes | — | — |
error.details | object | — | — | No | No | — | — |
error.message | string | — | — | No | Yes | — | — |
200 application/json response schema
| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
|---|---|---|---|---|---|---|---|
$ | object | WorkspaceMemberRoleResponse | — | No | Yes | — | — |
membership_id | string | — | — | No | Yes | — | — |
role | string | — | — | No | Yes | "owner", "admin", "member" | — |
user_id | string | — | — | No | Yes | — | — |
Response example
{
"membership_id": "string",
"user_id": "string",
"role": "owner"
}Errors
Reviewed common and route-declared errors are summarized here; the list is not exhaustive. Start with the distributed error index to find each code's canonical domain page.
| Status | Code | Description |
|---|---|---|
401 | unauthenticated | Authentication is missing, invalid, or revoked. |
403 | forbidden | The authenticated caller does not have access to this operation. |
404 | not_found | The requested workspace resource was not found. |
422 | validation_failed | The request did not pass field or business validation. |
