> ## Documentation Index
> Fetch the complete documentation index at: https://dev.docs.1to1ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Template detail

> Look up a template by name and language and get the parameters you need to fill in when sending it.

<Info>
  **Endpoint** · `GET /templates/{name}/{language}`
</Info>

<Note>
  **Read-only** endpoint: it returns information and changes nothing. It is not sent inside the `actions` array — you call it directly.
</Note>

Returns the detail of an approved template, identified by its natural key `(name, language)` — the same key Meta uses and the one you see in the dashboard. Along with the status and the category, the response carries the `parameters` block **already computed**: which variables the body takes, whether the header expects a parameter, and which URL buttons accept a dynamic value.

That is the point of this lookup: Meta serializes the placeholders (`{{1}}`, `{{2}}`, ...) inside the template's `components` structure, and here they arrive already parsed. You never have to parse Meta's shape to know what to fill in.

The usual flow is read first, act after: you look up what the template expects, then send the action with the values in place.

<Tip>
  Templates are created and approved in the dashboard, and that is where their name and language are shown. This reference does not publish the full list of a business's templates, so you take the name from the dashboard.
</Tip>

**Parameters**

All three live in the path. There are no query parameters.

* `slug` — the business identifier in the URL (**required**). It must match the token's business.
* `name` — the template name exactly as it appears in the dashboard (**required**). Alphanumeric plus underscore. Any casing is accepted: the server normalizes it to lowercase.
* `language` — Meta language code (**required**): `es`, `es_MX`, `en_US`, `pt_BR`. The server normalizes it to the `lower_UPPER` format.

### Response

```json theme={null}
{
  "data": {
    "name": "confirmacion_cita",
    "language": "es_MX",
    "status": "APPROVED",
    "category": "UTILITY",
    "body_text": "Hola {{1}}, tu cita quedó confirmada para las {{2}}.",
    "parameters": {
      "body_variables": [
        { "index": 1, "example": "Ana" },
        { "index": 2, "example": "10:00 AM" }
      ],
      "header_parameter": { "type": "image", "example": "4::aW1hZ2U=" },
      "button_parameters": [
        { "index": 0, "sub_type": "url", "example": "cita-12345" }
      ]
    }
  }
}
```

* `status` — status in Meta. The public API only exposes `APPROVED` templates.
* `category` — Meta category: `MARKETING`, `UTILITY`, or `AUTHENTICATION`.
* `body_text` — the approved body, with its placeholders. It can be `null`.
* `parameters.body_variables` — one entry per body placeholder, with its `index` (1-based position) and the `example` loaded in Meta when the template was approved (`null` if there is none). Empty array when the body has no variables.
* `parameters.header_parameter` — `type` (`text`, `image`, `video`, or `document`) and `example`. It is `null` when the header expects no parameter.
* `parameters.button_parameters` — only URL buttons with a placeholder: the button `index`, the `sub_type` (`url`), and `example`. Quick-reply buttons do not appear here.

### Example

A single read, with no side effects: the `GET` sends nothing and does not touch the conversation, it only returns what the template expects.

```bash theme={null}
curl -X GET "https://app.1to1.ai/api/v1/public/{slug}/templates/confirmacion_cita/es_MX" \
  -H "Authorization: Bearer sk_1to1_your_api_key"
```

That response tells you the body takes two variables, so the send action looks like this:

```jsonc theme={null}
{
  "type": "send_message",
  "template": {
    "name": "confirmacion_cita",
    "language": "es_MX",
    "body_variables": [
      { "index": 1, "value": "Ana" },
      { "index": 2, "value": "10:00 AM" }
    ]
  }
}
```

### Errors

| Code                    | HTTP | When                                                                                          |
| ----------------------- | ---- | --------------------------------------------------------------------------------------------- |
| `INVALID_REQUEST`       | 400  | The `name` or the `language` does not match the expected format.                              |
| `TEMPLATE_NOT_FOUND`    | 404  | No template with that name and language exists for the business.                              |
| `TEMPLATE_AMBIGUOUS`    | 409  | The same `(name, language)` exists on 2 or more connected WhatsApp channels. Contact support. |
| `TEMPLATE_NOT_APPROVED` | 422  | The template exists but its status in Meta is `PENDING` or `REJECTED`.                        |

The shared authentication, permission, and rate-limit codes are in [Errors](/en/errors).

The data this lookup returns feeds the `template` field of the send actions: [Send message](/en/action-groups/send-message) and [Send quick reply or template](/en/action-groups/send-quick-reply-or-template). The template concept and the 24-hour window are covered in [Templates](/en/templates).
