Install a template

SDK platic.agentTemplates.install()

Create an agent from a template by sending its slug, with no body. This uses the template’s latest version, including instructions, configuration and photo. Read setup to complete the pending items for your business; the agent remains a draft until you publish it.

Example

await platic.agentTemplates.install("atencion-a-clientes");

Path parameters

ParameterTypeDescriptionRequired
slugstringThe template's slug, from List agent templates✓

Request body

It takes no body.

Response

201 Created

{
  "status": "success",
  "message": "Agent created from the template Vendedor de la tienda",
  "data": {
    "agent": {
      "id": "Ag6bV8nM1qW3eR5t",
      "name": "Vendedor de la tienda",
      "url": "https://app.platica.mx/workspace/K7u9rQ2LmZx18BvC5tNd/agents/Ag6bV8nM1qW3eR5t"
    },
    "setup": {
      "template": { "slug": "vendedor-de-tienda", "name": "Vendedor de la tienda", "version": 3 },
      "status": "in_progress",
      "ready": false,
      "done": 1,
      "total": 4,
      "slots": [
        {
          "id": "negocio",
          "kind": "variable",
          "label": "Datos del negocio",
          "detail": "Horario",
          "required": true,
          "state": "pending",
          "variables": [{ "key": "horario", "label": "Horario", "placeholder": "{{horario}}" }],
          "openUrl": null
        },
        {
          "id": "tool-shopify",
          "kind": "tool",
          "label": "Shopify",
          "detail": "Conéctala y actívala para este agente",
          "required": false,
          "state": "done",
          "provider": { "type": "mcp", "id": "shopify" },
          "openUrl": null
        },
        {
          "id": "canal",
          "kind": "channel",
          "label": "Canal",
          "detail": "WhatsApp",
          "required": true,
          "state": "pending",
          "channels": [{ "id": "whatsapp", "name": "WhatsApp" }],
          "openUrl": "https://app.platica.mx/workspace/K7u9rQ2LmZx18BvC5tNd/integrations"
        },
        {
          "id": "conocimiento",
          "kind": "knowledge",
          "label": "Catálogo",
          "detail": "Tu catálogo de productos con precios",
          "required": false,
          "state": "pending",
          "hint": "Tu catálogo de productos con precios",
          "openUrl": null
        }
      ]
    }
  },
  "nextStep": "The agent Ag6bV8nM1qW3eR5t was created as a draft with 3 pending items. Datos del negocio: replace {{horario}} in the draft's instructions with PATCH /v1/agents/Ag6bV8nM1qW3eR5t/draft. Canal: connect one of WhatsApp with POST /v1/channels/connections and this agentId, or give this agent an existing channel with PATCH /v1/channels/{channelId}. Catálogo: add files to this agent with PUT /v1/agents/Ag6bV8nM1qW3eR5t/files/{fileId}. Optional items can be skipped with POST /v1/agents/Ag6bV8nM1qW3eR5t/template-setup (action \"skip\" and slotId). Each item is marked done when Platica sees it in the agent: check again with GET /v1/agents/Ag6bV8nM1qW3eR5t/template-setup. It can also be finished in Platica: https://app.platica.mx/workspace/K7u9rQ2LmZx18BvC5tNd/agents/Ag6bV8nM1qW3eR5t"
}
FieldDescription
agent.idThe new agent. Use it in the Agents routes
agent.nameIts name, the template's
agent.urlThe agent's page in Platica, where the pending items can also be finished
setupThe list of pending items. See the list
nextStepWhat is missing and which route resolves each pending item, in English

Errors

Statusdetails.codeWhen
402CREDIT_LIMIT_REACHEDThe workspace has no credit. Nothing was created
404AGENT_TEMPLATE_NOT_FOUNDThere is no published template with that slug
409AGENT_TEMPLATE_UNAVAILABLEThe workspace doesn't use agents with versions. Nothing was created

The errors that come up on any operation are in the introduction.

Notes

  • 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 or creator chat. See API key or OAuth.
  • The data the workspace already has is filled in on its own in the agent's instructions.
  • After that: resolve the pending items, finish the template and publish the agent.
  • From an AI agent, the tool is install_agent_template.