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

# Overview

> REST API for programmatic access to Qalico regulatory data

# API Reference

The Qalico REST API lets B2B clients integrate regulatory intelligence into their own products. Each API client gets access to one or more workspaces, with full control over profiles, subscriptions, references, and updates.

## Base URL

```
https://api.qalico.com/api
```

## Authentication

All requests require an API key passed via the `X-API-Key` header:

```bash theme={null}
curl -H "X-API-Key: sk_live_..." https://api.qalico.com/api/workspaces
```

Alternatively, use the `Authorization: Bearer` header:

```bash theme={null}
curl -H "Authorization: Bearer sk_live_..." https://api.qalico.com/api/workspaces
```

API keys are created in the Qalico back office. The raw key is shown once at creation — store it securely.

## Workspace scoping

Most endpoints are scoped to a workspace. The API key determines which workspaces you can access. Requests to unauthorized workspaces return `403 Forbidden`.

## Errors

| Status | Meaning                                                   |
| ------ | --------------------------------------------------------- |
| `200`  | Success                                                   |
| `201`  | Created                                                   |
| `400`  | Bad request — invalid input                               |
| `401`  | Unauthorized — missing or invalid API key                 |
| `403`  | Forbidden — API key doesn't have access to this workspace |
| `404`  | Not found                                                 |

Error responses include a `message` field:

```json theme={null}
{
  "message": "API client does not have access to this workspace",
  "statusCode": 403
}
```

## Typical workflow

<Steps>
  <Step title="Create a workspace">
    `POST /api/workspaces` with a name.
  </Step>

  <Step title="Generate a profile">
    `POST /api/workspaces/:id/profile/generate` with a company website URL. AI analyzes the site and creates a regulatory profile.
  </Step>

  <Step title="Generate subscriptions">
    `POST /api/workspaces/:id/subscriptions/generate` — AI recommends regulatory sources based on the profile.
  </Step>

  <Step title="Wait for impact assessment">
    After subscriptions are set, an impact assessment runs in the background. Updates will appear with priority and impact summaries once complete.
  </Step>

  <Step title="Query data">
    Use the GET endpoints to list references, updates, and their details.
  </Step>
</Steps>
