> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Workspace Member Role

> Updates the role of a member in an workspace.

<ParamField path="id" type="string" required>
  The ID of the workspace.
</ParamField>

<ParamField path="userId" type="string" required>
  The ID of the user whose role is to be updated.
</ParamField>

<ParamField body="role" type="string" required>
  The new role for the member. Must be one of: `owner`, `admin`, `developer`, `operator`, `viewer`.
</ParamField>

### Response

<ResponseExample>
  ```json Response theme={null}
  {}
  ```
</ResponseExample>

### Error Responses

<ResponseField name="code" type="string">
  The error code indicating the reason for failure. Possible values:

  * `UNAUTHORIZED`: The user is not authenticated.
  * `ONLY_OWNER_CAN_UPDATE_ROLE`: Only the workspace owner can update member roles.
  * `CANNOT_CHANGE_OWNER_ROLE`: The owner's role cannot be changed.
  * `INVALID_ROLE`: The provided role is invalid.
  * `MEMBER_NOT_FOUND`: The specified user is not a member of the workspace.
  * `ORG_ID_MUST_BE_STRING`: The provided workspace\_id is not a string.
  * `USER_ID_MUST_BE_STRING`: The provided user ID is not a string.
  * `ROLE_MUST_BE_STRING`: The provided role is not a string.
</ResponseField>

<ResponseField name="message" type="string">
  A descriptive message providing additional details about the error.
</ResponseField>

<ResponseExample>
  ```json Error Response (403) theme={null}
  {
    "code": "UNAUTHORIZED"
  }
  ```

  ```json Error Response (403) theme={null}
  {
    "code": "ONLY_OWNER_CAN_UPDATE_ROLE"
  }
  ```

  ```json Error Response (404) theme={null}
  {
    "code": "MEMBER_NOT_FOUND"
  }
  ```
</ResponseExample>
