---
title: "Edit Monitor Webhook URL - API Reference"
description: "API endpoint to update the monitor-specific webhook URL, overriding the global webhook URL for a single Twitter/X monitor."
source: "https://docs.socialdata.tools/monitoring/edit-monitor-webhook/"
---

Updates a single monitor’s settings. You can change its `webhook_url`, and — for [search monitors](https://docs.socialdata.tools/monitoring/create-search-query-monitor/) — its `refresh_frequency`.

Updating `webhook_url` only affects this one monitor and does not change your global webhook URL. When a monitor-specific webhook is not set, its webhook requests are routed to your [global webhook URL](https://docs.socialdata.tools/monitoring/set-global-webhook-url/).

PATCH https://api.socialdata.tools/monitors/{monitor\_id}

## Headers

**Authorization** `string` — required

Authorization Bearer header containing your SocialData API key

Example: Bearer YOUR\_API\_KEY

## Path Parameters

**monitor\_id** `string` — required

Target monitor ID

Example: 01jeg76qa91b095gttamsbwa6q

## Body

**webhook\_url** `string` — optional

Webhook URL for this monitor only. Pass an empty value to remove the monitor-specific webhook and fall back to your global webhook URL

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

**refresh\_frequency** `integer` — optional

**Search monitors only.** How often the monitor executes, in seconds (value between 1 and 3600). Sending this for any other monitor type returns a validation error. Changing it changes what the monitor costs — see [Pricing](https://docs.socialdata.tools/monitoring/pricing/#search-monitors)

Example: 300

The new frequency takes effect from the monitor’s next execution.

## Code Examples

#### curl

```shellscript
curl -X PATCH "https://api.socialdata.tools/monitors/01jeg76qa91b095gttamsbwa6q" \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{"webhook_url": "https://my-website.com/webhook"}'
```

#### JavaScript

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

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

#### Python

```python
import requests

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

url = f'https://api.socialdata.tools/monitors/{monitor_id}'

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

payload = {'webhook_url': webhook_url}

response = requests.patch(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
$monitor_id = '01jeg76qa91b095gttamsbwa6q';
$API_KEY = 'YOUR_API_KEY_HERE';
$webhook_url = 'https://my-website.com/webhook';

$url = "https://api.socialdata.tools/monitors/{$monitor_id}";

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_POSTFIELDS => json_encode(['webhook_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",
  "data": {
    "id": "01jksy1wv06r3jgk8d0bzahhwg",
    "created_at": "2025-02-11T07:19:53.000000Z",
    "monitor_type": "user_profile",
    "webhook_url": "https://my-website.com/webhook", // contains new webhook_url or null
    "parameters": {
      "user_screen_name": "MarioNawfal",
      "user_name": "Mario Nawfal",
      "user_id_str": "1319287761048723458"
    }
  }
}
```

#### 404

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

## Response Codes

-   **200 OK** - request succeeded
-   **404 Not Found** - requested monitor does not exist

## Related endpoints

-   [Get monitor details](https://docs.socialdata.tools/monitoring/get-monitor-details/)
-   [List active monitors](https://docs.socialdata.tools/monitoring/list-active-monitors/)
-   [Monitor event history](https://docs.socialdata.tools/monitoring/monitor-event-history/)
-   [Delete monitor](https://docs.socialdata.tools/monitoring/delete-monitor/)

## 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/)
