# Update template

> Update the fields you send; omitted fields keep their value.

Source: https://sndr.sh/docs/api/templates/update-template

`PATCH https://api.sndr.sh/v1/templates/{id}`

Update the fields you send; omitted fields keep their value. Empty html or text values are ignored, so a body cannot be cleared. Each update increments version.

Scope: `send`

**Path parameters**

- `id` (string, required): Template ID (tpl_...).

**Body** (JSON)

- `name` (string): New internal name, 1–200 characters.
- `subject` (string): New subject line, max 998 characters.
- `html` (string): New HTML body (sanitized on save).
- `text` (string): New plain-text body.

**Request**

```bash
curl -X PATCH 'https://api.sndr.sh/v1/templates/tpl_c19e5d34-82a' \
  -H "Authorization: Bearer $SNDR_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"subject": "Order #{{ order_id }} has shipped"}'
```

**Response** (200)

```json
{
  "id":              "tpl_c19e5d34-82a",
  "organization_id": "org_8d41c7a2-3f6",
  "name":            "Order confirmation",
  "subject":         "Order #{{ order_id }} has shipped",
  "html":            "<h1>Hi {{ first_name }},</h1><p>Order #{{ order_id }} confirmed.</p>",
  "text":            "Hi {{ first_name }}, order #{{ order_id }} confirmed.",
  "version":         4,
  "created_at":      "2026-02-10T14:00:00Z",
  "updated_at":      "2026-06-01T12:00:00Z"
}
```

**Errors**

- `unauthenticated` (401): Missing or invalid API key.
- `invalid_request` (400): Body is not valid JSON, has an unknown field, or a field has the wrong type.
- `insufficient_scope` (403): The API key is missing the send scope.
- `not_found` (404): Resource does not exist or belongs to a different account.
- `validation_failed` (422): name or subject is empty or too long.
