---
title: "Create a template in project"
method: POST
path: "/v1/projects/{projectId}/whatsapp/templates"
tags: ["WhatsApp Templates"]
---

# Create a template in project

`POST /v1/projects/{projectId}/whatsapp/templates`

Creates a new template with the request data. If the `status` field is set to `submit` the template will be created immediately, otherwise it will be saved as a `draft`.

## Path parameters

- `projectId` string, required

## Request body

- WhatsappTemplateInputDto
  - `status` 'DRAFT' | 'SUBMIT' — Create as draft or submit. Defaults to submit.
  - `name` string, required
  - `language` 'AF' | 'AR' | 'AZ' | 'BG' | 'BN' | 'CA' | 'CS' | 'DA' | 'DE' | 'EL' | 'EN' | 'EN_GB' | 'EN_US' | 'ES' | 'ES_AR' | 'ES_ES' | 'ES_MX' | 'ES_UY' | 'ET' | 'FA' | 'FI' | 'FIL' | 'FR' | 'GA' | 'GU' | 'HA' | 'HE' | 'HI' | 'HR' | 'HU' | 'ID' | 'IT' | 'JA' | 'KA' | 'KK' | 'KN' | 'KO' | 'KY_KG' | 'LO' | 'LT' | 'LV' | 'MK' | 'ML' | 'MR' | 'MS' | 'NB' | 'NL' | 'PA' | 'PL' | 'PT_BR' | 'PT_PT' | 'RO' | 'RU' | 'RW_RW' | 'SK' | 'SL' | 'SQ' | 'SR' | 'SV' | 'SW' | 'TA' | 'TE' | 'TH' | 'TR' | 'UK' | 'UR' | 'UZ' | 'VI' | 'ZH_CN' | 'ZH_HK' | 'ZH_TW' | 'ZU', required
  - `category` 'AUTHENTICATION' | 'MARKETING' | 'UTILITY', required
  - `saveDraftOnFailure` boolean — Flag to save template as draft if submission fails. Defaults to false.
  - `allowCategoryChange` boolean — True if Meta should be allowed to change the category if they determine the category is wrong. If false, Meta might reject the template if they determine the category is wrong based on the template contents. Defaults to false.
  - `details` WhatsappTemplateDetailsInputDto, required
    - `components` union[], required — List of components in the template. Must contain a BODY component and can only have one entry of each type. Not required for draft. Field 'type' must have unique values across items.
      - union
        - WhatsappLocationHeaderComponentInputDto
          - `type` 'HEADER', required
          - `format` 'LOCATION', required
        - WhatsappTextHeaderComponentInputDto
          - `type` 'HEADER', required
          - `format` 'TEXT', required
          - `text` string, required — Text to show in the header. Can contain one header variable. Not required for draft.
          - `examples` unknown
        - WhatsappMediaHeaderComponentInputDto
          - `type` 'HEADER', required
          - `format` 'DOCUMENT' | 'IMAGE' | 'VIDEO', required
          - `examples` unknown
        - WhatsappBodyComponentInputDto
          - `type` 'BODY', required
          - `text` string
          - `examples` string[] — Examples for the body variables. Requires one example for each variable in the body text. If no variables are used, the examples are optional.
          - `addSecurityRecommendation` boolean — Only valid if template category is AUTHENTICATION. If true, adds a security recommendation to the body. Defaults to false.
        - WhatsappFooterComponentInputDto
          - `type` 'FOOTER', required
          - `text` string
          - `codeExpirationMinutes` number — Only valid if template category is AUTHENTICATION. If set will add a text detailing the expiration time.
        - WhatsappButtonsComponentInputDto
          - `type` 'BUTTONS', required
          - `buttons` union[], required — Not required for draft. Each field in (value, text) must have unique values across items.
            - union
              - …
        - WhatsappInputCarouselComponentDto
          - `type` 'CAROUSEL', required
          - `cards` WhatsappInputCardDto[], required — Media cards. All cards defined on a template must have the same components. It is only necessary to define two product cards upon template creation. An approved template with two product cards can be used to send up to 10 cards in a template message. Not required for draft.
            - `components` union[], required — List of components in the cards. Each card in the template has an image or video header asset, card body text, and up to two buttons. All cards defined on a template must have the same components. Not required for draft. Field 'type' must have unique values across items.
              - …
    - `messageSendTtlSeconds` number — Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped. | | AUTHENTICATION | MARKETING | UTILITY | | -- | -- | -- | -- | | Default | 10 minutes | 30 days | 30 days | | Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours | | Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds | Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.

## Response `201`

Created template

- WhatsappTemplateDto
  - `whatsappId` string
  - `state` 'APPROVED' | 'DISABLED' | 'PAUSED' | 'PENDING' | 'REJECTED'
  - `name` string, required
  - `language` 'AF' | 'AR' | 'AZ' | 'BG' | 'BN' | 'CA' | 'CS' | 'DA' | 'DE' | 'EL' | 'EN' | 'EN_GB' | 'EN_US' | 'ES' | 'ES_AR' | 'ES_ES' | 'ES_MX' | 'ES_UY' | 'ET' | 'FA' | 'FI' | 'FIL' | 'FR' | 'GA' | 'GU' | 'HA' | 'HE' | 'HI' | 'HR' | 'HU' | 'ID' | 'IT' | 'JA' | 'KA' | 'KK' | 'KN' | 'KO' | 'KY_KG' | 'LO' | 'LT' | 'LV' | 'MK' | 'ML' | 'MR' | 'MS' | 'NB' | 'NL' | 'PA' | 'PL' | 'PT_BR' | 'PT_PT' | 'RO' | 'RU' | 'RW_RW' | 'SK' | 'SL' | 'SQ' | 'SR' | 'SV' | 'SW' | 'TA' | 'TE' | 'TH' | 'TR' | 'UK' | 'UR' | 'UZ' | 'VI' | 'ZH_CN' | 'ZH_HK' | 'ZH_TW' | 'ZU' | 'UNRECOGNIZED', required
  - `category` 'AUTHENTICATION' | 'MARKETING' | 'UTILITY' | 'UNRECOGNIZED', required
  - `rejectionCode` 'ABUSIVE_CONTENT' | 'INCORRECT_CATEGORY' | 'INVALID_FORMAT' | 'NONE' | 'SCAM' | 'UNRECOGNIZED' — Rejection code if template is in status 'REJECTED'
  - `qualityScore` 'QUALITY_SCORE_GREEN' | 'QUALITY_SCORE_RED' | 'QUALITY_SCORE_YELLOW' | 'QUALITY_SCORE_UNKNOWN' | 'UNRECOGNIZED' — Quality score of the HSM.
  - `changes` WhatsappTemplateChangesDto
    - `status` 'DRAFT' | 'IN_PROGRESS' | 'REJECTED', required — The current status of the changes. `DRAFT`: The changes has not been submitted. `IN_PROGRESS`: The changes has been submitted.
    - `allowCategoryChange` boolean — True if Meta should be allowed to change the category if they determine the category is wrong. If false, Meta might reject the template if they determine the category is wrong based on the template contents. Defaults to false.
    - `details` union — Template details and information.
      - object
        - `components` union[], required — List of components in the template. Must contain a BODY component and can only have one entry of each type.
          - union
            - WhatsappTextHeaderComponentDto
              - …
            - WhatsappMediaHeaderComponentDto
              - …
            - WhatsappBodyComponentDto
              - …
            - WhatsappFooterComponentDto
              - …
            - WhatsappButtonsComponentDto
              - …
            - WhatsappLocationHeaderComponentDto
              - …
            - WhatsappCarouselComponentDto
              - …
        - `messageSendTtlSeconds` number — Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped. | | AUTHENTICATION | MARKETING | UTILITY | | -- | -- | -- | -- | | Default | 10 minutes | 30 days | 30 days | | Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours | | Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds | Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.
      - object
        - `components` union[] — The current status of the changes. `DRAFT`: The changes has not been submitted. `IN_PROGRESS`: The changes has been submitted.
          - union
            - WhatsappTextHeaderComponentDto
              - …
            - WhatsappMediaHeaderComponentDto
              - …
            - WhatsappLocationHeaderComponentDto
              - …
            - WhatsappBodyComponentDto
              - …
            - WhatsappFooterComponentDto
              - …
            - WhatsappButtonsComponentDto
              - …
            - WhatsappCarouselComponentDto
              - …
        - `messageSendTtlSeconds` number — Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped. | | AUTHENTICATION | MARKETING | UTILITY | | -- | -- | -- | -- | | Default | 10 minutes | 30 days | 30 days | | Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours | | Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds | Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.
  - `details` WhatsappTemplateDetailsDto
    - `components` union[], required — List of components in the template. Must contain a BODY component and can only have one entry of each type.
      - union
        - WhatsappTextHeaderComponentDto
          - `type` 'HEADER', required
          - `format` 'TEXT', required
          - `text` string — Text to show in the header
          - `examples` unknown
        - WhatsappMediaHeaderComponentDto
          - `type` 'HEADER', required
          - `format` 'DOCUMENT' | 'IMAGE' | 'VIDEO', required
          - `examples` unknown
        - WhatsappBodyComponentDto
          - `type` 'BODY', required
          - `text` string
          - `examples` string[] — Examples for the body variables.
          - `addSecurityRecommendation` boolean
        - WhatsappFooterComponentDto
          - `type` 'FOOTER', required
          - `text` string
          - `codeExpirationMinutes` number
        - WhatsappButtonsComponentDto
          - `type` 'BUTTONS', required
          - `buttons` union[], required
            - union
              - …
        - WhatsappLocationHeaderComponentDto
          - `type` 'HEADER', required
          - `format` 'LOCATION', required
        - WhatsappCarouselComponentDto
          - `type` 'CAROUSEL', required
          - `cards` WhatsappCardDto[], required — Media cards.
            - `components` union[], required — List of components in the cards.
              - …
    - `messageSendTtlSeconds` number — Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped. | | AUTHENTICATION | MARKETING | UTILITY | | -- | -- | -- | -- | | Default | 10 minutes | 30 days | 30 days | | Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours | | Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds | Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.
  - `analytics` WhatsappTemplateAnalyticsDto[], required — Template analytics.
    - `sent` number, required — Number of times template has been sent.
    - `delivered` number, required — Number of times template has been delivered.
    - `read` number, required — Number of times template has been read.
    - `start` string, required — The UTC Date Time in ISO 8601 for start of date range.
    - `end` string, required — The UTC Date Time in ISO 8601 for end of date range.
    - `buttons` WhatsappTemplateAnalyticsButtonsDto[], required — Number of times buttons in the template has been clicked.
      - `type` 'QUICK_REPLY' | 'UNIQUE_URL' | 'URL' | 'UNRECOGNIZED', required — Type of button.
      - `content` string, required — Content of the button.
      - `clicks` number, required — Number of times the button has been clicked.
  - `isMetaGenerated` boolean, required — Indicates if the template was auto-generated by Meta.

## Other responses

- `400` — BadRequest
- `401` — Unauthorized
- `409` — Conflict
- `424` — FailedDependency
- `429` — TooManyRequests
- `500` — InternalServerError

---

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