# Template events

> Template versions created, updated, published or deleted.



## template.created

> Sent when a template version is created through the API, a dashboard import, or by saving a campaign as a template.

# template.created

Sent when a template version is created: with [Create a template](/docs/api-reference/templates/create/), by importing a template in the dashboard, or by saving a campaign as a template. A version created for a new alias is published right away; check `published_at`.

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
  "type": "template.created",
  "object": {
    "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
    "object": "template",
    "name": "Welcome email",
    "alias": "welcome-email",
    "from": "Acme <hello@acme.com>",
    "subject": "Welcome to Acme, {{ first_name }}",
    "reply_to": [
      "support@acme.com"
    ],
    "html": "<h1>Welcome, {{ first_name }}</h1>",
    "text": "Welcome, {{ first_name }}",
    "editor": "html",
    "published_at": "2026-09-30T10:30:00.482119+00:00",
    "created_at": "2026-09-30T10:30:00.482119+00:00",
    "updated_at": "2026-09-30T10:30:00.482119+00:00"
  },
  "data": {
    "object": {
      "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
      "object": "template",
      "name": "Welcome email",
      "alias": "welcome-email",
      "from": "Acme <hello@acme.com>",
      "subject": "Welcome to Acme, {{ first_name }}",
      "reply_to": [
        "support@acme.com"
      ],
      "html": "<h1>Welcome, {{ first_name }}</h1>",
      "text": "Welcome, {{ first_name }}",
      "editor": "html",
      "published_at": "2026-09-30T10:30:00.482119+00:00",
      "created_at": "2026-09-30T10:30:00.482119+00:00",
      "updated_at": "2026-09-30T10:30:00.482119+00:00"
    }
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `template.created`.

- `object` (object): The template version the event describes. Its fields are listed below.

- `data.object` (object): The same object again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

### Template object

- `id` (string): Template version ID (`tem_…`).

- `object` (string): Always `template`.

- `name` (string): Template name.

- `alias` (string): Alias shared by all versions of the template.

- `from` (string | null): Default sender.

- `subject` (string | null): Default subject line.

- `reply_to` (string[] | null): Default reply-to addresses.

- `html` (string | null): HTML body.

- `text` (string | null): Plain-text body.

- `editor` (string): `html`, `text`, `dragit` or `tiptap`.

- `published_at` (string | null): When this version was published, or `null` if it isn't the published version.

- `created_at` (string): When the version was created, in ISO 8601 with a UTC offset.

- `updated_at` (string): When the version was last updated.

---
Source: https://emailit.com/docs/webhooks/events/template/template-created/

## template.updated

> Sent when a template version changes or is published or unpublished. Check published_at to see which version is live.

# template.updated

Sent when a template version changes with [Update a template](/docs/api-reference/templates/update/). [Publishing](/docs/api-reference/templates/publish/) also sends this event: once for the version you publish and once for each version of the alias that was unpublished. Use `published_at` to tell them apart.

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
  "type": "template.updated",
  "object": {
    "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
    "object": "template",
    "name": "Welcome email",
    "alias": "welcome-email",
    "from": "Acme <hello@acme.com>",
    "subject": "Welcome to Acme, {{ first_name }}",
    "reply_to": [
      "support@acme.com"
    ],
    "html": "<h1>Welcome, {{ first_name }}</h1>",
    "text": "Welcome, {{ first_name }}",
    "editor": "html",
    "published_at": "2026-09-30T10:30:00.482119+00:00",
    "created_at": "2026-09-30T10:30:00.482119+00:00",
    "updated_at": "2026-10-01T10:02:14.307000+00:00"
  },
  "data": {
    "object": {
      "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
      "object": "template",
      "name": "Welcome email",
      "alias": "welcome-email",
      "from": "Acme <hello@acme.com>",
      "subject": "Welcome to Acme, {{ first_name }}",
      "reply_to": [
        "support@acme.com"
      ],
      "html": "<h1>Welcome, {{ first_name }}</h1>",
      "text": "Welcome, {{ first_name }}",
      "editor": "html",
      "published_at": "2026-09-30T10:30:00.482119+00:00",
      "created_at": "2026-09-30T10:30:00.482119+00:00",
      "updated_at": "2026-10-01T10:02:14.307000+00:00"
    }
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `template.updated`.

- `object` (object): The template version the event describes. Its fields are listed below.

- `data.object` (object): The same object again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

### Template object

- `id` (string): Template version ID (`tem_…`).

- `object` (string): Always `template`.

- `name` (string): Template name.

- `alias` (string): Alias shared by all versions of the template.

- `from` (string | null): Default sender.

- `subject` (string | null): Default subject line.

- `reply_to` (string[] | null): Default reply-to addresses.

- `html` (string | null): HTML body.

- `text` (string | null): Plain-text body.

- `editor` (string): `html`, `text`, `dragit` or `tiptap`.

- `published_at` (string | null): When this version was published, or `null` if it isn't the published version.

- `created_at` (string): When the version was created, in ISO 8601 with a UTC offset.

- `updated_at` (string): When the version was last updated.

---
Source: https://emailit.com/docs/webhooks/events/template/template-updated/

## template.deleted

> Sent when a template version is deleted. The payload is the version, with its content, as it was before deletion.

# template.deleted

Sent when a template version is deleted with [Delete a template](/docs/api-reference/templates/delete/). The payload is the version as it was before it was deleted. If it was the published version, the alias has no published version until you publish another one.

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
  "type": "template.deleted",
  "object": {
    "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
    "object": "template",
    "name": "Welcome email",
    "alias": "welcome-email",
    "from": "Acme <hello@acme.com>",
    "subject": "Welcome to Acme, {{ first_name }}",
    "reply_to": [
      "support@acme.com"
    ],
    "html": "<h1>Welcome, {{ first_name }}</h1>",
    "text": "Welcome, {{ first_name }}",
    "editor": "html",
    "published_at": "2026-09-30T10:30:00.482119+00:00",
    "created_at": "2026-09-30T10:30:00.482119+00:00",
    "updated_at": "2026-09-30T10:30:00.482119+00:00"
  },
  "data": {
    "object": {
      "id": "tem_2xKx7M2c9wQe3kHhJ8sVtY1pZ0a",
      "object": "template",
      "name": "Welcome email",
      "alias": "welcome-email",
      "from": "Acme <hello@acme.com>",
      "subject": "Welcome to Acme, {{ first_name }}",
      "reply_to": [
        "support@acme.com"
      ],
      "html": "<h1>Welcome, {{ first_name }}</h1>",
      "text": "Welcome, {{ first_name }}",
      "editor": "html",
      "published_at": "2026-09-30T10:30:00.482119+00:00",
      "created_at": "2026-09-30T10:30:00.482119+00:00",
      "updated_at": "2026-09-30T10:30:00.482119+00:00"
    }
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `template.deleted`.

- `object` (object): The template version the event describes. Its fields are listed below.

- `data.object` (object): The same object again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

### Template object

- `id` (string): Template version ID (`tem_…`).

- `object` (string): Always `template`.

- `name` (string): Template name.

- `alias` (string): Alias shared by all versions of the template.

- `from` (string | null): Default sender.

- `subject` (string | null): Default subject line.

- `reply_to` (string[] | null): Default reply-to addresses.

- `html` (string | null): HTML body.

- `text` (string | null): Plain-text body.

- `editor` (string): `html`, `text`, `dragit` or `tiptap`.

- `published_at` (string | null): When this version was published, or `null` if it isn't the published version.

- `created_at` (string): When the version was created, in ISO 8601 with a UTC offset.

- `updated_at` (string): When the version was last updated.

---
Source: https://emailit.com/docs/webhooks/events/template/template-deleted/
