Webhooks
Webhooks allow you to receive real-time notifications about important events in your Vayu account. This document describes the available webhook types and their payload structures.
Available Webhooks
Webhook Type | Description | Trigger Condition |
---|---|---|
Overage | Notifies when a customer exceeds their provisioned amount for a product | Customer’s consumption exceeds their provisioned amount |
Anonymous Customer Created | Notifies when a new anonymous customer is created in the system | Event was sent for a customer that couldn’t exist |
Webhook Payloads
Overage Notification
The overage webhook is triggered when a customer exceeds their provisioned amount for a product. The payload includes detailed information about the product consumption.
Payload Structure
you can read more about the product consumption type in the get product consumption endpoint page.
Example Payload
Anonymous Customer Created
This webhook is triggered when a new anonymous customer is created in the system. The payload contains basic customer information.
Payload Structure
Example Payload
Webhook Security
For security purposes, all webhook requests include:
- A timestamp header (in seconds)
- A signature header (RSA-SHA256 signed message of ‘timestamp.payload’)
- The event type in the payload
Note: Only HTTPS endpoints are supported. HTTP endpoints are not allowed for security reasons.
Signature Verification:
To ensure the webhook is authentic, you must verify the webhook signature using the public key provided by Vayu.
Here’s a ready-to-use helper function you can drop into your backend codebase:
Typescript:
Python:
Here’s a ready-to-use helper function you can drop into your backend codebase: