# Templates

Submit templates for Meta's review, track their status, sync them.

## Submit a template for Meta review

`POST /waba-connections/{wabaConnectionId}/templates`

Authentication: API key, or console session with X-Environment-Id · scope: templates:manage

Parameters:

| Name | Location | Type | Description |
|---|---|---|---|
| `wabaConnectionId` | path | string |  |

Body (JSON):

| Field | Type | | Description |
|---|---|---|---|
| `name` | string | required | Template name: lowercase letters, digits and underscores (e.g. appointment_reminder). |
| `language` | string | required | Language code: `fr`, `en`, `en_US`… |
| `category` | string | required | Meta category: MARKETING, UTILITY or AUTHENTICATION. It determines pricing at Meta. |
| `components` | string[] | required | Components in Meta format |

```bash
curl -X POST "$INBOX_API/waba-connections/WABA_CONNECTION_ID/templates" \
  -H "Authorization: Bearer $INBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "appointment_reminder",
    "language": "en",
    "category": "UTILITY",
    "components": [
      {
        "type": "BODY",
        "text": "Hello {{1}}, your appointment is confirmed for {{2}}.",
        "example": {
          "body_text": [
            [
              "Awa",
              "November 14 at 10 am"
            ]
          ]
        }
      }
    ]
  }'
```

Response 201:

```json
{
  "id": "ff532b8f-2956-4f04-851f-db09d5eefbd4",
  "name": "appointment_reminder",
  "language": "en",
  "category": "UTILITY",
  "status": "pending",
  "usable": false,
  "rejectionReason": null,
  "components": [
    {
      "type": "BODY",
      "text": "Hello {{1}}, your appointment is confirmed for {{2}}.",
      "example": {
        "body_text": [
          [
            "Awa",
            "November 14 at 10 am"
          ]
        ]
      }
    }
  ],
  "updatedAt": "2026-11-12T08:33:45.595Z"
}
```

## The WhatsApp account's templates and their review status

`GET /waba-connections/{wabaConnectionId}/templates`

Authentication: API key, or console session with X-Environment-Id · scope: templates:manage

Parameters:

| Name | Location | Type | Description |
|---|---|---|---|
| `wabaConnectionId` | path | string |  |

```bash
curl "$INBOX_API/waba-connections/WABA_CONNECTION_ID/templates" \
  -H "Authorization: Bearer $INBOX_KEY"
```

Response 200:

```json
[
  {
    "id": "ff532b8f-2956-4f04-851f-db09d5eefbd4",
    "name": "appointment_reminder",
    "language": "en",
    "category": "UTILITY",
    "status": "approved",
    "usable": true,
    "rejectionReason": null,
    "components": [
      {
        "text": "Hello {{1}}, your appointment is confirmed for {{2}}.",
        "type": "BODY"
      }
    ],
    "updatedAt": "2026-11-12T08:33:45.640Z"
  }
]
```

## Sync statuses from Meta

`POST /waba-connections/{wabaConnectionId}/templates/sync`

Authentication: API key, or console session with X-Environment-Id · scope: templates:manage

Parameters:

| Name | Location | Type | Description |
|---|---|---|---|
| `wabaConnectionId` | path | string |  |

```bash
curl -X POST "$INBOX_API/waba-connections/WABA_CONNECTION_ID/templates/sync" \
  -H "Authorization: Bearer $INBOX_KEY"
```

Response 200:

```json
[
  {
    "id": "ff532b8f-2956-4f04-851f-db09d5eefbd4",
    "name": "appointment_reminder",
    "language": "en",
    "category": "UTILITY",
    "status": "approved",
    "usable": true,
    "rejectionReason": null,
    "components": [
      {
        "text": "Hello {{1}}, your appointment is confirmed for {{2}}.",
        "type": "BODY"
      }
    ],
    "updatedAt": "2026-11-12T08:33:45.640Z"
  }
]
```

## Delete a template (all its languages)

`DELETE /waba-connections/{wabaConnectionId}/templates/{name}`

Authentication: API key, or console session with X-Environment-Id · scope: templates:manage

Parameters:

| Name | Location | Type | Description |
|---|---|---|---|
| `wabaConnectionId` | path | string |  |
| `name` | path | string |  |

```bash
curl -X DELETE "$INBOX_API/waba-connections/WABA_CONNECTION_ID/templates/NAME" \
  -H "Authorization: Bearer $INBOX_KEY"
```

Response 204:

```json
(no content)
```
