Skip to main content
POST
/
v2
/
webhooks
curl -X POST 'https://api.anyformat.ai/v2/webhooks/' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "url": "https://your-server.com/webhooks/anyformat",
    "events": ["extraction.completed", "extraction.failed"]
  }'
{
  "id": "wh_1234567890",
  "url": "https://your-server.com/webhooks/anyformat",
  "events": ["extraction.completed", "extraction.failed"],
  "is_active": true,
  "secret": "whsec_abc123def456...",
  "created_at": "2024-03-24T12:00:00.000Z"
}
Create a new webhook subscription. The response includes a secret for verifying webhook signatures. This secret is only returned on creation and cannot be retrieved later.

Request Body

FieldTypeRequiredDefaultDescription
urlstringYesHTTPS URL to receive webhook events. HTTP URLs are rejected.
eventsstring[]NoAll eventsArray of event types to subscribe to: extraction.completed, extraction.failed
The secret field is only included in the creation response. Store it immediately. If lost, delete the webhook and create a new one.
curl -X POST 'https://api.anyformat.ai/v2/webhooks/' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "url": "https://your-server.com/webhooks/anyformat",
    "events": ["extraction.completed", "extraction.failed"]
  }'
{
  "id": "wh_1234567890",
  "url": "https://your-server.com/webhooks/anyformat",
  "events": ["extraction.completed", "extraction.failed"],
  "is_active": true,
  "secret": "whsec_abc123def456...",
  "created_at": "2024-03-24T12:00:00.000Z"
}

Headers

authorization
string | null

Body

application/json

Request schema for creating a webhook subscription

url
string<uri>
required
Required string length: 1 - 2083
events
string[]

Response

Successful Response

Response schema for webhook subscription (includes secret)

id
string
required
url
string
required
events
string[]
required
is_active
boolean
required
secret
string
required
created_at
string
required