# Update template

> Updates any field of a template.

Source: https://mailvina.com/docs/api-reference/templates/update-template · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/templates

`PATCH /templates/:id_or_alias`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id_or_alias` | `string` | yes | Template ID or alias. |

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | no | New name, unique within your team. Renaming keeps the alias. |
| `alias` | `string` | no | New alias, unique within your team. Sends that use the old alias stop working. |
| `subject` | `string` | no | Supports variables. |
| `html` | `string` | no | Supports variables. |
| `text` | `string` | no | Plain-text version. |
| `from` | `string` | no | Default sender. |
| `reply_to` | `string` | no | Default Reply-To. |

Only the fields you send change; everything else stays as it is.

**Request**

```bash
curl -X PATCH 'https://api.mailvina.com/templates/:id_or_alias' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "subject": "Welcome aboard, {{name|friend}}!"
}'
```

```js
const res = await fetch('https://api.mailvina.com/templates/:id_or_alias', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "subject": "Welcome aboard, {{name|friend}}!"
  }),
});
const data = await res.json();
```

```python
import os, requests

res = requests.patch(
    "https://api.mailvina.com/templates/:id_or_alias",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
    json={
        "subject": "Welcome aboard, {{name|friend}}!"
    },
)
print(res.json())
```

**Response**

```json
{
  "object": "template",
  "id": "f3b9756c-f4f4-44da-bc00-9f7903c8a83f"
}
```
