> For the complete documentation index, see [llms.txt](https://wadocs.pepipost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wadocs.pepipost.com/webhooks/overview/incoming-message.md).

# Incoming message-text

## Webhook Incoming Message - Text

This webhook sends incoming message as and when user send a text message When user gives a reply to a previous message then context will be provided.

Method: POST

Parameters:

| Parameter     | Description                                                                       | Data Type   |
| ------------- | --------------------------------------------------------------------------------- | ----------- |
| ncmessage\_id | ncmessage\_id is unique id which is given when you send any message via PUSH api. | String      |
| message\_id   | Unique message id                                                                 | String      |
| received\_at  | The time of status. The time when the message is received                         | Date - Time |
| mesage\_type  | The type of message will be “text”                                                | String      |
| text          | Text message from user.                                                           | String      |
| from          | The user mobile number                                                            | number      |

### Webhook Payload

```
{
"incoming_message": [{
"message_id": "ABEGkZlgQyWAAgo-sDVSUOa9jH0z",
"from": "919960432580",
"received_at": "1567090835",
"context": {
"ncmessage_id": null,
"message_id": null
},
"message_type": "TEXT",
"text_type": {
"text": "hello"
}
}]
}
```

## Webhook Incoming Message - Media

This webhook send incoming message as and when user send a media message. Media message can be 3 type -

* Image
* Audio
* Video

  When user gives a reply to a previous message then context will be provided.

Method: POST

Parameters:

| Parameter     | Description                                                                                       | Data Type   |
| ------------- | ------------------------------------------------------------------------------------------------- | ----------- |
| ncmessage\_id | ncmessage\_id is unique id which is given when you send any message via PUSH api.                 | String      |
| message\_id   | Unique message id                                                                                 | String      |
| received\_at  | The time of status. The time when the message is received                                         | Date - Time |
| mesage\_type  | <p></p><p>The type of message will be -</p><ul><li>IMAGE</li><li>VIDEO</li><li>DOCUMENT</li></ul> | String      |
| id            | This will be media id. You can get the media from Media API.                                      | String      |
| caption       | This will contain the caption of file name                                                        | String      |
| from          | The user mobile number                                                                            | number      |

### Webhook Payload

```
{
"incoming_message": [{
"message_id": "ABEGkZlgQyWAAgo-sOme7WUxlHHq",
"from": "919960432580",
"received_at": "1567091670",
"context": {
"ncmessage_id": null,
"message_id": null
},
"message_type": "IMAGE",
"image_type": {
"sha256":
"dd04cf3f58d890729201bbfa100c22ba02ab2a9353de793eddaf9fbbfda
c9cbb",
"mime_type": "image\/jpeg",
"id": "aa41ac0d-2eb4-4d4a-a212-03f3c0e2001d"
}
}]
}
```

## Webhook Incoming message- Location

This webhook send incoming message as and when user send a location.

Location data will contain lat and long.

When user gives a reply to a previous message then context will be provided.

Method: POST

Parameters:

| Parameter     | Description                                                                       | Data Type   |
| ------------- | --------------------------------------------------------------------------------- | ----------- |
| ncmessage\_id | ncmessage\_id is unique id which is given when you send any message via PUSH api. | String      |
| message\_id   | Unique message id                                                                 | String      |
| received\_at  | The time of status. The time when the message is received                         | Date - Time |
| mesage\_type  | The type of message will be “location”                                            | String      |
| latitude      | The latitude of location                                                          | String      |
| longitude     | The longitude of location                                                         | String      |
| from          | The user mobile number                                                            | number      |

### Webhook Payload

```
{ 
    "incoming_message": [{ 
        "message_id": "ABEGkZlgQyWAAhC3CZb1ttzQo0mvQBbL2pFk", 
        "from": "919960432580", 
        "received_at": "1567092229", 
        "context": { 
            "ncmessage_id": null, 
            "message_id": null 
        }, 
        "message_type": "LOCATION", 
        "location_type": { 
            "address": "Dosti Pinnacle, Unit No. G1, Plot No. E7, Th\u0101ne, 
Mah\u0101r\u0101shtra 400604", 
            "latitude": 19.198988196033, 
            "name": "Passport Seva Kendra", 
            "url": "http:\/\/www.passportindia.gov.in", 
            "longitude": 72.948932751057 
        } 
    }] 
} 
 
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wadocs.pepipost.com/webhooks/overview/incoming-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
