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

# API Reference

> ClawHQ dashboard REST API.

The ClawHQ dashboard exposes a REST API for managing agents, settings, and integrations programmatically.

## Base URL

```
http://localhost:3500/api
```

Replace `localhost:3500` with your ClawHQ domain in production.

## Authentication

All API requests require a valid session. Authenticate via WorkOS (see [dashboard login](/quickstart)) and include the session cookie, or generate an API token under **Settings → General → API Tokens**.

```bash theme={null}
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://your-clawhq.com/api/agents
```

## Endpoints

### Agents

| Method   | Path              | Description         |
| -------- | ----------------- | ------------------- |
| `GET`    | `/api/agents`     | List all agents     |
| `GET`    | `/api/agents/:id` | Get agent details   |
| `POST`   | `/api/agents`     | Create an agent     |
| `PATCH`  | `/api/agents/:id` | Update agent config |
| `DELETE` | `/api/agents/:id` | Delete an agent     |

### Settings

| Method  | Path            | Description          |
| ------- | --------------- | -------------------- |
| `GET`   | `/api/settings` | Get current settings |
| `PATCH` | `/api/settings` | Update settings      |

### Integrations

| Method | Path                         | Description                    |
| ------ | ---------------------------- | ------------------------------ |
| `GET`  | `/api/integrations`          | List integrations and status   |
| `POST` | `/api/integrations/:id/test` | Test an integration connection |

### Sessions & Activity

| Method | Path            | Description                |
| ------ | --------------- | -------------------------- |
| `GET`  | `/api/sessions` | List recent agent sessions |
| `GET`  | `/api/metrics`  | Usage and cost metrics     |

<Note>
  Full OpenAPI spec coming soon. In the meantime, all endpoints return JSON and follow REST conventions.
</Note>
