---
docId: doc_657262191ac64f97ac1fae9221a85d7e
title: Install a template
description: Creates a new agent from a template, as a draft, with the list of pending items to finish it.
api:
  group: agentes/plantillas
  auth: bearer
  operations:
    - operationId: installAgentTemplate
      method: POST
      path: '/v1/agent-templates/{slug}/install'
      postmanName: Install an agent template
---

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

# Install a template

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.

<Note type="warning">

Each call creates another agent. If the response didn't arrive, check [List agents](/api-reference/agents/list) before repeating. If the agent was created but its list of pending items couldn't be saved, the error says so with `details.agentId`: delete that agent or finish it in Platica before installing again.

</Note>

## Example

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

```bash
curl -X POST https://api.platic.ai/v1/agent-templates/atencion-a-clientes/install \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `slug` | string | The template's `slug`, from [List agent templates](/api-reference/agent-templates/list) | ✓ |

## Request body

It takes no body.

## Response

`201 Created`

```json
{
  "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"
}
```

| Field | Description |
|-------|-------------|
| `agent.id` | The new agent. Use it in the [Agents](/api-reference/agents) routes |
| `agent.name` | Its name, the template's |
| `agent.url` | The agent's page in Platica, where the pending items can also be finished |
| `setup` | The list of pending items. See [the list](/api-reference/agent-templates#the-list-setup) |
| `nextStep` | What is missing and which route resolves each pending item, in English |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `402` | `CREDIT_LIMIT_REACHED` | The workspace has no credit. Nothing was created |
| `404` | `AGENT_TEMPLATE_NOT_FOUND` | There is no published template with that `slug` |
| `409` | `AGENT_TEMPLATE_UNAVAILABLE` | The workspace doesn't use agents with versions. Nothing was created |

The errors that come up on any operation are in the [introduction](/api-reference/agent-templates#common-errors).

## 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](/api-reference/agent-templates#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](/api-reference/agent-templates/setup/update) and [publish the agent](/api-reference/agents/publications/publish).
- From an AI agent, the tool is [`install_agent_template`](/mcp/tools#agents).
