> For the complete documentation index, see [llms.txt](https://docs.taqnyat.sa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taqnyat.sa/api-reference/templates/create-template/video-template.md).

# Video Template

## Create Video Template

Use this endpoint to create a WhatsApp template with a **video header**.

The template is submitted for approval and can be used for sending only after it is approved.

### Endpoint

```http
POST /templates/
```

Full URL:

```
https://api.taqnyat.sa/wa/v2/templates/
```

### Authentication

Include your API token in the request header:

```http
Authorization: <YOUR_TOKEN>
Content-Type: application/json
```

### Request Parameters

| Parameter               | Type   | Required   | Description                                                     |
| ----------------------- | ------ | ---------- | --------------------------------------------------------------- |
| `name`                  | String | Yes        | Unique name of the template.                                    |
| `language`              | String | Yes        | Language code of the template.                                  |
| `category`              | String | Yes        | Template category, such as `UTILITY` or `MARKETING`.            |
| `components`            | Array  | Yes        | Contains the template body and video header.                    |
| `components[].type`     | String | Yes        | Component type, such as `BODY` or `HEADER`.                     |
| `components[].text`     | String | For body   | Text content of the template body.                              |
| `format`                | String | For header | Must be `VIDEO`.                                                |
| `example.header_handle` | Array  | Yes        | Contains the video reference used when submitting the template. |

### Example Payload

```json
{
  "name": "video_update",
  "language": "en",
  "category": "UTILITY",
  "components": [
    {
      "type": "BODY",
      "text": "This is a test message"
    },
    {
      "type": "HEADER",
      "format": "VIDEO",
      "example": {
        "header_handle": [
          "<VIDEO_LINK>"
        ]
      }
    }
  ]
}
```

### Example Request

```bash
curl --location 'https://api.taqnyat.sa/wa/v2/templates/' \
--header 'Content-Type: application/json' \
--header 'Authorization: <YOUR_TOKEN>' \
--data '{
  "name": "video_update",
  "language": "en",
  "category": "UTILITY",
  "components": [
    {
      "type": "BODY",
      "text": "This is a test message"
    },
    {
      "type": "HEADER",
      "format": "VIDEO",
      "example": {
        "header_handle": [
          "<VIDEO_LINK>"
        ]
      }
    }
  ]
}'
```

### Body Component

The `BODY` component contains the main template text:

```json
{
  "type": "BODY",
  "text": "This is a test message"
}
```

### Video Header

To create a video template, add a `HEADER` component with:

```json
{
  "type": "HEADER",
  "format": "VIDEO",
  "example": {
    "header_handle": [
      "<VIDEO_LINK>"
    ]
  }
}
```

The `header_handle` array contains the video reference used as the example media for the template submission.

### Template Category

Set `category` according to the purpose of the template.

Common values include:

```
UTILITY
MARKETING
```

Meta reviews the submitted template and determines its final classification and approval status.

### Response

{% code overflow="wrap" expandable="true" %}

```json
{
  "type":"template",
  "statuses":{
    "message_id":"wamid.HBgMOTYyNzk3MDI3Nzg3FQIAERgSRjAyRDE0RDc5RDA0NkVBQjBCAA==",
    "recipient":"+966********"
  }
}
```

{% endcode %}

### Notes

* The header `format` must be `VIDEO`.
* The video reference is provided through `example.header_handle`.
* The template body is defined separately using the `BODY` component.
* The template must be approved before it can be used to send video template messages.
