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

# API Reference

> REST API for programmatic access to Datachecks.

The Datachecks API gives you programmatic access to all operations — comparisons, validations, data sources, jobs, and more.

## Authentication

All API requests require a Bearer token and a workspace ID header:

```http theme={null}
Authorization: Bearer <your-api-key>
Workspace-Id: <your-workspace-id>
```

You can create API keys under **Settings → API Keys**.

## Base URL

The base URL depends on your deployment. Replace `YOUR_BASE_URL` in all examples with your instance URL.

```
https://YOUR_BASE_URL
```

## Versioning

The current API version is `v1`. All endpoints are prefixed with `/api/v1/`.

## Scopes

API keys are scoped to control what operations they can perform. Each endpoint requires a specific scope:

| Scope              | Description                    |
| ------------------ | ------------------------------ |
| `read:datasource`  | List and read data sources     |
| `read:job`         | List and read comparison jobs  |
| `write:job`        | Terminate jobs                 |
| `write:comparison` | Create and execute comparisons |

## Response format

All responses use a consistent envelope format:

```json theme={null}
{
  "message": "...",
  "meta": {},
  "data": { ... }
}
```

Paginated responses include pagination metadata inside `data`:

```json theme={null}
{
  "data": {
    "items": [...],
    "page": 1,
    "size": 50,
    "total": 120,
    "pages": 3
  }
}
```
