Webhooks
Remover um endpoint de webhook
Remove o endpoint e devolve-o como estava.
DELETE https://api.diska.ai/v1/webhook-endpoints/{endpoint_id}
Âmbito: webhooks:manage
As entregas param de imediato.
Parâmetros
No caminho
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
endpoint_id | string | Sim | Identificador do endpoint. |
Exemplos
curl -X DELETE "https://api.diska.ai/v1/webhook-endpoints/<endpoint_id>" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.delete(
"https://api.diska.ai/v1/webhook-endpoints/<endpoint_id>",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 ou superior, num ficheiro .mjs
const response = await fetch('https://api.diska.ai/v1/webhook-endpoints/<endpoint_id>', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
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/<endpoint_id>');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
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));
Experimentar
Envie o pedido a partir desta página, com a sua chave. A chave fica só nesta página: não é guardada e só é enviada para api.diska.ai. Use uma chave de teste com os âmbitos mínimos.
DELETE
https://api.diska.ai/v1/webhook-endpoints/{endpoint_id}Começa por dsk_. Fica só neste separador do browser.
path
Introduza uma chave API (dsk_…).
Resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Identificador do endpoint. |
url | string | Destino das entregas. |
description | string | null | Descrição. |
events | array | Eventos subscritos. |
active | boolean | false quando foi desactivado (por si ou automaticamente). Padrão: true. |
disabled_reason | string | null | Motivo da desactivação automática, ou null. |
failure_count | integer | Entregas falhadas seguidas. Padrão: 0. |
last_delivery_at | string | null | Última entrega. |
last_delivery_status | string | null | Resultado da última entrega, por exemplo delivered (200). |
secret_preview | string | Início e fim do secret, para o identificar. |
created_at | string | null | Data de criação (ISO 8601). |
{
"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"
}
Erros
| Código | Quando |
|---|---|
404 | Endpoint não encontrado. |
Os erros comuns a todos os endpoints (401, 403, 422, 429 e 5xx) estão em Erros.

