---
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).
  - `notification` NotificationTemplatePayload, 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
            - `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
            - `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
            - `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
  - `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
          - `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
          - `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
          - `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
  - `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

---

[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/versions/04f69fbf96a5/schema)
