---
docId: doc_aa022fcfac154c3ca0059dfbbc13e01b
title: API reference
description: "Looks up Platica endpoints with TypeScript and cURL examples."
sidebarTitle: Overview
---

<script>
  import { Ways } from '$lib/components';
</script>

# API reference

Choose the resource you need and open its endpoint. Each call includes an example and the parameters for using it in your application.

```bash
https://api.platic.ai/v1
```

Conversations use version 2: `https://api.platic.ai/v2/conversations`. Every other resource is on `/v1`.

## Your first call

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/agents \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
import { Platic } from "platic-sdk";

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! });
const agents = await platic.agents.list();
```

</Ways.Way>
</Ways>

## What you need to know

- **Authentication:** every request carries `Authorization: Bearer <key>`. See [Authentication](/authentication).
- **Responses:** many routes return `{ "status": "success", "data": … }`; conversations add `included` and `meta`, and some V1 reads group data in `workspaces`. See [Responses](/api-reference/responses).
- **Paginated lists** use `limit` and `pageToken`. See [Pagination](/api-reference/pagination).
- **Retries:** use `Idempotency-Key` on routes that support it, including every conversation action, to avoid repeating a change. See [Idempotency](/api-reference/idempotency).
- **Errors** share one shape with a stable `details.code`. See [Errors](/api-reference/errors).
- A [Postman collection](/platica-api.postman_collection.json) has every request.

## Resources

### Build agents

| Resource | What it covers |
|---|---|
| [Agents](/api-reference/agents) | Create agents, change their settings and manage versions, files, tools and subagents. |
| [Agent templates](/api-reference/agent-templates) | Install a ready-made agent and resolve its pending items. |
| [Evals](/api-reference/evals) | Simulated conversations that test a version before you publish it. |
| [Chat](/api-reference/chat) | Talk with an agent now or schedule a turn. |

### Knowledge and tools

| Resource | What it covers |
|---|---|
| [Files](/api-reference/files) | Texts, web pages and documents your agents consult. |
| [Tools](/api-reference/tools) | The workspace tool catalog. |
| [Custom APIs](/api-reference/custom-apis) | Turn an HTTP endpoint into a tool. |
| [Custom functions](/api-reference/custom-functions) | Your own TypeScript code as a tool. |
| [MCP servers](/api-reference/mcp-servers) | Connect an external MCP server and install its tools. |
| [Databases](/api-reference/databases) | Read-only PostgreSQL or MySQL. |
| [Secrets](/api-reference/secrets) | Encrypted credentials for your tools and webhooks. |
| [AI providers](/api-reference/ai-providers) | Bring your own model key. |

### Channels and conversations

| Resource | What it covers |
|---|---|
| [Channels](/api-reference/channels) | WhatsApp, Instagram, Messenger and email. |
| [Web chats](/api-reference/web-chats) | The chat for your website. |
| [Conversations](/api-reference/conversations) | List, search and count conversations, read their messages, pause or resume the agent, tag, assign and archive. |
| [Messages](/api-reference/messages) | Send and schedule messages. |
| [WhatsApp templates](/api-reference/whatsapp-templates/list) | Create and track WhatsApp templates. |
| [Posts and comments](/api-reference/posts) | Instagram and Facebook posts, threads and replies. |
| [Cases](/api-reference/cases) | Conversations escalated to your team. |
| [Escalations](/api-reference/escalations) | Define when an agent asks for help and what happens while your team handles it. |

### Contacts and campaigns

| Resource | What it covers |
|---|---|
| [Contacts](/api-reference/contacts) | The people your business talks to (API: `clients`). |
| [Custom fields](/api-reference/custom-fields) | Extra data on contacts. |
| [Tags](/api-reference/tags) | Label contacts. |
| [Campaigns](/api-reference/campaigns) | WhatsApp campaigns to an audience. |

### Account

| Resource | What it covers |
|---|---|
| [Webhooks](/api-reference/webhooks) | Signed events on your server. |
| [Usage](/api-reference/usage) | Consumption and autonomy statistics. |
| [Workspaces](/api-reference/workspaces) | The workspaces a credential can use. |
| [Docs search](/api-reference/docs-search) | Search these docs from code. |
