The Webhook event system is continuously evolving. The event types and signature formats shown in this document represent the recommended implementation patterns — refer to the latest platform documentation for specifics.
What You’ll Build
This tutorial walks you through building a Webhook receiver service that securely receives and processes real-time events pushed by the Profy platform. You’ll implement signature verification, event dispatching, idempotent processing, and asynchronous consumption.Webhook Event Types
JSON structure of each Webhook request:
Prerequisites
Profy App
Created an App in Profy Studio and obtained the Client ID
Webhook URL
Configured a publicly accessible Webhook receiver URL in Studio
Webhook Secret
Obtained the Webhook signing secret from Studio (used to verify request origin)
Step 1: Register the Webhook URL
Complete the Webhook configuration in Profy Studio:- Go to App Management → Select your App → Webhook Settings
- Enter your Webhook receiver URL (e.g.,
https://your-app.com/api/webhook) - Select the event types you want to subscribe to
- Save and copy the auto-generated Webhook Secret
.env
Step 2: Create the Webhook Receiver Endpoint
Step 3: Verify Signatures
Profy signs the request body using HMAC-SHA256, with the signature passed via theX-Profy-Signature header. The format is sha256=<hex_digest>.
Step 4: Handle Events
Dispatch to the appropriate handler based onevent_type.
Step 5: Idempotent Processing
Network issues or timeout retries can cause the same event to be delivered multiple times. Useevent_id for idempotent deduplication.
Step 6: Response and Retry Behavior
Response Guidelines
Best Practices
Local Development and Debugging
During local development, the Webhook URL needs to be publicly accessible. Use a tunnel tool to expose your local port to the internet.https://abc123.ngrok-free.app/api/webhook).
Complete Example
Here’s a complete, ready-to-run example:Security Best Practices
Always Verify Signatures
Every request must pass HMAC-SHA256 signature verification — reject all unsigned or incorrectly signed requests
Use HTTPS
The Webhook URL must use HTTPS to prevent request content from being intercepted or tampered with in transit
Idempotent Processing
Use
event_id for deduplication to ensure the same event is only processed once even if delivered multiple timesTimeout Protection
Return 200 within 10 seconds. Move time-consuming logic to a background queue to avoid blocking responses and triggering retries
- IP Allowlisting: If your firewall supports it, only allow traffic from Profy platform egress IP ranges
- Secret Rotation: Periodically regenerate the Webhook Secret in Studio and smoothly transition on the application side (support verifying both old and new Secrets during the transition period)
- Logging and Monitoring: Log the
event_id, processing result, and latency for each Webhook to help troubleshoot missed or delayed events
Next Steps
Next.js Full-Stack Integration
OAuth login + Token management + billing event reporting
Per-Use Billing SaaS
PER_USE mode: fixed-price per-use billing
Events API Reference
View the complete Events API documentation
Token Management Best Practices
Concurrent refresh, secure storage, degradation strategies

