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

# API Reference

> Programmatic access to Capy's agent platform

## Authentication

All API requests require a Bearer token in the `Authorization` header:

```bash theme={null}
curl -H "Authorization: Bearer capy_xxxx" https://capy.ai/api/v1/projects
```

Generate API tokens at [capy.ai/settings/tokens](https://capy.ai/settings/tokens).

## Base URL

All endpoints are served from `https://capy.ai/api/v1/`.

## Pagination

List endpoints support cursor-based pagination:

* `limit` (query, default: 20, max: 100)
* `cursor` (query, opaque string from previous response)

Responses include `items`, `nextCursor` (null if no more), and `hasMore`.

## Errors

All errors return a consistent JSON structure:

```json theme={null}
{
  "error": {
    "code": "validation_error",
    "message": "Request body validation failed",
    "details": {}
  }
}
```

| Status | Code               | Description                               |
| ------ | ------------------ | ----------------------------------------- |
| 401    | `unauthorized`     | Missing or invalid API token              |
| 403    | `forbidden`        | Token doesn't have access to the resource |
| 404    | `not_found`        | Resource not found                        |
| 422    | `validation_error` | Invalid request parameters                |
| 500    | `internal_error`   | Unexpected server error                   |

## Task identifiers

Task IDs accept both formats:

* UUID: `550e8400-e29b-41d4-a716-446655440000`
* Identifier: `SCO-123` (project prefix + number)
