> ## 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.

# Retrieve a message

> Retrieves a WhatsApp message you've previously sent.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml get /whatsapp/messages/{id}
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/messages/{id}:
    get:
      tags:
        - WhatsApp Messages
      summary: Retrieve a message
      description: Retrieves a WhatsApp message you've previously sent.
      operationId: whatsapp_message-retrieve
      parameters:
        - $ref: '#/components/parameters/id-in_path'
      responses:
        '200':
          description: Successfully retrieved the object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappMessage'
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    id-in_path:
      name: id
      in: path
      description: ID of the object.
      required: true
      schema:
        type: string
        example: 627c8640675de8fc689ab9d9
  schemas:
    WhatsappMessage:
      type: object
      description: WhatsApp outbound message object.
      required:
        - id
        - wabaId
        - from
      properties:
        id:
          type: string
          description: Unique ID of the message.
        wamid:
          type: string
          description: The original message ID on WhatsApp's platform.
          example: wamid.BgNODYxN...
        wabaId:
          type: string
          description: WhatsApp Business Account ID.
          example: whatsapp-business-account-id
        from:
          type: string
          description: >-
            The sender's phone number in
            [E.164](https://en.wikipedia.org/wiki/E.164) format.
          example: '+16315551111'
        to:
          type: string
          description: >-
            The recipient's phone number in
            [E.164](https://en.wikipedia.org/wiki/E.164) format.
          example: '+16315551111'
        recipient:
          type: string
          description: >-
            The recipient value submitted in the request when a BSUID or parent
            BSUID was used.
          example: US.1234
        recipientUserId:
          type: string
          description: The recipient's WhatsApp Business-scoped user ID (BSUID).
          example: US.1234
        toUserId:
          type: string
          description: Alias of `recipientUserId` kept for compatibility.
          example: US.1234
        parentRecipientUserId:
          type: string
          description: The recipient's parent WhatsApp Business-scoped user ID.
          example: US.ENT.1234
        toParentUserId:
          type: string
          description: Alias of `parentRecipientUserId` kept for compatibility.
          example: US.ENT.1234
        customerProfile:
          $ref: '#/components/schemas/WhatsappProfile'
          description: >-
            The recipient's profile information, including WhatsApp username
            when available.
        conversation:
          $ref: '#/components/schemas/WhatsappConversation'
          description: >-
            WhatsApp defines a conversation as a 24-hour session of messaging
            between a person and a business.

            This field is present after the message status changes to `sent`.

            See also [Conversation-Based
            Pricing](https://developers.facebook.com/docs/whatsapp/pricing).
        type:
          $ref: '#/components/schemas/WhatsappMessageType'
        template:
          $ref: '#/components/schemas/WhatsappMessageTemplate'
        text:
          $ref: '#/components/schemas/WhatsappMessageText'
        image:
          $ref: '#/components/schemas/WhatsappMessageMedia'
        video:
          $ref: '#/components/schemas/WhatsappMessageMedia'
        audio:
          $ref: '#/components/schemas/WhatsappMessageMedia'
        document:
          $ref: '#/components/schemas/WhatsappMessageMedia'
        sticker:
          $ref: '#/components/schemas/WhatsappMessageMedia'
        location:
          $ref: '#/components/schemas/WhatsappMessageLocation'
        interactive:
          $ref: '#/components/schemas/WhatsappMessageInteractive'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/WhatsappMessageContact'
        reaction:
          $ref: '#/components/schemas/WhatsappMessageReaction'
        context:
          $ref: '#/components/schemas/WhatsappMessageContext'
        externalId:
          type: string
          description: >-
            A unique (recommended) string to reference the object. This can be
            an order number or similar, and can be used to reconcile the object
            with your internal systems.
        category:
          type: string
          description: >-
            The Direct Send category, such as `utility` or `authentication`,
            when applicable.
          example: utility
        ttlSeconds:
          type: integer
          description: >-
            The configured Direct Send message lifetime in seconds, when
            applicable.
          example: 600
        status:
          $ref: '#/components/schemas/WhatsappMessageStatus'
        errorCode:
          type: string
          description: Error code when the message status is `failed`.
          example: INTERNAL_SERVER_ERROR
        errorMessage:
          type: string
          description: Error message when the message status is `failed`.
        createTime:
          type: string
          format: date-time
          description: >-
            The time at which this message 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 message 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'
        sendTime:
          type: string
          format: date-time
          description: >-
            The time at which this message `status` changed to `sent`, 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'
        deliverTime:
          type: string
          format: date-time
          description: >-
            The time at which this message `status` changed to `delivered`,
            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'
        readTime:
          type: string
          format: date-time
          description: >-
            The time at which this message `status` changed to `read`, 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'
        totalPrice:
          type: number
          format: double
          description: >-
            Total price of this message.

            **Note: It's only an estimated price when the `status` is `accepted`
            or `sent`. It becomes the final price after the message is
            delivered, i.e., the `status` is `delivered` or `read`.**
          example: 0.05
        currency:
          type: string
          description: >-
            Price currency. [ISO 4217 currency
            code](https://en.wikipedia.org/wiki/ISO_4217).
          example: USD
        regionCode:
          type: string
          description: >-
            The [region code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
            of the recipient phone number.
          example: US
        pricingCategory:
          $ref: '#/components/schemas/WhatsappPricingCategory'
          description: >-
            The pricing category of the message.

            **Note: It's only an estimated pricing category when the `status` is
            `accepted` or `sent`. It becomes final after the message is
            delivered, i.e., the `status` is `delivered` or `read`.**
        pricingModel:
          $ref: '#/components/schemas/WhatsappPricingModel'
          description: |-
            The pricing model of the message.
            - `PMP`: Per-message pricing applies.
            - `CBP`: Conversation-based pricing applies.
        pricingType:
          $ref: '#/components/schemas/WhatsappPricingType'
          description: >-
            The pricing type of the message. This field is only available in PMP
            (Per-Message Pricing) mode.

            - `regular`: Indicates the message is billable.

            - `free_customer_service`: Indicates the message is free because it
            was either a utility template message or non-template message sent
            within a customer service window.

            - `free_entry_point`: Indicates the message is free because it is
            part of a free-entry point conversation.
        whatsappApiError:
          $ref: '#/components/schemas/WhatsappApiError'
        bizType:
          type: string
          description: >-
            This can be either empty or one of `whatsapp`, or `verify`. Defaults
            to `whatsapp`.

            - `whatsapp`: Indicates that the message is sent via the
            **WhatsApp** product.

            - `verify`: Indicates that the message is sent via the **Verify**
            product.
          example: whatsapp
        verificationId:
          type: string
          description: The verification ID. Included only when `bizType` is `verify`.
          example: VERIFICATION-ID
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
          description: >-
            Contains the error code and human-readable message for the API
            error.
    WhatsappProfile:
      type: object
      description: Represents the profile of a WhatsApp account.
      properties:
        name:
          type: string
          description: Name of the WhatsApp account.
          example: John
        username:
          type: string
          description: WhatsApp username.
          example: john_doe
    WhatsappConversation:
      type: object
      description: >-
        WhatsApp defines a conversation as a 24-hour session of messaging
        between a person and a business.

        See also [Conversation-Based
        Pricing](https://developers.facebook.com/docs/whatsapp/pricing).
      properties:
        id:
          type: string
          description: Unique ID for the object.
        type:
          $ref: '#/components/schemas/WhatsappConversationType'
        originType:
          $ref: '#/components/schemas/WhatsappConversationOriginType'
        expireTime:
          type: string
          format: date-time
          description: >-
            Date when the conversation expires, 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'
    WhatsappMessageType:
      type: string
      description: >-
        WhatsApp outbound message type.

        See also [WhatsApp
        messages](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages).
      enum:
        - template
        - text
        - image
        - audio
        - video
        - document
        - sticker
        - location
        - interactive
        - contacts
        - reaction
    WhatsappMessageTemplate:
      type: object
      description: Use for sending a WhatsApp `template` message.
      required:
        - name
        - language
      properties:
        name:
          type: string
          description: Name of the template.
          example: sample_whatsapp_template
        language:
          type: object
          description: >-
            Contains a language object. Specifies the language the template may
            be rendered in.
          properties:
            code:
              type: string
              description: >-
                The code of the language or locale to use. Accepts both language
                and language_locale formats (e.g., en and en_US). See [Supported
                Languages](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/supported-languages)
                for all codes.
              example: en
            policy:
              type: string
              description: >-
                The language policy the message should follow.

                Default (and only supported option): `deterministic`, which
                means that WhatsApp delivers the message template in exactly the
                language and locale asked for.
              example: deterministic
          required:
            - code
        components:
          type: array
          description: >-
            **Required when the specified template contains variables or
            media.**

            Array of component objects containing the parameters of the message.
          items:
            $ref: '#/components/schemas/WhatsappMessageTemplateComponent'
    WhatsappMessageText:
      type: object
      description: WhatsApp Message Text Object.
      required:
        - body
      properties:
        body:
          type: string
          description: >-
            Required for text messages.

            The text of the text message which can contain URLs which begin with
            http:// or https:// and formatting. See available formatting options
            here.

            If you include URLs in your text and want to include a preview box
            in text messages (preview_url: true), make sure the URL starts with
            http:// or https:// — https:// URLs are preferred. You must include
            a hostname, since IP addresses will not be matched.

            Maximum length: 4096 characters.
          maxLength: 4096
        preview_url:
          type: boolean
          description: >-
            By default, WhatsApp recognizes URLs and makes them clickable, but
            you can also include a preview box with more information about the
            link. Set this field to true if you want to include a URL preview
            box.

            The majority of the time, the receiver will see a URL they can click
            on when you send an URL, set preview_url to true, and provide a body
            object with a http or https link.

            URL previews are only rendered after one of the following has
            happened:

            - The business has sent a message template to the user.

            - The user initiates a conversation with a "click to chat" link.

            - The user adds the business phone number to their address book and
            initiates a conversation.

            Default: `false`.
    WhatsappMessageMedia:
      type: object
      description: >-
        Use for `image`, `gif`, `video`, `audio`, `document`, or `sticker`
        messages.

        See also [Supported Media
        Types](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#supported-media-types).


        **Note**: Either `id` or `link` must be provided, but not both. These
        parameters are mutually exclusive.


        Reference: [WhatsApp Cloud API Media
        Object](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#media-object)
      properties:
        id:
          type: string
          description: >-
            **Use this when media is uploaded to WhatsApp servers.**


            Provide the media object ID obtained from WhatsApp media upload API
            (https://docs.ycloud.com/reference/whatsapp_media-upload#/).


            Note: Either `id` or `link` must be provided. Do not provide both.
        link:
          type: string
          description: >-
            **Use this when sending media directly from your server.**


            The protocol and URL of the media to be sent. Use only with
            HTTP/HTTPS URLs.


            Note: WhatsApp Cloud API caches media resources for 10 minutes. To
            ensure latest content, add random query strings to the URL.


            Note: Either `id` or `link` must be provided. Do not provide both.
        caption:
          type: string
          description: >-
            Describes the specified `image`, `gif`, `video`, or `document`
            media. Not applicable in the `header` of `template` or `interactive`
            messages.
        filename:
          type: string
          description: >-
            Describes the filename for the specific document. Use only with
            `document` media.
        voice:
          type: boolean
          description: >-
            Whether to send an `audio` message as a WhatsApp voice message. Set
            to `true` for a voice message. Set to `false`, or omit this field,
            to send the audio as a regular attachment. This field applies only
            when the enclosing message `type` is `audio`.
      allOf:
        - not:
            allOf:
              - not:
                  required:
                    - id
              - not:
                  required:
                    - link
        - not:
            required:
              - id
              - link
    WhatsappMessageLocation:
      type: object
      description: Use for `location` messages.
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          format: double
          description: Latitude of the location.
        longitude:
          type: number
          format: double
          description: Longitude of the location.
        name:
          type: string
          description: Name of the location.
        address:
          type: string
          description: Address of the location. Only displayed if `name` is present.
    WhatsappMessageInteractive:
      type: object
      description: Use for `interactive` messages.
      required:
        - type
        - action
      properties:
        type:
          type: string
          description: >-
            **Required.**

            The type of interactive message you want to send.

            - `button`: Use for Reply Buttons.

            - `list`: Use for List Messages.

            - `cta_url`: Use for Call-To-Action (CTA) URL Button Messages.

            - `product`: Use for Single Product Messages.

            - `product_list`: Use for Multi-Product Messages.

            - `catalog_message`: Use for Catalog Messages.

            - `location_request_message`: Use for Location Request Messages.

            - `order_details`: Use for Order Details Messages.

            - `order_status`: Use for Order Status Messages.

            - `voice_call`: Use for Voice Call Messages.

            - `request_contact_info`: Ask the WhatsApp user to share their
            contact information.

            - `flow`: Use for Flow Messages.

            - `carousel`: Use for media carousel message.
          enum:
            - button
            - list
            - cta_url
            - product
            - product_list
            - catalog_message
            - location_request_message
            - order_details
            - order_status
            - voice_call
            - request_contact_info
            - flow
            - carousel
        action:
          $ref: '#/components/schemas/WhatsappMessageInteractiveAction'
        body:
          $ref: '#/components/schemas/WhatsappMessageInteractiveBody'
        header:
          $ref: '#/components/schemas/WhatsappMessageInteractiveHeader'
        footer:
          $ref: '#/components/schemas/WhatsappMessageInteractiveFooter'
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - button
              - properties:
                  action:
                    not:
                      required:
                        - buttons
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - list
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - button
                            - sections
                        - properties:
                            sections:
                              items:
                                required:
                                  - rows
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - cta_url
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                            - parameters
                        - properties:
                            name:
                              enum:
                                - cta_url
                            parameters:
                              required:
                                - display_text
                                - url
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - product
              - properties:
                  action:
                    not:
                      required:
                        - catalog_id
                        - product_retailer_id
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - product_list
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - catalog_id
                            - sections
                        - properties:
                            sections:
                              items:
                                required:
                                  - product_items
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - catalog_message
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                        - properties:
                            name:
                              enum:
                                - catalog_message
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - location_request_message
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                        - properties:
                            name:
                              enum:
                                - send_location
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - flow
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                            - parameters
                        - properties:
                            name:
                              enum:
                                - flow
                            parameters:
                              required:
                                - flow_message_version
                                - flow_cta
                              not:
                                allOf:
                                  - not:
                                      required:
                                        - flow_id
                                  - not:
                                      required:
                                        - flow_name
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - order_details
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                            - parameters
                        - properties:
                            name:
                              enum:
                                - review_and_pay
                            parameters:
                              required:
                                - reference_id
                                - type
                                - currency
                                - total_amount
                                - order
                                - payment_settings
                              allOf:
                                - not:
                                    allOf:
                                      - properties:
                                          type:
                                            enum:
                                              - physical-goods
                                      - not:
                                          required:
                                            - beneficiaries
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - order_status
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                            - parameters
                        - properties:
                            name:
                              enum:
                                - review_order
                            parameters:
                              required:
                                - reference_id
                                - order
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - voice_call
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                        - properties:
                            name:
                              enum:
                                - voice_call
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - request_contact_info
              - properties:
                  action:
                    not:
                      allOf:
                        - required:
                            - name
                        - properties:
                            name:
                              enum:
                                - request_contact_info
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - carousel
              - properties:
                  action:
                    not:
                      required:
                        - cards
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - button
                      - list
                      - cta_url
                      - product_list
                      - catalog_message
                      - location_request_message
                      - order_details
                      - order_status
                      - voice_call
                      - request_contact_info
                      - flow
                      - carousel
              - properties:
                  body:
                    not:
                      required:
                        - text
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - product_list
              - properties:
                  header:
                    not:
                      allOf:
                        - required:
                            - type
                            - text
                        - properties:
                            type:
                              enum:
                                - text
    WhatsappMessageContact:
      type: object
      description: >-
        When the message type filed is set to `contacts`, this object is
        included in the message object.
      required:
        - name
      properties:
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/WhatsappMessageContactAddress'
        birthday:
          type: string
          description: '`YYYY-MM-DD` formatted string.'
          example: '2022-09-27'
        emails:
          type: array
          items:
            $ref: '#/components/schemas/WhatsappMessageContactEmail'
        name:
          $ref: '#/components/schemas/WhatsappMessageContactName'
        org:
          $ref: '#/components/schemas/WhatsappMessageContactOrg'
        phones:
          type: array
          description: Contact phone number(s) formatted as a phone object.
          items:
            $ref: '#/components/schemas/WhatsappMessageContactPhone'
        urls:
          type: array
          description: Contact URL(s) formatted as a urls object.
          items:
            $ref: '#/components/schemas/WhatsappMessageContactUrl'
        vcard:
          type: string
          description: Optional vCard supplied with the shared contact payload.
          readOnly: true
        origin:
          type: string
          description: >-
            Set to `contact_request` when the user shared the contact in
            response to a request-contact-info message.
          example: contact_request
          readOnly: true
    WhatsappMessageReaction:
      type: object
      description: >-
        When a user reacts to messages with an emoji, the message type is set to
        `reaction`, and this field is included.
      required:
        - message_id
      properties:
        message_id:
          type: string
          description: >-
            Specifies the `wamid` of the message received that contained the
            reaction.
          example: wamid.BgNODYxN...
        emoji:
          type: string
          description: >-
            **Required** when you send a `reaction` message. Set it to `""` if
            you want to remove the emoji.

            **Optional** when you received a message from a user. This field is
            included when a user reacts to messages with an emoji. Otherwise, it
            indicates a user removed the emoji.
    WhatsappMessageContext:
      type: object
      description: >-
        Used to mention a specific message you are replying to. The reply can be
        any message type.
      properties:
        message_id:
          type: string
          description: >-
            Specifies the `wamid` of the message your are replying to. `wamid`
            is the original message ID on WhatsApp's platform.
          example: wamid.BgNODYxN...
    WhatsappMessageStatus:
      type: string
      description: >-
        WhatsApp message status. One of `accepted`, `failed`, `sent`,
        `delivered`, `read`.

        - `accepted`: The messaging request is accepted by our system.

        - `failed`: A message sent by your business failed to send.

        - `sent`: A message sent by your business is in transit within
        WhatsApp's systems.

        - `delivered`: A message sent by your business was delivered to the
        user's device.

        - `read`: A message sent by your business was read by the user.
      enum:
        - accepted
        - failed
        - sent
        - delivered
        - read
    WhatsappPricingCategory:
      type: string
      description: >-
        WhatsApp pricing category.

        - `referral_conversion`: Indicates a [free entry point
        conversation](https://developers.facebook.com/docs/whatsapp/pricing#free-entry-point-conversations).

        - `authentication`: Indicates the conversation was billed at
        authentication rate.

        - `authentication_international`: Indicates the conversation was
        conversation was billed at the [authentication-international
        rate](https://developers.facebook.com/docs/whatsapp/pricing/authentication-international-rates).

        - `marketing`: Indicates the conversation was billed at authentication
        rate.

        - `marketing_lite`: Indicates the conversation was billed at
        marketing-lite rate.

        - `utility`: Indicates the conversation was billed at utility rate.

        - `service`: Indicates the conversation was billed at service rate.


        See also [Conversation-Based
        Pricing](https://developers.facebook.com/docs/whatsapp/pricing).
      enum:
        - referral_conversion
        - authentication
        - authentication_international
        - marketing
        - marketing_lite
        - utility
        - service
    WhatsappPricingModel:
      type: string
      description: |-
        WhatsApp pricing model.
        - `PMP`: Per-message pricing applies.
        - `CBP`: Conversation-based pricing applies.
      enum:
        - PMP
        - CBP
    WhatsappPricingType:
      type: string
      description: >-
        WhatsApp pricing type. This field is only available in PMP (Per-Message
        Pricing) mode.

        - `regular`: Indicates the message is billable.

        - `free_customer_service`: Indicates the message is free because it was
        either a utility template message or non-template message sent within a
        customer service window.

        - `free_entry_point`: Indicates the message is free because it is part
        of a free-entry point conversation.
      enum:
        - regular
        - free_customer_service
        - free_entry_point
    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
    Error:
      type: object
      required:
        - status
        - code
      properties:
        status:
          type: integer
          format: int32
          pattern: '[45]\d{2}'
          description: >-
            HTTP status code, [RFC 7231, Section
            6](https://datatracker.ietf.org/doc/html/rfc7231#section-6). It
            conveys the HTTP status code used for the convenience of the
            consumer.
          example: 404
        code:
          type: string
          description: >-
            One of a server-defined error codes. Some `4xx` errors that could be
            handled programmatically include an error code that briefly explains
            the error reported.
          example: NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable representation of the error. It is intended as an
            aid to developers and is not suitable for exposure to end users.
          example: The requested resource does not exist.
        target:
          type: string
          description: The target of the error.
          example: ''
        docUrl:
          type: string
          description: A URL to more information about the error.
          example: ''
        requestId:
          type: string
          description: >-
            Each API request has an associated request ID. It conveys the
            response header `YCloud-Request-ID` used for the convenience of the
            consumer.
          example: req_1KjtKI80IKoaJNa6n6p
        whatsappApiError:
          $ref: '#/components/schemas/WhatsappApiError'
          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).


            Note: This field is returned if we tried to request the WhatsApp
            Business API and got an error response.
        metaBusinessAgentApiError:
          $ref: '#/components/schemas/MetaBusinessAgentApiError'
          description: >-
            Sanitized upstream details returned when a Meta Business Agent
            request fails.
    WhatsappConversationType:
      type: string
      description: >-
        Conversation type. There is a charge when the first business message of
        this conversation is delivered, initiating the 24-hour conversation
        session. As such, the conversation type can be `null` before the first
        message is delivered.

        - `FREE_ENTRY`: Conversations originating from a [free entry
        point](https://developers.facebook.com/docs/whatsapp/pricing#free-entry-point-conversations).

        - `FREE_TIER`: Conversations within the monthly [free
        tier](https://developers.facebook.com/docs/whatsapp/pricing#free-tier-conversations).

        - `REGULAR`: Any conversations that did not originate from a [free entry
        point](https://developers.facebook.com/docs/whatsapp/pricing#free-entry-point-conversations)
        or are above the monthly [free
        tier](https://developers.facebook.com/docs/whatsapp/pricing#free-tier-conversations)
        allotment.
      enum:
        - FREE_ENTRY
        - FREE_TIER
        - REGULAR
    WhatsappConversationOriginType:
      type: string
      description: >-
        Indicates [conversation
        category](https://developers.facebook.com/docs/whatsapp/pricing#conversation-categories).
        This can also be referred to as a conversation entry point.

        - `referral_conversion`: Indicates a [free entry point
        conversation](https://developers.facebook.com/docs/whatsapp/pricing#free-entry-point-conversations).

        - `authentication`: Indicates the conversation was opened by a business
        sending template categorized as `AUTHENTICATION` to the customer. This
        applies any time it has been more than 24 hours since the last customer
        message.

        - `marketing`: Indicates the conversation was opened by a business
        sending template categorized as `MARKETING` to the customer. This
        applies any time it has been more than 24 hours since the last customer
        message.

        - `utility`: Indicates the conversation was opened by a business sending
        template categorized as `UTILITY` to the customer. This applies any time
        it has been more than 24 hours since the last customer message.

        - `service`: Indicates that the conversation opened by a business
        replying to a customer within a [customer service
        window](https://developers.facebook.com/docs/whatsapp/pricing#customer-service-windows).
      enum:
        - referral_conversion
        - authentication
        - marketing
        - utility
        - service
    WhatsappMessageTemplateComponent:
      type: object
      description: Component object containing the parameters of the message.
      required:
        - type
      properties:
        type:
          type: string
          description: Component type.
          enum:
            - header
            - body
            - button
            - limited_time_offer
            - carousel
            - order_status
        sub_type:
          type: string
          description: >-
            **Required when type is `button`.**

            Type of button.

            - `quick_reply`: Refers to a previously created quick reply button
            that allows for the customer to return a predefined message.

            - `url`: Refers to a previously created url button that allows the
            customer to visit the URL generated by appending the text parameter
            to the predefined prefix URL in the template.

            - `copy_code`: Refers to a previously created copy code button that
            allows the customer to 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.

            - `catalog`: Refers to a previously created catalog button that
            allows the customer to view your product catalog.

            - `mpm`: Refers to a previously created MPM (multi-product message)
            button that allows the customer to browser products and sections.

            - `flow`: Refers to a previously created flow button that allows the
            customer to interact with a
            [flow](https://developers.facebook.com/docs/whatsapp/flows).

            - `order_details`: Refers to a previously created order details
            button that allows the customer to view the details of an order.
          enum:
            - quick_reply
            - url
            - copy_code
            - catalog
            - mpm
            - flow
            - order_details
        index:
          type: integer
          format: int32
          minimum: 0
          maximum: 9
          description: >-
            **Required when `type` = `button`. Not used for the other types.**

            Indicates order in which button should appear, if the template uses
            multiple buttons.

            Buttons are zero-indexed, so setting value to 0 will cause the
            button to appear first, and another button with an index of 1 will
            appear next, etc.
        parameters:
          type: array
          description: >-
            **Required when `type` = `button`, or there are variables in the
            corresponding template component, or the template `HEADER` format is
            media (`IMAGE`, `VIDEO`, or `DOCUMENT`).**

            Array of parameter objects with the content of the message.
          items:
            $ref: '#/components/schemas/WhatsappMessageTemplateComponentParameter'
        cards:
          type: array
          description: >-
            Use for `carousel` components. Provides card components containing
            the parameters of the message.
          items:
            $ref: '#/components/schemas/WhatsappMessageTemplateComponentCard'
    WhatsappMessageInteractiveAction:
      type: object
      description: >-
        **Required.**

        Action you want the user to perform after reading the `interactive`
        message.
      properties:
        buttons:
          type: array
          description: Required for Reply Buttons. You can have up to 3 buttons.
          minItems: 1
          maxItems: 3
          items:
            $ref: '#/components/schemas/WhatsappMessageInteractiveActionButton'
        button:
          type: string
          description: >-
            Required for List Messages. Button content. It cannot be an empty
            string and must be unique within the message. Emojis are supported,
            markdown is not. Maximum length: 20 characters.
          maxLength: 20
        catalog_id:
          type: string
          description: >-
            Required for Single Product Messages and Multi-Product Messages.

            Unique identifier of the Facebook catalog linked to your WhatsApp
            Business Account. This ID can be retrieved via the [Meta Commerce
            Manager](https://business.facebook.com/commerce).
        product_retailer_id:
          type: string
          description: |-
            Required for Single Product Messages.
            Unique identifier of the product in a catalog.
        sections:
          type: array
          description: |-
            Required for List Messages and Multi-Product Messages.
            Array of section objects. Minimum of 1, maximum of 10.
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/WhatsappMessageInteractiveActionSection'
        name:
          type: string
          description: >-
            Action name.

            Required for Call-To-Action (CTA) buttons.

            - `cta_url`: Use for Call-To-Action (CTA) URL buttons.

            - `catalog_message`: Use for Catalog Messages.

            - `send_location`: Use for Location Request buttons.

            - `flow`: Use for Flow buttons.

            - `review_and_pay`: Use for Order Details buttons.

            - `review_order`: Use for Order Status buttons.

            - `voice_call`: Use for Voice Call buttons.

            - `request_contact_info`: Use for Request Contact Information
            buttons.
          enum:
            - cta_url
            - catalog_message
            - send_location
            - flow
            - review_and_pay
            - review_order
            - voice_call
            - request_contact_info
        parameters:
          $ref: '#/components/schemas/WhatsappMessageInteractiveActionParameters'
        cards:
          type: array
          description: |-
            Required for Carousel Messages.
            Array of card objects. Minimum of 2, maximum of 10.
          minItems: 2
          maxItems: 10
          items:
            $ref: '#/components/schemas/WhatsappMessageInteractiveActionCard'
      not:
        allOf:
          - not:
              required:
                - buttons
          - not:
              required:
                - button
                - sections
          - not:
              required:
                - catalog_id
                - product_retailer_id
          - not:
              required:
                - catalog_id
                - sections
          - not:
              required:
                - name
          - not:
              required:
                - cards
    WhatsappMessageInteractiveBody:
      type: object
      description: Optional for type `product`. Required for other message types.
      required:
        - text
      properties:
        text:
          type: string
          description: >-
            The body content of the message. Emojis and markdown are supported.
            Maximum length: 1024 characters.
          maxLength: 1024
    WhatsappMessageInteractiveHeader:
      type: object
      description: Required for type `product_list`. Optional for other types.
      required:
        - type
      properties:
        type:
          description: >-
            The media type for the interactive message header. Determines which
            media field should be populated (text, image, video, or document).
          type: string
          enum:
            - text
            - image
            - video
            - document
        text:
          type: string
          description: Text for the header. Formatting allows emojis, but not markdown.
          maxLength: 60
        image:
          $ref: '#/components/schemas/WhatsappMessageInteractiveMedia'
        video:
          $ref: '#/components/schemas/WhatsappMessageInteractiveMedia'
        document:
          $ref: '#/components/schemas/WhatsappMessageInteractiveMedia'
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - text
              - not:
                  required:
                    - text
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - image
              - not:
                  required:
                    - image
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - video
              - not:
                  required:
                    - video
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - document
              - not:
                  required:
                    - document
    WhatsappMessageInteractiveFooter:
      type: object
      description: Optional. An object with the footer of the message.
      required:
        - text
      properties:
        text:
          type: string
          description: >-
            The footer content. Emojis and markdown are supported. Links are
            supported. Maximum length: 60 characters.
          maxLength: 60
    WhatsappMessageContactAddress:
      type: object
      description: Full contact address(es) formatted as an addresses object.
      properties:
        street:
          type: string
          description: Street number and name.
        city:
          type: string
          description: City name.
        state:
          type: string
          description: State abbreviation.
        zip:
          type: string
          description: ZIP code.
        country:
          type: string
          description: Full country name.
        country_code:
          type: string
          description: Two-letter country abbreviation.
        type:
          type: string
          description: Standard values are `HOME` and `WORK`.
          example: WORK
    WhatsappMessageContactEmail:
      type: object
      description: Contact email address(es) formatted as an emails object.
      properties:
        email:
          type: string
          description: Email address.
        type:
          type: string
          description: Standard values are `HOME` and `WORK`.
          example: WORK
    WhatsappMessageContactName:
      type: object
      description: Full contact name formatted as a name object.
      required:
        - formatted_name
      properties:
        formatted_name:
          type: string
          description: Full name, as it normally appears.
        first_name:
          type: string
          description: First name.
        last_name:
          type: string
          description: Last name.
        middle_name:
          type: string
          description: Middle name.
        suffix:
          type: string
          description: Name suffix.
        prefix:
          type: string
          description: Name prefix.
    WhatsappMessageContactOrg:
      type: object
      description: Contact organization information formatted as an org object.
      properties:
        company:
          type: string
          description: Name of the contact's company.
        department:
          type: string
          description: Name of the contact's department.
        title:
          type: string
          description: Contact's business title.
    WhatsappMessageContactPhone:
      type: object
      properties:
        phone:
          type: string
          description: >-
            Automatically populated with the `wa_id` value as a formatted phone
            number.
        type:
          type: string
          description: Standard Values are `CELL`, `MAIN`, `IPHONE`, `HOME`, and `WORK`.
        wa_id:
          type: string
          description: WhatsApp ID.
    WhatsappMessageContactUrl:
      type: object
      properties:
        url:
          type: string
          description: URL.
        type:
          type: string
          description: Standard values are `HOME` and `WORK`.
    MetaBusinessAgentApiError:
      type: object
      description: Sanitized details from a failed Meta Business Agent upstream request.
      properties:
        title:
          type: string
        detail:
          type: string
        type:
          type: string
        status:
          type: integer
          format: int32
        requestId:
          type: string
    WhatsappMessageTemplateComponentParameter:
      type: object
      properties:
        type:
          type: string
          description: >-
            **Required.**

            Component parameter type.

            - `text`: Used when the template component type is `BODY`, or the
            `HEADER` component format is `TEXT`.

            - `image`: Used when the template `HEADER` component is `IMAGE`.

            - `gif`: Used when the template `HEADER` component is `GIF`.

            - `video`: Used when the template `HEADER` component is `VIDEO`.

            - `document`: Used when the template `HEADER` component is
            `DOCUMENT`.

            - `payload`: Used when the template component button type is
            `QUICK_REPLY`.

            - `coupon_code`: Used when the template component button type is
            `COPY_CODE`.

            - `limited_time_offer`: Used when the template component type is
            `LIMITED_TIME_OFFER`.

            - `action`: Used when the template component button type is
            `CATALOG`, `MPM`, `FLOW`, or `ORDER_DETAILS`.

            - `order_status`: Used when the template subcategory is
            `ORDER_STATUS`.

            - `location`: Used when the template `HEADER` component is
            `LOCATION`.

            - `group_id`: Used by WhatsApp group invite link templates.
          enum:
            - text
            - image
            - gif
            - video
            - document
            - payload
            - coupon_code
            - limited_time_offer
            - action
            - order_status
            - location
            - group_id
        text:
          type: string
          description: >-
            **Required when `type` = `text`.**

            The message's text. For the header component, the character limit is
            60 characters. For the body component, the character limit is 1024
            characters.

            For url buttons, it indicates the developer-provided suffix that is
            appended to the predefined prefix URL in the template.
        payload:
          type: string
          description: >-
            Required for `quick_reply` buttons.

            Developer-defined payload that is returned when the button is
            clicked in addition to the display text on the button.
        coupon_code:
          type: string
          description: |-
            **Required when `type` = `coupon_code`.**
            The coupon code to be copied when the customer taps the button.
        image:
          $ref: '#/components/schemas/WhatsappMessageMedia'
          description: '**Required when the template `HEADER` format is `IMAGE`.**'
        gif:
          $ref: '#/components/schemas/WhatsappMessageMedia'
          description: '**Required when the template `HEADER` format is `GIF`.**'
        video:
          $ref: '#/components/schemas/WhatsappMessageMedia'
          description: '**Required when the template `HEADER` format is `VIDEO`.**'
        document:
          $ref: '#/components/schemas/WhatsappMessageMedia'
          description: '**Required when the template `HEADER` format is `DOCUMENT`.**'
        limited_time_offer:
          $ref: >-
            #/components/schemas/WhatsappMessageTemplateComponentParameterLimitedTimeOffer
        action:
          $ref: '#/components/schemas/WhatsappMessageTemplateComponentParameterAction'
        order_status:
          $ref: '#/components/schemas/WhatsappMessageOrderStatus'
        location:
          $ref: '#/components/schemas/WhatsappMessageLocation'
          description: '**Required when `type` = `location`.**'
        group_id:
          type: string
          description: |-
            **Required when `type` = `group_id`.**
            WhatsApp group ID used by group invite link templates.
          example: 120363345678901234@g.us
      required:
        - type
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - text
              - not:
                  required:
                    - text
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - image
              - not:
                  required:
                    - image
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - gif
              - not:
                  required:
                    - gif
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - video
              - not:
                  required:
                    - video
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - document
              - not:
                  required:
                    - document
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - payload
              - not:
                  required:
                    - payload
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - coupon_code
              - not:
                  required:
                    - coupon_code
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - limited_time_offer
              - not:
                  required:
                    - limited_time_offer
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - action
              - not:
                  required:
                    - action
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - order_status
              - not:
                  required:
                    - order_status
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - location
              - not:
                  required:
                    - location
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - group_id
              - not:
                  required:
                    - group_id
    WhatsappMessageTemplateComponentCard:
      type: object
      description: Card component containing the parameters of the message.
      required:
        - card_index
      properties:
        card_index:
          type: integer
          format: int32
          description: >-
            **Required.**

            Zero-indexed order in which card appears within the card carousel. 0
            indicates first card, 1 indicates second card, etc.
          minimum: 0
          maximum: 9
        components:
          type: array
          description: Card component.
          items:
            $ref: '#/components/schemas/WhatsappMessageTemplateComponentCardComponent'
    WhatsappMessageInteractiveActionButton:
      type: object
      description: A button object in `interactive` messages.
      required:
        - type
        - reply
      properties:
        type:
          description: >-
            The button type. Only `reply` is supported for interactive reply
            buttons.
          type: string
          enum:
            - reply
        reply:
          type: object
          required:
            - id
            - title
          properties:
            title:
              type: string
              description: >-
                Button title. It cannot be an empty string and must be unique
                within the message. Emojis are supported, markdown is not.
                Maximum length: 20 characters.
              maxLength: 20
            id:
              type: string
              description: >-
                Unique identifier for your button. This ID is returned in the
                webhook when the button is clicked by the user. Maximum length:
                256 characters. You cannot have leading or trailing spaces when
                setting the ID.
              maxLength: 256
    WhatsappMessageInteractiveActionSection:
      type: object
      description: WhatsApp Message Interactive Section Object.
      properties:
        title:
          type: string
          description: |-
            **Required if the message has more than one section.**
            Title of the section. Maximum length: 24 characters.
          maxLength: 24
        rows:
          type: array
          description: >-
            Contains a list of rows. You can have a total of 10 rows across your
            sections.

            Each row must have a title (Maximum length: 24 characters) and an ID
            (Maximum length: 200 characters). You can add a description (Maximum
            length: 72 characters), but it is optional.
          maxItems: 10
          minItems: 1
          items:
            $ref: '#/components/schemas/WhatsappMessageInteractiveActionSectionRow'
        product_items:
          type: array
          description: >-
            Required for Multi-Product Messages.

            Array of product objects. There is a minimum of 1 product per
            section and a maximum of 30 products across all sections.
          minItems: 1
          maxItems: 30
          items:
            $ref: >-
              #/components/schemas/WhatsappMessageInteractiveActionSectionProductItem
    WhatsappMessageInteractiveActionParameters:
      type: object
      description: |-
        Action parameters.
        Required for Call-To-Action (CTA) buttons.
      properties:
        display_text:
          type: string
          description: |-
            Text of the CTA URL button.
            Maximum length: 20 bytes.
          maxLength: 20
          example: See Docs
        url:
          type: string
          description: URL of the CTA URL button.
          example: https://developers.facebook.com/docs/whatsapp
        thumbnail_product_retailer_id:
          type: string
          description: >-
            Item SKU number. Labeled as **Content ID** in the [Commerce
            Manager](https://business.facebook.com/commerce).

            The thumbnail of this item will be used as the message's header
            image.
        flow_message_version:
          type: string
          description: |-
            Use for `flow` buttons.
            Value must be "3".
          enum:
            - '3'
        flow_token:
          type: string
          description: >-
            Use for `flow` buttons.

            Flow token that is generated by the business to serve as an
            identifier. Defaults to `unused`.
        flow_id:
          type: string
          description: >-
            Conditionally required for `flow` buttons. Unique ID of the Flow
            provided by WhatsApp. Cannot be used with the `flow_name` parameter.
        flow_name:
          type: string
          description: >-
            Conditionally required for `flow` buttons.

            The name of the Flow that you created. Cannot be used with the
            `flow_id` parameter. Changing the Flow name will require updating
            this parameter to match the new name.
        flow_cta:
          type: string
          description: >-
            Required for `flow` buttons.

            Text on the CTA button. For example: "Open flow!". Maximum length:
            20 characters.
          maxLength: 20
          example: Open flow!
        flow_action:
          type: string
          description: |-
            Use for `flow` buttons.
            Either `navigate` or `data_exchange`. Defaults to `navigate`.
          enum:
            - navigate
            - data_exchange
          example: navigate
        flow_action_payload:
          type: object
          description: >-
            Optional when `flow_action` is `navigate`. Use it to select an entry
            screen and provide initial screen data. If omitted, WhatsApp opens
            the Flow at its default entry screen. Omit this field for other
            actions.
          properties:
            screen:
              type: string
              description: >-
                The ID of the screen displayed first. It needs to be an
                **entry** screen.
            data:
              type: object
              description: Optional input data for the first screen of the Flow.
        reference_id:
          type: string
          description: >-
            Required for `review_and_pay` buttons.

            Unique identifier for the order provided by the business. It is case
            sensitive and cannot be an empty string and can only contain English
            letters, numbers, underscores, dashes, or dots, and should not
            exceed 35 characters.


            The `reference_id` must be unique for each order_details message for
            a given business. If there is a need to send multiple order_details
            messages for the same order, it is recommended to include a sequence
            number in the reference_id (for example, "BM345A-12") to ensure
            reference_id uniqueness.
        type:
          type: string
          description: >-
            Required for `review_and_pay` buttons.

            The type of goods being paid for in this order. Current supported
            options are `digital-goods` and `physical-goods`.
          enum:
            - digital-goods
            - physical-goods
        beneficiaries:
          type: array
          description: >-
            Required for `physical-goods` orders sent with `review_and_pay`
            buttons.

            An array of beneficiaries for this order.

            A beneficiary is an intended recipient for shipping the physical
            goods in the order.

            Beneficiary information isn't shown to users but is needed for legal
            and compliance reasons.
          items:
            $ref: '#/components/schemas/WhatsappMessageOrderBeneficiary'
        currency:
          type: string
          description: |-
            Required for `review_and_pay` buttons.
            The currency for this order.
            Currently the only supported value is `INR`.
          enum:
            - INR
        total_amount:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: |-
            Required for `review_and_pay` buttons.
            The total amount for this order.
        order:
          $ref: '#/components/schemas/WhatsappMessageOrderInfo'
          description: >-
            Required for `review_and_pay` or `review_order` buttons.


            For `review_and_pay` buttons, provides order `status`, `items`,
            `subtotal`, `tax`, etc.


            For `review_order` buttons, provides only order `status` and
            `description`.
        payment_settings:
          type: array
          description: |-
            Required for `review_and_pay` buttons.
            Payment settings for the order.
          items:
            $ref: '#/components/schemas/WhatsappMessageOrderPaymentSetting'
      not:
        anyOf:
          - required:
              - flow_id
              - flow_name
          - allOf:
              - properties:
                  flow_action:
                    enum:
                      - data_exchange
              - required:
                  - flow_action
                  - flow_action_payload
    WhatsappMessageInteractiveActionCard:
      type: object
      description: >-
        A card object in `interactive` messages. All cards must have the same
        structure.
      required:
        - card_index
        - type
        - header
        - action
      properties:
        card_index:
          type: integer
          minimum: 0
          maximum: 9
          description: Card index. Unique index for each card (0-9).
        type:
          description: >-
            The card type. Must be `cta_url` for carousel cards with
            call-to-action URL buttons.
          type: string
          enum:
            - cta_url
        header:
          $ref: '#/components/schemas/WhatsappMessageInteractiveActionCardHeader'
        body:
          $ref: '#/components/schemas/WhatsappMessageInteractiveActionCardBody'
        action:
          $ref: '#/components/schemas/WhatsappMessageInteractiveActionCardAction'
    WhatsappMessageInteractiveMedia:
      type: object
      description: >-
        Media used in an interactive message header. Requests must reference an
        HTTPS URL. Responses may include the uploaded WhatsApp media ID for
        compatibility.
      not:
        allOf:
          - not:
              required:
                - id
          - not:
              required:
                - link
      properties:
        id:
          type: string
          readOnly: true
          description: >-
            Uploaded WhatsApp media ID returned in message responses. This
            response-only field cannot be used to send an interactive message
            header.
        link:
          type: string
          format: uri
          pattern: ^https://
          description: Publicly accessible HTTPS URL of the media resource.
        caption:
          type: string
          description: Optional media caption.
        filename:
          type: string
          description: Optional filename for document media.
    WhatsappMessageTemplateComponentParameterLimitedTimeOffer:
      type: object
      description: Required if template uses offer expiration details.
      required:
        - expiration_time_ms
      properties:
        expiration_time_ms:
          type: integer
          format: int64
          description: |-
            **Required.**
            Offer code expiration time as a UNIX timestamp in milliseconds.
          example: '1698562800000'
    WhatsappMessageTemplateComponentParameterAction:
      type: object
      description: >-
        Required if template uses catalog or MPM (multi-product message)
        buttons.
      properties:
        thumbnail_product_retailer_id:
          type: string
          description: >-
            **Optional.**

            Use for catalog and MPM template messages.

            Item SKU number. Labeled as Content ID in the Commerce Manager.

            The thumbnail of this item will be used as the message's header
            image.

            If the `parameters` object is omitted, the product image of the
            first item in your catalog will be used.
          example: 2lc20305pt
        sections:
          type: array
          description: |-
            Use for MPM templates.
            Product sections. You can define up to 10 sections.
          maxItems: 10
          items:
            $ref: >-
              #/components/schemas/WhatsappMessageTemplateComponentParameterActionSection
        flow_token:
          type: string
          description: >-
            Use for `FLOW` buttons.

            Flow token that is generated by the business to serve as an
            identifier. Defaults to `unused`.
        flow_action_data:
          type: object
          description: |-
            Use for `FLOW` buttons.
            JSON object with the data payload for the first screen.
        order_details:
          $ref: '#/components/schemas/WhatsappMessageOrderDetails'
          description: Required for `order_details` buttons.
    WhatsappMessageOrderStatus:
      type: object
      properties:
        reference_id:
          type: string
          description: Unique identifier for the order provided by the business.
        order:
          $ref: '#/components/schemas/WhatsappMessageOrderInfo'
          description: >-
            Provides only `status` and `description` of this order for
            `order_status` messages.
    WhatsappMessageTemplateComponentCardComponent:
      type: object
      description: Card component object containing the parameters of the message.
      required:
        - type
      properties:
        type:
          type: string
          description: Component type.
          enum:
            - header
            - body
            - button
        sub_type:
          type: string
          description: >-
            **Required when type is `button`.**

            Type of button.

            - `quick_reply`: Refers to a previously created quick reply button
            that allows for the customer to return a predefined message.

            - `url`: Refers to a previously created url button that allows the
            customer to visit the URL generated by appending the text parameter
            to the predefined prefix URL in the template.
          enum:
            - quick_reply
            - url
        index:
          type: integer
          format: int32
          minimum: 0
          maximum: 9
          description: >-
            **Required when `type` = `button`. Not used for the other types.**

            Indicates order in which button should appear, if the template uses
            multiple buttons.

            Buttons are zero-indexed, so setting value to 0 will cause the
            button to appear first, and another button with an index of 1 will
            appear next, etc.
        parameters:
          type: array
          description: >-
            **Required when `type` = `button`, or there are variables in the
            corresponding template component, or the card component `HEADER`
            format is media (`IMAGE`, `VIDEO`).**

            Array of parameter objects with the content of the message.
          items:
            $ref: '#/components/schemas/WhatsappMessageTemplateComponentParameter'
    WhatsappMessageInteractiveActionSectionRow:
      type: object
      required:
        - id
        - title
      properties:
        id:
          type: string
          description: 'Unique row ID. Maximum length: 200 characters.'
          maxLength: 200
        title:
          type: string
          description: 'Row title content. Maximum length: 24 characters.'
          maxLength: 24
        description:
          type: string
          description: 'Row description content. Maximum length: 72 characters.'
          maxLength: 72
    WhatsappMessageInteractiveActionSectionProductItem:
      type: object
      required:
        - product_retailer_id
      properties:
        product_retailer_id:
          type: string
          description: |-
            Required for Multi-Product Messages.
            Unique identifier of the product in a catalog.
    WhatsappMessageOrderBeneficiary:
      type: object
      description: >-
        A beneficiary is an intended recipient for shipping the physical goods
        in the order.

        Beneficiary information isn't shown to users but is needed for legal and
        compliance reasons.
      required:
        - name
        - address_line1
        - city
        - state
        - country
        - postal_code
      properties:
        name:
          type: string
          description: >-
            Name of the individual or business receiving the physical goods.
            Cannot exceed 200 characters.
          maxLength: 200
        address_line1:
          type: string
          description: >-
            Shipping address (Door/Tower Number, Street Name etc.). Cannot
            exceed 100 characters.
          maxLength: 100
        address_line2:
          type: string
          description: >-
            Shipping address (Landmark, Area, etc.). Cannot exceed 100
            characters.
          maxLength: 100
        city:
          type: string
          description: Name of the city.
        state:
          type: string
          description: Name of the state.
        country:
          type: string
          description: |-
            Name of the country.
            Currently the only supported value is `India`.
        postal_code:
          type: string
          description: 6-digit zipcode of shipping address.
          minLength: 6
          maxLength: 6
    WhatsappMessageOrderAmount:
      type: object
      description: Represents the amount of an order.
      required:
        - offset
        - value
      properties:
        offset:
          type: integer
          format: int32
          description: Must be `100` for `INR`.
          example: 100
        value:
          type: integer
          format: int32
          description: |-
            Positive integer representing the amount value multiplied by offset.
            For example, ₹12.34 has value 1234.
          example: 1234
        description:
          type: string
          description: |-
            Use only for `tax`, `shipping`, or `discount`.
            Description of the amount. Max character limit is 60 characters.
          maxLength: 60
        discount_program_name:
          type: string
          description: >-
            Use only for `discount`.

            Text used for defining incentivised orders. If order is
            incentivised, the merchant needs to define this information. Max
            character limit is 60 characters.
          maxLength: 60
    WhatsappMessageOrderInfo:
      type: object
      description: Order info.
      properties:
        status:
          $ref: '#/components/schemas/WhatsappMessageOrderStatusEnum'
        type:
          type: string
          description: >-
            Only supported value is `quick_pay`.

            When this field is passed in we hide the "Review and Pay" button and
            only show the "Pay Now" button in the order details bubble.
        catalog_id:
          type: string
          description: >-
            Unique identifier of the Facebook catalog being used by the
            business.

            If you do not provide this field, you must provide the following
            fields inside the items object: `country_of_origin`,
            `importer_name`, and `importer_address`.
        items:
          type: array
          description: Array of items in the order.
          items:
            $ref: '#/components/schemas/WhatsappMessageOrderItem'
        subtotal:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: >-
            The value **must be equal** to sum of `order.amount.value` *
            `order.amount.quantity`.
        tax:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: The tax information for this order.
        shipping:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: The shipping cost of the order.
        discount:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: The discount amount for this order.
        expiration:
          $ref: '#/components/schemas/WhatsappMessageOrderExpiration'
        description:
          type: string
          description: >-
            **Optional.**

            Text for sharing status related information. Could be useful while
            sending cancellation. Max character limit is 120 characters.
          maxLength: 120
    WhatsappMessageOrderPaymentSetting:
      type: object
      description: Payment settings for the order.
      required:
        - type
        - payment_gateway
      properties:
        type:
          type: string
          description: Must be set to `payment_gateway`.
          example: payment_gateway
        payment_gateway:
          $ref: '#/components/schemas/WhatsappMessageOrderPaymentGateway'
    WhatsappMessageInteractiveActionCardHeader:
      type: object
      required:
        - type
      properties:
        type:
          description: >-
            The media type for the carousel card header. Must be either `image`
            or `video`.
          type: string
          enum:
            - image
            - video
        image:
          $ref: '#/components/schemas/WhatsappMessageInteractiveMedia'
        video:
          $ref: '#/components/schemas/WhatsappMessageInteractiveMedia'
      allOf:
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - image
              - not:
                  required:
                    - image
        - not:
            allOf:
              - properties:
                  type:
                    enum:
                      - video
              - not:
                  required:
                    - video
    WhatsappMessageInteractiveActionCardBody:
      type: object
      description: Optional for card.
      required:
        - text
      properties:
        text:
          type: string
          description: Max 160 chars, and up to 2 line breaks.
          maxLength: 160
    WhatsappMessageInteractiveActionCardAction:
      type: object
      description: >-
        A button object in `interactive` messages.

        Cards must include either one URL button, or one or more quick-reply
        buttons. Button types and numbers must match across all cards (for
        example, if you define a card with 2 quick-reply buttons, all cards must
        define exactly 2 quick-reply buttons).
      allOf:
        - not:
            allOf:
              - not:
                  required:
                    - name
                    - parameters
              - not:
                  required:
                    - buttons
        - not:
            allOf:
              - required:
                  - name
                  - parameters
              - required:
                  - buttons
      properties:
        name:
          type: string
          description: Required when card action is url button. Must be "cta_url".
          enum:
            - cta_url
        parameters:
          $ref: >-
            #/components/schemas/WhatsappMessageInteractiveActionCardActionParameters
        buttons:
          type: array
          description: Required when card action is quick reply button.
          minItems: 1
          items:
            $ref: >-
              #/components/schemas/WhatsappMessageInteractiveActionCardActionButton
    WhatsappMessageTemplateComponentParameterActionSection:
      type: object
      properties:
        title:
          type: string
          description: |-
            Section title text.
            Maximum 24 characters. Markdown is not supported.
          maxLength: 24
        product_items:
          type: array
          description: >-
            Array of product SKU numbers. There is a minimum of 1 product per
            section and a maximum of 30 products across all sections.
          minItems: 1
          maxItems: 30
          items:
            $ref: >-
              #/components/schemas/WhatsappMessageTemplateComponentParameterActionSectionProductItem
    WhatsappMessageOrderDetails:
      type: object
      description: >-
        Contains the order details when sending a template message with a
        `order_details` button.
      required:
        - currency
        - order
        - reference_id
        - total_amount
        - type
        - payment_settings
      properties:
        currency:
          type: string
          description: |-
            The currency for this order.
            Currently the only supported value is `INR`.
        order:
          $ref: '#/components/schemas/WhatsappMessageOrderInfo'
          description: Provides order `status`, `items`, `subtotal`, `tax`, etc.
        reference_id:
          type: string
          description: >-
            Unique identifier for the order provided by the business. It is case
            sensitive and cannot be an empty string and can only contain English
            letters, numbers, underscores, dashes, or dots, and should not
            exceed 35 characters.


            The `reference_id` must be unique for each order_details message for
            a given business. If there is a need to send multiple order_details
            messages for the same order, it is recommended to include a sequence
            number in the reference_id (for example, "BM345A-12") to ensure
            reference_id uniqueness.
        total_amount:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: The total amount of the order.
        type:
          type: string
          description: >-
            The type of goods being paid for in this order. Current supported
            options are `digital-goods` and `physical-goods`.
        payment_settings:
          type: array
          description: Payment settings for the order.
          items:
            $ref: '#/components/schemas/WhatsappMessageOrderPaymentSetting'
    WhatsappMessageOrderStatusEnum:
      type: string
      description: >-
        Only supported value in the `order_details` message is `pending`.

        In an `order_status` message, `status` can be: `pending`, `processing`,
        `partially_shipped`, `shipped`, `completed`, or `canceled`.
      enum:
        - pending
        - processing
        - partially_shipped
        - shipped
        - completed
        - canceled
    WhatsappMessageOrderItem:
      type: object
      required:
        - name
        - amount
        - quantity
      properties:
        retailer_id:
          type: string
          description: Content ID for an item in the order from your catalog.
        name:
          type: string
          description: >-
            The item's name to be displayed to the user. Cannot exceed 60
            characters.
          maxLength: 60
        image:
          $ref: '#/components/schemas/WhatsappMessageMedia'
          description: Custom image for the item to be displayed to the user.
        amount:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: The price per item.
        sale_amount:
          $ref: '#/components/schemas/WhatsappMessageOrderAmount'
          description: >-
            The discounted price per item. This should be less than the original
            amount. If included, this field is used to calculate the subtotal
            amount.
        quantity:
          type: integer
          format: int32
          description: The number of items in the order.
        country_of_origin:
          type: string
          description: |-
            Required if `catalog_id` is not present.
            The country of origin of the product.
        importer_name:
          type: string
          description: |-
            Required if `catalog_id` is not present.
            Name of the importer company.
        importer_address:
          type: string
          description: |-
            Required if `catalog_id` is not present.
            Address of importer company.
    WhatsappMessageOrderExpiration:
      type: object
      description: Expiration for this order.
      required:
        - timestamp
      properties:
        timestamp:
          type: string
          description: >-
            A string of UTC timestamp in seconds of time when order should
            expire. Minimum threshold is 300 seconds.
          example: '1727438564'
        description:
          type: string
          description: Text explanation for expiration.
          maxLength: 120
    WhatsappMessageOrderPaymentGateway:
      type: object
      description: An object that describes payment account information.
      required:
        - type
        - configuration_name
      properties:
        type:
          type: string
          description: >-
            Payment type.

            Must set this to `billdesk`, `razorpay`, `payu`, or `zaakpay`, if
            you have linked your BillDesk, Razorpay, PayU, or Zaakpay payment
            gateway to accept payments.
          enum:
            - billdesk
            - razorpay
            - payu
            - zaakpay
        configuration_name:
          type: string
          description: >-
            The name of the pre-configured payment configuration to use for this
            order and must not exceed 60 characters.

            This value must match with a payment configuration set up on the
            WhatsApp Business Manager.
          maxLength: 60
        billdesk:
          $ref: >-
            #/components/schemas/WhatsappMessageOrderPaymentSettingPaymentGatewayBilldesk
        payu:
          $ref: >-
            #/components/schemas/WhatsappMessageOrderPaymentSettingPaymentGatewayPayu
        razorpay:
          $ref: >-
            #/components/schemas/WhatsappMessageOrderPaymentSettingPaymentGatewayRazorpay
        zaakpay:
          $ref: >-
            #/components/schemas/WhatsappMessageOrderPaymentSettingPaymentGatewayZaakpay
    WhatsappMessageInteractiveActionCardActionParameters:
      type: object
      description: >-
        Required when card action is url button. Only support `display_text` and
        `url`. Button display text Max 20 chars.
      required:
        - display_text
        - url
      properties:
        display_text:
          type: string
          description: |-
            Text of the CTA URL button.
            Maximum length: 20 bytes.
          maxLength: 20
          example: See Docs
        url:
          type: string
          description: URL of the CTA URL button.
          example: https://developers.facebook.com/docs/whatsapp
    WhatsappMessageInteractiveActionCardActionButton:
      type: object
      required:
        - type
        - quick_reply
      properties:
        type:
          description: >-
            The button type. Must be `quick_reply` for carousel card quick reply
            buttons.
          type: string
          enum:
            - quick_reply
        quick_reply:
          type: object
          required:
            - id
            - title
          properties:
            title:
              type: string
              description: >-
                Button title. It cannot be an empty string and must be unique
                within the message. Emojis are supported, markdown is not.
                Maximum length: 20 characters.
              maxLength: 20
            id:
              type: string
              description: >-
                Unique identifier for your button. This ID is returned in the
                webhook when the button is clicked by the user. Maximum length:
                20 characters. You cannot have leading or trailing spaces when
                setting the ID.
              maxLength: 20
    WhatsappMessageTemplateComponentParameterActionSectionProductItem:
      type: object
      required:
        - product_retailer_id
      properties:
        product_retailer_id:
          type: string
          description: >-
            SKU number of the item you want to appear in the section.

            SKU numbers are labeled as **Content ID** in the [Commerce
            Manager](https://business.facebook.com/commerce).
    WhatsappMessageOrderPaymentSettingPaymentGatewayBilldesk:
      type: object
      description: >-
        Additional info for BillDesk.

        User-defined fields (extra) are used to store any information
        corresponding to a particular order. Each extra field has a maximum
        character limit of 120.
      properties:
        additional_info1:
          type: string
        additional_info2:
          type: string
        additional_info3:
          type: string
        additional_info4:
          type: string
        additional_info5:
          type: string
        additional_info6:
          type: string
        additional_info7:
          type: string
    WhatsappMessageOrderPaymentSettingPaymentGatewayPayu:
      type: object
      description: >-
        Additional info for PayU.

        User-defined fields (udf) are used to store any information
        corresponding to a particular order. Each UDF field has a maximum
        character limit of 255.
      properties:
        udf1:
          type: string
        udf2:
          type: string
        udf3:
          type: string
        udf4:
          type: string
    WhatsappMessageOrderPaymentSettingPaymentGatewayRazorpay:
      type: object
      description: Additional info for Razorpay.
      properties:
        receipt:
          type: string
          description: >-
            Receipt number that corresponds to this order, set for your internal
            reference.

            Maximum length of 40 characters supported with minimum length
            greater than 0 characters.
        notes:
          type: object
          additionalProperties:
            type: string
          description: >-
            The object can be key value pairs with maximum 15 keys and each
            value limits to 256 characters.
    WhatsappMessageOrderPaymentSettingPaymentGatewayZaakpay:
      type: object
      description: >-
        Additional info for Zaakpay.

        User-defined fields (extra) are used to store any information
        corresponding to a particular order. Each extra field has a maximum
        character limit of 180.
      properties:
        extra1:
          type: string
        extra2:
          type: string
  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.