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. 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

MethodEndpointWhat it does
GET / POST/v1/agentsList 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}/copiesCopy an agent from a version (with or without files)
GET / PATCH / PUT/v1/agents/{agentId}/draftRead, edit or replace the draft
POST/v1/agents/{agentId}/draft/validateValidate changes without saving
POST/v1/agents/{agentId}/draft/restoreRestore an old version into the draft
GET/v1/agents/{agentId}/versionsList versions, get one or compare two
GET / POST/v1/agents/{agentId}/publicationSee the current publication or publish
POST/v1/agents/{agentId}/publication/rollbackGo back to a previous publication
GET/v1/agents/{agentId}/publicationsHistory of publications and rollbacks

Resources connected to the agent

AreaMain routes
SubagentsCreate, link and unlink under /draft/subagents
FilesList, connect, pause/schedule, disconnect and processing
ToolsList, available, connect, pause and disconnect
EscalationsList, connect and disconnect
TemplatesTemplates ready to install
Evals and ChatTest 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.