# Create or replace a template set

`PUT /notify/templates/{name}` · Rivier · campaigns

Create or replace a template set: one name, a fallback language, and per language the push and feed title and body, the mail subject and body, a text, and the approved WhatsApp template with the data keys that fill it.

- Scope: campaigns:write
- Mcp: rivier_notify_template_put
- Graphql: Mutation.campaignsNotifyTemplatePut
- Sdk: campaigns.notifyTemplate.put
- Cli: campaigns notify template put

## Parameters

- `name` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "fallback": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$",
      "description": "The language used when the asked one and its base language are missing"
    },
    "languages": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Push and feed title"
          },
          "body": {
            "type": "string",
            "maxLength": 1000,
            "description": "Push and feed body"
          },
          "url": {
            "type": "string",
            "maxLength": 1000
          },
          "subject": {
            "type": "string",
            "maxLength": 998,
            "description": "Mail subject"
          },
          "html": {
            "type": "string",
            "maxLength": 200000
          },
          "text": {
            "type": "string",
            "maxLength": 100000,
            "description": "Mail plain text; defaults to the body"
          },
          "sms": {
            "type": "string",
            "maxLength": 1600,
            "description": "A text message; defaults to the title and body"
          },
          "whatsappTemplate": {
            "type": "string",
            "maxLength": 80,
            "description": "The id of an approved WhatsApp template (POST /phone/templates) in this language"
          },
          "whatsappVariables": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 60
            },
            "maxItems": 20,
            "description": "The data keys that fill the WhatsApp template's variables, in order"
          }
        },
        "additionalProperties": false
      },
      "propertyNames": {
        "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
      }
    }
  },
  "required": [
    "fallback",
    "languages"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: 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 PUT 'https://api.rivier.ai/notify/templates/{name}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "fallback": "string",
  "languages": {}
}'
```
