Types & Formats

This page documents the structure of webhook payloads, delivery headers, and the data models used throughout the Webhooks API.

Event Types

sync.pending

Fired when a sync job is created and queued for processing.

1{
2 "event_type": "sync.pending",
3 "job_id": "550e8400-e29b-41d4-a716-446655440000",
4 "collection_readable_id": "finance-data-ab123",
5 "collection_name": "Finance Data",
6 "source_connection_id": "660e8400-e29b-41d4-a716-446655440001",
7 "source_type": "notion",
8 "status": "pending",
9 "timestamp": "2025-01-15T14:00:00Z"
10}

sync.running

Fired when the sync job starts processing.

1{
2 "event_type": "sync.running",
3 "job_id": "550e8400-e29b-41d4-a716-446655440000",
4 "collection_readable_id": "finance-data-ab123",
5 "collection_name": "Finance Data",
6 "source_connection_id": "660e8400-e29b-41d4-a716-446655440001",
7 "source_type": "notion",
8 "status": "running",
9 "timestamp": "2025-01-15T14:00:05Z"
10}

sync.completed

Fired when the sync job finishes successfully.

1{
2 "event_type": "sync.completed",
3 "job_id": "550e8400-e29b-41d4-a716-446655440000",
4 "collection_readable_id": "finance-data-ab123",
5 "collection_name": "Finance Data",
6 "source_connection_id": "660e8400-e29b-41d4-a716-446655440001",
7 "source_type": "notion",
8 "status": "completed",
9 "timestamp": "2025-01-15T14:05:00Z"
10}

sync.failed

Fired when the sync job encounters an error. Includes an error field with details.

1{
2 "event_type": "sync.failed",
3 "job_id": "550e8400-e29b-41d4-a716-446655440000",
4 "collection_readable_id": "finance-data-ab123",
5 "collection_name": "Finance Data",
6 "source_connection_id": "660e8400-e29b-41d4-a716-446655440001",
7 "source_type": "notion",
8 "status": "failed",
9 "timestamp": "2025-01-15T14:02:30Z",
10 "error": "Authentication token expired"
11}

sync.cancelled

Fired when the sync job is manually cancelled.

1{
2 "event_type": "sync.cancelled",
3 "job_id": "550e8400-e29b-41d4-a716-446655440000",
4 "collection_readable_id": "finance-data-ab123",
5 "collection_name": "Finance Data",
6 "source_connection_id": "660e8400-e29b-41d4-a716-446655440001",
7 "source_type": "notion",
8 "status": "cancelled",
9 "timestamp": "2025-01-15T14:01:15Z"
10}

Payload Schema

Every event payload follows this structure:

FieldTypeDescription
event_typestringThe event type (e.g., sync.completed)
job_idUUIDUnique identifier for the sync job
collection_readable_idstringHuman-readable collection ID (e.g., sales-data-ab123)
collection_namestringDisplay name of the collection
source_connection_idUUIDUnique identifier for the source connection
source_typestringShort name of the source (e.g., slack, notion, github)
statusstringCurrent job status: pending, running, completed, failed, cancelled
timestampISO 8601When the event occurred
errorstringError message (only present for sync.failed events)

Delivery Format

When Airweave delivers an event to your webhook endpoint, the HTTP request includes:

Headers

HeaderDescriptionExample
Content-TypeAlways application/jsonapplication/json
svix-idUnique message identifiermsg_2xKvB8LPqM4nRst
svix-timestampUnix timestamp of delivery1705329000
svix-signatureHMAC-SHA256 signature for verificationv1,g0hM9SsE+OTPJTGt/...

Body

The request body is the raw event payload (JSON).

Expected Response

Your endpoint should return a 2xx status code to acknowledge receipt:

ResponseMeaning
200-299Success — message delivered
4xxClient error — will retry
5xxServer error — will retry
Timeout (30s)Delivery failed — will retry

Webhook Subscription

When you create or retrieve a subscription, you’ll see this structure:

1{
2 "id": "ep_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
3 "url": "https://your-server.com/webhooks/airweave",
4 "filter_types": ["sync.completed", "sync.failed"],
5 "disabled": false,
6 "description": "Production webhook endpoint",
7 "created_at": "2025-01-15T10:30:00Z",
8 "updated_at": "2025-01-15T10:30:00Z"
9}
FieldTypeDescription
idstringUnique subscription ID (prefix: ep_)
urlstringYour webhook endpoint URL
filter_typesarrayEvent types this subscription receives
disabledbooleanWhether delivery is paused
descriptionstringOptional description
created_atISO 8601When the subscription was created
updated_atISO 8601When the subscription was last modified

Webhook Message

When retrieving messages via the API, each message has this structure:

1{
2 "id": "msg_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
3 "event_type": "sync.completed",
4 "payload": {
5 "event_type": "sync.completed",
6 "job_id": "550e8400-e29b-41d4-a716-446655440000",
7 "collection_readable_id": "finance-data-ab123",
8 "collection_name": "Finance Data",
9 "source_connection_id": "880e8400-e29b-41d4-a716-446655440003",
10 "source_type": "slack",
11 "status": "completed",
12 "timestamp": "2025-01-15T14:22:15Z"
13 },
14 "timestamp": "2025-01-15T14:22:15Z",
15 "channels": ["sync.completed"],
16 "event_id": "evt_550e8400e29b41d4a716446655440000",
17 "tags": ["sync", "slack"]
18}
FieldTypeDescription
idstringUnique message ID (prefix: msg_)
event_typestringThe event type
payloadobjectThe full event payload
timestampISO 8601When the message was created
channelsarrayDelivery channels (typically matches event type)
event_idstringDeduplication ID for idempotency
tagsarrayTags for filtering

Delivery Attempt

When you retrieve delivery attempts (via include_attempts=true or the subscription endpoint), each attempt has this structure:

1{
2 "id": "atmpt_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
3 "message_id": "msg_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
4 "endpoint_id": "ep_2bVxUn3RFnLYHa8z6ZKHMT9PqPX",
5 "response": "{\"received\": true}",
6 "response_status_code": 200,
7 "status": "success",
8 "timestamp": "2025-01-15T14:22:15Z"
9}
FieldTypeDescription
idstringUnique attempt ID (prefix: atmpt_)
message_idstringThe message being delivered
endpoint_idstringThe subscription endpoint
responsestringResponse body from your endpoint
response_status_codeintegerHTTP status code returned
statusstringsuccess, pending, or failed
timestampISO 8601When the attempt occurred

Retry Schedule

Failed deliveries are retried with exponential backoff:

AttemptDelay After Failure
1Immediate
25 seconds
35 minutes
430 minutes
52 hours

After 5 failed attempts, the message is marked as failed. You can manually recover failed messages using the recover endpoint.

Next Steps