> 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-1.md).

# Templates

Create and retrieve WhatsApp message templates.

## Get Templates

> Retrieve and synchronize WhatsApp templates associated with the account.

```json
{"openapi":"3.0.3","info":{"title":"Taqnyat WhatsApp API","version":"2.0"},"tags":[{"name":"Templates","description":"Create and retrieve WhatsApp message templates."}],"servers":[{"url":"https://api.taqnyat.sa/wa/v2","description":"Taqnyat WhatsApp API"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Taqnyat API token."}}},"paths":{"/templates/":{"get":{"tags":["Templates"],"summary":"Get Templates","description":"Retrieve and synchronize WhatsApp templates associated with the account.","operationId":"getTemplates","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sync"],"properties":{"sync":{"type":"integer","description":"Triggers template synchronization before retrieving templates."}}}}}},"responses":{"200":{"description":"Templates retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"waba_templates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"parameter_format":{"type":"string"},"components":{"type":"array","items":{"type":"object","additionalProperties":true}},"language":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"id":{"type":"string"}}}}}}}}},"401":{"description":"Invalid or missing API token."}}}}}}
```

## Create Template

> Create and submit a WhatsApp message template for approval.\
> \
> The request structure depends on the type of template being created.<br>

```json
{"openapi":"3.0.3","info":{"title":"Taqnyat WhatsApp API","version":"2.0"},"tags":[{"name":"Templates","description":"Create and retrieve WhatsApp message templates."}],"servers":[{"url":"https://api.taqnyat.sa/wa/v2","description":"Taqnyat WhatsApp API"}],"security":[{"ApiToken":[]}],"components":{"securitySchemes":{"ApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Taqnyat API token."}}},"paths":{"/templates/":{"post":{"tags":["Templates"],"summary":"Create Template","description":"Create and submit a WhatsApp message template for approval.\n\nThe request structure depends on the type of template being created.\n","operationId":"createTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","language","category","components"],"properties":{"name":{"type":"string","description":"Unique template name."},"language":{"type":"string","description":"Template language code."},"category":{"type":"string","enum":["UTILITY","MARKETING","AUTHENTICATION"],"description":"Template category."},"components":{"type":"array","description":"Components that define the template structure.","items":{"type":"object","additionalProperties":true}}}}}}},"responses":{"200":{"description":"Template submitted successfully."},"400":{"description":"Invalid template request."},"401":{"description":"Invalid or missing API token."}}}}}}
```
