> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/inbox/inbox-api/receiving-messages.md).

# Receiving messages

Get every new WhatsApp message delivered to your own endpoint.

Tell the Inbox where to send new messages, and it calls that URL every time a customer writes to your number.

You need an HTTPS endpoint that accepts `POST` requests with a JSON body.

{% stepper %}
{% step %}
**Register your webhook**

```bash
curl -X POST $INBOX/api/v1/webhooks/waba/ \
  -H "Authorization: Token $SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-endpoint.example.com/whatsapp", "on_incoming_message": true}'
```

The webhook belongs to the user whose token you use. Register it with your service's own token — see [Authentication](/docs/inbox/inbox-api/authentication.md).

Reference: [Create webhook](/docs/inbox/inbox-api/api-ref/webhooks.md#post-api-v1-webhooks-waba)
{% endstep %}

{% step %}
**Send a message to your number**

From your phone, send a WhatsApp message to your business number.
{% endstep %}

{% step %}
**Read what arrives**

Your endpoint receives the message in the standard WhatsApp webhook format. Trimmed down:

```json
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "changes": [
        {
          "value": {
            "contacts": [
              {
                "profile": { "name": "Anna" },
                "wa_id": "4915112345678",
                "user_id": "DE.13491208655302741918"
              }
            ],
            "messages": [
              {
                "from": "4915112345678",
                "from_user_id": "DE.13491208655302741918",
                "id": "wamid.ID",
                "timestamp": "1759150800",
                "type": "text",
                "text": { "body": "Hi" }
              }
            ]
          }
        }
      ]
    }
  ]
}
```

The message is in `messages[]`, and who sent it is in `contacts[]`. The phone number fields can be missing when WhatsApp does not share the number; the BSUID (`user_id`, `from_user_id`) is always there. See [Contacts](/docs/inbox/inbox-api/contacts.md).

Respond with `200` as soon as you have received the request, and do any slow work afterwards.
{% endstep %}
{% endstepper %}

To answer the message, see [Sending messages](/docs/inbox/inbox-api/sending-messages.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.360dialog.com/docs/inbox/inbox-api/receiving-messages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
