---
title: "Create a template"
method: POST
path: "/templates"
tags: ["Templates"]
---

# Create a template

`POST /templates`

Create a new template in a workspace

## Request body

- CreateTemplateDTO
  - `name` string — The name of the template
  - `folder_id` string, nullable — The ID of the folder the template should be created in
  - `whats_app_business_account_id` string, nullable — The WhatsApp Business Account ID associated with the template
  - `content` union — The content definition for the template
    - object
      - `body` string — The body text of the generic template
      - `file_ids` FilePublicId[] — The file IDs attached to the generic template
        - `id` string
      - `subject` string — The subject of the generic template
      - `type` 'generic_template'
      - `variables` CreateTemplateContentVariableDTO[] — The variables declared for the generic template
        - `position` integer — The position of the template variable
        - `attribute_identifier` string — The attribute identifier referenced by the variable
    - object
      - `body` string — The body text of the WhatsApp template
      - `buttons` union[] — The buttons configured for the WhatsApp template
        - union
          - CREATETEMPLATEWHATSAPPBUTTONQUICKREPLY
            - `text` string — The text shown on the quick reply button
            - `type` 'quick_reply'
          - CREATETEMPLATEWHATSAPPBUTTONPHONENUMBER
            - `phone_number` string — The phone number target of the button
            - `text` string — The text shown on the phone number button
            - `type` 'phone_number'
          - CREATETEMPLATEWHATSAPPBUTTONDYNAMICURL
            - `example_url_suffix` string — The example suffix used for the dynamic URL
            - `target` string — The URL target pattern of the button
            - `text` string — The text shown on the dynamic URL button
            - `type` 'dynamic_url'
          - CREATETEMPLATEWHATSAPPBUTTONURL
            - `target` string — The URL target of the button
            - `text` string — The text shown on the URL button
            - `type` 'url'
      - `category` 'account_update' | 'payment_update' | 'personal_finance_update' | 'shipping_update' | 'reservation_update' | 'issue_resolution' | 'appointment_update' | 'transportation_update' | 'ticket_update' | 'alert_update' | 'auto_reply' | 'transactional' | 'marketing' | 'otp' | 'authentication' | 'utility'
      - `footer` string — The optional footer of the WhatsApp template
      - `header` union — The optional header of the WhatsApp template
        - CREATETEMPLATEWHATSAPPHEADERTEXT
          - `type` 'text'
          - `value` string — The text value of the WhatsApp header
        - CREATETEMPLATEWHATSAPPHEADERVIDEO
          - `file_id` string — The file ID used for the video header
          - `is_persistent` boolean — Whether the header media should be persisted
          - `type` 'video'
        - CREATETEMPLATEWHATSAPPHEADERIMAGE
          - `file_id` string — The file ID used for the image header
          - `is_persistent` boolean — Whether the header media should be persisted
          - `type` 'image'
        - CREATETEMPLATEWHATSAPPHEADERDOCUMENT
          - `file_id` string — The file ID used for the document header
          - `is_persistent` boolean — Whether the header media should be persisted
          - `type` 'document'
      - `language` 'afrikaans' | 'albanian' | 'arabic' | 'azerbaijani' | 'bengali' | 'bulgarian' | 'catalan' | 'chinese_china' | 'chinese_hong_kong' | 'chinese_taiwan' | 'croatian' | 'czech' | 'danish' | 'dutch' | 'english' | 'english_britain' | 'english_us' | 'estonian' | 'filipino' | 'finnish' | 'french' | 'german' | 'greek' | 'gujarati' | 'hausa' | 'hebrew' | 'hindi' | 'hungarian' | 'indonesian' | 'irish' | 'italian' | 'japanese' | 'kannada' | 'kasahi' | 'korean' | 'lao' | 'latvian' | 'lithuanian' | 'macedonian' | 'malay' | 'malayalam' | 'marathi' | 'norwegian' | 'persian' | 'polish' | 'portuguese_brazil' | 'portuguese_portugal' | 'punjabi' | 'romanian' | 'russian' | 'serbian' | 'slovak' | 'slovenian' | 'spanish' | 'spanish_argentina' | 'spanish_spain' | 'spanish_mexico' | 'swahili' | 'swedish' | 'tamil' | 'telugu' | 'thai' | 'turkish' | 'ukrainian' | 'urdu' | 'uzbek' | 'vietnamese' | 'zulu'
      - `track_links` boolean — Whether links in the template should be tracked
      - `type` 'whats_app_template'
      - `variables` CreateTemplateContentVariableDTO[] — The variables declared for the WhatsApp template
        - `position` integer — The position of the template variable
        - `attribute_identifier` string — The attribute identifier referenced by the variable

