---
title: "Replace Notification Template"
method: PUT
path: "/notifications/{id}"
tags: ["Templates"]
---

# Replace Notification Template

`PUT /notifications/{id}`

Replaces a notification template in full, so send every field rather than only the ones you want changed. Publish separately to make it live.

## Path parameters

- `id` string, required

## Request body

- NotificationTemplateUpdateRequest — Request body for replacing a notification template. Same shape as create. All fields required (PUT = full replacement), except `alias`, whose omission means "leave the existing aliases alone".
  - `notification` NotificationTemplateWritePayload, required — Core template fields used in POST and PUT request bodies (nested under a `notification` key) and returned at the top level in responses.
    - `name` string, required — Display name for the template.
    - `tags` string[], required — Tags for categorization. Send empty array for none.
    - `brand` object, nullable, required — Brand reference, or null for no brand.
      - `id` string, required
    - `subscription` object, nullable, required — Subscription topic reference, or null for none.
      - `topic_id` string, required
    - `routing` object, nullable, required — Routing strategy reference, or null for none.
      - `strategy_id` string, required
    - `content` ElementalContent, required
      - `version` string, required — For example, "2022-01-01"
      - `elements` ElementalNode[], required
        - union
          - object — Represents a body of text to be rendered inside of the notification.
            - `type` 'text', required
            - `content` string, required — The text content displayed in the notification. Either this field must be specified, or the elements field
            - `align` 'left' | 'center' | 'right', required
            - `text_style` 'text' | 'h1' | 'h2' | 'subtext'
            - `color` string, nullable — Specifies the color of text. Can be any valid css color value
            - `bold` string, nullable — Apply bold to the text
            - `italic` string, nullable — Apply italics to the text
            - `strikethrough` string, nullable — Apply a strike through the text
            - `underline` string, nullable — Apply an underline to the text
            - `font_size` string, nullable — CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` preset. Email only.
            - `line_height` string, nullable — CSS line height for this text block, as a px value or a unitless multiplier, e.g. `24px` or `1.5`. Email only.
            - `locales` Locales, nullable
            - `format` 'markdown', nullable
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — The meta element contains information describing the notification that may be used by a particular channel or provider. One important field is the title field which will be used as the title for channels that support it.
            - `type` 'meta', required
            - `title` string, nullable — The title to be displayed by supported channels. For example, the email subject.
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — The channel element allows a notification to be customized based on which channel it is sent through. For example, you may want to display a detailed message when the notification is sent through email, and a more concise message in a push notification. Channel elements are only valid as top-level elements; you cannot nest channel elements. If there is a channel element specified at the top-level of the document, all sibling elements must be channel elements. Note: As an alternative, most elements support a `channel` property. Which allows you to selectively display an individual element on a per channel basis. See the [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
            - `type` 'channel', required
            - `channel` string, required — The channel the contents of this element should be applied to. Can be `email`, `push`, `direct_message`, `sms` or a provider such as slack
            - `padding` string, nullable — Email only. Document-level body padding applied once around the email body, as a CSS px shorthand (1–4 values), e.g. `48px 64px`.
            - `font_size` string, nullable — Email only. Document-level base font size (CSS px, e.g. `16px`) for body content — text, quote, list and action button labels. Heading styles (`h1`/`h2`/`h3`) and `subtext` keep their preset sizes.
            - `line_height` string, nullable — Email only. Document-level line height (CSS px or unitless multiplier, e.g. `24px` or `1.5`) applied to all body content unless overridden per block.
            - `raw` object, nullable — Raw data to apply to the channel. If `elements` has not been specified, `raw` is required.
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — Used to embed an image into the notification.
            - `type` 'image', required
            - `src` string, required — The source of the image.
            - `href` string, nullable — A URL to link to when the image is clicked.
            - `align` 'center' | 'left' | 'right' | 'full'
            - `altText` string, nullable — Alternate text for the image.
            - `width` string, nullable — CSS width properties to apply to the image. For example, 50px
            - `border_color` string, nullable — CSS border color applied to the image. For example, `#ccc`
            - `border_size` string, nullable — CSS border width applied to the image. For example, `1px`
            - `padding` string, nullable — CSS padding applied around the image. For example, `10px`
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — Allows the user to execute an action. Can be a button or a link.
            - `type` 'action', required
            - `content` string, required — The text content of the action shown to the user.
            - `href` string, required — The target URL of the action.
            - `action_id` string, nullable — A unique id used to identify the action when it is executed.
            - `align` 'center' | 'left' | 'right' | 'full'
            - `background_color` string, nullable — The background color of the action button.
            - `border_radius` string, nullable — CSS border-radius applied to the action button. For example, `4px`
            - `border_size` string, nullable — CSS border width applied to the action button. For example, `1px`
            - `font_size` string, nullable — CSS font-size applied to the action button label. For example, `14px`
            - `padding` string, nullable — CSS padding applied to the action button. For example, `8px 16px`
            - `disable_tracking` boolean, nullable — When true, the action's href is not rewritten for click-through tracking, even when click-through tracking is enabled for the workspace.
            - `style` 'button' | 'link'
            - `locales` Locales, nullable, required
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — Renders a dividing line between elements.
            - `type` 'divider', required
            - `color` string, nullable — The CSS color to render the line with. For example, `#fff`
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — Renders a quote block.
            - `type` 'quote', required
            - `content` string, required — The text value of the quote.
            - `align` 'center' | 'left' | 'right' | 'full'
            - `borderColor` string, nullable — CSS border color property. For example, `#fff`
            - `text_style` 'text' | 'h1' | 'h2' | 'subtext', required
            - `font_size` string, nullable — CSS px font size for this quote block, e.g. `16px`. Overrides the size of the `text_style` preset. Email only.
            - `line_height` string, nullable — CSS line height for this quote block, as a px value or a unitless multiplier, e.g. `24px` or `1.5`. Email only.
            - `locales` Locales, nullable, required
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
          - object — Raw HTML string inside an Elemental document. When rendering a message, this node is turned into output only for the email channel; for other channels it produces no blocks.
            - `type` 'html', required
            - `content` string, required — Raw HTML string to render inside the notification.
            - `locales` Locales, nullable
            - `channels` string[], nullable
            - `ref` string, nullable
            - `if` string, nullable
            - `loop` string, nullable
    - `alias` string, nullable — Send-time alias for this template — the value you pass as `event` to POST /send. Writes accept a single alias only. Optional, with three distinct meanings. Omit it to leave any existing aliases untouched. Send a string to make this the template's only alias — a template that already resolved from several aliases keeps just this one and the rest are detached. Send null to remove every alias from the template. An alias may not be claimed by another template — doing so returns 409 — and may not begin with "tenant/".
  - `state` 'DRAFT' | 'PUBLISHED' — Template state after update. Case-insensitive input, normalized to uppercase in the response. Defaults to "DRAFT".

