> For the complete documentation index, see [llms.txt](https://docs.tsgglobal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-sms-and-10dlc/update-inbound-sms-webhook-uri.md).

# Update inbound SMS webhook/URI

Set or change the inbound SMS webhook URL, format and shared secret for a phone number, or switch the number back to SMPP delivery.

## Overview

This method allows you to update your inbound messaging webhook/URI for a phone number.

{% hint style="danger" %}
If you are an HTTP API customer and do not use SMPP, `webhook_url` must be a fully qualified URL, for example `https://api.example.com/inbound-sms`.\
\
Leaving `webhook_url` blank or omitting it converts the number from HTTP POST delivery to SMPP delivery.\
\
Make sure you have SMPP credentials set up and tested before converting numbers to SMPP, otherwise inbound messages can be lost.
{% endhint %}

## Authentication

{% hint style="info" %}
Authentication is done by passing your TSG Global API key via the Authorization header in the format "Authorization: Bearer \<api\_key>"
{% endhint %}

## Method

## Update per-DID configuration. Currently only the SMS webhook URL can be changed with this endpoint.

<mark style="color:green;">`POST`</mark> `https://api-service.tsgglobal.world/v1/sms/webhook`

#### Request Body

| Name                                  | Type   | Description                                                                                                                                                       |
| ------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| webhook\_url                          | String | e.g. <https://example.com/webhook>                                                                                                                                |
| did<mark style="color:red;">\*</mark> | String | DID you want to set/update SMS webhook endpoint for                                                                                                               |
| webhook\_type                         | String | postv2 (default) \| postv1 \| post3jam \| smpp                                                                                                                    |
| x\_api\_key\_header                   | String | This value will be passed as x-api-key header in the webhook http call. Can be used to secure your webhook API. (should not be provided if webhook\_type is smpp) |

{% tabs %}
{% tab title="200: OK " %}

```javascript
Success
```

{% endtab %}
{% endtabs %}

## Example CURL

```bash
curl -n https://api-service.tsgglobal.world/v1/sms/webhook -XPOST -H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" -d '{
  "webhook_url": "https://example.com/webhook",
  "did": "12003004000"
}'
```
