> ## 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](https://closedloop.sh/docs/integrations/data-sources.md), not through this API.

## Two ways to integrate

| | **This REST API** | **MCP** |
| - | - | - |
| Best for | Server-to-server, scheduled workloads, ETL, unattended agents | Interactive AI assistants and agents |
| Shape | Resource endpoints, JSON | Tool calls over the Model Context Protocol |
| Auth | `X-API-Key` header | OAuth |

Use [MCP](https://closedloop.sh/docs/mcp-server/overview.md) for interactive assistants. Use this REST API for scheduled Databricks jobs or other unattended workloads: API-key authentication does not require an OAuth approval step at run time.

## 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={"dark"}
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](https://closedloop.sh/docs/account/api-keys.md) 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 |
| Products and areas | The current product, product-area, and feature-area vocabulary, with area totals and earliest feedback dates |
| Themes | Top-level problem clusters of related insights, RIC-scored |
| Features | The buildable, shippable children of a theme |
| Coverage | Whether the evidence in a selected product or area scope is informative, too thin, or predates coverage |
| 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](https://closedloop.sh/docs/api-reference/conventions.md) for authentication, pagination, filtering, error shapes, and rate limits.
* Browse the **Endpoints** section in the sidebar for every resource, parameter, and response schema.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.