Agents
Create an agent to answer your contacts through Platica channels. Start with Create an agent and define its instructions in the configuration.
To change its behavior, edit the draft. Each saved change creates an immutable version. Publish the version you want to use with your contacts. The API uses /v1/clients for contacts.
Example
# 1. Create an agent (it is born published as v1)
curl -X POST https://api.platic.ai/v1/agents \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Sales", "instructions": "Answer pricing questions briefly."}'
# 2. Edit the draft (creates v2 without publishing), then publish
curl -X PATCH https://api.platic.ai/v1/agents/$AGENT_ID/draft \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"instructions": "Answer in under 80 words."}'
curl -X POST https://api.platic.ai/v1/agents/$AGENT_ID/publication \
-H "Authorization: Bearer $PLATIC_API_KEY" // 1. It is born published as v1
const agent = await platic.agents.create({
name: "Sales",
instructions: "Answer pricing questions briefly.",
});
// 2. Edit the draft (creates v2 without affecting production) and publish
await platic.agents.draft.update(agent.id, {
instructions: "Answer in under 80 words. Never make up prices.",
});
await platic.agents.publish(agent.id); What you need to know
- What is versioned (applies when you publish): the agent's configuration (instructions, model, guardrails, follow-up, schedule, assistance and subagents).
- What applies live (without creating a version): name, photo, status and owners (Update an agent), connected files, tools and channels.
- Escalations (human assistance): the rules that tell the agent when to hand a conversation to your team and open a case. They live inside the configuration, but connecting or disconnecting one creates and publishes a new version right away.
- Going back: Restore copies an earlier version into the draft without touching production; Rollback publishes a previously published version again without touching the draft.
Endpoints
Agent, draft, versions and publication
| Method | Endpoint | What it does |
|---|---|---|
GET / POST | /v1/agents | List agents or create one (published as v1) |
GET / PATCH / DELETE | /v1/agents/{agentId} | Get, update name, photo, status or owners, or delete |
POST | /v1/agents/{agentId}/copies | Copy an agent from a version (with or without files) |
GET / PATCH / PUT | /v1/agents/{agentId}/draft | Read, edit or replace the draft |
POST | /v1/agents/{agentId}/draft/validate | Validate changes without saving |
POST | /v1/agents/{agentId}/draft/restore | Restore an old version into the draft |
GET | /v1/agents/{agentId}/versions | List versions, get one or compare two |
GET / POST | /v1/agents/{agentId}/publication | See the current publication or publish |
POST | /v1/agents/{agentId}/publication/rollback | Go back to a previous publication |
GET | /v1/agents/{agentId}/publications | History of publications and rollbacks |
Resources connected to the agent
| Area | Main routes |
|---|---|
| Subagents | Create, link and unlink under /draft/subagents |
| Files | List, connect, pause/schedule, disconnect and processing |
| Tools | List, available, connect, pause and disconnect |
| Escalations | List, connect and disconnect |
| Templates | Templates ready to install |
| Evals and Chat | Test versions with evals and talk to an agent in Chat |
General format in Responses, errors in Errors and AI tools in the Agents MCP tools.