webhook_record destination delivers one HTTP request per record.
For the API call to register a destination with Prequel, including a complete example, see Create Destination.
For higher-volume workloads, consider the Batch API, which delivers multiple records per request.
Register
Declare your schema and request template within Prequel.
Receive
Receive and process the record in the request body.
Respond
Return a status code Prequel acts on.
Acknowledge
Optionally, report the outcome of each record.
Authentication
Prequel signs every delivery request with theX-Prequel-Webhook-Signature header so your endpoint can validate the request originated from Prequel. Fetch the public key for verification from GET /public/signatures/webhook-public-key. See Webhook headers for the full header list and verification steps.
Creating your destination spec
Thedestination object allows you to customize the contract between data shared by your customers and the shape Prequel provides to your receiving endpoint.
Example: Suppose you are importing a users table with string fields id, email, and subscription.
Below are four possible shapes for a webhook_record destination. These are not exhaustive and features can be combined to conform to your endpoint’s requirements:
- Schema as body: Each request body is the record in the shape declared by
record_schema, with no additional shaping. - Custom body: Use a
bodytemplate to customize each record. - Routed by provider:
uriand/orheadersvary at delivery time using theProviderIDdelivery-level identifier. - Destination per provider: A separate destination is registered for each provider, with a
record_schemathat includes provider-specific custom fields.
- Schema as body
- Custom body
- Routed by provider
- Destination per provider
Destination spec you register
POST /import/destinations
What Prequel sends to your endpoint
Webhook request
1
Name your destination
Set
name (string, required) to a unique identifier for this destination within your account.2
Set the destination type
Set
type (string, required) to webhook_record for record deliveries.3
Declare your record schema
Set
record_schema (object, required) to a JSON Schema (draft-07) document that declares the fields each record contains. Prequel validates records against this schema before delivery.4
Configure the request template
Set
webhook_record.request_template (object, required) with the HTTP method (string, defaults to POST), uri (string, required), and optional headers (object). The uri and headers templates support the .Prequel.* namespace, .Record.* fields, and .IsDeleted. With no body template, Prequel sends each record as a JSON object.5
Tune optional throughput limits
Optionally set
webhook_record.max_records_per_minute (integer, default 3000) and webhook_record.max_concurrency (integer, default 1) to control delivery throughput.Template variables
Thebody, uri, and headers templates all have access to every variable below.
Webhook headers
Prequel includes the following headers on every delivery request.Response codes
Your endpoint should return the following response codes.
For more detail on this retry behavior see:
Delivery failure handling
Retry rules, redelivery across loads, and the circuit breakers that stop a failing stream.
Error codes
Prequel records the error code below against the record, so return the status that best describes the failure. Use422 for schema and data validation problems.
Acknowledgements
Without an acknowledgement, a record your pipeline rejects an hour later still counts as delivered. Acknowledging makes that failure visible to you and to the Provider who can fix it.Acknowledgements
Report each record’s downstream outcome back to Prequel once your system has processed it.