Skip to main content
For the exhaustive schema-derived catalog, see all examples.

What it is

Handle inbound WhatsApp message types with annotated payload examples.

Before you begin

  • Create a public HTTPS endpoint in your application.
  • Configure a YCloud webhook endpoint for the event types you need.
  • Store the endpoint signing secret securely.
  • Make event processing idempotent.

How it works

YCloud sends an HTTP POST request when the event occurs. Verify the signature, durably record the event, return a 2xx response, and process slow work asynchronously.

Request

The scenarios below show requests delivered to your webhook URL. Treat the event id as the delivery identifier and use type to route the payload.

Response

Return a 2xx status after accepting the event.
For endpoint setup, signature validation, and retry behavior, see Configure webhooks.

Inbound unsupported message

In this case, your webhook endpoint received an inbound unsupported message:
  • type is set to unsupported.
  • errors explains why the message is unsupported or unavailable.
  • unsupported.type identifies the message category, such as poll_creation, poll_update, edit, or pin.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • Error 131051 with Message type unknown means that WhatsApp Cloud API does not support the message type.
  • Error 131060 with This message is currently unavailable. means that WhatsApp could not provide the message content.
  • unsupported.type identifies the general category. It does not contain the original message content.
  • See Unsupported messages in Inbox for a readable list of message types. See Meta’s unsupported messages webhook reference for the current payload contract.

Inbound Text message

In this case, your webhook endpoint received an inbound text message:
  • Contains plain text that the user sent.
  • Contains the mentioned message information in context.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • Inbound messages are those sent from customers to your business phone numbers.
  • The context (optional) contains the mentioned message information, typically used to reply to a previous message sent by the user or your business.
    • context.from is the WhatsApp ID (phone number without the ’+’ prefix) of the user who sent the mentioned message.
    • context.id is the original ID of the mentioned message on WhatsApp’s platform, starting with wamid..

Inbound Text message triggered by click to WhatsApp Ads

In this case, your webhook endpoint received an inbound text message triggered by click to WhatsApp Ads:
  • Contains plain.
  • Contains information about the Ad.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Inbound Image message

In this case, your webhook endpoint received an inbound image message:
  • Contains an image URL.
  • Contains caption to describe this image.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The image.link can be directly accessed in a few minutes for the convenience of the consumer, but you should always include an X-API-Key header to download this file within 30 days.

Inbound Video message

In this case, your webhook endpoint received an inbound video message:
  • Contains a video URL.
  • Contains caption to describe this video.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The video.link can be directly accessed in a few minutes for the convenience of the consumer, but you should always include an X-API-Key header to download this file within 30 days.

Inbound Audio message

In this case, your webhook endpoint received an inbound audio message:
  • Contains an audio URL.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The audio.link can be directly accessed in a few minutes for the convenience of the consumer, but you should always include an X-API-Key header to download this file within 30 days.

Inbound Document message

In this case, your webhook endpoint received an inbound document message:
  • Contains a document URL.
  • Contains caption to describe this document.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The document.link can be directly accessed in a few minutes for the convenience of the consumer, but you should always include an X-API-Key header to download this file within 30 days.

Inbound Sticker message

In this case, your webhook endpoint received an inbound sticker message:
  • Contains a sticker URL.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The sticker.link can be directly accessed in a few minutes for the convenience of the consumer, but you should always include an X-API-Key header to download this file within 30 days.

Inbound Location message

In this case, your webhook endpoint received an inbound location message:
  • Contains latitude and longitude of the place.
  • Contains name, address, and URL of the place.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Inbound Contacts message

In this case, your webhook endpoint received an inbound contacts message:
  • Contains one contact with addresses, birthday, emails, name, phones, and other contact fields.
  • Contains origin: contact_request when the user shared the contact in response to a request-contact-info message.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Inbound Reaction message

In this case, your webhook endpoint received an inbound reaction message:
  • Contains the message ID that the user reacts to.
  • Contains the emoji.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The emoji is present when the user reacts to a message with an emoji. If not, it indicates that the user removed the emoji on a message.

Inbound Template Button message

In this case, your webhook endpoint received an inbound template button message:
  • Contains the button text of the template you used when sending a template message.
  • Contains the button payload that you provided when sending a template message.
  • Contains the wamid (context.wamid) of the template message you sent.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Inbound Interactive List Reply message

