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

# API Reference

> Programmatic access to your Decipher data

The Decipher API lets you retrieve test results, session replays, AI-generated timelines, screenshots, and monitoring issue data programmatically. Use it to integrate Decipher into your CI/CD pipelines, build custom dashboards, analyze user behavior, monitor production issues, or trigger alerts in external systems.

**Base API URL:** `https://api.getdecipher.com`

## Authentication

All API requests require an API key. You can create and manage API keys from [Settings > API Keys](https://app.getdecipher.com/settings?section=api-keys) in the Decipher dashboard.

Include your key in the `Authorization` header:

```bash theme={null}
curl https://api.getdecipher.com/api/v1/tests/456 \
  -H "Authorization: Bearer dcp_live_your_api_key_here"
```

Alternatively, you can use the `X-API-Key` header:

```bash theme={null}
curl https://api.getdecipher.com/api/v1/tests/456 \
  -H "X-API-Key: dcp_live_your_api_key_here"
```

API keys are scoped to your organization. Any test or run belonging to your organization is accessible with your key.

## Errors

The API uses standard HTTP status codes and returns a consistent error object:

```json theme={null}
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested test was not found."
  }
}
```

| Status | Type                   | Meaning                                    |
| ------ | ---------------------- | ------------------------------------------ |
| 401    | `authentication_error` | Missing or invalid API key                 |
| 403    | `authorization_error`  | Key doesn't have access to this resource   |
| 404    | `not_found_error`      | Resource doesn't exist or isn't accessible |
| 422    | `validation_error`     | Invalid request parameters                 |
| 429    | `rate_limit_error`     | Too many requests                          |
| 500    | `api_error`            | Internal server error                      |

## Pagination

List endpoints use cursor-based pagination. The response includes:

* `hasMore` — whether more results exist
* `nextCursor` — pass this as the `cursor` query parameter to fetch the next page

```bash theme={null}
# First page
curl "https://api.getdecipher.com/api/v1/tests/456/runs?limit=10" \
  -H "Authorization: Bearer dcp_live_..."

# Next page
curl "https://api.getdecipher.com/api/v1/tests/456/runs?limit=10&cursor=eyJpZCI6..." \
  -H "Authorization: Bearer dcp_live_..."
```
