> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Template Localization

> Create or replace a caller-supplied localized template variant

Create or replace one localized variant with your own translated content. The
locale must be enabled in the company's localization settings and cannot be the
primary locale.

## Request

<ParamField path="templateId" type="string" required>
  Template ID, transactional email ID, or transactional slug.
</ParamField>

<ParamField path="locale" type="string" required>
  Enabled non-primary locale code, such as `es`, `fr`, or `pt-BR`.
</ParamField>

<ParamField body="subject" type="string" required>
  Localized email subject line.
</ParamField>

<ParamField body="previewText" type="string">
  Optional localized inbox preview text.
</ParamField>

<ParamField body="html" type="string">
  Localized raw HTML. Provide exactly one of `html` or `blocks`.
</ParamField>

<ParamField body="blocks" type="array">
  Localized Sequenzy email blocks. Provide exactly one of `blocks` or `html`.
</ParamField>

```bash theme={null}
curl -X PUT "https://api.sequenzy.com/api/v1/templates/email_abc123/localizations/es" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Bienvenido",
    "previewText": "Nos alegra que estés aquí",
    "html": "<p>Gracias por registrarte.</p>"
  }'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "templateId": "email_abc123",
    "localization": {
      "locale": "es",
      "status": "synced",
      "subject": "Bienvenido",
      "previewText": "Nos alegra que estés aquí",
      "blocks": [
        {
          "id": "generated-block-id",
          "type": "text",
          "content": "<p>Gracias por registrarte.</p>",
          "variant": "html"
        }
      ],
      "sourceHash": "f4c3...",
      "lastError": null,
      "syncedAt": "2026-07-14T20:00:00Z",
      "createdAt": "2026-07-14T20:00:00Z",
      "updatedAt": "2026-07-14T20:00:00Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Locale \"es\" is not enabled for this company."
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Template not found"
  }
  ```
</ResponseExample>
