Skip to content

Webhook endpoints ​

8 endpoints. Every path below is relative to the API base URL and already includes the /api/v1 prefix — see conventions for authentication, pagination, errors and idempotency.

Endpoint
GET/webhooksList webhook endpoints newest first, filterable by active state and by subscribed event
POST/webhooksCreate a webhook endpoint and return its signing secret, the only time the secret is ever shown
GET/webhooks/{webhook}Retrieve one webhook endpoint; the signing secret is structurally absent from the payload
PUT/webhooks/{webhook}Update a webhook endpoint. The signing secret is not settable here
DELETE/webhooks/{webhook}Soft-delete a webhook endpoint and return an empty body
POST/webhooks/{webhook}/rotate-secretRotate the signing secret and return the new one; the previous secret keeps signing for an overlap
POST/webhooks/{webhook}/testQueue a real signed test event so you can verify your signature check end to end
GET/webhooks/eventsList the webhook event types an endpoint can subscribe to, each with its label, group and volume flag

Endpoints ​

List webhook endpoints newest first, filterable by active state and by subscribed event ​

GET/webhooks
  • Requires webhook.read.

Query parameters

NameTypeRequiredNotes
activeboolean—default false
bash
curl -X GET "$CALLAGENT_API_URL/webhooks?active=false" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks?active=false`, {
  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') . '/webhooks?active=false');

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']}/webhooks?active=false",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
200Array of WebhookEndpointResource

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.read scope

Example response, generated from the schema:

json
{
  "data": [
    {
      "id": "01JQ0000000000000000000000",
      "object": "string",
      "name": "Support Line",
      "url": "https://example.com/hook",
      "description": "string",
      "events": {},
      "assistant_ids": {},
      "headers": {},
      "active": true,
      "status": "string",
      "consecutive_failures": 1,
      "max_attempts": 1,
      "timeout_seconds": 30,
      "api_version": "string",
      "secret_rotated_at": "2026-01-01T12:00:00+00:00",
      "secret_overlap_until": "string",
      "last_success_at": "2026-01-01T12:00:00+00:00",
      "last_failure_at": "2026-01-01T12:00:00+00:00",
      "disabled_reason": "string",
      "created_at": "2026-01-01T12:00:00+00:00",
      "updated_at": "2026-01-01T12:00:00+00:00"
    }
  ]
}

Create a webhook endpoint and return its signing secret, the only time the secret is ever shown ​

POST/webhooks

The response is the only time the signing secret is returned. Store it immediately; afterwards it can be rotated but never read back.

  • Requires webhook.write.
  • secret and secret_notice sit beside data, not inside it. A URL resolving to a private address is rejected as a 422 on the url field.

Request body

FieldTypeRequiredNotes
namestringyesmax 255 chars
urlstringyesuri. max 2048 chars
descriptionstring | null—max 500 chars
eventsstring[] | null—
headersstring[] | null—
assistant_idsstring[] | null—
max_attemptsinteger | null—min 1. max 12
timeout_secondsinteger | null—min 1. max 60
metadatastring[] | null—
activeboolean | null—
bash
curl -X POST "$CALLAGENT_API_URL/webhooks" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
       "name": "Support Line",
       "url": "https://example.com/hook",
       "max_attempts": 1,
       "timeout_seconds": 30,
       "active": true
     }'
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Support Line",
    "url": "https://example.com/hook",
    "max_attempts": 1,
    "timeout_seconds": 30,
    "active": true
  }),
});

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') . '/webhooks');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Support Line',
    'url' => 'https://example.com/hook',
    'max_attempts' => 1,
    'timeout_seconds' => 30,
    'active' => true,
]),
]);

$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']}/webhooks",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    json={
      "name": "Support Line",
      "url": "https://example.com/hook",
      "max_attempts": 1,
      "timeout_seconds": 30,
      "active": True
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
201data-wrapped object

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.write scope
422Validation failed, an event name is unknown, or the URL is SSRF-blocked

Example response, generated from the schema:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "name": "Support Line",
    "url": "https://example.com/hook",
    "description": "string",
    "events": {},
    "assistant_ids": {},
    "headers": {},
    "active": true,
    "status": "string",
    "consecutive_failures": 1,
    "max_attempts": 1,
    "timeout_seconds": 30,
    "api_version": "string",
    "secret_rotated_at": "2026-01-01T12:00:00+00:00",
    "secret_overlap_until": "string",
    "last_success_at": "2026-01-01T12:00:00+00:00",
    "last_failure_at": "2026-01-01T12:00:00+00:00",
    "disabled_reason": "string",
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00"
  },
  "secret": "string",
  "secret_notice": "string"
}

Retrieve one webhook endpoint; the signing secret is structurally absent from the payload ​

GET/webhooks/{webhook}
  • Requires webhook.read.

Path parameters

NameTypeRequiredNotes
webhookstringyesThe webhook ID
bash
curl -X GET "$CALLAGENT_API_URL/webhooks/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/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') . '/webhooks/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']}/webhooks/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
200WebhookEndpointResource

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.read scope
404No such endpoint in this organization

Example response, generated from the schema:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "name": "Support Line",
    "url": "https://example.com/hook",
    "description": "string",
    "events": {},
    "assistant_ids": {},
    "headers": {},
    "active": true,
    "status": "string",
    "consecutive_failures": 1,
    "max_attempts": 1,
    "timeout_seconds": 30,
    "api_version": "string",
    "secret_rotated_at": "2026-01-01T12:00:00+00:00",
    "secret_overlap_until": "string",
    "last_success_at": "2026-01-01T12:00:00+00:00",
    "last_failure_at": "2026-01-01T12:00:00+00:00",
    "disabled_reason": "string",
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00"
  }
}

Update a webhook endpoint. The signing secret is not settable here ​

PUT/webhooks/{webhook}
  • Requires webhook.write.
  • PATCH is accepted on the same path, with the same body.
  • secret, previous_secret and organization_id are silently dropped. headers is read back as a list of header names only, never their values.

Path parameters

NameTypeRequiredNotes
webhookstringyesThe webhook ID

Request body

FieldTypeRequiredNotes
namestring—max 255 chars
urlstring—uri. max 2048 chars
descriptionstring | null—max 500 chars
eventsstring[]—
headersstring[] | null—
assistant_idsstring[]—
max_attemptsinteger—min 1. max 12
timeout_secondsinteger—min 1. max 60
metadatastring[] | null—
activeboolean—
bash
curl -X PUT "$CALLAGENT_API_URL/webhooks/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
       "name": "Support Line",
       "url": "https://example.com/hook",
       "max_attempts": 1,
       "timeout_seconds": 30,
       "active": true
     }'
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/01JQ0000000000000000000000`, {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Support Line",
    "url": "https://example.com/hook",
    "max_attempts": 1,
    "timeout_seconds": 30,
    "active": true
  }),
});

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') . '/webhooks/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Support Line',
    'url' => 'https://example.com/hook',
    'max_attempts' => 1,
    'timeout_seconds' => 30,
    'active' => true,
]),
]);

$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.put(
    f"{os.environ['CALLAGENT_API_URL']}/webhooks/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    json={
      "name": "Support Line",
      "url": "https://example.com/hook",
      "max_attempts": 1,
      "timeout_seconds": 30,
      "active": True
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
200WebhookEndpointResource

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.write scope
404No such endpoint in this organization
422Validation failed, an event name is unknown, or a new URL is SSRF-blocked

Example response, generated from the schema:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "name": "Support Line",
    "url": "https://example.com/hook",
    "description": "string",
    "events": {},
    "assistant_ids": {},
    "headers": {},
    "active": true,
    "status": "string",
    "consecutive_failures": 1,
    "max_attempts": 1,
    "timeout_seconds": 30,
    "api_version": "string",
    "secret_rotated_at": "2026-01-01T12:00:00+00:00",
    "secret_overlap_until": "string",
    "last_success_at": "2026-01-01T12:00:00+00:00",
    "last_failure_at": "2026-01-01T12:00:00+00:00",
    "disabled_reason": "string",
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00"
  }
}

Soft-delete a webhook endpoint and return an empty body ​

DELETE/webhooks/{webhook}
  • Requires webhook.write.
  • This response is not data-wrapped.
  • Delete is a soft delete and the dispatcher resolves endpoints withTrashed, so already-queued deliveries are still POSTed to a deleted endpoint.

