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

# Members & Invites

> API endpoints for managing organization members and invitations

## List Members

Returns all members of the authenticated organization.

```
GET /api/members
```

### Response

```json theme={null}
[
  {
    "id": "mem_01hx...",
    "email": "alice@acme.com",
    "name": "Alice Smith",
    "role": "ORG_ADMIN",
    "dashboard_access": true,
    "joined_at": "2025-09-01T12:00:00Z"
  }
]
```

***

## Update a Member

Change a member's role or dashboard access.

```
PATCH /api/members/:id
```

### Request Body

```json theme={null}
{
  "role": "ANALYST",
  "dashboard_access": true
}
```

| Field              | Type    | Description                           |
| ------------------ | ------- | ------------------------------------- |
| `role`             | string  | `ORG_ADMIN`, `ANALYST`, or `APP_USER` |
| `dashboard_access` | boolean | Allow/deny dashboard login            |

### Response

`200 OK` with the updated member object.

***

## Remove a Member

Removes a member from the organization.

```
DELETE /api/members/:id
```

### Response

`204 No Content`

***

## List Pending Invites

```
GET /api/invites
```

### Response

```json theme={null}
[
  {
    "id": "inv_01hx...",
    "email": "bob@acme.com",
    "role": "ANALYST",
    "created_at": "2025-10-10T09:00:00Z"
  }
]
```

***

## Send an Invite

```
POST /api/invites
```

### Request Body

```json theme={null}
{
  "email": "bob@acme.com",
  "role": "ANALYST"
}
```

### Response

`201 Created` with the invite object.

***

## Cancel an Invite

```
DELETE /api/invites/:id
```

### Response

`204 No Content`

***

## Accept an Invite

This endpoint does **not** require authentication — it is called from the invite acceptance link in the email.

```
POST /api/invites/accept
```

### Request Body

```json theme={null}
{
  "token": "<invite_token_from_email>"
}
```

### Response

`200 OK` — the user is now a member of the organization. They will be added to the correct org on next login.
