# Update inbound SMS webhook/URI

## 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 utilize SMPP the `posturl` must be a fully qualified URL i.e. <http://someapi.somedomain.com/somescript.php>\
\
Leaving the `posturl` blank or not including it in your API call will convert the number from HTTP POST to SMPP\
\
Please be sure to have SMPP credentials setup and tested before converting numbers to SMPP or message loss could occur (which is bad).
{% 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 sms webhook URL is available using this enpodint.

<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

```
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"
}'
```


---

# Agent Instructions: 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:

```
GET https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-sms-and-10dlc/update-inbound-sms-webhook-uri.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
