POST /webhooks endpoint can subscribe to any of Prequel’s Event Types and configure delivery via HTTPS, Slack, or Pagerduty.
Choose a delivery method to get started:
Slack webhooks
Deliver events into a Slack channel for the team to triage.
Datadog webhooks
Forward events into Datadog as monitor-ready events.
Generic HTTP webhooks
Send
HTTPS POST or GET callbacks to your own receiver.Delivery methods
HTTP POST and GET
Prequel supportsHTTPS callbacks to your custom webhook receiver. Creating a webhook endpoint as the generic_post type will cause payloads to be sent as a JSON payload. The generic_get type will deliver payloads as URL parameters. The payloads are defined in Event Types.
PagerDuty, Slack & Datadog
You may want to have events sent to specific vendors for special handling of webhook requests. Currently, PagerDuty, Slack and Datadog are supported, with specific payload shapes according to the vendor specifications. For detailed instructions on integrating Prequel webhooks with Slack or Datadog please visit the following pages:Authentication
You can provide an API key for the webhook to use if the destination requires one. Additionally, Prequel signs every payload and passes the signature through theX-Prequel-Webhook-Signature header. See Verifying Webhooks for more information on handling the signature.
Versioning
Prequel uses a top-levelapi_version field. A version is represented by the date it was released. Currently, all webhooks use the version 2023-10-15.
Contents & structure
All event types follow this structure:Headers
| Header | Description |
|---|---|
Content-Type | Always application/json |
X-Prequel-Webhook-Timestamp | Timestamp generated when the event is sent. |
X-Prequel-Webhook-Signature | Signature generated by Prequel using SHA-256 and RSA PKCS1 v1.5 signature scheme. See Verifying Webhooks. |
X-Prequel-Webhook-Digest | Optional utility for signature verification. See Verifying Webhooks. |
Body
Body structure
Event types
When creating a webhook, you must specify which events it should listen to. Webhooks created before October 31 2023 will continue to receive only transfer errors. Webhooks are available for the following event types:transfer.successtransfer.errortransfer.cancelledexport_source.createdexport_source.updatedexport_source.deletedexport_destination.createdexport_destination.updatedexport_destination.deletedrecipient.createdrecipient.updatedrecipient.deletedexport_magic_link.createdexport_magic_link.deleted
Transfer events
- transfer.success
- transfer.error
- transfer.cancelled
This event has type
transfer.success. It is sent whenever Prequel identifies a successful transfer.transfer.success payload
Source events
- export_source.created
- export_source.updated
- export_source.deleted
This event has type
export_source.created. It is sent whenever Prequel identifies that a new source has been created. This example shows a new Snowflake source.export_source.created payload
Destination events
- export_destination.created
- export_destination.updated
- export_destination.deleted
This event has type
export_destination.created. It is sent whenever Prequel identifies that a new destination has been created.export_destination.created payload
Recipient events
- recipient.created
- recipient.updated
- recipient.deleted
This event has type
recipient.created. It is sent whenever Prequel identifies that a new recipient has been created.recipient.created payload
Magic link events
- export_magic_link.created
- export_magic_link.deleted
This event has type
export_magic_link.created. It is sent whenever Prequel identifies that a new magic link has been created.export_magic_link.created payload
Verifying webhooks
Prequel provides a unique signature in the HTTP header of each webhook request. You can use this signature and your account’s webhook public key to verify that the data you receive is from Prequel.Webhook signatures
Prequel’s approach to webhook signatures is based on asymmetric cryptography. Prequel generates an RSA private and public key pair for your account’s webhook integration. After generating a webhook, Prequel digitally signs the payload with the private key. On receiving the webhook, you can use the public key to verify the authenticity and freshness of this signature. See Verify the signature.Relevant headers
| Header | Description |
|---|---|
X-Prequel-Webhook-Timestamp | Timestamp the webhook was sent, in RFC 3339 format. |
X-Prequel-Webhook-Signature | Hex-encoded signature generated by Prequel using the signing data. |
(Maybe) X-Prequel-Webhook-Digest | Hex-encoded SHA-256 hash of the payload only, provided by Prequel for debugging purposes. |
Verify the signature
The general steps to verify a signature are outlined below.1. Retrieve your current webhook key
You can retrieve your current webhook key by hitting the following API endpoint/public/signatures/webhook-public-key.
2. Reconstruct the signing data
Extract the timestamp provided in theX-Prequel-Webhook-Timestamp header. The date is in RFC 3339 format and looks something like:
X-Prequel-Webhook-Timestamp: 2023-10-15T14:30:00Z
The signing data is in the format timestamp.body, constructed by concatenating
- The timestamp
- The character
. - The request body, i.e. the raw JSON payload
SHA-256.
Validate the response hash
Prequel hashes the raw body only and provides the result in theX-Prequel-Webhook-Digest header. You can use this to validate that you are handling the response body correctly by hex-decoding the value and comparing it to your SHA-256 hash of the raw body. You should not use this to confirm the signature.
3. Confirm the signature
Once you’ve reconstructed and hashed the signing data, you can sign the data with your public key and compare the output to the signature in theX-Prequel-Webhook-Signature header. Make sure to decode Prequel’s signature from hex before comparing.
Prequel uses the PKCS1 v1.5 signature scheme.