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

# API overview

> Understand how to interact with the Telentir platform APIs

<Note>
  Telentir’s APIs are served from the Next.js `telentir-web` project. All
  examples below reference real route handlers in `/app/api`.
</Note>

## Base URLs

| Environment | Base URL                       | Notes                                                       |
| ----------- | ------------------------------ | ----------------------------------------------------------- |
| Production  | `https://app.telentir.com/api` | Same origin as the Telentir dashboard.                      |
| Local dev   | `http://localhost:3000/api`    | Available when you run `npm run dev` inside `telentir-web`. |

Every route documented in this section is relative to the base URL above. The
API is versionless—breaking changes follow Telentir’s deprecation policy and
are announced via the changelog.

## Authentication in two layers

1. **Workspace sessions**: Created via the auth endpoints (email + password,
   2FA, phone verification). These return JWTs that the frontend stores in the
   `token` cookie. You can also copy the token and send it as a `Bearer` header
   for server-to-server work.
2. **API keys**: Long‑lived keys generated from `/api/api-keys`. These keys are
   accepted as bearer tokens everywhere the middleware `objectAuth` or `auth`
   is used. Keys inherit the owner’s scopes (phone verification, 2FA, etc.).

Most data-plane routes (encrypted objects, connect, persona previews, session
calls) use `objectAuth`, which additionally loads the user’s encrypted object
store and enforces phone verification. Bring-your-own encryption keys are
explained in [Encrypted objects](/api-reference/data-plane).

## Typical workflow

1. `POST /api/auth/login` to obtain a short-lived JWT or use an API key.
2. `GET /api/root` to fetch server metadata, stores, and encryption keys.
3. Mint store keys with `PUT /api/keys` and persist encrypted payloads through
   `PUT /api/objects`.
4. Subscribe to `GET /api/events/{type}` streams to mirror mutations or use
   `/api/connect` to ingest data from Telentir-managed scrapers.
5. Layer on voice/knowledge capabilities via the specialized endpoints listed
   in the rest of the API reference.

## Tooling and schema

<CardGroup>
  <Card title="OpenAPI playground" icon="code" href="/api-reference/openapi.json">
    Key auth + data-plane endpoints defined for quick prototyping.
  </Card>

  <Card title="Authentication guide" icon="lock" href="/api-reference/authentication">
    Covers login, phone verification, 2FA, API keys, and password resets.
  </Card>

  <Card title="Encrypted objects" icon="database" href="/api-reference/data-plane">
    Explains root objects, store keys, publish/unpublish, and event streams.
  </Card>
</CardGroup>

Need to integrate voice, knowledge, billing, or automation features? Jump over
to the dedicated pages listed in the sidebar. Each section links back to
concrete files inside `telentir-web` so you can audit the exact server logic.
