Livrări webhook
3 endpoint-uri. Fiecare cale de mai jos este relativă la URL-ul de bază al API-ului și include deja prefixul /api/v1 — vezi convențiile pentru autentificare, paginare, erori și idempotență.
| Endpoint | ||
|---|---|---|
| GET | /webhook-deliveries | List webhook deliveries newest first, filterable by endpoint, event type, status or call |
| GET | /webhook-deliveries/{delivery} | Retrieve one delivery, including the per-attempt log |
| POST | /webhook-deliveries/{delivery}/redeliver | Queue a replay of a delivery as a new row that reuses the original event_id |
Endpoint-uri
List webhook deliveries newest first, filterable by endpoint, event type, status or call
GET/webhook-deliveries
- Necesită
webhook.read. - Filters are webhook_endpoint_id, event_type, status and call_id. attempt_log is omitted from list rows.
bash
curl -X GET "$CALLAGENT_API_URL/webhook-deliveries" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhook-deliveries`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();php
<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/webhook-deliveries');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];python
import os, requests
response = requests.get(
f"{os.environ['CALLAGENT_API_URL']}/webhook-deliveries",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | Array of WebhookDeliveryResource |
Erori
| Status | Când apare |
|---|---|
403 | The presenting API key does not carry the webhook.read scope |
Exemplu de răspuns, generat din schemă:
json
{
"data": [
{
"id": "01JQ0000000000000000000000",
"object": "string",
"webhook_endpoint_id": "01JQ0000000000000000000000",
"event_id": "01JQ0000000000000000000000",
"event_type": "string",
"status": "string",
"attempts": 1,
"max_attempts": 1,
"response_status": 1,
"duration_ms": 30,
"error": "string",
"call_id": "01JQ0000000000000000000000",
"assistant_id": "01JQ0000000000000000000000",
"next_attempt_at": "2026-01-01T12:00:00+00:00",
"delivered_at": "2026-01-01T12:00:00+00:00",
"failed_at": "2026-01-01T12:00:00+00:00",
"redelivery_of_id": "01JQ0000000000000000000000",
"created_at": "2026-01-01T12:00:00+00:00",
"payload": {},
"request_headers": {},
"response_headers": {},
"response_body": "string",
"attempt_log": []
}
]
}Retrieve one delivery, including the per-attempt log
GET/webhook-deliveries/{delivery}
- Necesită
webhook.read.
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
delivery | string | da | The delivery ID |
bash
curl -X GET "$CALLAGENT_API_URL/webhook-deliveries/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhook-deliveries/01JQ0000000000000000000000`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();php
<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/webhook-deliveries/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];python
import os, requests
response = requests.get(
f"{os.environ['CALLAGENT_API_URL']}/webhook-deliveries/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | WebhookDeliveryResource |
Erori
| Status | Când apare |
|---|---|
403 | The presenting API key does not carry the webhook.read scope |
404 | No such delivery in this organization |
Exemplu de răspuns, generat din schemă:
json
{
"data": {
"id": "01JQ0000000000000000000000",
"object": "string",
"webhook_endpoint_id": "01JQ0000000000000000000000",
"event_id": "01JQ0000000000000000000000",
"event_type": "string",
"status": "string",
"attempts": 1,
"max_attempts": 1,
"response_status": 1,
"duration_ms": 30,
"error": "string",
"call_id": "01JQ0000000000000000000000",
"assistant_id": "01JQ0000000000000000000000",
"next_attempt_at": "2026-01-01T12:00:00+00:00",
"delivered_at": "2026-01-01T12:00:00+00:00",
"failed_at": "2026-01-01T12:00:00+00:00",
"redelivery_of_id": "01JQ0000000000000000000000",
"created_at": "2026-01-01T12:00:00+00:00",
"payload": {},
"request_headers": {},
"response_headers": {},
"response_body": "string",
"attempt_log": [
{}
]
}
}Queue a replay of a delivery as a new row that reuses the original event_id
POST/webhook-deliveries/{delivery}/redeliver
The replay carries the same event_id, so a receiver that deduplicates on it will recognise the repeat.
- Necesită
webhook.write. - Only succeeded, failed or dead deliveries replay; the 422 message says "completed or failed", which does not match those status values.
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
delivery | string | da | The delivery ID |
bash
curl -X POST "$CALLAGENT_API_URL/webhook-deliveries/01JQ0000000000000000000000/redeliver" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhook-deliveries/01JQ0000000000000000000000/redeliver`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();php
<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/webhook-deliveries/01JQ0000000000000000000000/redeliver');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];python
import os, requests
response = requests.post(
f"{os.environ['CALLAGENT_API_URL']}/webhook-deliveries/01JQ0000000000000000000000/redeliver",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
202 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The presenting API key does not carry the webhook.write scope |
404 | No such delivery in this organization |
422 | The delivery is not in a replayable state |
Exemplu de răspuns, generat din schemă:
json
{
"data": {
"id": "01JQ0000000000000000000000",
"object": "string",
"webhook_endpoint_id": "01JQ0000000000000000000000",
"event_id": "01JQ0000000000000000000000",
"event_type": "string",
"status": "string",
"attempts": 1,
"max_attempts": 1,
"response_status": 1,
"duration_ms": 30,
"error": "string",
"call_id": "01JQ0000000000000000000000",
"assistant_id": "01JQ0000000000000000000000",
"next_attempt_at": "2026-01-01T12:00:00+00:00",
"delivered_at": "2026-01-01T12:00:00+00:00",
"failed_at": "2026-01-01T12:00:00+00:00",
"redelivery_of_id": "01JQ0000000000000000000000",
"created_at": "2026-01-01T12:00:00+00:00",
"payload": {},
"request_headers": {},
"response_headers": {},
"response_body": "string",
"attempt_log": [
{}
]
}
}