> ## 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                                                 |
| -------------------------- | -------------- | ----------------------------------------------------------- |
| `workspaces`               | array          | Workspaces the caller belongs to                            |
| `workspaces[].workspaceId` | string         | Workspace identifier — pass as `x-workspace-id` when needed |
| `workspaces[].slug`        | string \| null | Workspace slug. `null` when the workspace has no slug       |

### Example Response

```json theme={null}
{
  "workspaces": [
    {
      "workspaceId": "org_abc123",
      "slug": "acme-inc"
    },
    {
      "workspaceId": "org_def456",
      "slug": null
    }
  ]
}
```

## Using a Workspace ID

With a Monid API key, the workspace is bound to the key — no header needed. When authenticating with an OAuth/JWT access token that doesn't carry an organization context, 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 <access-token>" \
  -H "x-workspace-id: org_abc123" \
  -H "Content-Type: application/json" \
  -d '{"query":"twitter posts"}'
```