In this case, your webhook endpoint received an inbound Interactive List Reply message:
  • The interactive field contains the list reply that the user clicked on an interactive message you previously sent.
  • The context field contains information about the interactive message you previously sent to the user.
Click the button to select one item. The recipient replies to your message by selecting one of the items in your previously sent interactive message.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The context contains information about the interactive message you previously sent.
    • context.from is the WhatsApp ID (phone number without the ’+’ prefix) of who sent the interactive message.
    • context.id is the original message ID on WhatsApp’s platform, starting with wamid..

Inbound Interactive Button Reply message

In this case, your webhook endpoint received an inbound Interactive Button Reply message:
  • The interactive field contains the button reply that the user clicked on an interactive message you previously sent.
  • The context field contains information about the interactive message you previously sent to the user.
example-inboundmessage-buttonreply.png

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • The context contains information about the interactive message you previously sent.
    • context.from is the WhatsApp ID (phone number without the ’+’ prefix) of who sent the interactive message.
    • context.id is the original message ID on WhatsApp’s platform, starting with wamid..

Inbound Interactive Flow Response message

Upon flow completion a response message will be sent to the WhatsApp chat. You will receive it in the same way as you receive all other messages from the user - via message webhook. response_json field will contain flow-specific data.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • interactive.type is always nfm_reply. interactive.name is always flow. interactive.body is always Sent.
  • interactive.response_json is flow-specific data. The structure is either defined in flow JSON (see Complete action) or, if flow is using an endpoint, controlled by endpoint (see Final Response Payload in Data Exchange Request). Parse the interactive.response_json JSON string to a JSON object, where its values’ data type can be various. Typically, the values are plain text, except:
    • When it originates from a CheckboxGroup component, the value is a list of strings.
    • When it originates from an OptIn component, the value is a boolean, that is true or false. Currently, if present, the value must be true since there will be no such key included in the response_json if the user didn’t choose opt in.
    • When it originates from a DatePicker component, the value is a string representing Unix timestamp in milliseconds, such as "1725936737548"(i.e., 2024-09-10T02:52:17.548Z). Since Flow JSON version 5.0 , dates will be set in “yyyy-MM-dd” format, which makes the values unrelated to time zones.
  • To send a message with a Flow, see Flow template message, and Interactive Flow message.

Inbound System message

In this case, your webhook endpoint received an inbound system message:
  • The type is set to system, and system.type is set to user_changed_number.
  • A user changes their phone number on WhatsApp, and wa_id is the new WhatsApp ID (phone number without the + prefix).
  • user_id is the new BSUID. parent_user_id is included only when parent BSUIDs are enabled.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Inbound Order message

In this case, your webhook endpoint received an inbound order message when a customer adds one or more products to their cart and submits an order:
  • Contains information about the product ordered.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

Route the event by type, deduplicate it by id, and move slow or failure-prone work to an asynchronous processor.

Inbound Product Inquiry message

In this case, your webhook endpoint received an inbound text message when a customer inquiries a product:
  • Contains information about the product.

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • A Product Inquiry Message is received when a user is asking for more information about a specific product. These can be received in two scenarios:
    • When a customer replies to Single or Multi-Product Messages.
    • When a customer accesses a business’ catalog through another entry point, navigates to a Product Details Page, and clicks Message Business about this Product.

Inbound Request Welcome message

You can be notified by webhook whenever a WhatsApp user opens a chat with you for the first time. This can be useful if you want to reply to these users with a special welcome message of your own design. If you enable this feature and a user opens a chat, typically when a user taps a universal link (wa.me or api.whatsapp.com links), the WhatsApp client checks for an existing message thread between the user and your business phone number. If there is none, the client triggers a request_welcome webhook. You can then respond to the user with your own welcome message. example-inboundmessage-welcomemessage

Request

Response

Acknowledge the delivery after durably accepting the event.

Explanation

  • To enable this feature for a phone number, navigate to Meta WhatsApp Manager > Phone Numbers > Settings > Automations.
  • To test request_welcome message, if you already have a chat thread going with the business phone number, you must first delete the chat.
  • This feature only triggers an inbound request_welcome message, and does not reply any message automatically. It’s up to you whether to reply a welcome message.