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"
}

Documentation Index

Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt

Use this file to discover all available pages before exploring further.

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"
}

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/settings. Send as Authorization: Bearer <key>.

Body

application/json

Request to create a new webhook subscription.

url
string<uri>
required

The HTTPS URL to receive webhook events. Must be publicly accessible.

Required string length: 1 - 2083
Example:

"https://example.com/webhooks/anyformat"

events
string[]

List of event types to subscribe to. Available events: extraction.completed, extraction.failed.

Example:
["extraction.completed", "extraction.failed"]

Response

Successful Response

Webhook subscription details including the signing secret. The secret is only returned at creation time.

id
string
required

Unique identifier of the webhook.

url
string<uri>
required

The URL receiving webhook events.

Required string length: 1 - 2083
Example:

"https://example.com/webhooks/anyformat"

events
string[]
required

Event types this webhook is subscribed to.

Example:
["extraction.completed", "extraction.failed"]
is_active
boolean
required

Whether the webhook is currently active and receiving events.

Example:

true

secret
string
required

Webhook signing secret. Use this to verify that incoming webhook requests are authentic. Store securely — this value is only shown once at creation time.

created_at
string<date-time>
required

Timestamp when the webhook was created (ISO 8601).