## Response `200`

OK

- PATemplateNodeDTO
  - `id` string — The ID of the template
  - `status` 'submitted' | 'approved' | 'rejected' | 'pending' | 'external_deleted' | 'unknown' | 'draft' | 'missing_after_migration'
  - `name` string — The name of the template
  - `content` union — The content definition of the template
    - object
      - `body` string — The body text of the generic template
      - `file_ids` FileDTO[] — The files attached to the generic template
        - `blurhash` string
        - `content_type` string
        - `created_at` string, date-time
        - `file_size_bytes` integer
        - `file_url` string
        - `id` string
        - `name` string
        - `thumbnail_url` string
        - `usage_type` string
      - `type` 'generic_template' | 'whats_app_template'
      - `variables` union[] — The variables available in the generic template
        - union
          - TEMPLATEVARIABLESTATIC
            - `display_name` string — The display name of the template variable
            - `position` integer — The position of the template variable
            - `type` 'static'
          - TEMPLATEVARIABLECONTACTATTRIBUTE
            - `attribute_id` string — The contact attribute ID referenced by the variable
            - `display_name` string — The display name of the template variable
            - `position` integer — The position of the template variable
            - `type` 'contact_attribute'
    - object
      - `body` string — The body text of the WhatsApp template
      - `buttons` union[] — The buttons configured for the WhatsApp template
        - union
          - TEMPLATEWHATSAPPBUTTONPHONENUMBER
            - `target` string — The phone number target of the button
            - `title` string — The button label
            - `type` 'phone_number'
          - TEMPLATEWHATSAPPBUTTONQUICKREPLY
            - `title` string — The button label
            - `type` 'quick_reply'
          - TEMPLATEWHATSAPPBUTTONSTATICURL
            - `target` string — The URL target of the button
            - `title` string — The button label
            - `type` 'static_url'
          - TEMPLATEWHATSAPPBUTTONDYNAMICURL
            - `target` string — The URL target pattern of the button
            - `title` string — The button label
            - `type` 'dynamic_url'
      - `category` 'account_update' | 'payment_update' | 'personal_finance_update' | 'shipping_update' | 'reservation_update' | 'issue_resolution' | 'appointment_update' | 'transportation_update' | 'ticket_update' | 'alert_update' | 'auto_reply' | 'transactional' | 'marketing' | 'otp' | 'authentication' | 'utility'
      - `footer` string — The optional footer of the WhatsApp template
      - `header` union — The optional header of the WhatsApp template
        - TEMPLATEWHATSAPPHEADERTEXT
          - `type` 'text'
          - `value` string — The text value of the WhatsApp template header
        - TEMPLATEWHATSAPPHEADERIMAGE
          - `file_id` string — The file ID used for the image header
          - `type` 'image'
        - TEMPLATEWHATSAPPHEADERVIDEO
          - `file_id` string — The file ID used for the video header
          - `type` 'video'
        - TEMPLATEWHATSAPPHEADERDOCUMENT
          - `file_id` string — The file ID used for the document header
          - `type` 'document'
      - `track_links` boolean — Whether links in the template are tracked
      - `type` 'generic_template' | 'whats_app_template'
      - `variables` union[] — The variables available in the WhatsApp template
        - union
          - TEMPLATEVARIABLESTATIC
            - `display_name` string — The display name of the template variable
            - `position` integer — The position of the template variable
            - `type` 'static'
          - TEMPLATEVARIABLECONTACTATTRIBUTE
            - `attribute_id` string — The contact attribute ID referenced by the variable
            - `display_name` string — The display name of the template variable
            - `position` integer — The position of the template variable
            - `type` 'contact_attribute'
  - `folder` object, nullable — The folder the template belongs to
    - `id` string — The ID of the template folder
    - `name` string — The name of the template folder
    - `parent_id` string, nullable — The ID of the parent folder
  - `channels` PATemplateNodeChannelDTO[] — The channels associated with the template
    - `id` string — The ID of the channel
    - `name` string — The name of the channel
    - `url` string — The URL of the channel resource
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `url` string — The URL of the template resource

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/superchat/apis/superchat-api.md) · [All operations](https://skmtc.dev/superchat/apis/superchat-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/superchat/superchat-api/revisions/3bc557a0072f/schema)
