What is a webhook?
ChainPatrol uses webhooks to notify you about changes to our global blocklist. This allows you to update your blocklist in real-time, without having to wait for a scheduled cron job to run. This is especially useful if you opt to use our Asset List endpoint to sync our data as you can update your blocklist as soon as we update ours.Managing Webhooks
You can manage your webhooks through the ChainPatrol dashboard underSettings > Webhooks
. From here you can:
- Create new webhooks
- View and monitor webhook deliveries
- Test webhooks with sample events
- Enable/disable webhooks
- Update webhook configurations
- Delete webhooks
Event Types
debug.test
This event is used for testing your webhook endpoint. It is sent when you click the “Test” button for a webhook in the dashboard.
asset.status-updated
This event is sent when the status of an asset changes. The status
field can be one of BLOCKED
, ALLOWED
, or UNKNOWN
.
organization.threat-detection-added
This event is sent when a new threat detection is added for your organization detection tab.
Webhook Configuration
When creating a webhook, you’ll need to provide:- A HTTPS endpoint URL that will receive the webhook events
- An optional description to help identify the webhook’s purpose
- Select which events you want to receive (currently only asset.status-updated is available)
Signature Verification
ChainPatrol signs each webhook request with a signature to verify that the request originated from ChainPatrol. The signature is included in theX-ChainPatrol-Signature
header of each request. The signature is computed by taking the SHA256 HMAC of the request body using your webhook secret as the key. The signature is encoded as a hex string.
Delivery Status and Retries
Each webhook delivery attempt is logged with one of the following statuses:PENDING
: The delivery is queuedIN_PROGRESS
: The delivery is being attemptedSUCCESS
: The delivery was successful (received 2xx response)FAILURE
: The delivery failed
Security
Webhooks are sent over HTTPS and are signed with a secret that is unique to your account. You should:- Only use HTTPS endpoints
- Keep your webhook secret secure and never commit it to version control
- Always verify the signature of incoming webhooks
- Contact us immediately if you suspect your webhook secret has been compromised