# Webhooks

> Kontiga is document fraud detection by Bynn Intelligence for insurers, letting agents, lenders and HR screening teams: every document is compared with a proprietary library of more than 300 million original documents, gathered over 20 years.

Documentation index: https://kontiga.com/llms.txt

Section: Reference. URL: https://kontiga.com/docs/webhooks

A webhook endpoint is an https address of yours that Kontiga sends events to as they happen, each signed so you can tell it came from Kontiga. An endpoint takes Kontiga's own events, or the compatible document events in Bynn's exact format, never both, and is live or test. Add endpoints, follow their deliveries, send test events and resend what failed.

Updated December 1, 2026

## Contents

- [The endpoint object](https://kontiga.com/docs/webhooks#the-endpoint-object)
- [Add a webhook endpoint](https://kontiga.com/docs/webhooks#add-a-webhook-endpoint)
- [List webhook endpoints](https://kontiga.com/docs/webhooks#list-webhook-endpoints)
- [List webhook endpoints with their health](https://kontiga.com/docs/webhooks#webhook-health)
- [Read a webhook endpoint](https://kontiga.com/docs/webhooks#read-a-webhook-endpoint)
- [Change a webhook endpoint](https://kontiga.com/docs/webhooks#change-a-webhook-endpoint)
- [Roll a signing secret](https://kontiga.com/docs/webhooks#roll-a-signing-secret)
- [Delete a webhook endpoint](https://kontiga.com/docs/webhooks#delete-a-webhook-endpoint)
- [List webhook deliveries](https://kontiga.com/docs/webhooks#list-webhook-deliveries)
- [Read a webhook delivery](https://kontiga.com/docs/webhooks#read-a-webhook-delivery)
- [Resend a delivery](https://kontiga.com/docs/webhooks#resend-a-delivery)
- [Recover failed deliveries](https://kontiga.com/docs/webhooks#recover-failed-deliveries)
- [Send a test event](https://kontiga.com/docs/webhooks#send-a-test-event)
- [List event types](https://kontiga.com/docs/webhooks#list-event-types)
- [Read the test inbox](https://kontiga.com/docs/webhooks#read-the-test-inbox)
- [Clear the test inbox](https://kontiga.com/docs/webhooks#clear-the-test-inbox)
- [Read the webhook public key](https://kontiga.com/docs/webhooks#read-the-webhook-public-key)
- [Trigger a sample event](https://kontiga.com/docs/webhooks#trigger-a-sample-event)
- [Screening webhooks](https://kontiga.com/docs/webhooks#screening-webhooks)

## The endpoint object

- `id` (string): The endpoint's id, starting with `whe_`.
- `url` (string): The https address events are sent to.
- `format` (enum): `kontiga` for Kontiga's own events, signed with `Kontiga-Signature`; `compatible` for Bynn's `document.*` events, sent and signed exactly as Bynn sends them.
- `mode` (enum): `live` or `test`. Test events go only to test endpoints, live events only to live ones; a test send you ask for goes anywhere.
- `events` (array): The event types it receives.
- `state` (enum): `enabled`, `failing` (deliveries are failing and being retried) or `disabled`.
- `health` (object): Its last 24 hours: requests, delivered, failed, the error rate and the response times in milliseconds.
- `secret` (object): The last four characters of its signing secret, and of the previous one while it still verifies after a roll. The secret itself is shown once.
- `retry_rules` (object): How deliveries are retried and when the endpoint is turned off, in words: its `summary` on every endpoint, and on a single endpoint's read also `success`, `redirect`, `retries`, `gone` and `disabling`.

**An endpoint**

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "object": "webhook_endpoint",
  "url": "https://api.harbourline.example/hooks/kontiga",
  "description": "Loan origination system",
  "format": "kontiga",
  "mode": "live",
  "source": "custom",
  "events": ["document.received", "document.checked", "document.failed"],
  "state": "enabled",
  "disabled": null,
  "last_error": null,
  "failing_since": null,
  "disables_at": null,
  "last_delivery": { "at": "2026-11-27T08:51:14Z", "status": 200, "state": "delivered" },
  "health": { "requests": 318, "delivered": 316, "failed": 2, "error_rate": 0.0063, "avg_ms": 182, "min_ms": 74, "max_ms": 1210, "hourly": [{ "at": "2026-11-27T07:00:00Z", "delivered": 14, "failed": 0 }, { "at": "2026-11-27T08:00:00Z", "delivered": 12, "failed": 1 }] },
  "created_at": "2026-09-03T10:11:00Z",
  "created_by_name": "Priya Raman",
  "secret": { "last4": "Qe7m", "created_at": "2026-09-03T10:11:00Z", "previous": null },
  "method": "post",
  "is_inbox": false,
  "retry_rules": {
    "success": "A 2xx answer within 10 seconds.",
    "redirect": "A redirect is a failure: it is not followed.",
    "retries": "Retried with waits that double from about 1 minute, up to 6 hours apart, for 72 hours. A Retry-After header is honoured.",
    "gone": "A 410 Gone disables the endpoint at once.",
    "disabling": "After 72 hours of failures with no success the endpoint is disabled, and owners, admins and developers get one email.",
    "summary": "Kontiga retries each delivery for 72 hours, the waits doubling from about 1 minute, and turns the endpoint off after 72 hours of failures."
  },
  "recoverable": 0,
  "delayed": false
}
```

Every delivery is signed. To check one came from Kontiga, answer it and test it with the inbox, see [Receive webhooks](https://kontiga.com/docs/guides/receive-webhooks#verify-the-signature).

A workspace has at most 10 live endpoints and 10 test endpoints, the test inbox aside, and adds at most 100 in 24 hours, deleted ones counted. The signing secret is in the answer once: a repeat of the call with the same `Idempotency-Key` answers the endpoint with `signing_secret` null. Roll the secret if it was lost.

## Add a webhook endpoint

Register an https address for Kontiga's own events or for the compatible document events, live or test; its signing secret is shown once.

`POST /v1/webhook_endpoints`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks create --url <https://...> --events <type,type> [--format <kontiga|compatible>] [--mode <live|test>] [--description <text>] [--source <custom|zapier|make|n8n>] [--max-retries <0-65>] [--retry-frequency-minutes <1-1440>]`. MCP tool: `create_webhook_endpoint`.

**Parameters**
- `url` (string, required): The https address to send to, on any port. An address on a private network is refused, now and at every send. At most 2,048 characters.
- `events` (array of string, required): The event types to receive, from the list of event types. A compatible endpoint takes document.analyzed, document.rejected and document.monitoring_event, all three when left out. At most 60 items.
- `format` (enum, default "kontiga"): Kontiga's own events, or the compatible document events. It cannot be changed later. One of `kontiga`, `compatible`.
- `mode` (enum, default "live"): Live or test. It cannot be changed later. One of `live`, `test`.
- `description` (string): What the endpoint is, for your team. At most 240 characters.
- `source` (enum, default "custom"): What receives the events: your own code or a no-code automation tool. One of `custom`, `zapier`, `make`, `n8n`.
- `max_retries` (integer): For a compatible endpoint: the attempts per delivery, 0 to 65.
- `retry_frequency_minutes` (integer): For a compatible endpoint: the base retry interval, 1 to 1440 minutes. Kept for compatibility; the waits follow the compatible schedule.

**Returns** webhook endpoint, with its secret: The endpoint, and its signing secret shown this once.

API:

```bash
curl -X POST https://api.kontiga.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://claims.harbourline.example/kontiga/events",
    "events": [
      "document.checked",
      "document.failed"
    ],
    "format": "kontiga",
    "mode": "live",
    "description": "Claims system"
  }'
```

CLI:

```bash
kontiga webhooks create \
  --url https://claims.harbourline.example/kontiga/events \
  --events document.checked,document.failed \
  --format kontiga \
  --mode live \
  --description 'Claims system'
```

MCP tool `create_webhook_endpoint`:

```json
{
  "name": "create_webhook_endpoint",
  "arguments": {
    "url": "https://claims.harbourline.example/kontiga/events",
    "events": [
      "document.checked",
      "document.failed"
    ],
    "format": "kontiga",
    "mode": "live",
    "description": "Claims system"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.create({
  url: "https://claims.harbourline.example/kontiga/events",
  events: ["document.checked", "document.failed"],
  format: "kontiga",
  mode: "live",
  description: "Claims system",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.create(
    url="https://claims.harbourline.example/kontiga/events",
    events=["document.checked", "document.failed"],
    format="kontiga",
    mode="live",
    description="Claims system",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Create(ctx, &kontiga.WebhooksCreateParams{
	Url:         "https://claims.harbourline.example/kontiga/events",
	Events:      []string{"document.checked", "document.failed"},
	Format:      "kontiga",
	Mode:        "live",
	Description: "Claims system",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().create(WebhooksCreateParams.builder()
    .url("https://claims.harbourline.example/kontiga/events")
    .events(List.of("document.checked", "document.failed"))
    .format("kontiga")
    .mode("live")
    .description("Claims system")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.CreateAsync(new WebhooksCreateOptions
{
    Url = "https://claims.harbourline.example/kontiga/events",
    Events = new[] { "document.checked", "document.failed" },
    Format = "kontiga",
    Mode = "live",
    Description = "Claims system",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->create([
    'url' => 'https://claims.harbourline.example/kontiga/events',
    'events' => ['document.checked', 'document.failed'],
    'format' => 'kontiga',
    'mode' => 'live',
    'description' => 'Claims system',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.create(
  url: "https://claims.harbourline.example/kontiga/events",
  events: ["document.checked", "document.failed"],
  format: "kontiga",
  mode: "live",
  description: "Claims system"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .create(kontiga::webhooks::CreateParams {
        url: "https://claims.harbourline.example/kontiga/events".into(),
        events: vec!["document.checked".into(), "document.failed".into()],
        format: "kontiga".into(),
        mode: "live".into(),
        description: "Claims system".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718297",
  "object": "webhook_endpoint",
  "url": "https://claims.harbourline.example/kontiga/events",
  "description": "Claims system",
  "format": "kontiga",
  "mode": "live",
  "source": "custom",
  "events": ["document.checked", "document.failed"],
  "state": "enabled",
  "last_delivery": null,
  "created_at": "2026-11-27T11:50:00Z",
  "created_by_name": "Priya Raman",
  "secret": { "last4": "m2Lw", "created_at": "2026-11-27T11:50:00Z", "previous": null },
  "signing_secret": "whsec_sample0secret0shown0once0m2Lw"
}
```

## List webhook endpoints

Where the workspace receives events: each endpoint of a mode, newest first, with its state, its last delivery and its 24 hours' totals.

`GET /v1/webhook_endpoints`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks list [--mode <live|test>] [--limit <n>] [--cursor <whe_...>]`. MCP tool: `list_webhook_endpoints`.

**Parameters**
- `mode` (enum): The mode's endpoints: `live` or `test`. Left out, the call's own (a key's mode).
- `limit` (integer): How many on a page, 1 to 100. Left out, 100: a workspace has at most 10 of a mode and the test inbox, so one page holds them all.
- `cursor` (id (whe_)): The next_cursor of the page before, to read the page after it. has_more says whether there is one.

**Returns** list of webhook endpoints: The endpoints, Kontiga's own and the compatible ones; next_cursor reads the page after.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks list
```

MCP tool `list_webhook_endpoints`:

```json
{
  "name": "list_webhook_endpoints",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.list();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.list()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.List(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().list();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.ListAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->list();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.list
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .list()
    .await?;
```

Response, 200 OK:

```json
{
  "object": "list",
  "items": [{
      "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
      "object": "webhook_endpoint",
      "url": "https://api.harbourline.example/hooks/kontiga",
      "description": "Loan origination system",
      "format": "kontiga",
      "mode": "live",
      "source": "custom",
      "events": ["document.received", "document.checked", "document.failed"],
      "state": "enabled",
      "disabled": null,
      "last_error": null,
      "failing_since": null,
      "disables_at": null,
      "last_delivery": { "at": "2026-11-27T08:51:14Z", "status": 200, "state": "delivered" },
      "health": { "requests": 318, "delivered": 316, "failed": 2, "error_rate": 0.0063, "avg_ms": 182, "min_ms": 74, "max_ms": 1210 },
      "created_at": "2026-09-03T10:11:00Z",
      "created_by_name": "Priya Raman",
      "secret": { "last4": "Qe7m", "created_at": "2026-09-03T10:11:00Z", "previous": null },
      "method": "post",
      "is_inbox": false,
      "retry_rules": {
        "summary": "Kontiga retries each delivery for 72 hours, the waits doubling from about 1 minute, and turns the endpoint off after 72 hours of failures."
      },
      "recoverable": 0,
      "delayed": false
    }],
  "next_cursor": null,
  "has_more": false
}
```

An endpoint's `health` holds its 24 hours' totals. The hour by hour series, `health.hourly`, is in the health call's list and in a single endpoint's read; a list's and a change's answer leave it out. `delayed` is true while deliveries wait more than 5 minutes past their time because sending is running late: they are kept and sent once it catches up. Deliveries can arrive out of order, after a delay or a retry: an event's `created_at` orders them.

## List webhook endpoints with their health

Every endpoint of a mode, Kontiga's own and the compatible ones, with its state, its last delivery and its requests, failures and times over 24 hours.

`GET /v1/webhook_endpoints/health`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks health [--mode <live|test>]`. MCP tool: `get_webhook_health`.

**Parameters**
- `mode` (enum): The mode's endpoints: `live` or `test`. Left out, the call's own (a key's mode). Live and test are never mixed in a list.

**Returns** list of webhook endpoints: The endpoints with their health; never a secret, only its last four characters.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhook_endpoints/health \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks health
```

MCP tool `get_webhook_health`:

```json
{
  "name": "get_webhook_health",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.health();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.health()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Health(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().health();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.HealthAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->health();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.health
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .health()
    .await?;
```

Response, 200 OK:

```json
{
  "object": "list",
  "items": [{
      "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
      "object": "webhook_endpoint",
      "url": "https://api.harbourline.example/hooks/kontiga",
      "description": "Loan origination system",
      "format": "kontiga",
      "mode": "live",
      "source": "custom",
      "events": ["document.received", "document.checked", "document.failed"],
      "state": "enabled",
      "disabled": null,
      "last_error": null,
      "failing_since": null,
      "disables_at": null,
      "last_delivery": { "at": "2026-11-27T08:51:14Z", "status": 200, "state": "delivered" },
      "health": { "requests": 318, "delivered": 316, "failed": 2, "error_rate": 0.0063, "avg_ms": 182, "min_ms": 74, "max_ms": 1210, "hourly": [{ "at": "2026-11-27T07:00:00Z", "delivered": 14, "failed": 0 }, { "at": "2026-11-27T08:00:00Z", "delivered": 12, "failed": 1 }] },
      "created_at": "2026-09-03T10:11:00Z",
      "created_by_name": "Priya Raman",
      "secret": { "last4": "Qe7m", "created_at": "2026-09-03T10:11:00Z", "previous": null },
      "method": "post",
      "is_inbox": false,
      "retry_rules": {
        "summary": "Kontiga retries each delivery for 72 hours, the waits doubling from about 1 minute, and turns the endpoint off after 72 hours of failures."
      },
      "recoverable": 0,
      "delayed": false
    }],
  "next_cursor": null,
  "has_more": false
}
```

## Read a webhook endpoint

One endpoint: its address, format, mode, events, state, health, the secret's last four characters and its retry rules.

`GET /v1/webhook_endpoints/{endpoint_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks get <endpoint_id>`. MCP tool: `get_webhook_endpoint`.

**Parameters**
- `endpoint_id` (id (whe_), required): The endpoint to read. In the path.

**Returns** webhook endpoint: The endpoint, without its secret.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks get whe_0193c1a2d0017a2b8c3d4e5f60718291
```

MCP tool `get_webhook_endpoint`:

```json
{
  "name": "get_webhook_endpoint",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.get("whe_0193c1a2d0017a2b8c3d4e5f60718291");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.get("whe_0193c1a2d0017a2b8c3d4e5f60718291")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Get(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718291")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().get("whe_0193c1a2d0017a2b8c3d4e5f60718291");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.GetAsync("whe_0193c1a2d0017a2b8c3d4e5f60718291");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->get('whe_0193c1a2d0017a2b8c3d4e5f60718291');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.get("whe_0193c1a2d0017a2b8c3d4e5f60718291")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .get("whe_0193c1a2d0017a2b8c3d4e5f60718291".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "object": "webhook_endpoint",
  "url": "https://api.harbourline.example/hooks/kontiga",
  "description": "Loan origination system",
  "format": "kontiga",
  "mode": "live",
  "source": "custom",
  "events": ["document.received", "document.checked", "document.failed"],
  "state": "enabled",
  "disabled": null,
  "last_error": null,
  "failing_since": null,
  "disables_at": null,
  "last_delivery": { "at": "2026-11-27T08:51:14Z", "status": 200, "state": "delivered" },
  "health": { "requests": 318, "delivered": 316, "failed": 2, "error_rate": 0.0063, "avg_ms": 182, "min_ms": 74, "max_ms": 1210, "hourly": [{ "at": "2026-11-27T07:00:00Z", "delivered": 14, "failed": 0 }, { "at": "2026-11-27T08:00:00Z", "delivered": 12, "failed": 1 }] },
  "created_at": "2026-09-03T10:11:00Z",
  "created_by_name": "Priya Raman",
  "secret": { "last4": "Qe7m", "created_at": "2026-09-03T10:11:00Z", "previous": null },
  "method": "post",
  "is_inbox": false,
  "retry_rules": {
    "success": "A 2xx answer within 10 seconds.",
    "redirect": "A redirect is a failure: it is not followed.",
    "retries": "Retried with waits that double from about 1 minute, up to 6 hours apart, for 72 hours. A Retry-After header is honoured.",
    "gone": "A 410 Gone disables the endpoint at once.",
    "disabling": "After 72 hours of failures with no success the endpoint is disabled, and owners, admins and developers get one email.",
    "summary": "Kontiga retries each delivery for 72 hours, the waits doubling from about 1 minute, and turns the endpoint off after 72 hours of failures."
  },
  "recoverable": 0,
  "delayed": false
}
```

## Change a webhook endpoint

Change an endpoint's address, events or description, or disable it and enable it again; the format and the mode stay as made.

`PATCH /v1/webhook_endpoints/{endpoint_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks update <endpoint_id> [--url <https://...>] [--events <type,type>] [--description <text>] [--state <enabled|disabled>] [--max-retries <0-65>] [--retry-frequency-minutes <1-1440>]`. MCP tool: `update_webhook_endpoint`.

**Parameters**
- `endpoint_id` (id (whe_), required): The endpoint to change. Its format and mode stay as made. In the path.
- `url` (string): A new address. At most 2,048 characters.
- `events` (array of string): The event types it receives from now on. At most 60 items.
- `description` (string): A new description. At most 240 characters.
- `state` (enum): `disabled` stops sending; `enabled` starts again. Also taken as `status`, its earlier name.
- `max_retries` (integer): For a compatible endpoint: the attempts per delivery. At most 65.
- `retry_frequency_minutes` (integer): For a compatible endpoint: the base retry interval, kept for compatibility. At least 1, at most 1,440.

**Returns** webhook endpoint: The endpoint as it is now.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      "document.received",
      "document.checked",
      "document.failed"
    ]
  }'
```

CLI:

```bash
kontiga webhooks update whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  --events document.received,document.checked,document.failed
```

MCP tool `update_webhook_endpoint`:

```json
{
  "name": "update_webhook_endpoint",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    "events": [
      "document.received",
      "document.checked",
      "document.failed"
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.update("whe_0193c1a2d0017a2b8c3d4e5f60718291", {
  events: ["document.received", "document.checked", "document.failed"],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.update("whe_0193c1a2d0017a2b8c3d4e5f60718291", events=["document.received", "document.checked", "document.failed"])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Update(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718291", &kontiga.WebhooksUpdateParams{
	Events: []string{"document.received", "document.checked", "document.failed"},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().update("whe_0193c1a2d0017a2b8c3d4e5f60718291", WebhooksUpdateParams.builder()
    .events(List.of("document.received", "document.checked", "document.failed"))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.UpdateAsync("whe_0193c1a2d0017a2b8c3d4e5f60718291", new WebhooksUpdateOptions
{
    Events = new[] { "document.received", "document.checked", "document.failed" },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->update('whe_0193c1a2d0017a2b8c3d4e5f60718291', [
    'events' => ['document.received', 'document.checked', 'document.failed'],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.update("whe_0193c1a2d0017a2b8c3d4e5f60718291", events: ["document.received", "document.checked", "document.failed"])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .update("whe_0193c1a2d0017a2b8c3d4e5f60718291".into(), kontiga::webhooks::UpdateParams {
        events: vec!["document.received".into(), "document.checked".into(), "document.failed".into()],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "object": "webhook_endpoint",
  "url": "https://api.harbourline.example/hooks/kontiga",
  "description": "Loan origination system",
  "format": "kontiga",
  "mode": "live",
  "source": "custom",
  "events": ["document.received", "document.checked", "document.failed"],
  "state": "enabled",
  "disabled": null,
  "last_error": null,
  "failing_since": null,
  "disables_at": null,
  "last_delivery": { "at": "2026-11-27T08:51:14Z", "status": 200, "state": "delivered" },
  "health": { "requests": 318, "delivered": 316, "failed": 2, "error_rate": 0.0063, "avg_ms": 182, "min_ms": 74, "max_ms": 1210 },
  "created_at": "2026-09-03T10:11:00Z",
  "created_by_name": "Priya Raman",
  "secret": { "last4": "Qe7m", "created_at": "2026-09-03T10:11:00Z", "previous": null },
  "method": "post",
  "is_inbox": false,
  "retry_rules": {
    "summary": "Kontiga retries each delivery for 72 hours, the waits doubling from about 1 minute, and turns the endpoint off after 72 hours of failures."
  },
  "recoverable": 0,
  "delayed": false
}
```

## Roll a signing secret

Give a Kontiga endpoint a new signing secret, shown once; the old one keeps verifying for the overlap chosen, none to 7 days.

`POST /v1/webhook_endpoints/{endpoint_id}/roll_secret`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks roll-secret <endpoint_id> [--overlap <none|1h|24h|3d|7d>]`. MCP tool: `roll_webhook_secret`.

**Parameters**
- `endpoint_id` (id (whe_), required): A Kontiga endpoint. A compatible endpoint is verified with the public key instead. In the path.
- `overlap` (enum, default "24h"): How long the old secret keeps verifying. One of `none`, `1h`, `24h`, `3d`, `7d`.

**Returns** webhook endpoint, with its new secret: The endpoint and its new secret, shown this once.

API:

```bash
curl -X POST https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718291/roll_secret \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "overlap": "24h"
  }'
```

CLI:

```bash
kontiga webhooks roll-secret whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  --overlap 24h
```

MCP tool `roll_webhook_secret`:

```json
{
  "name": "roll_webhook_secret",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    "overlap": "24h"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.rollSecret("whe_0193c1a2d0017a2b8c3d4e5f60718291", {
  overlap: "24h",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.roll_secret("whe_0193c1a2d0017a2b8c3d4e5f60718291", overlap="24h")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.RollSecret(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718291", &kontiga.WebhooksRollSecretParams{
	Overlap: "24h",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().rollSecret("whe_0193c1a2d0017a2b8c3d4e5f60718291", WebhooksRollSecretParams.builder()
    .overlap("24h")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.RollSecretAsync("whe_0193c1a2d0017a2b8c3d4e5f60718291", new WebhooksRollSecretOptions
{
    Overlap = "24h",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->rollSecret('whe_0193c1a2d0017a2b8c3d4e5f60718291', [
    'overlap' => '24h',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.roll_secret("whe_0193c1a2d0017a2b8c3d4e5f60718291", overlap: "24h")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .roll_secret("whe_0193c1a2d0017a2b8c3d4e5f60718291".into(), kontiga::webhooks::RollSecretParams {
        overlap: "24h".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "object": "webhook_endpoint",
  "url": "https://api.harbourline.example/hooks/kontiga",
  "format": "kontiga",
  "state": "enabled",
  "secret": {
    "last4": "Tz4k",
    "created_at": "2026-11-27T11:55:00Z",
    "previous": { "last4": "Qe7m", "expires_at": "2026-11-28T11:55:00Z" }
  },
  "signing_secret": "whsec_sample0rolled0secret0once0Tz4k"
}
```

## Delete a webhook endpoint

Stop sending to an endpoint and remove it; its delivery log is kept until its retention ends.

`DELETE /v1/webhook_endpoints/{endpoint_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks delete <endpoint_id>`. MCP tool: `delete_webhook_endpoint`.

**Parameters**
- `endpoint_id` (id (whe_), required): The endpoint to remove. Its delivery log is kept until its retention ends. In the path.

**Returns** deleted webhook endpoint: The endpoint's id, deleted.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718297 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks delete whe_0193c1a2d0017a2b8c3d4e5f60718297
```

MCP tool `delete_webhook_endpoint`:

```json
{
  "name": "delete_webhook_endpoint",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718297"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.delete("whe_0193c1a2d0017a2b8c3d4e5f60718297");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.delete("whe_0193c1a2d0017a2b8c3d4e5f60718297")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Delete(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718297")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().delete("whe_0193c1a2d0017a2b8c3d4e5f60718297");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.DeleteAsync("whe_0193c1a2d0017a2b8c3d4e5f60718297");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->delete('whe_0193c1a2d0017a2b8c3d4e5f60718297');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.delete("whe_0193c1a2d0017a2b8c3d4e5f60718297")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .delete("whe_0193c1a2d0017a2b8c3d4e5f60718297".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whe_0193c1a2d0017a2b8c3d4e5f60718297",
  "object": "webhook_endpoint",
  "deleted": true
}
```

## List webhook deliveries

One row per event per endpoint, newest first, with its state, attempts and last status; filter by endpoint, state, event type, one event's id or an object's id.

`GET /v1/webhook_deliveries`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks deliveries [--endpoint-id <whe_id>] [--state <delivered|pending|failed|skipped>] [--event <type>] [--event-id <evt_id>] [--object-id <doc_id>] [--limit <n>] [--cursor <dlv_id>]`. MCP tool: `list_webhook_deliveries`.

**Parameters**
- `endpoint_id` (id (whe_)): Only this endpoint's deliveries.
- `state` (enum): Only deliveries in this state: delivered, pending, failed or skipped (a pending delivery of a disabled endpoint reads as skipped). One of `delivered`, `pending`, `failed`, `skipped`.
- `event` (string): Only deliveries of this event type.
- `event_id` (string): Only the deliveries of this event (its evt_ id; a compatible event's uuid as its body writes it). An id of no event answers an empty list.
- `object_id` (string): Only the deliveries of this object's events (its id, such as doc_ and 32 characters). Give event_id or object_id, not both.
- `limit` (integer): How many to answer, 1 to 200; 50 when left out.
- `cursor` (id (dlv_)): The next_cursor of the page before, to read the page after it. has_more says whether there is one.

**Returns** list of webhook deliveries: The deliveries, newest first, test sends marked; next_cursor reads the page after.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/webhook_deliveries?endpoint_id=whe_0193c1a2d0017a2b8c3d4e5f60718291&state=failed&limit=1" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks deliveries \
  --endpoint-id whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  --state failed \
  --limit 1
```

MCP tool `list_webhook_deliveries`:

```json
{
  "name": "list_webhook_deliveries",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    "state": "failed",
    "limit": 1
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhookDeliveries.list({
  endpoint_id: "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  state: "failed",
  limit: 1,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.list(
    endpoint_id="whe_0193c1a2d0017a2b8c3d4e5f60718291",
    state="failed",
    limit=1,
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.WebhookDeliveries.List(ctx, &kontiga.WebhookDeliveriesListParams{
	EndpointId: "whe_0193c1a2d0017a2b8c3d4e5f60718291",
	State:      "failed",
	Limit:      1,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhookDeliveries().list(WebhookDeliveriesListParams.builder()
    .endpointId("whe_0193c1a2d0017a2b8c3d4e5f60718291")
    .state("failed")
    .limit(1)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.WebhookDeliveries.ListAsync(new WebhookDeliveriesListOptions
{
    EndpointId = "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    State = "failed",
    Limit = 1,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhookDeliveries->list([
    'endpoint_id' => 'whe_0193c1a2d0017a2b8c3d4e5f60718291',
    'state' => 'failed',
    'limit' => 1,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.list(
  endpoint_id: "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  state: "failed",
  limit: 1
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhook_deliveries()
    .list(kontiga::webhook_deliveries::ListParams {
        endpoint_id: "whe_0193c1a2d0017a2b8c3d4e5f60718291".into(),
        state: "failed".into(),
        limit: 1,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "list",
  "items": [
    {
      "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82",
      "object": "webhook_delivery",
      "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
      "endpoint_url": "https://api.harbourline.example/hooks/kontiga",
      "format": "kontiga",
      "mode": "live",
      "event_id": "evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e92",
      "event": "document.failed",
      "object_id": "doc_0193c1a2d0017a2b8c3d4e5f60718295",
      "object_href": "/console/documents/doc_0193c1a2d0017a2b8c3d4e5f60718295",
      "state": "failed",
      "attempts": 17,
      "last_status": 500,
      "last_duration_ms": 412,
      "created_at": "2026-11-24T10:03:30Z",
      "last_attempt_at": "2026-11-27T09:51:02Z",
      "next_retry_at": null,
      "test": false,
      "to_inbox": false,
      "resend_of": null
    }
  ],
  "next_cursor": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82",
  "has_more": true
}
```

## Read a webhook delivery

One delivery with every attempt: the request exactly as sent (address, method, headers with the signature, body) and the response (status, headers, body, time).

`GET /v1/webhook_deliveries/{delivery_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks delivery <delivery_id>`. MCP tool: `get_webhook_delivery`.

**Parameters**
- `delivery_id` (id (dlv_), required): The delivery to read, with every attempt's request and response. A restricted key without `events:read`, or a member whose role does not read events, gets every attempt without the bodies. In the path.

**Returns** webhook delivery: The delivery and each attempt's request and response.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhook_deliveries/dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks delivery dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81
```

MCP tool `get_webhook_delivery`:

```json
{
  "name": "get_webhook_delivery",
  "arguments": {
    "delivery_id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhookDeliveries.get("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.get("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.WebhookDeliveries.Get(ctx, "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhookDeliveries().get("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.WebhookDeliveries.GetAsync("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhookDeliveries->get('dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.get("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhook_deliveries()
    .get("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e81",
  "object": "webhook_delivery",
  "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "endpoint_url": "https://api.harbourline.example/hooks/kontiga",
  "format": "kontiga",
  "mode": "live",
  "event_id": "evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e90",
  "event": "document.checked",
  "object_id": "doc_0193c1a2d0017a2b8c3d4e5f60718294",
  "object_href": "/console/documents/doc_0193c1a2d0017a2b8c3d4e5f60718294",
  "state": "delivered",
  "attempts": 1,
  "last_status": 200,
  "last_duration_ms": 166,
  "created_at": "2026-11-26T08:41:07Z",
  "last_attempt_at": "2026-11-26T08:41:08Z",
  "next_retry_at": null,
  "delayed": false,
  "test": false,
  "to_inbox": false,
  "resend_of": null,
  "attempt_list": [
    {
      "number": 1,
      "at": "2026-11-26T08:41:08.031Z",
      "status": 200,
      "duration_ms": 166,
      "ok": true,
      "failure": null,
      "request": {
        "url": "https://api.harbourline.example/hooks/kontiga",
        "method": "POST",
        "headers": [
          ["Content-Type", "application/json"],
          ["User-Agent", "Kontiga-Webhooks/1.0"],
          ["Kontiga-Event-Id", "evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e90"],
          ["Kontiga-Signature", "t=1795682468,v1=5f1c9e0b7a2d4c6e8f0a1b3c5d7e9f2a4b6c8d0e1f3a5b7c9d2e4f6a8b0c1d3e"]
        ],
        "body": "{\"id\":\"evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e90\",\"object\":\"event\",\"type\":\"document.checked\",\"created_at\":\"2026-11-26T08:41:07.412Z\",\"workspace\":\"ws_0193c1a2b3c44d5e8f9a0b1c2d3e4f50\",\"mode\":\"live\",\"actor\":\"system\",\"request\":null,\"api_version\":\"v1\",\"data\":{\"object\":{\"id\":\"doc_0193c1a2d0017a2b8c3d4e5f60718294\",\"object\":\"document\",\"verdict\":\"review\"}}}"
      },
      "response": { "status": 200, "headers": [["content-type", "text/plain"]], "body": "ok", "truncated": false }
    }
  ],
  "body_hidden": null
}
```

## Resend a delivery

Send one delivery again with the same event id and a fresh timestamp and signature; the real result is logged as a new attempt.

`POST /v1/webhook_deliveries/{delivery_id}/resend`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks resend <delivery_id>`. MCP tool: `resend_webhook_delivery`.

**Parameters**
- `delivery_id` (id (dlv_), required): The delivery to send again, with the same event id and a fresh signature. A resend is an attempt of its own: when it fails, the delivery keeps its state and its next scheduled retry, and its attempts do not count toward the schedule. One resend of a delivery runs at a time; a second while one is in flight answers 409 `resend_in_progress` with Retry-After. In the path.

**Returns** webhook delivery: The delivery with its new attempt.

API:

```bash
curl -X POST https://api.kontiga.com/v1/webhook_deliveries/dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82/resend \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks resend dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82
```

MCP tool `resend_webhook_delivery`:

```json
{
  "name": "resend_webhook_delivery",
  "arguments": {
    "delivery_id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhookDeliveries.resend("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.resend("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.WebhookDeliveries.Resend(ctx, "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhookDeliveries().resend("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.WebhookDeliveries.ResendAsync("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhookDeliveries->resend('dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhook_deliveries.resend("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhook_deliveries()
    .resend("dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e82",
  "object": "webhook_delivery",
  "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "event": "document.failed",
  "state": "delivered",
  "attempts": 4,
  "last_status": 200,
  "attempt_list": [
    { "number": 3, "at": "2026-11-27T10:07:30.118Z", "status": 500, "duration_ms": 92, "ok": false, "failure": { "kind": "status", "message": "The endpoint answered 500: its server had an error." } },
    { "number": 4, "at": "2026-11-27T12:01:15.640Z", "status": 200, "duration_ms": 158, "ok": true, "failure": null }
  ]
}
```

## Recover failed deliveries

Send again every delivery of an endpoint that failed or was skipped since a date.

`POST /v1/webhook_endpoints/{endpoint_id}/recover`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks recover <endpoint_id> --since <date>`. MCP tool: `recover_webhook_deliveries`.

**Parameters**
- `endpoint_id` (id (whe_), required): The endpoint. In the path.
- `since` (string, required): Send again every delivery that failed or was skipped from this day or time on. A disabled endpoint answers 409 `endpoint_disabled`: enable it first.

**Returns** recovered deliveries: How many were sent again, and the deliveries.

API:

```bash
curl -X POST https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718292/recover \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "since": "2026-11-26"
  }'
```

CLI:

```bash
kontiga webhooks recover whe_0193c1a2d0017a2b8c3d4e5f60718292 \
  --since 2026-11-26
```

MCP tool `recover_webhook_deliveries`:

```json
{
  "name": "recover_webhook_deliveries",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718292",
    "since": "2026-11-26"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.recover("whe_0193c1a2d0017a2b8c3d4e5f60718292", {
  since: "2026-11-26",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.recover("whe_0193c1a2d0017a2b8c3d4e5f60718292", since="2026-11-26")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Recover(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718292", &kontiga.WebhooksRecoverParams{
	Since: "2026-11-26",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().recover("whe_0193c1a2d0017a2b8c3d4e5f60718292", WebhooksRecoverParams.builder()
    .since("2026-11-26")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.RecoverAsync("whe_0193c1a2d0017a2b8c3d4e5f60718292", new WebhooksRecoverOptions
{
    Since = "2026-11-26",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->recover('whe_0193c1a2d0017a2b8c3d4e5f60718292', [
    'since' => '2026-11-26',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.recover("whe_0193c1a2d0017a2b8c3d4e5f60718292", since: "2026-11-26")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .recover("whe_0193c1a2d0017a2b8c3d4e5f60718292".into(), kontiga::webhooks::RecoverParams {
        since: "2026-11-26".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "webhook_recovery",
  "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718292",
  "since": "2026-11-26",
  "resent": 2,
  "deliveries": [
    { "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e84", "object": "webhook_delivery", "event": "document.analyzed", "state": "pending" },
    { "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e85", "object": "webhook_delivery", "event": "document.rejected", "state": "pending" }
  ]
}
```

## Send a test event

Send a sample of any event type to an endpoint, live or test, or to the test inbox, as a real signed request; the answer is the attempt.

`POST /v1/webhook_endpoints/{endpoint_id}/test`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks test <endpoint_id> --type <event> [--payload <json>] [--target <endpoint|inbox>]`. MCP tool: `send_test_webhook`.

**Parameters**
- `endpoint_id` (id (whe_), required): The endpoint to send to, live or test. In the path.
- `type` (string, required): The event type to send a sample of.
- `payload` (record): Your own delivery body for a Kontiga test endpoint, or for the test inbox (`target` `inbox`), sent in place of the sample (at most 64 KiB). Its `id`, `workspace` and `mode` stay the test's own, so your server can always tell it from a real event. The catalogue's example of the type is sent when left out. A live endpoint and a compatible one are always sent the example: a body written for them is refused.
- `target` (enum, default "endpoint"): `endpoint` sends to its address; `inbox` sends to the workspace's test inbox instead.

**Returns** webhook delivery: The test send: the request as sent and the endpoint's answer, within 10 seconds.

API:

```bash
curl -X POST https://api.kontiga.com/v1/webhook_endpoints/whe_0193c1a2d0017a2b8c3d4e5f60718291/test \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "document.checked",
    "target": "endpoint"
  }'
```

CLI:

```bash
kontiga webhooks test whe_0193c1a2d0017a2b8c3d4e5f60718291 \
  --type document.checked \
  --target endpoint
```

MCP tool `send_test_webhook`:

```json
{
  "name": "send_test_webhook",
  "arguments": {
    "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    "type": "document.checked",
    "target": "endpoint"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhooks.test("whe_0193c1a2d0017a2b8c3d4e5f60718291", {
  type: "document.checked",
  target: "endpoint",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhooks.test(
    "whe_0193c1a2d0017a2b8c3d4e5f60718291",
    type="document.checked",
    target="endpoint",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Webhooks.Test(ctx, "whe_0193c1a2d0017a2b8c3d4e5f60718291", &kontiga.WebhooksTestParams{
	Type:   "document.checked",
	Target: "endpoint",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhooks().test("whe_0193c1a2d0017a2b8c3d4e5f60718291", WebhooksTestParams.builder()
    .type("document.checked")
    .target("endpoint")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Webhooks.TestAsync("whe_0193c1a2d0017a2b8c3d4e5f60718291", new WebhooksTestOptions
{
    Type = "document.checked",
    Target = "endpoint",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhooks->test('whe_0193c1a2d0017a2b8c3d4e5f60718291', [
    'type' => 'document.checked',
    'target' => 'endpoint',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhooks.test(
  "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  type: "document.checked",
  target: "endpoint"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhooks()
    .test("whe_0193c1a2d0017a2b8c3d4e5f60718291".into(), kontiga::webhooks::TestParams {
        r#type: "document.checked".into(),
        target: "endpoint".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e83",
  "object": "webhook_delivery",
  "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
  "event": "document.checked",
  "state": "delivered",
  "attempts": 1,
  "last_status": 200,
  "last_duration_ms": 141,
  "test": true,
  "to_inbox": false,
  "attempt_list": [
    {
      "number": 1,
      "at": "2026-11-27T11:58:02.204Z",
      "status": 200,
      "duration_ms": 141,
      "ok": true,
      "failure": null,
      "response": { "status": 200, "headers": [], "body": "ok", "truncated": false }
    }
  ],
  "body_hidden": null
}
```

## List event types

The events an endpoint can receive, grouped by product, each with what it means and an example payload.

`GET /v1/event_types`. Who may: Owner, Admin and Developer. CLI: `kontiga events types [--format <kontiga|compatible>]`. MCP tool: `list_event_types`.

**Parameters**
- `format` (enum): Only the events of this format. One of `kontiga`, `compatible`.

**Returns** list of event types: The catalogue: Kontiga's own events and the three compatible document events, with examples.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/event_types?format=kontiga" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga events types --format kontiga
```

MCP tool `list_event_types`:

```json
{
  "name": "list_event_types",
  "arguments": {
    "format": "kontiga"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.eventTypes.list({
  format: "kontiga",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.event_types.list(format="kontiga")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.EventTypes.List(ctx, &kontiga.EventTypesListParams{
	Format: "kontiga",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.eventTypes().list(EventTypesListParams.builder()
    .format("kontiga")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.EventTypes.ListAsync(new EventTypesListOptions
{
    Format = "kontiga",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->eventTypes->list([
    'format' => 'kontiga',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.event_types.list(format: "kontiga")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .event_types()
    .list(kontiga::event_types::ListParams {
        format: "kontiga".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "list",
  "items": [
    {
      "object": "event_type",
      "type": "document.checked",
      "format": "kontiga",
      "group": "Detect and Extract",
      "description": "Every check of a document is done: its verdict, findings, both scores and the fields read.",
      "example": { "id": "evt_0193c1a2d0017a2b8c3d4e5f60718293", "object": "event", "type": "document.checked", "created_at": "2026-11-26T09:48:42.118Z", "workspace": "ws_0193c1a2b3c44d5e8f9a0b1c2d3e4f50", "mode": "test", "actor": "system", "request": null, "api_version": "v1", "data": { "object": { "id": "doc_0193c1a2d0017a2b8c3d4e5f60718294", "object": "document" } } }
    },
    {
      "object": "event_type",
      "type": "document.analyzed",
      "format": "compatible",
      "group": "Documents (Bynn-compatible)",
      "description": "A document's analysis finished, test runs and rejected runs included. Bynn's envelope, headers and signature.",
      "example": { "event_id": "4b0e7c2a-1f3d-4a8e-9c6b-2d5f8e1a7c30", "event_type": "document.analyzed", "resource": { "type": "document", "status": "analyzed" } }
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## Read the test inbox

The workspace's Kontiga-hosted test address and the last requests it received, each with its headers, body and whether its signature verifies.

`GET /v1/webhook_inbox`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks inbox`. MCP tool: `get_webhook_inbox`.

**Parameters**

**Returns** webhook inbox: The inbox's address and its last 100 requests of the last 7 days.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhook_inbox \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks inbox
```

MCP tool `get_webhook_inbox`:

```json
{
  "name": "get_webhook_inbox",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhookInbox.get();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhook_inbox.get()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.WebhookInbox.Get(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhookInbox().get();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.WebhookInbox.GetAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhookInbox->get();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhook_inbox.get
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhook_inbox()
    .get()
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whi_0193c1a2b3c44d5e8f9a0b1c2d3e4f50",
  "object": "webhook_inbox",
  "url": "https://api.kontiga.com/inbox/whi_0193c1a2b3c44d5e8f9a0b1c2d3e4f50",
  "keeps": { "requests": 100, "days": 7 },
  "requests": [
    {
      "id": "ibr_0193c1a2d4e07c1d9e2f3a4b5c6d0001",
      "at": "2026-11-27T11:58:02.204Z",
      "method": "POST",
      "headers": [["Content-Type", "application/json"], ["User-Agent", "Kontiga-Webhooks/1.0"], ["Kontiga-Event-Id", "evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e91"], ["Kontiga-Signature", "t=1795867082,v1=8c2e..."]],
      "body": "{\"id\":\"evt_0193c1a2d4e07c1d9e2f3a4b5c6d7e91\",\"type\":\"document.checked\",\"mode\":\"test\"}",
      "event": "document.checked",
      "delivery_id": "dlv_0193c1a2d4e07c1d9e2f3a4b5c6d7e83",
      "endpoint_id": "whe_0193c1a2d0017a2b8c3d4e5f60718291",
      "endpoint_url": "https://api.harbourline.example/hooks/kontiga",
      "test": true,
      "signature": { "state": "verified", "detail": "Verified with the current secret, ending Qe7m." }
    }
  ]
}
```

The inbox holds test deliveries, so a live key reads and clears none of it: use a test key, or the console.

## Clear the test inbox

Remove every request the test inbox holds; its address stays the same.

`DELETE /v1/webhook_inbox/requests`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks inbox-clear`. MCP tool: `clear_webhook_inbox`.

**Parameters**

**Returns** cleared webhook inbox: The inbox's id, its requests deleted, and how many went; its address stays.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/webhook_inbox/requests \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga webhooks inbox-clear
```

MCP tool `clear_webhook_inbox`:

```json
{
  "name": "clear_webhook_inbox",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.webhookInbox.clear();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.webhook_inbox.clear()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.WebhookInbox.Clear(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.webhookInbox().clear();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.WebhookInbox.ClearAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->webhookInbox->clear();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.webhook_inbox.clear
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .webhook_inbox()
    .clear()
    .await?;
```

Response, 200 OK:

```json
{
  "id": "whi_0193c1a2b3c44d5e8f9a0b1c2d3e4f50",
  "object": "webhook_inbox",
  "deleted": true,
  "requests_deleted": 1
}
```

## Read the webhook public key

Kontiga's RSA public key, which verifies the compatible document webhooks: X-Bynn-Signature and the body's jwt. Read with no key, as Bynn's is, so a receiver can fetch it on its own; at most 60 a minute from one address.

`GET /v1/webhooks/public_key`. Who may: Anyone, with no account yet. CLI: `kontiga webhooks public-key`. MCP tool: `get_webhook_public_key`.

**Parameters**

**Returns** webhook public key: status ok, the algorithm RS256 and the public key as PEM, in Bynn's shape. When the signing key cannot be read: 503 with the code signing_key_unavailable.

API:

```bash
curl -X GET https://api.kontiga.com/v1/webhooks/public_key
```

CLI:

```bash
kontiga webhooks public-key
```

MCP tool `get_webhook_public_key`:

```json
{
  "name": "get_webhook_public_key",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // no key needed
const result = await kontiga.webhooks.publicKey();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # no key needed
result = kontiga.webhooks.public_key()
```

Go:

```go
client := kontiga.NewClient() // no key needed
result, err := client.Webhooks.PublicKey(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // no key needed
var result = kontiga.webhooks().publicKey();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // no key needed
var result = await kontiga.Webhooks.PublicKeyAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // no key needed
$result = $kontiga->webhooks->publicKey();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # no key needed
result = kontiga.webhooks.public_key
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // no key needed
let result = kontiga
    .webhooks()
    .public_key()
    .await?;
```

Response, 200 OK:

```json
{
  "status": "ok",
  "algorithm": "RS256",
  "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...\n-----END PUBLIC KEY-----\n"
}
```

## Trigger a sample event

Send a sample of one event type, with invented data, to every endpoint of this mode that takes it, or to one endpoint, each as a test delivery.

`POST /v1/test_triggers`. Who may: Owner, Admin and Developer. CLI: `kontiga webhooks trigger --type <event> [--endpoint-id <endpoint_id>]`. MCP tool: `trigger_sample_event`.

**Parameters**
- `type` (string, required): The event type to send a sample of, with invented data. Every delivery of one trigger carries the same event id, the trigger's own (ttr_ and evt_ share their 32 characters). A sample is not kept in the event log: its deliveries' `event_id` is null, and the body carries the sample's id.
- `endpoint_id` (id (whe_)): Only this endpoint. Without it, every endpoint of the mode subscribed to the type.

**Returns** test trigger: The sample, and the test delivery made to each endpoint it reached.

API:

```bash
curl -X POST https://api.kontiga.com/v1/test_triggers \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "document.checked"
  }'
```

CLI:

```bash
kontiga webhooks trigger --type document.checked
```

MCP tool `trigger_sample_event`:

```json
{
  "name": "trigger_sample_event",
  "arguments": {
    "type": "document.checked"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.testTriggers.create({
  type: "document.checked",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.test_triggers.create(type="document.checked")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.TestTriggers.Create(ctx, &kontiga.TestTriggersCreateParams{
	Type: "document.checked",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.testTriggers().create(TestTriggersCreateParams.builder()
    .type("document.checked")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.TestTriggers.CreateAsync(new TestTriggersCreateOptions
{
    Type = "document.checked",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->testTriggers->create([
    'type' => 'document.checked',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.test_triggers.create(type: "document.checked")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .test_triggers()
    .create(kontiga::test_triggers::CreateParams {
        r#type: "document.checked".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "ttr_0193c1a2d4e07c1d9e2f3a4b5c6d7e99",
  "object": "test_trigger",
  "type": "document.checked",
  "mode": "test",
  "deliveries": []
}
```

## Screening webhooks

A Kontiga endpoint subscribes to Screen's six events by name in its `events`: `screening.completed`, `screening.match_found`, `screening.match_confirmed`, `screening.match_dismissed`, `screening.match_reopened` and `screening.monitoring_ended`. Each carries the screening as `data.object` and the fields its type adds beside it, as [Screening events](https://kontiga.com/docs/events#screening-events) shows. A test screening's events go to test endpoints only, and a sample of each can be sent to any endpoint from here.

**Subscribe an endpoint to the six**

```bash
curl https://api.kontiga.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format": "kontiga", "url": "https://hooks.example.com/kontiga", "events": ["screening.completed", "screening.match_found", "screening.match_confirmed", "screening.match_dismissed", "screening.match_reopened", "screening.monitoring_ended"]}'
```

- An endpoint is live or test, the mode of the key that makes it unless `mode` says: a test endpoint takes test screenings' events only, a live one live ones. Its signing secret is answered once, at creation.
- Each delivery is a `POST` of the event, signed with `Kontiga-Signature: t=<seconds>,v1=<HMAC-SHA256 of "t.body" with the secret>`, made afresh on every attempt. Check `t` is within five minutes and a `v1` matches, as [Receive webhooks](https://kontiga.com/docs/guides/receive-webhooks#verify-the-signature) shows, and answer `2xx` within 10 seconds.
- A delivery is sent at least once: deduplicate by `Kontiga-Event-Id`, the event's `id`. Retries can arrive out of order: an event's `created_at` and its id both sort in the order things happened, and `data.object` is the screening as that event left it.
- A failed delivery is retried for 72 hours, the waits doubling from 1 minute up to 6 hours; an endpoint failing for 72 hours is turned off with an email. Any delivery can be sent again with `webhook_deliveries.resend`.
- A missed event is read back whole with `GET /v1/events/{id}` for 90 days.
- The body is the [event object](https://kontiga.com/docs/events#the-event-object): `actor` says who made the change (`mem_`, `key_`, `system`) and `request` the API call that made it, with the `Idempotency-Key` you sent, so a handler needs no second call to know who did it.
- When a person is deleted, what their screenings' events carried is deleted with them, deliveries not yet made are not sent, and a monitored screening sends `screening.monitoring_ended` with `person_deleted` as its last word.
