Skip to main content
POST
/
v1
/
webhooks
Create webhook configuration
curl --request POST \
  --url http://localhost:8000/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "document.processing.completed",
    "document.processing.failed"
  ],
  "is_active": true,
  "retry_enabled": true,
  "max_retries": 5
}
'
{
  "webhook_config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "url": "<string>",
  "signing_secret": "<string>",
  "events": [
    "<string>"
  ],
  "is_active": true,
  "retry_enabled": true,
  "max_retries": 123,
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API Key authentication. Format: dk_test_ or dk_live_

Body

application/json

Request schema for creating a webhook configuration (POST /v1/webhooks).

A cryptographically secure signing secret will be auto-generated. The secret is returned only in the creation response.

Configure webhook endpoints once and receive notifications for all subscribed events. This follows the Stripe/Clerk pattern for webhook management.

Attributes: url: HTTPS webhook endpoint URL events: List of event types to subscribe to (default: document.processing.completed, document.processing.failed) is_active: Whether the webhook is active (default: True) retry_enabled: Whether to retry failed deliveries (default: True) max_retries: Maximum retry attempts (default: 5)

Available Events: - document.uploaded: Document successfully uploaded and queued - document.processing.completed: Extraction completed successfully - document.processing.failed: Extraction failed with error

url
string
required

HTTPS webhook endpoint URL

Required string length: 1 - 2048
events
enum<string>[]

List of event types to subscribe to

Available options:
document.uploaded,
document.processing.completed,
document.processing.failed
is_active
boolean
default:true

Whether the webhook is active

retry_enabled
boolean
default:true

Whether to retry failed deliveries

max_retries
integer
default:5

Maximum retry attempts (0-10)

Required range: 0 <= x <= 10

Response

New webhook config with signing secret

Response for newly created webhook configuration (includes signing secret).

WARNING: The signing_secret field is shown only in this response. Store it securely immediately - it cannot be retrieved again.

Available Events: - document.uploaded: Document successfully uploaded and queued - document.processing.completed: Extraction completed successfully - document.processing.failed: Extraction failed with error

webhook_config_id
string<uuid>
required

Unique webhook configuration identifier

url
string
required

HTTPS webhook endpoint URL

signing_secret
string
required

Webhook signing secret for HMAC verification (SHOWN ONLY IN THIS RESPONSE)

events
string[]
required

List of event types subscribed to

is_active
boolean
required

Whether the webhook is active

retry_enabled
boolean
required

Whether to retry failed deliveries

max_retries
integer
required

Maximum retry attempts

created_at
string<date-time>
required

Configuration creation timestamp (ISO 8601)