Consignease webhooks
Consignease webhooks allow you to receive event notifications from Consignease, such as when a user is created or updated. When an event occurs, Consignease will send an HTTPPOST request to your webhook endpoint configured for the event type. The payload carries a JSON object. You can then use the information from the request’s JSON payload to trigger actions in your app, such as sending a notification or updating a database.
Consignease uses Svix to send our webhooks.
You can find the Webhook signing secret when you select the endpoint you created on the Webhooks page in the Consignease Dashboard.
Supported events
To find a list of all the events Consignease supports:- From the documentation visit the webhook events tab
- Or from the dashboard:
- In the Consignease Dashboard, navigate to Settings → Webhooks
- Select the Event Catalog tab
Payload structure
The payload of a webhook is a JSON object that contains the following properties:data: contains the actual payload sent by Consignease. The payload can be a different object depending on theeventtype. For example, foruser.*events, the payload will always be the User object.object: always set toevent.type: the type of event that triggered the webhook.timestamp: timestamp in milliseconds of when the event occurred.instance_id: the identifier of your Consignease instance.
user.created event:
How Consignease handles delivery issues
Retry
Svix will use a set schedule and retry any webhooks that fail. To see the up-to-date schedule, see the Svix Retry Schedule. If Svix is attempting and failing to send a webhook, and that endpoint is removed or disabled from the Webhooks page in the Consignease Dashboard, then the attempts will also be disabled.Replay
If a webhook message or multiple webhook messages fail to send, you have the option to replay the webhook messages. This protects against your service having downtime or against a misconfigured endpoint. To replay webhook messages:- In the Consignease Dashboard, navigate to the Webhooks page.
- Select the affected endpoint.
- In the Message Attempts section, next to the message you want to replay, select the menu icon on the right side, and then select Replay.
- The Replay Messages menu will appear. You can choose to:
- Resend the specific message you selected.
- Resend all failed messages since the first failed message in that date range.
- Resend all missing messages since the first failed message in that date range.
Sync data to your database
You can find a guide on how to use webhooks to sync your data to your database here.Protect your webhooks from abuse
To ensure that the API route receiving the webhook can only be hit by your app, there are a few protections you should put in place:-
Verify the request signature: Svix webhook requests are signed and can be verified to ensure the request is not malicious. To verify the signature, use Consignease’s
verifyWebhookhelper. To learn more, see Svix’s guide on how to verify webhooks with the svix libraries or how to verify webhooks manually. - Only accept requests coming from Svix’s webhook IPs: To further prevent attackers from flooding your servers or wasting your compute, you can ensure that your webhook-receiving api routes only accept requests coming from Svix’s webhook IPs, rejecting all other requests.