Skip to main content
Destination specifications are under active development. Please contact your Prequel Representative to confirm the current version before implementation.
Prequel Import delivers data by calling an HTTP endpoint you own. The request shape (URL, method, headers, and body) is defined by you in the request_template field when creating a destination. Prequel renders the template and makes the HTTP request on each delivery. This page covers what your endpoint must implement and what Prequel sends. For the API call to register a destination with Prequel, including a complete example, see Create Destination.

Record API

webhook_record destinations deliver one HTTP request per record. Upserts and deletions go to the same endpoint; use the {{.IsDeleted}} template variable in your body to distinguish them.

Request template fields

Set destination.webhook_record.request_template when creating a webhook_record destination:
FieldRequiredDescription
methodYesHTTP method. One of GET, POST, PUT, PATCH, DELETE.
uriYesThe endpoint URL Prequel delivers to. Supports Go template variables.
headersNoAdditional headers to include in each request. Values support Go template variables.
bodyNoRequest body as a Go template string. If omitted, Prequel sends the record as a JSON object.

Template variables

The following variables are available in uri, headers, and body:
VariableDescription
{{.Record.<field>}}Value of a specific field from the delivered record (e.g. {{.Record.email}}).
{{.Record.AsJson}}The full record serialized as a JSON object.
{{.IsDeleted}}Boolean; true when Prequel is delivering a record deletion.
Example body template:
{"data": {{.Record.AsJson}}, "is_deleted": {{.IsDeleted}}}

Batch API

webhook_batch destinations deliver multiple records in a single HTTP request. The format field on the destination controls how records are packaged.

Request template fields

Set destination.webhook_batch.request_template when creating a webhook_batch destination:
FieldRequiredDescription
methodYesHTTP method. One of POST, PUT, PATCH.
uriYesThe endpoint URL Prequel delivers to.
headersNoAdditional headers to include in each request. Values support Go template variables.
bodyNoRequest body as a Go template string. Used when format is json.

Delivery format

The format field determines how Prequel packages records in each request:
FormatDelivery
jsonRecords delivered inline in the request body via Go template.
csvRequest contains a presigned URL to a CSV file in object storage.
parquetRequest contains a presigned URL to a Parquet file in object storage.
icebergRequest contains a presigned URL to the Iceberg manifest file for the applied record updates.

Template variables (json format)

The following variables are available in uri, headers, and body when format is json:
VariableDescription
{{.Records}}The slice of records in this batch.
{{.Records[N].<field>}}Value of a specific field from the Nth record (e.g. {{.Records[0].timezone}}).
Example body template:
[{{range $i, $rec := .Records}}{{if $i}},{{end}}{"email": "{{$rec.email}}", "is_deleted": {{$rec.IsDeleted}}}{{end}}]

Headers Prequel sends automatically

Prequel includes the following headers on every delivery request. You should validate these to confirm authenticity.
HeaderDescription
X-Prequel-Webhook-SignatureSHA-256 RSA PKCS1 v1.5 signature of the payload.
X-Prequel-Webhook-TimestampRFC 3339 timestamp of when the request was sent, used to prevent replay attacks.
X-Prequel-Webhook-DigestSHA-256 hash of the raw request body.
X-Prequel-ProviderIdentifier for the provider whose data is being delivered.
X-Prequel-LoadIdentifier for the active load job.
For signature verification steps, see Webhooks and Monitoring.

Response codes

Your endpoint should respond with an appropriate HTTP status code. Prequel uses the response to determine whether to retry delivery.
CodeDescription
200Success. Record was processed and an existing record was updated.
201Created. Record was processed and a new record was inserted.
400Bad Request. Malformed or missing fields. Prequel will not retry.
403Forbidden. Invalid signature or credentials. Prequel will not retry.
404Not Found. Endpoint or resource could not be found.
413Payload Too Large. Request body exceeds your endpoint’s size limit.
422Unprocessable Entity. Validation failed for specific fields. Prequel will not retry.
429Too Many Requests. Rate limit exceeded. Prequel will back off and retry.
500Internal Server Error. Unexpected error during processing. Prequel will retry.
502Bad Gateway. Upstream error. Prequel will retry.
504Gateway Timeout. Request timed out. Prequel will retry.