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:
| Field | Required | Description |
|---|
method | Yes | HTTP method. One of GET, POST, PUT, PATCH, DELETE. |
uri | Yes | The endpoint URL Prequel delivers to. Supports Go template variables. |
headers | No | Additional headers to include in each request. Values support Go template variables. |
body | No | Request 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:
| Variable | Description |
|---|
{{.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:
| Field | Required | Description |
|---|
method | Yes | HTTP method. One of POST, PUT, PATCH. |
uri | Yes | The endpoint URL Prequel delivers to. |
headers | No | Additional headers to include in each request. Values support Go template variables. |
body | No | Request body as a Go template string. Used when format is json. |
The format field determines how Prequel packages records in each request:
| Format | Delivery |
|---|
json | Records delivered inline in the request body via Go template. |
csv | Request contains a presigned URL to a CSV file in object storage. |
parquet | Request contains a presigned URL to a Parquet file in object storage. |
iceberg | Request contains a presigned URL to the Iceberg manifest file for the applied record updates. |
The following variables are available in uri, headers, and body when format is json:
| Variable | Description |
|---|
{{.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}}]
Prequel includes the following headers on every delivery request. You should validate these to confirm authenticity.
| Header | Description |
|---|
X-Prequel-Webhook-Signature | SHA-256 RSA PKCS1 v1.5 signature of the payload. |
X-Prequel-Webhook-Timestamp | RFC 3339 timestamp of when the request was sent, used to prevent replay attacks. |
X-Prequel-Webhook-Digest | SHA-256 hash of the raw request body. |
X-Prequel-Provider | Identifier for the provider whose data is being delivered. |
X-Prequel-Load | Identifier 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.
| Code | Description |
|---|
200 | Success. Record was processed and an existing record was updated. |
201 | Created. Record was processed and a new record was inserted. |
400 | Bad Request. Malformed or missing fields. Prequel will not retry. |
403 | Forbidden. Invalid signature or credentials. Prequel will not retry. |
404 | Not Found. Endpoint or resource could not be found. |
413 | Payload Too Large. Request body exceeds your endpoint’s size limit. |
422 | Unprocessable Entity. Validation failed for specific fields. Prequel will not retry. |
429 | Too Many Requests. Rate limit exceeded. Prequel will back off and retry. |
500 | Internal Server Error. Unexpected error during processing. Prequel will retry. |
502 | Bad Gateway. Upstream error. Prequel will retry. |
504 | Gateway Timeout. Request timed out. Prequel will retry. |