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

# List Workspaces

> List the workspaces your API key or OAuth token has access to.

```text theme={null}
GET /v1/auth/workspaces
```

List the workspaces your API key or OAuth access token has access to. Use the returned workspace IDs to set the `x-workspace-id` header on subsequent requests.

## Headers

| Header          | Required | Description                              |
| --------------- | -------- | ---------------------------------------- |
| `Authorization` | Yes      | `Bearer <api-key>` or OAuth access token |

## Example Request

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.monid.ai/v1/auth/workspaces" \
    -H "Authorization: Bearer monid_live_..."
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch("https://api.monid.ai/v1/auth/workspaces", {
    headers: { Authorization: "Bearer monid_live_..." },
  });
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.monid.ai/v1/auth/workspaces",
      headers={"Authorization": "Bearer monid_live_..."},
  )
  ```
</CodeGroup>

## 200 OK

| Field                 | Type   | Description                                     |
| --------------------- | ------ | ----------------------------------------------- |
| `items`               | array  | Workspaces the caller can access                |
| `items[].workspaceId` | string | Workspace identifier — pass as `x-workspace-id` |
| `items[].name`        | string | Workspace display name                          |
| `items[].role`        | string | Caller's role in the workspace                  |

### Example Response

```json theme={null}
{
  "items": [
    {
      "workspaceId": "ws_abc123",
      "name": "Acme, Inc.",
      "role": "owner"
    },
    {
      "workspaceId": "ws_def456",
      "name": "Personal",
      "role": "owner"
    }
  ]
}
```

## Using a Workspace ID

Every Monid API request should include the `x-workspace-id` header so Monid knows which workspace to operate against:

```bash theme={null}
curl -X POST https://api.monid.ai/v1/discover \
  -H "Authorization: Bearer monid_live_..." \
  -H "x-workspace-id: ws_abc123" \
  -H "Content-Type: application/json" \
  -d '{"query":"twitter posts"}'
```
