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

# API overview

> Start using the TPC API, authentication methods, scopes, and reference docs.

# API overview

The Prompting Company API lets you manage your content programmatically through the same `/api/v1` endpoints the dashboard uses, with the same `ApiResult` envelope and organization-scoped data model.

Use the API when you need to sync site pages from a CMS, automate content operations, or build server-to-server workflows around your TPC workspace.

## Base URL

```text theme={null}
https://app.promptingco.com
```

Local development uses:

```text theme={null}
http://localhost:3000
```

Every public endpoint lives under `/api/v1`.

## Authentication at a glance

| Method         | Use it when                                                  | How you send it                                             |
| -------------- | ------------------------------------------------------------ | ----------------------------------------------------------- |
| Session cookie | You are making first-party dashboard calls from the browser. | The dashboard sends the `better-auth.session_token` cookie. |
| OAuth bearer   | You are using the CLI or another OAuth client flow.          | Send `Authorization: Bearer <token>`.                       |
| API key        | You are building server-to-server integrations.              | Send `x-api-key: <key>`.                                    |

For integrations, create an organization API key from your dashboard settings and grant only the scopes your workflow needs.

## Scope catalog

| Scope               | Allows                                                                    |
| ------------------- | ------------------------------------------------------------------------- |
| `content:read`      | Read site pages, markdown content, and llms.txt files                     |
| `content:write`     | Create, update, and delete site pages and content                         |
| `prompts:read`      | Read prompts, topics, and prompt analysis results                         |
| `prompts:write`     | Create, update, archive prompts                                           |
| `simulations:read`  | Read agent-simulation tasks, runs, environments, and analytics            |
| `simulations:write` | Create and trigger simulation runs                                        |
| `logs:read`         | Read AI-traffic logs and request-level audit events                       |
| `analytics:read`    | Read analytics aggregates, including rankings, mentions, sources, and SOV |
| `products:read`     | Read product metadata and competitor data                                 |
| `products:write`    | Update product settings and competitor lists                              |

<Note>
  This table is intentionally copied from `apps/client/src/lib/api/scopes.ts`.
  When that catalog changes, update this page in the same PR so the docs and
  dashboard stay aligned.
</Note>

## Where to go next

<Card title="Quickstart" icon="rocket" href="/api/quickstart" horizontal>
  Create a scoped key, make your first request, and parse the response envelope.
</Card>

<Card title="Authentication" icon="shield-check" href="/api/authentication" horizontal>
  Choose between session cookies, OAuth bearer tokens, and API keys.
</Card>

<Card title="Reference" icon="book-open" href="/api/reference" horizontal>
  Explore endpoint schemas generated from the live OpenAPI document.
</Card>
