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

# Update Member Role

> Changes a member's role

```
PATCH /openapi/memorylake/admin/v1/members/{principal_id}
```

Changes a member's role. Guard rails:

* the `tenant_owner` role cannot be assigned here — ownership transfer stays in the console (`400`)
* the owner's own role cannot be changed (`409`)
* the calling key cannot change **its creator's** role — self-demotion would sever the automation's own authorization mid-run (`409`)

<Note>
  **Permission required:** `member:change_role`
</Note>

### Path Parameters

<ParamField path="principal_id" type="string" required>
  Member identifier from the [members list](/features/management-api/members/list-members)
</ParamField>

### Headers

<ParamField header="Idempotency-Key" type="string">
  Optional. Retrying with the same value replays the first result.
</ParamField>

### Request Body

<ParamField body="role" type="string" required>
  New role: `tenant_admin`, `tenant_member`, or a custom role key of this team
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH 'https://app.memorylake.ai/openapi/memorylake/admin/v1/members/9f2c1a7b3d5e4f60a1b2c3d4e5f60718' \
    -H 'Authorization: Bearer sk-xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{"role": "tenant_admin"}'
  ```
</RequestExample>

### Response

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Operation completed successfully",
    "data": {}
  }
  ```

  ```json Changing the owner's role (409) theme={null}
  {
    "success": false,
    "message": "cannot change the owner's role",
    "error_code": "STATE_NOT_READY"
  }
  ```
</ResponseExample>
