# Get a template

Use these endpoints to retrieve a template by language or to list all available language variants.
Before making requests, ensure you have configured [authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication).

For the full technical reference, see the [OpenAPI specification](/fr/products/whatsapp/openapi/template/gettemplate).

## Get template by language

Retrieves a specific template by its ID and language.

#### Endpoint

```
GET /api/template/{templateId}
```

#### Headers

| Name | Required | Description |
|  --- | --- | --- |
| `Authorization` | Yes | Basic Auth credentials. See [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication). |
| `X-Api-Key` | Yes | API key for the account. See [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication). |


#### Path parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `templateId` | integer | Yes | The template ID to retrieve |


#### Query parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `language` | string | Yes | The template language code (e.g. `it`, `en`) |


#### Request example

```
GET /api/template/9?language=en
```

#### Response examples

**200 — Utility template**

```json
{
  "body": {
    "text": "Hello *{{1}}*, your signature is required for a document. Open by using following link:",
    "parameters": [
      { "text": "John Smith" }
    ]
  },
  "urlButtons": [
    {
      "index": 0,
      "urlPath": "sign",
      "url": "https://yourendpoint.com/{{1}}",
      "text": "Open Document"
    }
  ],
  "textHeader": {
    "text": "Document signing request"
  },
  "language": "en",
  "status": "APPROVED",
  "category": "UTILITY",
  "name": "signature_template",
  "description": "sign a doc using a link",
  "templateId": "9",
  "default": true
}
```

**200 — Authentication template**

```json
{
  "body": {
    "text": "*{{1}}* è il tuo codice di verifica. Per garantire la tua sicurezza, ti consigliamo di non condividere questo codice.",
    "parameters": [
      { "text": "123456" }
    ]
  },
  "urlButtons": [
    {
      "index": 0,
      "urlPath": "123456",
      "url": "https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp{{1}}",
      "text": "Copia codice"
    }
  ],
  "footer": {
    "text": "Scade tra 10 minuti.",
    "codeExpirationMinutes": 10
  },
  "language": "it",
  "status": "APPROVED",
  "category": "AUTHENTICATION",
  "name": "authentication_template",
  "description": "auth",
  "templateId": "1",
  "default": false
}
```

The response fields are:

| Field | Type | Description |
|  --- | --- | --- |
| `templateId` | string | The template ID |
| `name` | string | The template name. Only alphabetic characters and underscores (max 100 characters) |
| `description` | string | The template description |
| `language` | string | The template language code. See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) |
| `status` | string | Approval status: `PENDING`, `APPROVED`, or `REJECTED` |
| `category` | string | Template category: `UTILITY`, `MARKETING`, or `AUTHENTICATION` |
| `default` | boolean | Whether this is the default language variant for the template |
| `body` | object | Body component. See [Body component](/fr/products/whatsapp/enterprise-documentation/developer-documentation/api-references/send-message-apis/send#body-component) for details on how placeholders and parameters work |
| `urlButtons` | array | URL buttons defined in the template. Each entry has `index` (zero-based position), `text` (button label), `url` (base URL with optional `{{1}}` placeholder), and `urlPath` (default path appended to the URL). Empty array `[]` if none. Max 2 buttons |
| `textHeader` | object | Header text component, if present. Not present in `AUTHENTICATION` templates |
| `footer` | object | Footer text component, if present. For `AUTHENTICATION` templates, includes `codeExpirationMinutes` (OTP expiration time in minutes) |


**404 — Template not found**

```json
{
  "type": "UnavailableTemplateException",
  "code": 7,
  "message": "Invalid template"
}
```

#### Error codes

| HTTP Status | Error code | Error type | Solution |
|  --- | --- | --- | --- |
| `404` | 7 | `UnavailableTemplateException` | Verify that the `templateId` and `language` exist |


For authentication errors (code 1, 6, 9), see [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication).

## Get template languages

Returns all available language variants for a specific template.

#### Endpoint

```
GET /api/template/{templateId}/languages
```

#### Headers

| Name | Required | Description |
|  --- | --- | --- |
| `Authorization` | Yes | Basic Auth credentials. See [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication). |
| `X-Api-Key` | Yes | API key for the account. See [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication). |


#### Path parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `templateId` | integer | Yes | The template ID |


#### Request example

```
GET /api/template/9/languages
```

#### Response examples

**200 — Languages list**

```json
["de", "en", "fr", "it"]
```

The response is an array of language codes. Each code follows the format defined by Meta. See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) for the full list of valid values.

**404 — Template not found**

```json
{
  "type": "UnavailableTemplateException",
  "code": 7,
  "message": "Invalid template"
}
```

#### Error codes

| HTTP Status | Error code | Error type | Solution |
|  --- | --- | --- | --- |
| `404` | 7 | `UnavailableTemplateException` | Verify that the `templateId` exists |


For authentication errors (code 1, 6, 9), see [Authentication](/fr/products/whatsapp/enterprise-documentation/developer-documentation/authentication).