## Response `200`

- NotificationTemplateResponse — Core template fields used in POST and PUT request bodies (nested under a `notification` key) and returned at the top level in responses.
  - `name` string, required — Display name for the template.
  - `tags` string[], required — Tags for categorization. Send empty array for none.
  - `brand` object, nullable, required — Brand reference, or null for no brand.
    - `id` string, required
  - `subscription` object, nullable, required — Subscription topic reference, or null for none.
    - `topic_id` string, required
  - `routing` object, nullable, required — Routing strategy reference, or null for none.
    - `strategy_id` string, required
  - `content` ElementalContent, required
    - `version` string, required — For example, "2022-01-01"
    - `elements` ElementalNode[], required
      - union
        - object — Represents a body of text to be rendered inside of the notification.
          - `type` 'text', required
          - `content` string, required — The text content displayed in the notification. Either this field must be specified, or the elements field
          - `align` 'left' | 'center' | 'right', required
          - `text_style` 'text' | 'h1' | 'h2' | 'subtext'
          - `color` string, nullable — Specifies the color of text. Can be any valid css color value
          - `bold` string, nullable — Apply bold to the text
          - `italic` string, nullable — Apply italics to the text
          - `strikethrough` string, nullable — Apply a strike through the text
          - `underline` string, nullable — Apply an underline to the text
          - `font_size` string, nullable — CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` preset. Email only.
          - `line_height` string, nullable — CSS line height for this text block, as a px value or a unitless multiplier, e.g. `24px` or `1.5`. Email only.
          - `locales` Locales, nullable
          - `format` 'markdown', nullable
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — The meta element contains information describing the notification that may be used by a particular channel or provider. One important field is the title field which will be used as the title for channels that support it.
          - `type` 'meta', required
          - `title` string, nullable — The title to be displayed by supported channels. For example, the email subject.
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — The channel element allows a notification to be customized based on which channel it is sent through. For example, you may want to display a detailed message when the notification is sent through email, and a more concise message in a push notification. Channel elements are only valid as top-level elements; you cannot nest channel elements. If there is a channel element specified at the top-level of the document, all sibling elements must be channel elements. Note: As an alternative, most elements support a `channel` property. Which allows you to selectively display an individual element on a per channel basis. See the [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more details.
          - `type` 'channel', required
          - `channel` string, required — The channel the contents of this element should be applied to. Can be `email`, `push`, `direct_message`, `sms` or a provider such as slack
          - `padding` string, nullable — Email only. Document-level body padding applied once around the email body, as a CSS px shorthand (1–4 values), e.g. `48px 64px`.
          - `font_size` string, nullable — Email only. Document-level base font size (CSS px, e.g. `16px`) for body content — text, quote, list and action button labels. Heading styles (`h1`/`h2`/`h3`) and `subtext` keep their preset sizes.
          - `line_height` string, nullable — Email only. Document-level line height (CSS px or unitless multiplier, e.g. `24px` or `1.5`) applied to all body content unless overridden per block.
          - `raw` object, nullable — Raw data to apply to the channel. If `elements` has not been specified, `raw` is required.
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — Used to embed an image into the notification.
          - `type` 'image', required
          - `src` string, required — The source of the image.
          - `href` string, nullable — A URL to link to when the image is clicked.
          - `align` 'center' | 'left' | 'right' | 'full'
          - `altText` string, nullable — Alternate text for the image.
          - `width` string, nullable — CSS width properties to apply to the image. For example, 50px
          - `border_color` string, nullable — CSS border color applied to the image. For example, `#ccc`
          - `border_size` string, nullable — CSS border width applied to the image. For example, `1px`
          - `padding` string, nullable — CSS padding applied around the image. For example, `10px`
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — Allows the user to execute an action. Can be a button or a link.
          - `type` 'action', required
          - `content` string, required — The text content of the action shown to the user.
          - `href` string, required — The target URL of the action.
          - `action_id` string, nullable — A unique id used to identify the action when it is executed.
          - `align` 'center' | 'left' | 'right' | 'full'
          - `background_color` string, nullable — The background color of the action button.
          - `border_radius` string, nullable — CSS border-radius applied to the action button. For example, `4px`
          - `border_size` string, nullable — CSS border width applied to the action button. For example, `1px`
          - `font_size` string, nullable — CSS font-size applied to the action button label. For example, `14px`
          - `padding` string, nullable — CSS padding applied to the action button. For example, `8px 16px`
          - `disable_tracking` boolean, nullable — When true, the action's href is not rewritten for click-through tracking, even when click-through tracking is enabled for the workspace.
          - `style` 'button' | 'link'
          - `locales` Locales, nullable, required
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — Renders a dividing line between elements.
          - `type` 'divider', required
          - `color` string, nullable — The CSS color to render the line with. For example, `#fff`
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — Renders a quote block.
          - `type` 'quote', required
          - `content` string, required — The text value of the quote.
          - `align` 'center' | 'left' | 'right' | 'full'
          - `borderColor` string, nullable — CSS border color property. For example, `#fff`
          - `text_style` 'text' | 'h1' | 'h2' | 'subtext', required
          - `font_size` string, nullable — CSS px font size for this quote block, e.g. `16px`. Overrides the size of the `text_style` preset. Email only.
          - `line_height` string, nullable — CSS line height for this quote block, as a px value or a unitless multiplier, e.g. `24px` or `1.5`. Email only.
          - `locales` Locales, nullable, required
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
        - object — Raw HTML string inside an Elemental document. When rendering a message, this node is turned into output only for the email channel; for other channels it produces no blocks.
          - `type` 'html', required
          - `content` string, required — Raw HTML string to render inside the notification.
          - `locales` Locales, nullable
          - `channels` string[], nullable
          - `ref` string, nullable
          - `if` string, nullable
          - `loop` string, nullable
  - `alias` union — A template's send-time alias as returned by a read, omitted entirely when it has none. Usually a single string; an array for a template that resolves from several aliases, which writes through this API can no longer produce — only templates predating that restriction, or aliases attached outside this API, hold more than one.
    - string
    - string[]
  - `id` string, required — The template ID.
  - `state` 'DRAFT' | 'PUBLISHED', required — The template state. Always uppercase.
  - `created` integer, required — Epoch milliseconds when the template was created.
  - `creator` string, required — User ID of the creator.
  - `updated` integer — Epoch milliseconds of last update.
  - `updater` string — User ID of the last updater.

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `409` — Conflict — the requested alias is already assigned to a different notification template. The template is left unchanged.

---

[API](https://skmtc.net/trycourier/apis/courier.md) · [All operations](https://skmtc.net/trycourier/apis/courier/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycourier/courier/revisions/cb8586034158/schema)
