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

# API reference

> Programmatic REST access to your ClosedLoop AI product insights, themes, customers, and analytics. Region-scoped /v1 endpoints with API key auth.

## The /v1 REST API

The ClosedLoop AI REST API gives you programmatic access to the product insights your workspace already collects: the structured intelligence extracted from customer conversations and structured feedback. Pull insights, themes, features, customer context, and analytics into your own dashboards, warehouses, and scripts.

Every `/v1` endpoint is **read-only** (`GET`) and **team-scoped**: your API key belongs to one team, and every response is automatically limited to that team's data. Feedback is ingested through your connected [integrations](/docs/integrations/data-sources), not through this API.

## Two ways to integrate

|          | **This REST API**                          | **MCP**                                    |
| -------- | ------------------------------------------ | ------------------------------------------ |
| Best for | Server-to-server, dashboards, ETL, scripts | AI assistants (Claude, Cursor) and agents  |
| Shape    | Resource endpoints, JSON                   | Tool calls over the Model Context Protocol |
| Auth     | `X-API-Key` header                         | OAuth                                      |

Most agentic use cases are already covered by [MCP](/docs/mcp-server/overview). Reach for this REST API when you want plain HTTP resources.

## Base URLs

Each team lives in exactly one region, and your API key is scoped to it. Use the base URL for **your** region: a key issued in the EU only works against the EU host.

| Region         | Base URL                          |
| -------------- | --------------------------------- |
| United States  | `https://api.closedloop.sh/v1`    |
| European Union | `https://eu.api.closedloop.sh/v1` |

## Authentication

Create a key in **Settings, API Keys** in the app, then send it on every request as an `X-API-Key` header:

```bash theme={null}
curl https://api.closedloop.sh/v1/insights \
  -H "X-API-Key: clai_live_xxxxxxxxxxxxxxxxxxxx"
```

Never expose a key in client-side code. See [API keys](/docs/account/api-keys) for creating, scoping, and revoking keys.

## What you can read

| Resource    | What it returns                                                                                 |
| ----------- | ----------------------------------------------------------------------------------------------- |
| Insights    | Individual product insights: pain point, severity, workaround, competitor gap, evidence         |
| Themes      | Top-level problem clusters of related insights, RIC-scored                                      |
| Features    | The buildable, shippable children of a theme                                                    |
| Customers   | The people and accounts who gave feedback, with CRM context                                     |
| Context     | Strategic intelligence behind your customers: churn reasons, competitive mentions, satisfaction |
| Competitors | Competitors your customers mention, each with a mention trend over time                         |
| Trends      | Zero-filled time series for a metric over a window                                              |
| Facets      | Available filter values and their counts over the full dataset                                  |

Insights and context share the same resolved `customer_id`, so you can line up what a customer said with the strategic picture around them. Endpoints for your connected integrations and credit usage round out the surface.

## Next steps

* Read [Conventions](/docs/api-reference/conventions) for authentication, pagination, filtering, error shapes, and rate limits.
* Browse the **Endpoints** section in the sidebar for every resource, parameter, and response schema.
