> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a WhatsApp message template

> Creates a WhatsApp message template using the supplied template name, language, category and components.



## OpenAPI

````yaml /cpaas-api-reference.yaml post /api/whatsapp/{sender_hash}/message_templates
openapi: 3.1.0
info:
  title: CPaaS+ Messaging API
  version: 1.0.0
  description: >-
    Unified REST API for sending and managing customer communications across
    **SMS**, **WhatsApp**, **Email**, **RCS** and **Flow Builder**. It also
    includes the **WhatsApp Wrapper API**, a simplified layer over Meta's
    WhatsApp Cloud API for sending free-form message types (text, media,
    interactive and more).


    All APIs are HTTP-based, use JSON and are secured with bearer-token
    authentication. Generate a token in the CPaaS+ portal (API tab, then **Add
    new Token**) and send it as `Authorization: Bearer <token>` on every
    request.


    A `200` response means the request was **accepted**, not that the message
    was delivered. Use the status endpoints for delivery results.
servers:
  - url: '{baseUrl}'
    description: Your CPaaS+ API host (provided at onboarding)
    variables:
      baseUrl:
        default: https://api.yourcpaas.com
        description: Host of your CPaaS+ web portal account, without a trailing slash.
security:
  - bearerAuth: []
tags:
  - name: SMS
    description: >-
      Send SMS using portal campaigns, approved templates, or open text, and
      check delivery status.
  - name: SMS Webhooks
    description: SMS delivery report callback payloads.
  - name: WhatsApp Messaging
    description: Send WhatsApp template messages and manage order status and refunds.
  - name: WhatsApp Wrapper API
    description: >-
      Send text, media, contact, location, interactive and other WhatsApp
      message types through the single Wrapper endpoint.
  - name: WhatsApp User Management
    description: >-
      Block, unblock, bulk-import and sync blocked WhatsApp users for a WABA
      number.
  - name: Email
    description: Send template-based or open-text email and check delivery status.
  - name: RCS Templates
    description: Create RCS templates (text with buttons, rich card, carousel).
  - name: RCS Messaging
    description: Send RCS messages and check message status.
  - name: RCS Webhooks
    description: Customer-facing RCS webhook callback payloads and event schemas.
  - name: Flow Builder
    description: Create, manage, publish and trigger Flow Builder journeys.
paths:
  /api/whatsapp/{sender_hash}/message_templates:
    post:
      tags:
        - WhatsApp Messaging
      summary: Create a WhatsApp message template
      description: >-
        Creates a WhatsApp message template using the supplied template name,
        language, category and components.
      operationId: createWhatsAppMessageTemplate
      parameters:
        - name: sender_hash
          in: path
          required: true
          description: WhatsApp sender identifier used in the URL.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsAppTemplateCreateRequest'
            example:
              name: api_custom_message121
              language: en
              category: MARKETING
              components:
                - type: HEADER
                  format: TEXT
                  text: Our {{1}} is on!
                  example:
                    header_text:
                      - Summer Sale
                - type: BODY
                  text: >-
                    Shop now through {{1}} and use code {{2}} to get {{3}} off
                    of all merchandise.
                  example:
                    body_text:
                      - - the end of August
                        - 25OFF
                        - 25%
                - type: FOOTER
                  text: Use the buttons below to manage your marketing subscriptions
                - type: BUTTONS
                  buttons:
                    - type: QUICK_REPLY
                      text: Unsubcribe from Promos
                    - type: QUICK_REPLY
                      text: Unsubscribe from All
                    - type: QUICK_REPLY
                      text: Reply button 3
                    - type: QUICK_REPLY
                      text: Reply button 4
      responses:
        default:
          description: >-
            Response status and body were not included in the supplied API
            details.
