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

# Create a template

> Creates a WhatsApp template.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml post /whatsapp/templates
openapi: 3.0.0
info:
  description: >-
    The [YCloud](https://ycloud.com) API is organized around
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our
    API is designed to have predictable, resource-oriented URLs, return
    [JSON](https://www.json.org) responses, and use standard HTTP response codes
    and verbs.
  version: v2
  title: YCloud API
  termsOfService: https://ycloud.com/terms-service
  contact:
    email: service@ycloud.com
servers:
  - url: https://api.ycloud.com/v2
    description: Base URL
security:
  - api_key: []
tags:
  - name: Balance
  - name: Contacts
  - name: Custom Events
  - name: Emails
  - name: SMS
  - name: Unsubscribers
  - name: Verify
  - name: Voices
  - name: Webhook Endpoints
  - name: WhatsApp Business Accounts
  - name: WhatsApp Inbound Messages
  - name: WhatsApp Media
  - name: WhatsApp Messages
  - name: WhatsApp Blocked Users
  - name: WhatsApp Groups
  - name: WhatsApp Calling
  - name: WhatsApp Phone Numbers
  - name: WhatsApp Templates
  - name: WhatsApp Flows
  - name: Meta Business Agent
  - name: WhatsApp Group Messages
externalDocs:
  description: Homepage
  url: https://ycloud.com
paths:
  /whatsapp/templates:
    post:
      tags:
        - WhatsApp Templates
      summary: Create a template
      description: Creates a WhatsApp template.
      operationId: whatsapp_template-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappTemplateCreateRequest'
        required: true
      responses:
        '200':
          description: Successfully created a WhatsApp template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappTemplate'
components:
  schemas:
    WhatsappTemplateCreateRequest:
      type: object
      description: >-
        See [WhatsApp
        Templates](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates).
      required:
        - wabaId
        - name
        - language
        - category
        - components
      properties:
        wabaId:
          type: string
          description: WhatsApp Business Account ID.
          example: whatsapp-business-account-id
        name:
          type: string
          description: Name of the template.
          maxLength: 512
          pattern: '[a-z0-9]{1,512}'
          example: sample_whatsapp_template
        language:
          type: string
          description: >-
            Language code of the template. See [Supported
            Languages](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/supported-languages)
            for all codes.
          example: en
        category:
          $ref: '#/components/schemas/WhatsappTemplateCategory'
          description: >-
            The template category that determines message pricing and use case.
            Must be one of `AUTHENTICATION` (one-time passcodes), `MARKETING`
            (promotions and offers), or `UTILITY` (transactional updates and
            notifications).
        subCategory:
          $ref: '#/components/schemas/WhatsappTemplateSubCategory'
        messageSendTtlSeconds:
          type: integer
          format: int32
          description: >-
            If we are unable to deliver a message for an amount of time that
            exceeds its time-to-live, we will stop retrying and drop the
            message.

            By default, messages that use an authentication template have a
            default TTL of **10 minutes**, and messages that use a utility or
            marketing template have a default TTL of **30 days**.

            Set its value between `30` and `900` seconds (i.e., 30 seconds to 15
            minutes) for authentication templates, or `30` and `43200` seconds
            (i.e., 30 seconds to 12 hours) for utility templates, or `43200` and
            `2592000` seconds (i.e., 12 hours to 30 days) for marketing
            templates. Alternatively, you can set this value to `-1`, which will
            set a custom TTL of 30 days for either type of template.

            We encourage you to set a time-to-live for all of your
            authentication templates, preferably equal to or less than your code
            expiration time, to ensure your customers only get a message when a
            code is still usable.

            Authentication templates created before October 23, 2024, have a
            default TTL of 30 days.
          example: 600
        components:
          description: >-
            Array of template components defining the structure and content of
            the template message. Must include at least a BODY component. May
            also include HEADER, FOOTER, BUTTONS, and other component types. See
            WhatsappTemplateComponent for detailed structure.
          type: array
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponent'
        ctaUrlLinkTrackingOptedOut:
          type: boolean
          description: >-
            **Optional.**

            Indicates if template button click tracking is disabled. Set to
            `true` to disable button click tracking on the template, or `false`
            to enable.

            You can disable button click tracking on an individual template by
            setting this field to `true`. Once disabled, button
            engagement/clicks will not be displayed in the WhatsApp Manager when
            viewing the template's insights.

            If not provided or set to `null`, this value defaults to `true`,
            which means button click tracking is disabled by default.
          example: true
    WhatsappTemplate:
      type: object
      description: >-
        See [WhatsApp
        Templates](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates).
      required:
        - wabaId
        - name
        - language
      properties:
        officialTemplateId:
          type: string
          description: >-
            Official template ID assigned by WhatsApp. This ID is used to
            identify the template in WhatsApp's system.
          example: official-template-id
        wabaId:
          type: string
          description: WhatsApp Business Account ID.
          example: whatsapp-business-account-id
        name:
          type: string
          description: Name of the template.
          maxLength: 512
          pattern: '[a-z0-9]{1,512}'
        language:
          type: string
          description: >-
            Language code of the template. See [Supported
            Languages](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/supported-languages)
            for all codes.
          example: en
        category:
          $ref: '#/components/schemas/WhatsappTemplateCategory'
        subCategory:
          $ref: '#/components/schemas/WhatsappTemplateSubCategory'
        previousCategory:
          type: string
          description: >-
            This field indicates the template's previous category (or `null`,
            for newly created templates after April 1, 2023). Compare this value
            to the template's `category` field value, which indicates the
            template's current category.
        messageSendTtlSeconds:
          type: integer
          format: int32
          description: >-
            If we are unable to deliver a message for an amount of time that
            exceeds its time-to-live, we will stop retrying and drop the
            message.

            By default, messages that use an authentication template have a
            default TTL of **10 minutes**, and messages that use a utility or
            marketing template have a default TTL of **30 days**.

            Set its value between `30` and `900` seconds (i.e., 30 seconds to 15
            minutes) for authentication templates, or `30` and `43200` seconds
            (i.e., 30 seconds to 12 hours) for utility templates, or `43200` and
            `2592000` seconds (i.e., 12 hours to 30 days) for marketing
            templates. Alternatively, you can set this value to `-1`, which will
            set a custom TTL of 30 days for either type of template.

            We encourage you to set a time-to-live for all of your
            authentication templates, preferably equal to or less than your code
            expiration time, to ensure your customers only get a message when a
            code is still usable.

            Authentication templates created before October 23, 2024, have a
            default TTL of 30 days.
          example: 600
        components:
          type: array
          description: >-
            Template components. A template consists of `HEADER`, `BODY`,
            `FOOTER`, and `BUTTONS` components. `BODY` component is required,
            the other types are optional.
          minItems: 1
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponent'
        ctaUrlLinkTrackingOptedOut:
          type: boolean
          description: >-
            Whether Meta CTA URL click tracking is disabled. Historical `null`
            values are returned as `true`.
          example: true
        status:
          $ref: '#/components/schemas/WhatsappTemplateStatus'
        qualityRating:
          $ref: '#/components/schemas/WhatsappTemplateQualityRating'
        reason:
          type: string
          description: The reason why the template is rejected.
        createTime:
          type: string
          format: date-time
          description: >-
            The time at which this object is created, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-06-01T12:00:00.000Z`.
          example: '2022-06-01T12:00:00.000Z'
        updateTime:
          type: string
          format: date-time
          description: >-
            The time at which this object is updated, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-06-01T12:00:00.000Z`.
          example: '2022-06-01T12:00:00.000Z'
        statusUpdateEvent:
          $ref: '#/components/schemas/WhatsappTemplateStatusUpdateEventEnum'
          description: >-
            The WhatsApp template status update event that caused this webhook.
            For `ARCHIVED`, the template `status` is `ARCHIVED`. For
            `UNARCHIVED`, the template `status` is the current status returned
            by Meta, for example `APPROVED`; it does not represent a new
            approval review.
        disableDate:
          type: string
          description: >-
            The date at which the template will be disabled. When a WhatsApp
            template `FLAGGED` event is received, this field is set.
          example: December 9, 2022
        whatsappApiError:
          $ref: '#/components/schemas/WhatsappApiError'
    WhatsappTemplateCategory:
      type: string
      description: >-
        Category of WhatsApp templates.

        - `AUTHENTICATION`: Enable businesses to authenticate users with
        one-time passcodes, potentially at multiple steps in the login process
        (e.g., account verification, account recovery, integrity challenges).

        - `MARKETING`: Include promotions or offers, informational updates, or
        invitations for customers to respond / take action. Any conversation
        that does not qualify as utility or authentication is a marketing
        conversation.

        - `UTILITY`: Facilitate a specific, agreed-upon request or transaction
        or update to a customer about an ongoing transaction, including
        post-purchase notifications and recurring billing statements.
      enum:
        - AUTHENTICATION
        - MARKETING
        - UTILITY
    WhatsappTemplateSubCategory:
      type: string
      description: >-
        Subcategory of WhatsApp templates.

        - ORDER_STATUS: Order status template is categorized as `UTILITY`
        template and apart from name and language of choice, it has general
        template components such as `BODY`, `FOOTER` and additionally
        subcategory as `ORDER_STATUS`.
      enum:
        - ORDER_STATUS
    WhatsappTemplateComponent:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >-
            **Required.** Template component type.

            - `BODY`: Body components are text-only components and are required
            by all templates. Templates are limited to one body component.

            - `HEADER`: Headers are optional components that appear at the top
            of template messages. Headers support text, media (images, gif,
            videos, documents). Templates are limited to one header component.

            - `FOOTER`: Footers are optional text-only components that appear
            immediately after the body component. Templates are limited to one
            footer component.

            - `BUTTONS`: Buttons are optional interactive components that
            perform specific actions when tapped.

            - `LIMITED_TIME_OFFER`: Use for limited-time offer templates. The
            delivered message can display an offer expiration details section
            with a heading, an optional expiration timer, and the offer code
            itself.

            - `CAROUSEL`: Carousel templates allow you to send a single text
            message (1), accompanied by a set of up to 10 carousel cards (2) in
            a horizontally scrollable view.

            - `CALL_PERMISSION_REQUEST`: Sending a template message allows you
            to initiate a user conversation with a call permission request.
          enum:
            - BODY
            - HEADER
            - FOOTER
            - BUTTONS
            - LIMITED_TIME_OFFER
            - CAROUSEL
            - CALL_PERMISSION_REQUEST
        format:
          type: string
          description: '**Required for type `HEADER`.**'
          enum:
            - TEXT
            - IMAGE
            - GIF
            - VIDEO
            - DOCUMENT
            - LOCATION
        text:
          type: string
          description: >-
            For body text (type = `BODY`), maximum 1024 characters.

            For header text (type = `HEADER`, format = `TEXT`), maximum 60
            characters.

            For footer text (type = `FOOTER`), maximum 60 characters.

            For card body text (`CAROUSEL` card component type = `BODY`),
            maximum 160 characters.
          maxLength: 1024
        buttons:
          type: array
          description: >-
            **Required for type `BUTTONS`.**

            Buttons are optional interactive components that perform specific
            actions when tapped. Templates can have a mixture of up to 10 button
            components total, although there are limits to individual buttons of
            the same type as well as combination limits.

            If a template has more than three buttons, two buttons will appear
            in the delivered message and the remaining buttons will be replaced
            with a **See all options** button. Tapping the **See all options**
            button reveals the remaining buttons.
          maxItems: 10
          minItems: 1
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponentButton'
        add_security_recommendation:
          type: boolean
          description: >-
            **Optional. Only applicable in the `BODY` component of an
            AUTHENTICATION template.**

            Set to `true` if you want the template to include the string, *For
            your security, do not share this code.* Set to `false` to exclude
            the string.
        code_expiration_minutes:
          type: integer
          format: int32
          description: >-
            **Optional. Only applicable in the `FOOTER` component of an
            AUTHENTICATION template.**

            Indicates number of minutes the password or code is valid.

            If omitted, the code expiration warning will not be displayed in the
            delivered message.

            Minimum 1, maximum 90.
          maximum: 90
          minimum: 1
          example: 5
        limited_time_offer:
          $ref: '#/components/schemas/WhatsappTemplateComponentLimitedTimeOffer'
        example:
          $ref: '#/components/schemas/WhatsappTemplateComponentExample'
        cards:
          type: array
          description: |-
            **Required for type `CAROUSEL`.**
            Carousel templates support up to 10 carousel cards.
          maxItems: 10
          minItems: 1
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponentCard'
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - HEADER
              - not:
                  required:
                    - format
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - BUTTONS
              - not:
                  required:
                    - buttons
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - LIMITED_TIME_OFFER
              - not:
                  required:
                    - limited_time_offer
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - CAROUSEL
              - not:
                  required:
                    - cards
    WhatsappTemplateStatus:
      type: string
      description: >-
        The status of a WhatsApp template.

        - `PENDING`: The template is still under review. Review can take up to
        24 hours.

        - `REJECTED`: The template has been rejected during review process.

        - `APPROVED`: The template is approved, and you may begin sending it to
        customers.

        - `PAUSED`: The template has been paused due to recurring negative
        feedback from customers. Message templates with this status cannot be
        sent to customers. See [Template
        Pausing](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#template-pausing).

        - `DISABLED`: The template has been disabled due to recurring negative
        feedback from customers or for violating one or more of our policies.
        Message templates with this status cannot be sent to customers. You may
        be able to edit a disabled message template and request an appeal. See
        [Appeals](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#appeals).

        - `ARCHIVED`: The template has been archived. Archived templates cannot
        be sent or edited.

        - `IN_APPEAL`: The template is in appeal. See also [Template
        Appeals](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#appeals).

        - `DELETED`: The template is deleted.
      enum:
        - PENDING
        - REJECTED
        - APPROVED
        - PAUSED
        - DISABLED
        - ARCHIVED
        - IN_APPEAL
        - DELETED
      example: REJECTED
    WhatsappTemplateQualityRating:
      type: string
      description: >-
        Quality rating of WhatsApp template. One of `GREEN`, `YELLOW`, `RED`, or
        `UNKNOWN`. See also [Template Quality
        Rating](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines/#quality-rating).

        - `GREEN`: High quality.

        - `YELLOW`: Medium quality.

        - `RED`: Low quality.

        - `UNKNOWN`: Unknown quality.
      enum:
        - GREEN
        - YELLOW
        - RED
        - UNKNOWN
    WhatsappTemplateStatusUpdateEventEnum:
      type: string
      description: >-
        Used when an event happened on WhatsApp template status updates.

        - `PENDING`: Pending.

        - `APPROVED`: Approved.

        - `REJECTED`: Rejected.

        - `IN_APPEAL`: In appeal. See also [Template
        Appeals](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#appeals).

        - `PAUSED`: Paused. See also [Template
        Pausing](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#template-pausing).

        - `FLAGGED`: Flagged. The template is scheduled for disabling.

        - `DISABLED`: Disabled. See also [Template
        Pausing](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines#template-pausing).

        - `ARCHIVED`: Archived. The template status is updated to `ARCHIVED`.

        - `UNARCHIVED`: Unarchived. The template status is restored to the
        current status returned by Meta. If the status is `APPROVED`, this event
        still does not represent a new approval review.

        - `REINSTATED`: Reinstated.

        - `PENDING_DELETION`: Pending deletion.
      enum:
        - PENDING
        - APPROVED
        - REJECTED
        - IN_APPEAL
        - PAUSED
        - FLAGGED
        - DISABLED
        - ARCHIVED
        - UNARCHIVED
        - REINSTATED
        - PENDING_DELETION
    WhatsappApiError:
      type: object
      description: >-
        The original error object returned by WhatsApp. See [Handling
        Errors](https://developers.facebook.com/docs/graph-api/guides/error-handling),
        [Cloud API Error
        Codes](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes).
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: A human-readable description of the error.
          example: HSM Template creation failed
        code:
          type: string
          description: An error code.
          example: 200002
        type:
          type: string
          description: Error type.
          example: OAuthException
        is_transient:
          type: boolean
          description: Whether the error is transient.
          example: false
        error_subcode:
          type: string
          description: Additional code about the error.
          example: 2388109
        error_user_msg:
          type: string
          description: >-
            The message to display to the user. The language of the message is
            based on the locale of the API request.
          example: This message template cannot be created.
        error_user_title:
          type: string
          description: >-
            The title of the dialog, if shown. The language of the message is
            based on the locale of the API request.
          example: Message Cannot Be Submitted
        fbtrace_id:
          type: string
          description: >-
            Internal support identifier. When reporting a bug related to a Graph
            API call, include the fbtrace_id to help us find log data for
            debugging.
          example: AVGjJ7ia2zJkrHG
        error_data:
          description: >-
            Additional data about the error. A string or map.

            - For template APIs, this field is a string describing the reason
            for the error.

            - For message APIs, this field is a map with property `details`
            describing the reason for the error.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
    WhatsappTemplateComponentButton:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/WhatsappTemplateComponentButtonType'
          description: >-
            The button type that determines the button's behavior when tapped.
            Supported types include `QUICK_REPLY` (sends predefined text), `URL`
            (opens a web link), `PHONE_NUMBER` (initiates a call), `COPY_CODE`
            (copies text to clipboard), `OTP` (one-time password
            authentication), `CATALOG` (displays product catalog), `MPM`
            (multi-product message), `FLOW` (WhatsApp Flow), `ORDER_DETAILS`
            (order review), `VOICE_CALL` (initiates WhatsApp call), and
            `REQUEST_CONTACT_INFO` (requests the user's contact information).
        text:
          type: string
          description: >-
            **Required for button type `PHONE_NUMBER` or `URL`.** Button text.

            **Required for button type `REQUEST_CONTACT_INFO`.** Set it to the
            fixed value `Share Contact Info`.

            For `CODE_CODE` buttons, the text is a pre-set value and cannot be
            customized.

            For `OTP` buttons, if omitted, the text will default to a pre-set
            value localized to the template's language. For example, `Copy Code`
            for English (US). If your template is using a one-tap autofill
            button and you supply this value, the authentication template
            message will display a copy code button with this text if we are
            unable to validate your
            [handshake](https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/autofill-button-authentication-templates#handshake).
            Maximum 25 characters.
          maxLength: 25
        url:
          type: string
          description: >-
            **Required for button type `URL`.** URL of website.

            There can be at most 1 variable at the end of the URL. Example:
            `https://www.luckyshrub.com/shop?promo={{1}}`.

            2000 characters maximum.
          maxLength: 2000
        phone_number:
          type: string
          description: >-
            **Required for button type `PHONE_NUMBER`.**

            Alphanumeric string. Business phone number to be (display phone
            number) called when the user taps the button.

            20 characters maximum.
          maxLength: 20
          example: 15550051310
        otp_type:
          $ref: '#/components/schemas/WhatsappTemplateComponentButtonOtpType'
          description: >-
            **Required for button type `OTP`.**

            Indicates button OTP type.

            Set to `COPY_CODE` if you want the template to use a copy code
            button, `ONE_TAP` to have it use a one-tap autofill button, or
            `ZERO_TAP` to have no button at all.
        autofill_text:
          type: string
          description: |-
            **One-tap and zero-tap buttons only.**
            One-tap button text.
            Maximum 25 characters.
          maxLength: 25
          example: Autofill
        package_name:
          type: string
          description: |-
            **Deprecated since 2025-07-23. Use `supported_apps` instead.**
            **One-tap and zero-tap buttons only.**
            Your Android app's package name.
          example: com.example.myapplication
          deprecated: true
        signature_hash:
          type: string
          description: >-
            **Deprecated since 2025-07-23. Use `supported_apps` instead.**

            **One-tap and zero-tap buttons only.**

            Your app signing key hash. See [App Signing Key
            Hash](https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/zero-tap-authentication-templates#app-signing-key-hash).
          example: K8a%2FAINcGX7
          deprecated: true
        supported_apps:
          type: array
          description: |-
            **One-tap and zero-tap buttons only.**
            List of supported apps.
          items:
            $ref: >-
              #/components/schemas/WhatsappTemplateComponentButtonOtpSupportedApp
        zero_tap_terms_accepted:
          type: boolean
          description: >-
            **Zero-tap buttons only.**

            Set to `true` to indicate that you understand that your use of
            zero-tap authentication is subject to the WhatsApp Business Terms of
            Service, and that it's your responsibility to ensure your customers
            expect that the code will be automatically filled in on their behalf
            when they choose to receive the zero-tap code through WhatsApp.

            If set to `false`, the template will not be created as you need to
            accept zero-tap terms before creating zero-tap enabled message
            templates.
        example:
          type: array
          description: Sample full URL for a `URL` button with a variable.
          items:
            type: string
        flow_id:
          type: string
          description: >-
            **Conditionally required for button type `FLOW`.**

            The unique ID of the Flow. Cannot be used if `flow_name` is
            provided. Use either `flow_id` or `flow_name` when referencing an
            existing Flow.
          example: '1'
        flow_name:
          type: string
          description: >-
            **Conditionally required for button type `FLOW`.**

            The name of the Flow. Cannot be used if `flow_id` is provided. Use
            either `flow_id` or `flow_name` when referencing an existing Flow.
            The Flow ID is stored in the message template, not the name, so
            changing the Flow name will not affect existing message templates.
        flow_json:
          type: string
          description: >-
            **Conditionally required for button type `FLOW`.**

            The Flow JSON encoded as string with escaping. The Flow JSON
            specifies the content of the Flow. Used to pass Flow JSON
            content/parameters.
        flow_action:
          type: string
          description: |-
            **Use for button type `FLOW`.**
            Either `navigate` or `data_exchange`. Defaults to `navigate`.
          enum:
            - navigate
            - data_exchange
          example: navigate
        navigate_screen:
          type: string
          description: |-
            **Required if `flow_action` is `navigate`.**
            The unique ID of the Screen in the Flow.
          example: WELCOME_SCREEN
        app_deep_link:
          $ref: '#/components/schemas/WhatsappTemplateComponentButtonAppDeepLink'
      allOf:
        - not:
            required:
              - flow_id
              - flow_name
        - not:
            required:
              - flow_id
              - flow_json
        - not:
            required:
              - flow_name
              - flow_json
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - PHONE_NUMBER
              - not:
                  required:
                    - text
                    - phone_number
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - URL
              - not:
                  required:
                    - text
                    - url
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - OTP
              - not:
                  required:
                    - otp_type
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - REQUEST_CONTACT_INFO
              - not:
                  allOf:
                    - required:
                        - text
                    - properties:
                        text:
                          enum:
                            - Share Contact Info
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - FLOW
              - allOf:
                  - not:
                      required:
                        - flow_id
                  - not:
                      required:
                        - flow_name
                  - not:
                      required:
                        - flow_json
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - FLOW
                  flow_action:
                    enum:
                      - navigate
              - required:
                  - flow_action
              - not:
                  required:
                    - navigate_screen
    WhatsappTemplateComponentLimitedTimeOffer:
      type: object
      description: Use for `LIMITED_TIME_OFFER` components.
      required:
        - text
      properties:
        text:
          type: string
          description: |-
            **Required.**
            Offer details text.
            Maximum 16 characters.
          maxLength: 16
          example: Expiring offer!
        has_expiration:
          type: boolean
          description: >-
            **Optional.**

            Set to `true` to have the [offer expiration
            details](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/limited-time-offer-templates#offer-expiration-details)
            appear in the delivered message.

            If set to `true`, the copy code button component must be included in
            the `buttons` array, and must appear first in the array.

            If set to `false`, offer expiration details will not appear in the
            delivered message and the copy code button component is optional. If
            including the copy code button, it must appear first in the
            `buttons` array.
    WhatsappTemplateComponentExample:
      type: object
      description: >-
        **Required** when:

        - `type` is `HEADER`, and `format` is one of `IMAGE`, `GIF`, `VIDEO`, or
        `DOCUMENT`. Provide a sample media URL in `header_url`.

        - `type` is `HEADER`, `format` is `TEXT`, and a variable is used in
        `text`. Provide a sample value for that variable in `header_text`. There
        can be at most 1 variable in `HEADER` text.

        - `type` is `BODY`, and variables are used in `text`. Provide sample
        values for those variables in `body_text`.
      properties:
        body_text:
          type: array
          description: Sample values for variables in `text` of a `BODY` component.
          items:
            type: array
            items:
              type: string
        header_text:
          type: array
          description: Sample value for the variable in `text` of a `HEADER` component.
          items:
            type: string
        header_url:
          type: array
          description: >-
            Sample media URL for a `HEADER` component whose format is one of
            `IMAGE`, `GIF`, `VIDEO`, or `DOCUMENT`.

            Supported types:

            - For `IMAGE`, the URL must end with one of `.jpg`, `.jpeg`, or
            `.png`, size limit is 5MB.

            - For `GIF`, the URL must end with `.mp4`, size limit is 3.5MB.

            - For `VIDEO`, the URL must end with `.mp4`, size limit is 16MB.

            - For `DOCUMENT`, the URL must end with `.pdf`, size limit is 100MB.
          items:
            type: string
    WhatsappTemplateComponentCard:
      type: object
      description: >-
        Carousel templates support up to 10 carousel cards. Cards must have a
        media header (image or video) and can optionally include body text and
        up to 2 quick reply buttons, phone number buttons, or URL buttons
        (button types can be mixed).
      required:
        - components
      properties:
        components:
          type: array
          minItems: 1
          description: |-
            **Required.**
            Card components.
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponentCardComponent'
            description: >-
              Cards must have a media header (image or video) and can optionally
              include body text and up to 2 quick reply buttons, phone number
              buttons, or URL buttons (button types can be mixed).
    WhatsappTemplateComponentButtonType:
      type: string
      description: >-
        Button type.

        - `PHONE_NUMBER`: Phone number buttons call the specified business phone
        number when tapped by the app user. Templates are limited to one phone
        number button.

        - `URL`: URL buttons load the specified URL in the device's default web
        browser when tapped by the app user. Templates are limited to two URL
        buttons.

        - `QUICK_REPLY`: Quick reply buttons are custom text-only buttons that
        immediately message you with the specified text string when tapped by
        the app user. Templates are limited to 10 quick reply buttons. If using
        quick reply buttons with other buttons, buttons must be organized into
        two groups: quick reply buttons and non-quick reply buttons.

        - `COPY_CODE`: Copy code buttons copy a text string (defined when the
        template is sent in a template message) to the device's clipboard when
        tapped by the app user. Templates are limited to one copy code button.

        - `OTP`: One-time password (OTP) buttons are a special type of URL
        button component used with authentication templates.

        - `CATALOG`: When a customer taps the **View catalog** button in a
        catalog template message, your product catalog appears within WhatsApp.

        - `MPM`: Customers can browse products and sections by tapping the
        **View items** button in a multi-product template message.

        - `FLOW`: Use this type to specify the
        [Flow](https://developers.facebook.com/docs/whatsapp/flows) to be sent
        with the template message.

        - `ORDER_DETAILS`: Provides a order details button with `Review and Pay`
        text.

        - `VOICE_CALL`: Triggers a WhatsApp call, when clicked by a WhatsApp
        customer.

        - `REQUEST_CONTACT_INFO`: Requests that the WhatsApp user share their
        contact information. The button text is fixed as `Share Contact Info`.
      enum:
        - PHONE_NUMBER
        - URL
        - QUICK_REPLY
        - COPY_CODE
        - OTP
        - CATALOG
        - MPM
        - FLOW
        - ORDER_DETAILS
        - VOICE_CALL
        - REQUEST_CONTACT_INFO
    WhatsappTemplateComponentButtonOtpType:
      type: string
      description: >-
        Indicates button OTP type.

        Set to `COPY_CODE` if you want the template to use a copy code button,
        `ONE_TAP` to have it use a one-tap autofill button, or `ZERO_TAP` to
        have no button at all.
      enum:
        - COPY_CODE
        - ONE_TAP
        - ZERO_TAP
    WhatsappTemplateComponentButtonOtpSupportedApp:
      description: >-
        The supported_apps array allows you define pairs of app package names
        and signing key hashes for up to 5 apps. This can be useful if you have
        different app builds and want each of them to be able to initiate the
        handshake:
      type: object
      properties:
        package_name:
          type: string
          description: Your Android app's package name.
          example: com.example.myapplication
        signature_hash:
          type: string
          description: >-
            Your app signing key hash. See [App Signing Key
            Hash](https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/zero-tap-authentication-templates#app-signing-key-hash).
          example: K8a%2FAINcGX7
    WhatsappTemplateComponentButtonAppDeepLink:
      type: object
      properties:
        meta_app_id:
          type: string
          description: Required if using a URL button mapped to a deep link. APP ID.
          example: '2892949377516980'
        android_deep_link:
          type: string
          description: >-
            Required if using a URL button component mapped to a deep link.The
            WhatsApp client will attempt to load this URI if the WhatsApp user
            taps the button on an Android device.
          example: luckyshrub://deals/summer/
        android_fallback_playstore_url:
          type: string
          description: >-
            Optional. URL of a website that the WhatsApp client will attempt to
            load in the device’s default web browser when the button is tapped
            but unable to load the Android deep link URI.
          example: https://www.luckyshrub.com/deals/summer/
    WhatsappTemplateComponentCardComponent:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >-
            **Required.**

            Card component type.

            - `BODY`: Body components are text-only components. Cards must have
            body text.

            - `HEADER`: Cards must have a media header (image or video).

            - `BUTTONS`: Buttons are interactive components that perform
            specific actions when tapped. Cards must have at least one button,
            up to 2 buttons.
          enum:
            - BODY
            - HEADER
            - BUTTONS
        format:
          type: string
          description: |-
            **Required for type `HEADER`.**
            Cards must have a media header (image or video).
          enum:
            - IMAGE
            - VIDEO
        text:
          type: string
          description: |-
            **Required for type `BODY`.**
            Card body text supports variables. Maximum 160 characters.
          maxLength: 160
        buttons:
          type: array
          description: >-
            **Required for type `BUTTONS`.**

            Cards must have at least one button. Supports 2 buttons. Buttons can
            be the same or a mix of quick reply buttons, phone number buttons,
            or URL buttons.
          minItems: 1
          maxItems: 2
          items:
            $ref: '#/components/schemas/WhatsappTemplateComponentButton'
        example:
          $ref: '#/components/schemas/WhatsappTemplateComponentExample'
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - BODY
              - not:
                  required:
                    - text
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - HEADER
              - not:
                  required:
                    - format
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - BUTTONS
              - not:
                  required:
                    - buttons
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````

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