---
title: "Create or Update a Tenant Template"
method: PUT
path: "/tenants/{tenant_id}/templates/{template_id}"
tags: ["Tenant Templates"]
---

# Create or Update a Tenant Template

`PUT /tenants/{tenant_id}/templates/{template_id}`

## Request

- Base URL: `https://api.courier.com`
- URL: `https://api.courier.com/tenants/{tenant_id}/templates/{template_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/trycourier/apis/courier/docs/tenants/:tenant_id/templates/:template_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Creates or updates a notification template scoped to one tenant, letting a tenant override the content the workspace template would send.

## Path parameters

- `tenant_id` string, required
- `template_id` string, required

## Request body

- PutTenantTemplateRequest: Request body for creating or updating a tenant notification template
  - `published` boolean: Whether to publish the template immediately after saving. When true, the template becomes the active/published version. When false (default), the template is saved as a draft.
  - `template` TenantTemplateInput, required: Template configuration for creating or updating a tenant notification template
    - `channels` MessageChannels
    - `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
    - `providers` MessageProviders
    - `routing` MessageRouting
      - `method` 'all' | 'single', required
      - `channels` MessageRoutingChannel[], required
        - union
          - string
          - MessageRouting (recursive)

## Response `200`

Template updated successfully

- PutTenantTemplateResponse: Response from creating or updating a tenant notification template
  - `id` string, required: The template ID
  - `version` string, required: The version of the saved template
  - `published_at` string, nullable: The timestamp when the template was published. Only present if the template was published as part of this request.

## Other responses

- `201`: Template created successfully
- `400`: Bad request - validation error
- `404`: Tenant not found
- `413`: Payload too large - template size exceeds maximum allowed

## Changes

- **2026-08-10** `cb8586034158`: 1 breaking, 1 info
  - removed `subschema #1, subschema #3, subschema #7` from the `template/content/elements/items/` request property `oneOf` list
  - added `subschema #1, subschema #3, subschema #7` to the `template/content/elements/items/` request property `oneOf` list
- **2026-07-29** `f76bed79a913`: 2 info
  - api tag `Tenant Templates` added
  - api tag `Courier Create` removed
- **2026-07-20** `d2377425a729`: 1 breaking, 1 info
  - removed `subschema #4, subschema #5` from the `template/content/elements/items/` request property `oneOf` list
  - added `subschema #4, subschema #5` to the `template/content/elements/items/` request property `oneOf` list
- **2026-04-02** `b3dde9374868`: 1 info
  - added `subschema #8` to the `template/content/elements/items/` request property `oneOf` list
- **2026-03-04** `44c2e612f5d4`: 1 warning
  - removed the request property `template/content/brand`

[Operation history](https://skmtc.dev/trycourier/apis/courier/changes/tenants/:tenant_id/templates/:template_id/put.md)

---

[API](https://skmtc.dev/trycourier/apis/courier.md) - [All operations](https://skmtc.dev/trycourier/apis/courier/llms.txt) - [OpenAPI document](https://skmtc.dev/trycourier/apis/courier/revisions/cb8586034158?raw)