components:
  schemas:
    WhatsAppTemplateCreateRequest:
      type: object
      required:
        - name
        - language
        - category
        - components
      properties:
        name:
          type: string
          description: Lowercase template name using letters, numbers and underscores.
          minLength: 1
          maxLength: 512
        language:
          type: string
          description: Meta language or locale code, for example en or en_US.
          minLength: 2
          maxLength: 20
        category:
          type: string
          description: WhatsApp template category.
          enum:
            - MARKETING
            - UTILITY
            - AUTHENTICATION
        components:
          type: array
          description: >
            Template components. Add the component types required by the
            template: HEADER, BODY, FOOTER, BUTTONS, LIMITED_TIME_OFFER or
            CAROUSEL. BODY is required by standard templates; component
            combinations and limits depend on the template category and type.
          items:
            oneOf:
              - $ref: '#/components/schemas/WhatsAppTemplateHeaderComponent'
              - $ref: '#/components/schemas/WhatsAppTemplateBodyComponent'
              - $ref: '#/components/schemas/WhatsAppTemplateFooterComponent'
              - $ref: '#/components/schemas/WhatsAppTemplateButtonsComponent'
              - $ref: '#/components/schemas/WhatsAppTemplateLimitedTimeOfferComponent'
              - $ref: '#/components/schemas/WhatsAppTemplateCarouselComponent'
    WhatsAppTemplateHeaderComponent:
      type: object
      title: Header component
      description: >-
        Optional template header. Supports text, image, video, document or
        location format.
      required:
        - type
        - format
      properties:
        type:
          type: string
          const: HEADER
        format:
          type: string
          enum:
            - TEXT
            - IMAGE
            - VIDEO
            - DOCUMENT
            - LOCATION
        text:
          type: string
          description: Header text. Used when format is TEXT.
          maxLength: 60
        example:
          type: object
          description: Required when the header contains sample variables or sample media.
          properties:
            header_text:
              type: array
              description: Sample values for header text variables, in order.
              items:
                type: string
            header_handle:
              type: array
              description: >-
                Meta media handle(s) for an image, video or document header
                sample.
              items:
                type: string
    WhatsAppTemplateBodyComponent:
      type: object
      title: Body component
      description: >-
        Main template message text. Required for standard templates;
        authentication templates have category-specific rules.
      required:
        - type
        - text
      properties:
        type:
          type: string
          const: BODY
        text:
          type: string
          description: Body text. Supports numbered variables such as {{1}}.
          maxLength: 1024
        example:
          type: object
          description: Sample values for each body variable, supplied as a nested array.
          properties:
            body_text:
              type: array
              items:
                type: array
                items:
                  type: string
    WhatsAppTemplateFooterComponent:
      type: object
      title: Footer component
      description: Optional static footer displayed below the body.
      required:
        - type
        - text
      properties:
        type:
          type: string
          const: FOOTER
        text:
          type: string
          maxLength: 60
          description: Footer text. Variables are not supported.
    WhatsAppTemplateButtonsComponent:
      type: object
      title: Buttons component
      description: >-
        Optional interactive buttons. Button types and combinations are subject
        to Meta's category-specific limits.
      required:
        - type
        - buttons
      properties:
        type:
          type: string
          const: BUTTONS
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/WhatsAppTemplateButton'
    WhatsAppTemplateLimitedTimeOfferComponent:
      type: object
      title: Limited-time offer component
      description: >-
        Limited-time offer component for supported MARKETING templates. Use with
        the required COPY_CODE button configuration.
      required:
        - type
        - limited_time_offer
      properties:
        type:
          type: string
          const: LIMITED_TIME_OFFER
        limited_time_offer:
          type: object
          required:
            - text
          properties:
            text:
              type: string
              description: Offer heading shown in the limited-time offer section.
              maxLength: 16
            has_expiration:
              type: boolean
              description: Whether the offer displays an expiration countdown.
    WhatsAppTemplateCarouselComponent:
      type: object
      title: Carousel component
      description: >-
        Carousel component for supported MARKETING templates. Each card contains
        a header and may contain body and buttons.
      required:
        - type
        - cards
      properties:
        type:
          type: string
          const: CAROUSEL
        cards:
          type: array
          minItems: 2
          maxItems: 10
          items:
            type: object
            required:
              - components
            properties:
              components:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/WhatsAppTemplateHeaderComponent'
                    - $ref: '#/components/schemas/WhatsAppTemplateBodyComponent'
                    - $ref: '#/components/schemas/WhatsAppTemplateButtonsComponent'
    WhatsAppTemplateButton:
      type: object
      title: Template button
      description: >
        Button configuration. Supply the fields required for the selected type:
        URL, PHONE_NUMBER, QUICK_REPLY, COPY_CODE, OTP, FLOW, CATALOG, MPM or
        VOICE_CALL.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - QUICK_REPLY
            - URL
            - PHONE_NUMBER
            - COPY_CODE
            - OTP
            - FLOW
            - CATALOG
            - MPM
            - VOICE_CALL
        text:
          type: string
          description: Button label where supported by the selected button type.
          maxLength: 25
        url:
          type: string
          description: >-
            Destination URL. Dynamic URL buttons may contain a numbered variable
            such as {{1}}.
        phone_number:
          type: string
          description: Destination phone number in international format.
        example:
          type: array
          description: Example value for a dynamic URL button.
          items:
            type: string
        otp_type:
          type: string
          enum:
            - COPY_CODE
            - ONE_TAP
            - ZERO_TAP
        autofill_text:
          type: string
          description: Autofill button text for supported OTP button configurations.
        package_name:
          type: string
          description: Android application package name for one-tap or zero-tap OTP.
        signature_hash:
          type: string
          description: Android app signing hash for one-tap or zero-tap OTP.
        supported_apps:
          type: array
          description: Android applications supported by the OTP button.
          items:
            type: object
            properties:
              package_name:
                type: string
              signature_hash:
                type: string
        flow_id:
          type: string
          description: WhatsApp Flow ID for a FLOW button.
        flow_name:
          type: string
          description: >-
            WhatsApp Flow name where required by the selected Flow
            configuration.
        flow_action:
          type: string
          enum:
            - NAVIGATE
            - DATA_EXCHANGE
        navigate_screen:
          type: string
          description: Initial screen ID when flow_action is NAVIGATE.
        catalog_id:
          type: string
          description: Product catalog identifier for a CATALOG button, where required.
        thumbnail_product_retailer_id:
          type: string
          description: Product retailer ID used as the catalog thumbnail, where required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token issued for your account. Send as `Authorization: Bearer
        <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.