> ## 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

> Changes a member's role and/or per-member usage cap

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

Changes a member's role and/or per-member usage cap. Only the fields you send change; null is rejected. The owner role cannot be assigned here, and the owner's own role and your own role cannot be changed — use [Transfer Ownership](/features/memorylake/api-reference/team/transfer-ownership) to hand the team to another member.

<Note>
  **Permission required:** depends on what you send:

  * When you send `role`: `member:change_role`
  * When you send `max_tokens`: `member:set_quota`
  * Changes that give someone an admin role, or that reduce what an admin can reach, also require the team owner or an admin.
</Note>

### Path Parameters

<ParamField path="principal_id" type="string" required>
  Identifier of the member (`principal_id`)
</ParamField>

### Headers

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

### Request Body

<ParamField body="max_tokens" type="integer">
  Per-member usage cap in tokens, at most 1374389534. 0 removes the cap.
</ParamField>

<ParamField body="role" type="string">
  New role: tenant\_admin, tenant\_member, or a custom role key of this team. The owner role cannot be assigned here.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH 'https://app.memorylake.ai/openapi/memorylake/admin/v1/members/dbcf9a3aabee5042775269c9d137a2f8' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Idempotency-Key: 7c1d2e3f-0a9b-4c8d-b7e6-f5a4d3c2b1a0' \
    -H 'Content-Type: application/json' \
    -d '{
      "max_tokens": 1200000,
      "role": "tenant_member"
    }'
  ```
</RequestExample>

### Response

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

### Errors

Errors answer with `success: false`, a `message` and an `error_code`. See [Error Codes](/features/memorylake/api-reference/errors) for every code.

| Status | Meaning |
| - | - |
| `400` | A parameter or the body is invalid |
| `401` | The API key is missing, invalid, disabled or expired |
| `403` | The key is not allowed to do this |
| `404` | The resource does not exist |
| `409` | The request conflicts with the current state, e.g. a duplicate or a limit reached |
| `422` | The body or a parameter failed validation |
| `429` | Too many requests. Wait for the time in `Retry-After` |
| `500` | Server-side error |
| `503` | Temporarily unavailable. Retry later |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.