Webhooks
Create a webhook endpoint
Registers an https:// URL that starts receiving the subscribed events.
POST https://api.diska.ai/v1/webhook-endpoints
Scope: webhooks:manage
The response carries the secret (dskw_…) to verify signatures: it only appears in this response. Each organization can have up to 10 endpoints.
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Full https:// URL of your receiver. Private or internal addresses are refused. 12 to 2000 characters. |
description | string | null | No | Description. Up to 500 characters. |
events | array | No | Events to subscribe to: call.completed, booking.created. Default ["call.completed"]. |
{
"url": "https://o-seu-sistema.com/hooks/diska",
"description": "CRM — produção",
"events": [
"call.completed"
]
}
Examples
curl -X POST "https://api.diska.ai/v1/webhook-endpoints" \
-H "Authorization: Bearer $DISKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://o-seu-sistema.com/hooks/diska","description":"CRM — produção","events":["call.completed"]}'
import os
import requests
response = requests.post(
"https://api.diska.ai/v1/webhook-endpoints",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
json={
"url": "https://o-seu-sistema.com/hooks/diska",
"description": "CRM — produção",
"events": ["call.completed"],
},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/webhook-endpoints', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DISKA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://o-seu-sistema.com/hooks/diska",
"description": "CRM — produção",
"events": [
"call.completed"
]
})
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/webhook-endpoints');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DISKA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://o-seu-sistema.com/hooks/diska',
'description' => 'CRM — produção',
'events' => ['call.completed'],
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Try it
Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.
POST
https://api.diska.ai/v1/webhook-endpointsStarts with dsk_. It stays in this browser tab only.
Enter an API key (dsk_…).
Response 201
| Field | Type | Description |
|---|---|---|
endpoint | object | The created endpoint. |
endpoint.id | string | Endpoint ID. |
endpoint.url | string | Delivery destination. |
endpoint.description | string | null | Description. |
endpoint.events | array | Subscribed events. |
endpoint.active | boolean | false when disabled (by you or automatically). Default: true. |
endpoint.disabled_reason | string | null | Why it was disabled automatically, or null. |
endpoint.failure_count | integer | Consecutive failed deliveries. Default: 0. |
endpoint.last_delivery_at | string | null | Last delivery. |
endpoint.last_delivery_status | string | null | Result of the last delivery, for example delivered (200). |
endpoint.secret_preview | string | Start and end of the secret, to identify it. |
endpoint.created_at | string | null | Creation date (ISO 8601). |
secret | string | The secret (dskw_…) to verify signatures. It only appears in this response. |
{
"endpoint": {
"id": "e7a1c3f5-9b2d-4f6e-8a0c-3d5f7b9e1c24",
"url": "https://o-seu-sistema.com/hooks/diska",
"description": "CRM — produção",
"events": [
"call.completed"
],
"active": true,
"disabled_reason": null,
"failure_count": 0,
"last_delivery_at": "2026-10-25T18:40:00Z",
"last_delivery_status": "delivered (200)",
"secret_preview": "dskw_AbC…wXyZ",
"created_at": "2026-10-25T18:40:00Z"
},
"secret": "dskw_…"
}
Errors
| Code | When |
|---|---|
400 | URL inválido: use um endpoint https:// completo. (use a full https:// URL), URL bloqueado por segurança: … (blocked for security), Subscreva pelo menos um evento. (at least one event), Eventos desconhecidos: … (unknown events) or Limite de 10 endpoints por organização atingido. (10 endpoints per organization). |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

