Skip to main content
Webhooks let you receive real-time HTTP callbacks when events occur on your routes — such as successful requests, errors, rate limit hits, and more. KnoxCall signs every webhook delivery so you can verify authenticity.

List Webhooks

GET /v1/webhooks
Returns a paginated list of all webhooks in your tenant.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items per page (max 100)
sortstringcreated_atSort by: created_at, name, or enabled
orderstringdescSort direction: asc or desc

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Error Notifications",
      "description": "Notify Slack on 5xx errors",
      "url": "https://hooks.slack.com/services/T00/B00/xxx",
      "method": "POST",
      "event_types": ["request.error", "request.timeout"],
      "auth_type": "none",
      "enabled": true,
      "last_triggered_at": "2026-03-10T14:22:01.000Z",
      "trigger_count": 142,
      "success_count": 140,
      "failure_count": 2,
      "created_at": "2026-01-20T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 4,
    "page": 1,
    "per_page": 20,
    "total_pages": 1,
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
curl https://api.knoxcall.com/v1/webhooks \
  -H "Authorization: Bearer tk_live_abc123..."

Get Webhook

GET /v1/webhooks/:id
Returns the full configuration for a single webhook, including delivery statistics.

Path Parameters

ParameterTypeDescription
iduuidThe webhook ID

Response

{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Error Notifications",
    "description": "Notify Slack on 5xx errors",
    "url": "https://hooks.slack.com/services/T00/B00/xxx",
    "method": "POST",
    "event_types": ["request.error", "request.timeout"],
    "auth_type": "none",
    "request_headers": null,
    "route_filter": null,
    "include_request_body": true,
    "include_response_body": false,
    "include_headers": false,
    "timeout_seconds": 30,
    "retry_on_failure": true,
    "max_retries": 3,
    "enabled": true,
    "last_triggered_at": "2026-03-10T14:22:01.000Z",
    "last_success_at": "2026-03-10T14:22:01.000Z",
    "last_failure_at": "2026-02-28T08:15:00.000Z",
    "trigger_count": 142,
    "success_count": 140,
    "failure_count": 2,
    "created_at": "2026-01-20T10:00:00.000Z"
  },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}

Errors

StatusTypeDescription
404not_foundWebhook not found

Create Webhook

POST /v1/webhooks
Creates a new webhook. The secret_key for verifying webhook signatures is returned only once in the response.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name for the webhook
urlstringYesThe URL to deliver webhook payloads to
event_typesstring[]YesEvents to subscribe to (non-empty array)
descriptionstringNoDescription
methodstringNoHTTP method for delivery (defaults to POST)
auth_typestringNoAuthentication type: none, basic, bearer, hmac (defaults to none)
auth_configobjectNoAuth credentials (depends on auth_type)
request_headersobjectNoCustom headers to include in deliveries
route_filterstringNoOnly trigger for events on a specific route ID
include_request_bodybooleanNoInclude the original request body in the payload (defaults to true)
include_response_bodybooleanNoInclude the upstream response body (defaults to false)
include_headersbooleanNoInclude request/response headers (defaults to false)
timeout_secondsintegerNoDelivery timeout in seconds (defaults to 30)
retry_on_failurebooleanNoRetry failed deliveries (defaults to true)
max_retriesintegerNoMaximum retry attempts (defaults to 3)
enabledbooleanNoEnable immediately (defaults to true)

Response

{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Error Notifications",
    "description": "Notify Slack on 5xx errors",
    "url": "https://hooks.slack.com/services/T00/B00/xxx",
    "method": "POST",
    "event_types": ["request.error", "request.timeout"],
    "auth_type": "none",
    "enabled": true,
    "created_at": "2026-01-20T10:00:00.000Z",
    "secret_key": "whsec_a1b2c3d4e5f6..."
  },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}
The secret_key is returned only at creation time. Store it securely — you’ll need it to verify webhook signatures. See the Verifying Signatures guide.
curl -X POST https://api.knoxcall.com/v1/webhooks \
  -H "Authorization: Bearer tk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Error Notifications",
    "url": "https://hooks.slack.com/services/T00/B00/xxx",
    "event_types": ["request.error", "request.timeout"],
    "description": "Notify Slack on 5xx errors"
  }'

Errors

StatusTypeDescription
400validation_errorMissing required fields or empty event_types array

Update Webhook

PATCH /v1/webhooks/:id
Updates one or more fields on an existing webhook.

Path Parameters

ParameterTypeDescription
iduuidThe webhook ID

Request Body

All fields are optional. Only provided fields will be updated.
FieldTypeDescription
namestringDisplay name
descriptionstringDescription
urlstringDelivery URL
methodstringHTTP method
event_typesstring[]Subscribed event types
auth_typestringAuthentication type
auth_configobjectAuthentication credentials
request_headersobjectCustom delivery headers
route_filterstringRoute ID filter
include_request_bodybooleanInclude request body
include_response_bodybooleanInclude response body
include_headersbooleanInclude headers
timeout_secondsintegerDelivery timeout
retry_on_failurebooleanRetry on failure
max_retriesintegerMax retry attempts
enabledbooleanEnable or disable

Response

Returns the updated webhook object (without secret_key).

Errors

StatusTypeDescription
400validation_errorNo valid fields provided
404not_foundWebhook not found

Delete Webhook

DELETE /v1/webhooks/:id
Permanently deletes a webhook and all of its delivery logs.

Path Parameters

ParameterTypeDescription
iduuidThe webhook ID

Response

{
  "data": { "deleted": true },
  "meta": { "request_id": "550e8400-e29b-41d4-a716-446655440000" }
}

Errors

StatusTypeDescription
404not_foundWebhook not found

Get Webhook Logs

GET /v1/webhooks/:id/logs
Returns paginated delivery logs for a specific webhook, showing every delivery attempt with status and timing.

Path Parameters

ParameterTypeDescription
iduuidThe webhook ID

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items per page (max 100)

Response

{
  "data": [
    {
      "id": "log-uuid",
      "request_method": "POST",
      "request_path": "/services/T00/B00/xxx",
      "request_ip": "203.0.113.1",
      "response_status": 200,
      "response_time_ms": 342,
      "executed_at": "2026-03-10T14:22:01.000Z",
      "success": true,
      "error_message": null
    }
  ],
  "meta": {
    "total": 142,
    "page": 1,
    "per_page": 20,
    "total_pages": 8,
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Errors

StatusTypeDescription
404not_foundWebhook not found