Path parameters

NameTypeRequiredNotes
webhookstringyesThe webhook ID
bash
curl -X DELETE "$CALLAGENT_API_URL/webhooks/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/01JQ0000000000000000000000`, {
  method: 'DELETE',
  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') . '/webhooks/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    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.delete(
    f"{os.environ['CALLAGENT_API_URL']}/webhooks/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
204No content

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.write scope
404No such endpoint in this organization

Rotate the signing secret and return the new one; the previous secret keeps signing for an overlap ​

POST/webhooks/{webhook}/rotate-secret

The previous secret keeps signing alongside the new one for overlap_hours, so a rolling deploy of your verifier does not drop events. Pass 0 to revoke the old secret immediately.

  • Requires webhook.write.
  • secret sits beside data. overlap_hours defaults to 24; 0 retires the previous secret immediately.

Path parameters

NameTypeRequiredNotes
webhookstringyesThe webhook ID

Request body

FieldTypeRequiredNotes
overlap_hoursinteger | null—min 0. max 168
bash
curl -X POST "$CALLAGENT_API_URL/webhooks/01JQ0000000000000000000000/rotate-secret" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
       "overlap_hours": 1
     }'
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/01JQ0000000000000000000000/rotate-secret`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "overlap_hours": 1
  }),
});

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') . '/webhooks/01JQ0000000000000000000000/rotate-secret');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'overlap_hours' => 1,
]),
]);

$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']}/webhooks/01JQ0000000000000000000000/rotate-secret",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    json={
      "overlap_hours": 1
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
200data-wrapped object

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.write scope
404No such endpoint in this organization
422overlap_hours is not an integer in 0..168

Example response, generated from the schema:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "object": "string",
    "name": "Support Line",
    "url": "https://example.com/hook",
    "description": "string",
    "events": {},
    "assistant_ids": {},
    "headers": {},
    "active": true,
    "status": "string",
    "consecutive_failures": 1,
    "max_attempts": 1,
    "timeout_seconds": 30,
    "api_version": "string",
    "secret_rotated_at": "2026-01-01T12:00:00+00:00",
    "secret_overlap_until": "string",
    "last_success_at": "2026-01-01T12:00:00+00:00",
    "last_failure_at": "2026-01-01T12:00:00+00:00",
    "disabled_reason": "string",
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00"
  },
  "secret": "string",
  "secret_notice": "string"
}

Queue a real signed test event so you can verify your signature check end to end ​

POST/webhooks/{webhook}/test
  • Requires webhook.write.
  • Returns the webhook_delivery, not the endpoint. The event is sent as event_type assistant.request with a payload containing test:true.

Path parameters

NameTypeRequiredNotes
webhookstringyesThe webhook ID
bash
curl -X POST "$CALLAGENT_API_URL/webhooks/01JQ0000000000000000000000/test" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/01JQ0000000000000000000000/test`, {
  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') . '/webhooks/01JQ0000000000000000000000/test');

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']}/webhooks/01JQ0000000000000000000000/test",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
202data-wrapped object

Errors

StatusWhen it happens
403The presenting API key does not carry the webhook.write scope
404No such endpoint in this organization

Example response, generated from the schema:

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": [
      {}
    ]
  }
}

List the webhook event types an endpoint can subscribe to, each with its label, group and volume flag ​

GET/webhooks/events
  • No scope is enforced in the handler — any valid key may call it.
  • The response is a flat list carrying a group field per entry, not a grouped object.
bash
curl -X GET "$CALLAGENT_API_URL/webhooks/events" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/webhooks/events`, {
  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') . '/webhooks/events');

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']}/webhooks/events",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Responses

StatusBody
200data-wrapped array

Example response, generated from the schema:

json
{
  "data": [
    {
      "value": "string",
      "label": "string",
      "group": "Assistant",
      "high_volume": true
    }
  ]
}

Documented against the code. Anything not yet implemented is labelled, never described as working.