Create a new webhook configuration for a project.
POST/v2/projects/{project_id}/integrations/webhooks Path Parameters
The unique identifier of the project.
Request Body
The destination URL for webhook events.
curl -X POST "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/integrations/webhooks" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://myapp.com/webhooks/botsubscription"
}'
const project_id = 'YOUR_PROJECT_ID';
const response = await fetch(`https://api.botsubscription.com/v2/projects/${project_id}/integrations/webhooks`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://myapp.com/webhooks/botsubscription'
})
});
const data = await response.json();
import requests
project_id = 'YOUR_PROJECT_ID'
response = requests.post(
f'https://api.botsubscription.com/v2/projects/{project_id}/integrations/webhooks',
headers={'Authorization': 'Bearer YOUR_TOKEN'},
json={'url': 'https://myapp.com/webhooks/botsubscription'}
)
data = response.json()
$project_id = 'YOUR_PROJECT_ID';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.botsubscription.com/v2/projects/{$project_id}/integrations/webhooks");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'url' => 'https://myapp.com/webhooks/botsubscription'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Webhook createdapplication/json
{
"ok": true,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/integrations/webhooks",
"code": 200,
"message": "Webhook created successfully",
"data": {
"url": "https://myapp.com/webhooks/botsubscription",
"id": "22222222-2222-2222-2222-222222222222",
"secret": "a1b2c3d4e5f6..."
}
}
Last updated: