# Write a WhatsApp template

`POST /phone/templates` · Rivier · voice

Write a WhatsApp template. Placeholders are {{1}}, {{2}}. It cannot be sent until WhatsApp approves it.

- Scope: voice:write
- Mcp: rivier_phone_template_create
- Graphql: Mutation.voicePhoneTemplateCreate
- Sdk: voice.phoneTemplate.create
- Cli: voice phone template create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 3,
      "maxLength": 60
    },
    "language": {
      "type": "string",
      "pattern": "^[a-z]{2}(_[A-Z]{2})?$",
      "default": "en"
    },
    "category": {
      "type": "string",
      "enum": [
        "utility",
        "marketing",
        "authentication"
      ]
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    }
  },
  "required": [
    "name",
    "category",
    "body"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/phone/templates' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "category": "utility",
  "body": "string"
}'
```
