Event Types
Organize and filter webhooks by event type. Route specific events to specific endpoints.
What Are Event Types?
Event types are string identifiers that describe what happened. They follow a resource.action pattern:
order.createdorder.updatedorder.cancelledpayment.succeededpayment.faileduser.createduser.updatedinvoice.paidYou can use any string format, but resource.action is recommended for consistency.
Registering Event Types
Event types are automatically registered when you send a webhook. No pre-registration required:
curl -X POST https://hooksniff-api-1046140057667.europe-west1.run.app/v1/webhooks \
-H "Authorization: Bearer hr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"endpoint_id": "ep_abc123",
"event": "order.created",
"data": {"order_id": "12345"}
}'The event type order.created is now available for filtering and search.
Filtering by Event Type
Configure endpoints to only receive specific event types using the event_filter field:
curl -X POST https://hooksniff-api-1046140057667.europe-west1.run.app/v1/endpoints \
-H "Authorization: Bearer hr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://myapp.com/webhooks/orders",
"description": "Order events only",
"event_filter": "order.*"
}'Supported filter patterns:
order.createdโ Exact matchorder.*โ Wildcard (all order events)*โ All events (default)
Querying by Event Type
Filter delivery logs by event type:
curl "https://hooksniff-api-1046140057667.europe-west1.run.app/v1/webhooks?event=order.created" \
-H "Authorization: Bearer hr_live_YOUR_KEY"Schema Validation
Optionally define JSON schemas for event types to validate payloads:
{
"event_type": "order.created",
"schema": {
"type": "object",
"required": ["order_id", "total"],
"properties": {
"order_id": { "type": "string" },
"total": { "type": "number", "minimum": 0 },
"currency": { "type": "string", "default": "USD" }
}
}
}When a schema is defined, payloads that don't match are rejected with a 400 Bad Request error.