A Batch-based API endpoint is the recommended implementation for most use cases. Contact the Prequel team if you have questions.
webhook_batch destination delivers multiple records in a single HTTP request.
For the API call to register a destination with Prequel, including a complete example, see Create Destination.
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.
After verifying the request signature, you can optionally read provider_id and load_id from the envelope body to confirm the request belongs to an expected provider and load.
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_batch destination. These are not exhaustive and features can be combined to confirm to your endpoint’s requirements:
- Schema as body: Records land in the
JSONLartifact in the shape declared byrecord_schema, with no additional shaping. - Custom body: Use a
bodytemplate to customize each record. Only supported whenformatisjson. - 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
POST destination payload
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_batch for batch 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_batch.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.5
Pick a delivery format
Set
webhook_batch.format (string, required) to one of json, csv, or parquet. See Delivery format for what each option produces.6
Tune optional throughput limits
Optionally set
webhook_batch.max_size_per_batch (integer, default 24000), webhook_batch.max_batches_per_minute (integer, default 10), and webhook_batch.max_concurrency (integer, default 1) to control delivery throughput.Template variables
Thebody template has access to every variable below; the uri and headers templates only have access to the .Prequel.* namespace.
Delivery format
Prequel makes one HTTP request per batch. The request body is an envelope with the following fields:
Your endpoint reads the envelope, downloads the file at
url, and processes the records inside. The format field on the destination controls what kind of file the URL points to: