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

# API Overview

> Base URL, authentication, response format, and error codes for the CollabKit REST API.

The CollabKit REST API lets you manage rooms, users, files, webhooks, and workflows. All real-time features (presence, stores, comments, broadcasts) use the [WebSocket protocol](/api-reference/websocket) instead.

## Base URL

```
https://api.collab-kit.com
```

Replace with your deployed CollabKit server URL.

## Authentication

Most endpoints require authentication via a Bearer token. See the [Authentication guide](/authentication) for full details.

### Bearer Token

Construct the token by Base64-encoding `accountId:apiKey`:

```bash theme={null}
TOKEN=$(echo -n "${ACCOUNT_ID}:${API_KEY}" | base64)
```

Include it in the `Authorization` header:

```bash theme={null}
curl -H "Authorization: Bearer ${TOKEN}" \
  https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/rooms
```

## Response Format

All API responses use a standard envelope:

```json theme={null}
{
  "type": "response",
  "success": true,
  "description": "Request completed successfully",
  "data": { /* payload */ },
  "error": null,
  "requestId": "req_abc123"
}
```

| Field         | Type             | Description                            |
| ------------- | ---------------- | -------------------------------------- |
| `type`        | `string`         | Always `"response"`                    |
| `success`     | `boolean`        | Whether the request succeeded          |
| `description` | `string`         | Human-readable description             |
| `data`        | `object`         | Response payload (empty `{}` on error) |
| `error`       | `object \| null` | Error details, or `null` on success    |
| `requestId`   | `string`         | Optional request identifier            |

### Error Format

When `success` is `false`, the `error` field contains:

```json theme={null}
{
  "error": {
    "module": "Rooms",
    "code": "NOT_FOUND",
    "message": "Room not found"
  }
}
```

| Field     | Type     | Description                             |
| --------- | -------- | --------------------------------------- |
| `module`  | `string` | Which server module generated the error |
| `code`    | `string` | Machine-readable error code             |
| `message` | `string` | Human-readable error message            |

## Error Codes

| Code               | HTTP Status | Description                        |
| ------------------ | ----------- | ---------------------------------- |
| `UNAUTHORIZED`     | 401         | Missing or invalid authentication  |
| `FORBIDDEN`        | 403         | Insufficient permissions           |
| `NOT_FOUND`        | 404         | Resource not found                 |
| `BAD_REQUEST`      | 400         | Invalid request body or parameters |
| `CONFLICT`         | 409         | Resource already exists            |
| `INTERNAL_ERROR`   | 500         | Server-side error                  |
| `VALIDATION_ERROR` | 400         | Request body failed validation     |
| `RATE_LIMITED`     | 429         | Too many requests                  |

## Pagination

List endpoints support pagination with `limit` and `offset` query parameters:

| Parameter | Type     | Default | Max | Description                |
| --------- | -------- | ------- | --- | -------------------------- |
| `limit`   | `number` | 50      | 100 | Number of results per page |
| `offset`  | `number` | 0       | --  | Number of results to skip  |

Paginated responses include total count:

```json theme={null}
{
  "data": {
    "rooms": [ /* ... */ ],
    "total": 150,
    "limit": 50,
    "offset": 0
  }
}
```

## Search & Filtering

Many list endpoints support a `search` query parameter for case-insensitive partial matching, and `from`/`to` date range filters:

| Parameter | Type     | Description                                                           |
| --------- | -------- | --------------------------------------------------------------------- |
| `search`  | `string` | Case-insensitive partial match on the primary field (name, URL, etc.) |
| `from`    | `string` | ISO date string. Filters `created_at >= from`                         |
| `to`      | `string` | ISO date string. Filters `created_at <= to`                           |
