# Registering Webhooks

Receive Web Hook notifications, register your webhook endpoint. Please provide a publicly accessible HTTPS URL to your webhook endpoint.

### <mark style="color:green;">`POST`</mark> `/webhooks/receipt`

Used to register for [Delivery Receipt](https://wiki.mobivatebulksms.com/archived-docs/registering-webhooks/delivery-receipt-notification) notifications.

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -X POST \
"https://api.mobivatebulksms.com/webhooks/receipt" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API Key]' \
-d '{ "url": "https://your.domain.com/endpoint" }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [API Key]',
}

json_data = {
    'url': 'https://your.domain.com/endpoint',
}

response = requests.post('https://api.mobivatebulksms.com/webhooks/receipt', headers=headers, json=json_data)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "url": "https://your.domain.com/endpoint" }'
#response = requests.post('https://api.mobivatebulksms.com/webhooks/receipt', headers=headers, data=data)
```

{% endtab %}
{% endtabs %}

### Incoming Messages

### <mark style="color:green;">`POST`</mark> `/webhooks/incoming`

Use to register for [Incoming Message](https://wiki.mobivatebulksms.com/archived-docs/registering-webhooks/incoming-message-notification) notifications.

{% tabs %}
{% tab title="Curl" %}

```hsts
/curl -X POST \
"https://api.mobivatebulksms.com/webhooks/incoming" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API Key]' \
-d '{ "url": "https://your.domain.com/endpoint" }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [API Key]',
}

json_data = {
    'url': 'https://your.domain.com/endpoint',
}

response = requests.post('https://api.mobivatebulksms.com/webhooks/incoming', headers=headers, json=json_data)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "url": "https://your.domain.com/endpoint" }'
#response = requests.post('https://api.mobivatebulksms.com/webhooks/incoming', headers=headers, data=data)
```

{% endtab %}
{% endtabs %}

### Short URL Clicks

### <mark style="color:green;">`POST`</mark> `/webhooks/click`

Use to register for [Short URL Click](https://wiki.mobivatebulksms.com/archived-docs/registering-webhooks/short-url-click-notification) notifications.

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -X POST \
"https://api.mobivatebulksms.com/webhooks/click" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [API Key]' \
-d '{ "url": "https://your.domain.com/endpoint" }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [API Key]',
}

json_data = {
    'url': 'https://your.domain.com/endpoint',
}

response = requests.post('https://api.mobivatebulksms.com/webhooks/click', headers=headers, json=json_data)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "url": "https://your.domain.com/endpoint" }'
#response = requests.post('https://api.mobivatebulksms.com/webhooks/click', headers=headers, data=data)
```

{% endtab %}
{% endtabs %}

**Headers**

| Header        | Value             |
| ------------- | ----------------- |
| Content-Type  | application/json  |
| Authorization | Bearer \[API Key] |

**Body**

<table><thead><tr><th>Name</th><th width="131">Type</th><th width="111">Required?</th><th>Description</th></tr></thead><tbody><tr><td>url</td><td>string</td><td>Yes</td><td>URL to receive Delivery Receipt notifications.</td></tr></tbody></table>

**Response**

We use conventional HTTP response codes to indicate the success or failure of an API request. In general:

**2xx** indicate success\
**4xx** indicate an error that failed given the information provided (e.g., a required parameter was omitted)\
**5xx** errors indicate an error with ours servers (these are rare).

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

```json
{
   "message":"Webhook updated successfully"
}
```

{% endtab %}

{% tab title="401" %}

```json
{
   "code":401,
   "message":"Unauthorized"
}
```

{% endtab %}
{% endtabs %}

To see a full list of our **Response codes**, please [click here](https://wiki.mobivatebulksms.com/overview/introduction/understanding-response-codes).
