Edit Monitor Webhook URL - API Reference
Used to update or remove a monitor-specific webhook_url
. This only updates the webhook URL value associated with a single monitor and does not change your global webhook URL. When monitor-specific webhook is not set, all webhook requests will be routed to your 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 required
New webhook URL that will be used for all monitors that don't have an individual webhook_url set. Pass an empty value to remove monitor-specific webhook
Example: https://my-website.com/webhook or NULL
Code Examples
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"}'
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));
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)
$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
{ "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" } }}
{ "status": "error", "message": "Not found"}
Response Codes
- 200 OK - request succeeded
- 404 Not Found - requested monitor does not exist