Agent templates

Create an agent from a template for sales, support, appointments or another use. Choose a template, install it and check the pending items to adapt it to your business.

The agent starts as a draft. Publish it when you are done so it can begin replying.

Example

// 1. List templates and install one
const [template] = await platic.agentTemplates.list();
const { agent, setup } = await platic.agentTemplates.install(template.slug);

// 2. Resolve pending items (draft, files, tools, channels) or skip optional ones
for (const slot of (setup?.slots ?? []).filter((s) => s.state === "pending" && !s.required)) {
  await platic.agents.templateSetup.update(agent.id, { action: "skip", slotId: slot.id });
}

// 3. Close the list when ready === true and publish
const current = await platic.agents.templateSetup.get(agent.id);
if (current.setup?.ready) {
  await platic.agents.templateSetup.update(agent.id, { action: "complete" });
  await platic.agents.publish(agent.id);
}

What you need to know

  • They are marked done on their own: each pending item (variable, tool, channel or knowledge) is resolved with the agent's normal endpoints; when you read template-setup, Platica detects what you already completed and moves it to done.
  • Optional items and closing: only pending items with required: false can be skipped (action: "skip"). complete closes the list when ready is true; dismiss closes it as is.
  • Permissions and credits: it requires the Agents permission. Installing consumes creation credits if applicable (402 CREDIT_LIMIT_REACHED if there is no credit). With OAuth the agent is placed under the person's name; with an API key it is born without an owner.

Endpoints

MethodEndpointWhat it does
GET/v1/agent-templatesList the available templates
POST/v1/agent-templates/{slug}/installInstall a template and create a new agent
GET/v1/agents/{agentId}/template-setupSee the agent's pending items
POST/v1/agents/{agentId}/template-setupSkip a pending item, finish (complete) or dismiss (dismiss)

The list (setup)

Installing and reading the pending items return the same setup object:

FieldDescription
templateThe template the agent comes from: slug, name and version
statusin_progress, completed or dismissed
readytrue when every required item is done: only then does complete work
done, totalItems done or skipped, and items in total
slotsThe pending items. See the pending items

setup is null on an agent that doesn't come from a template.

The pending items

Each item in slots has an id, a kind, a label, a detail, required, a state and an openUrl (the page in Platica where it can also be resolved, or null).

kindWhat it asks forExtra fields
variableReplace the {{variables}} in the draft's instructions with your business datavariables: key, label and placeholder of each one
toolConnect and activate a tool for this agentprovider: type and id
channelGive the agent a channelchannels: id and name of the ones the template is made for
knowledgeAdd files to the agenthint: what to add

state is pending, done or skipped. Skipped items count in done.

API key or OAuth

With an OAuth token, the agent is placed under the person's name and their creator chat in Platica starts with the template. With an API key there is no person: the agent has no owner and no creator chat.

Common errors

Statusdetails.codeWhen
402CREDIT_LIMIT_REACHEDThe workspace has no credit. Nothing was created
403FORBIDDENYour token only sees your assigned agents and this one isn't yours
404AGENT_NOT_FOUNDThe agent doesn't exist in this workspace

The rest are listed on each endpoint's page and in Errors. AI tools are in the Agents MCP tools.