# Update an email template

`PATCH https://api.cademi.com.br/api/v3/settings/emails/templates/{email_template_id}`

Operation ID: `settings.emails.templates.update` · API v3

Updates an email template. Only the fields included in the request are changed.

`body` can be changed only on editable templates. Sending `body` for the `new_access` template is rejected as invalid data.

To avoid overwriting a newer version, send the `ETag` returned by the retrieve operation in the `If-Match` header. The header is optional; when it is omitted, the update is applied to the current revision.

Required permissions: `settings.update_emails`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `email_template_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

Schema: object.

## Responses

### 200

Returns the updated email template.

Body: `data`: EmailTemplate.

Fields of EmailTemplate:

| Field | Type | Required | Description |
|---|---|---|---|
| `body` | string or null | yes |  |
| `editable` | boolean | yes |  |
| `enabled` | boolean | yes |  |
| `id` | string, one of `sale`, `import`, `free`, `new_access` | yes |  |
| `include_credentials` | boolean | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `email_template` | yes |  |
| `revision` | string | yes |  |
| `variables` | array of object | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The template key is not part of the email template catalog.

Body: Error.

### 412

The email template has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
