---
title: "PUT /api/admin/content/templates"
method: PUT
path: "/api/admin/content/templates"
tags: ["Content"]
---

# PUT /api/admin/content/templates

`PUT /api/admin/content/templates`

Create or update message template

## Request body

- object
  - `workspaceId` string, required
  - `id` string
  - `name` string, required
  - `definition` union
    - object — Mobile push template resource
      - `type` 'MobilePush', required
      - `title` string
      - `body` string
      - `imageUrl` string
      - `android` object
        - `notification` object, required
          - `channelId` string
    - object
      - `type` 'Email', required
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
      - `emailContentsType` 'Code'
      - `body` string, required
    - object
      - `type` 'Email', required
      - `emailContentsType` 'LowCode', required
      - `body` Def0, required
        - `type` string
        - `attrs` object
        - `content` Def0[]
        - `marks` object[]
          - `type` string, required
          - `attrs` object
        - `text` string
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
    - object — SMS template resource
      - `type` 'Sms', required
      - `body` string, required
    - object — Webhook template resource
      - `type` 'Webhook', required
      - `identifierKey` string, required
      - `body` string, required
  - `draft` union
    - object — Mobile push template resource
      - `type` 'MobilePush', required
      - `title` string
      - `body` string
      - `imageUrl` string
      - `android` object
        - `notification` object, required
          - `channelId` string
    - object
      - `type` 'Email', required
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
      - `emailContentsType` 'Code'
      - `body` string, required
    - object
      - `type` 'Email', required
      - `emailContentsType` 'LowCode', required
      - `body` Def0, required
        - `type` string
        - `attrs` object
        - `content` Def0[]
        - `marks` object[]
          - `type` string, required
          - `attrs` object
        - `text` string
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
    - object — SMS template resource
      - `type` 'Sms', required
      - `body` string, required
    - object — Webhook template resource
      - `type` 'Webhook', required
      - `identifierKey` string, required
      - `body` string, required
  - `resourceType` union
    - 'Declarative'
    - 'Internal'

## Response `200`

Default Response

- object
  - `workspaceId` string, required
  - `id` string, required
  - `name` string, required
  - `type` union, required
    - 'Email'
    - 'MobilePush'
    - 'Sms'
    - 'Webhook'
  - `definition` union
    - object — Mobile push template resource
      - `type` 'MobilePush', required
      - `title` string
      - `body` string
      - `imageUrl` string
      - `android` object
        - `notification` object, required
          - `channelId` string
    - object
      - `type` 'Email', required
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
      - `emailContentsType` 'Code'
      - `body` string, required
    - object
      - `type` 'Email', required
      - `emailContentsType` 'LowCode', required
      - `body` Def0, required
        - `type` string
        - `attrs` object
        - `content` Def0[]
        - `marks` object[]
          - `type` string, required
          - `attrs` object
        - `text` string
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
    - object — SMS template resource
      - `type` 'Sms', required
      - `body` string, required
    - object — Webhook template resource
      - `type` 'Webhook', required
      - `identifierKey` string, required
      - `body` string, required
  - `draft` union
    - object — Mobile push template resource
      - `type` 'MobilePush', required
      - `title` string
      - `body` string
      - `imageUrl` string
      - `android` object
        - `notification` object, required
          - `channelId` string
    - object
      - `type` 'Email', required
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
      - `emailContentsType` 'Code'
      - `body` string, required
    - object
      - `type` 'Email', required
      - `emailContentsType` 'LowCode', required
      - `body` Def0, required
        - `type` string
        - `attrs` object
        - `content` Def0[]
        - `marks` object[]
          - `type` string, required
          - `attrs` object
        - `text` string
      - `from` string, required
      - `subject` string, required
      - `replyTo` string
      - `cc` string
      - `bcc` string
      - `name` string
      - `headers` object[]
        - `name` string, required
        - `value` string, required
      - `attachmentUserProperties` string[] — Names of user properties to attach to the email as attachments.
    - object — SMS template resource
      - `type` 'Sms', required
      - `body` string, required
    - object — Webhook template resource
      - `type` 'Webhook', required
      - `identifierKey` string, required
      - `body` string, required
  - `updatedAt` number, required

## Other responses

- `400` — Default Response

---

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