> For the complete documentation index, see [llms.txt](https://www.docpartner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.docpartner.dev/en/api/sms-partner/webhooks.md).

# Webhooks

Manage the statuses and replies of your SMS campaigns

## Reply on a short number

After sending a campaign from our short number, SMS Partner lets you receive replies.\
For more information, [**contact us**](https://www.smspartner.fr/contact).

{% hint style="info" %}

#### Please note

To receive replies, you must set your reply reception URL

in your [SMS API](https://my.smspartner.fr/dashboard/api/paramaters) tab
{% endhint %}

**Example of JSON response sent via POST**

```json
{
"type":"response",
"phone_number":"+336....",
"text":"test",
"message_id":1111111
}

```

**For a STOP SMS the webhook response will be**

```json
{
"type":"stop",
"phone_number":"+336...",
"text":"Stop",
"message_id":111111
}
```

## Reply on a long number (virtual number)

SMS Partner offers the rental of a long number (example: 06 XX XX XX XX)\
To learn more about creating a dedicated long number, [contact us](https://www.smspartner.fr/contact/).

#### Example of a simple response (160 characters maximum)

```json
{
  "msisdn": "33xxxxxxxxx",
  "to": "33xxxxxxxxx",
  "messageId": "1235-1234-1233-4665",
  "text": "Test",
  "type": "text",
  "keyword": "Test",
  "message-timestamp": "2016-03-10 09:51:46"
}
```

#### Example of a response for a long SMS (+160 characters)

```json
{
  "msisdn": "33xxxxxxxxx",
  "to": "33xxxxxxxxx",
  "messageId": "a1b2c3d4-e5f6-40a1-80b2-c9d0e1f....", //in UUID format
  "concat": "true",
  "concat-ref": "171",
  "concat-total": "2",
  "concat-part": "1",
  "text": "   Long message....",
  "type": "text",
  "keyword": "MESSAGELONG",
  "message-timestamp": "2016-03-09 16:00:30"
}
 
{
  "msisdn": "33xxxxxxxxx",
  "to": "33xxxxxxxxx",
  "messageId": "a1b2c3d4-e5f6-40a1-80b2-c9d0e1...", //in UUID format
  "concat": "true",
  "concat-ref": "171",
  "concat-total": "2",
  "concat-part": "2",
  "text": "....very long",
  "type": "text",
  "keyword": "TRESLONG",
  "message-timestamp": "2016-03-09 16:00:31"
}
```

## DLR - retrieving SMS statuses

**The SMS delivery status can be sent via the webhook using POST**

<pre class="language-json" data-overflow="wrap"><code class="lang-json"><strong>{
</strong>"status":"delivered",
"msgId":"11111111",
"date":1764768485,
"phone":"+336.......",
"cost":"0.049",
"currency":"EUR",
"tag":"...."
}
</code></pre>

The possible statuses are

* delivered: The SMS was delivered
* not delivered: The SMS was not delivered
* waiting: The SMS is pending at the operator


---

# 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://www.docpartner.dev/en/api/sms-partner/webhooks.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.
