---
title: "Set Global Webhook URL - API Reference"
description: "Used to set the webhook URL that will be used for all monitors that don't have a monitor-specific webhook_url set"
source: "https://docs.socialdata.tools/monitoring/set-global-webhook-url/"
---

Used to set the webhook URL that will be used for all monitors that don’t have a monitor-specific `webhook_url` set.

POST https://api.socialdata.tools/user/webhook

## Headers

**Authorization** `string` — required

Authorization Bearer header containing your SocialData API key

Example: Bearer YOUR\_API\_KEY

## Body

**url** `string` — required

New webhook URL that will be used for all monitors that don't have an individual webhook\_url set

Example: https://my-website.com/webhook

## Code Examples

#### curl

```shellscript
curl -X POST "https://api.socialdata.tools/user/webhook" \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{"url": "https://my-website.com/webhook"}'
```

#### JavaScript

```js
const API_KEY = 'YOUR_API_KEY_HERE';
const webhookUrl = 'https://my-website.com/webhook';

fetch('https://api.socialdata.tools/user/webhook', {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    },
    body: JSON.stringify({ url: webhookUrl })
})
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
```

#### Python

```python
import requests

API_KEY = 'YOUR_API_KEY_HERE'
webhook_url = 'https://my-website.com/webhook'

url = 'https://api.socialdata.tools/user/webhook'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}

payload = {'url': webhook_url}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

#### PHP

```php
$API_KEY = 'YOUR_API_KEY_HERE';
$webhook_url = 'https://my-website.com/webhook';

$url = "https://api.socialdata.tools/user/webhook";

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode(['url' => $webhook_url]),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $API_KEY",
        "Content-Type: application/json",
        "Accept: application/json"
    ]
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);

curl_close($ch);
```

## Example Responses

#### 200

```json
{
  "status": "success",
  "message": "Webhook URL updated"
}
```

#### 404

```json
{
    "status": "error",
    "message": "Not found"
}
```

## Response Codes

-   **200 OK** - request succeeded
-   **404 Not Found** - requested tweet does not exist
-   **422 Unprocessable Content** - validation failed (e.g. one of the required parameters was not provided)
-   **500 Internal Error** - API internal error, typically means that SocialData API failed to obtain the requested information and you should try again later

## Related endpoints

-   [Set webhook secret](https://docs.socialdata.tools/monitoring/set-webhook-secret/)
-   [Verifying webhooks](https://docs.socialdata.tools/monitoring/verifying-webhooks/)
-   [Monitor event history](https://docs.socialdata.tools/monitoring/monitor-event-history/)

## Before you integrate

-   [Authentication](https://docs.socialdata.tools/getting-started/authentication/)
-   [Rate limits](https://docs.socialdata.tools/getting-started/rate-limits/)
-   [Errors](https://docs.socialdata.tools/getting-started/errors/)
-   [Monitoring API pricing](https://docs.socialdata.tools/monitoring/pricing/)
-   [Processing webhook events](https://docs.socialdata.tools/monitoring/processing-webhooks/)
