How it works
- You configure a webhook endpoint URL in your FlexyPe dashboard
- FlexyPe sends a
POSTrequest to that URL whenever a subscribed event fires - Your endpoint processes the payload and returns
HTTP 200 - If delivery fails, FlexyPe retries automatically
Setting up a webhook
Go to Settings → Webhooks in your FlexyPe dashboard. When creating an endpoint, you’ll provide:- Endpoint URL — the HTTPS URL where FlexyPe should deliver events
- Secret — a string you create, used to verify that requests come from FlexyPe
- Events — the specific events you want to subscribe to
Only the events you select will trigger deliveries to your endpoint. Subscribe only to what your integration needs to avoid unnecessary traffic.
Request headers
Every webhook request includes these headers:Verifying webhooks
Before processing any payload, validate theX-Flexype-Authorization header against the secret you set when configuring the webhook.
Responding to webhooks
Your endpoint must return HTTP 200 within 10 seconds to acknowledge receipt.Any non-200 response, or no response within 10 seconds, is treated as a delivery failure and triggers a retry.
Retry logic
When a delivery fails, FlexyPe retries three times before marking the webhook as failed:
You can check delivery status and see failure reasons in the Webhooks section of your dashboard.
If all retry attempts fail, the webhook is marked as failed. You can manually retry individual failed deliveries from the dashboard at any time.
Idempotency
Each event has a uniqueX-Event-Id header. Use this value to deduplicate events — retried deliveries carry the same X-Event-Id as the original attempt, so you can safely ignore duplicates.
In production, persist processed event IDs in a database rather than an in-memory Set, so deduplication survives server restarts.
Testing webhooks
Use the Test button on your configured webhook in the FlexyPe dashboard to send a sample payload to your endpoint. Do this before going live to confirm your verification logic and response handling are working correctly.Implementation example
A complete webhook handler that verifies the request, deduplicates retries, and processes the payload asynchronously:Available events
Best practices
- Use HTTPS — only HTTPS endpoints are accepted
- Return 200 quickly — hand off processing to a background job to avoid timeouts
- Check idempotency — use
X-Event-Idto handle retried deliveries without double-processing - Store your secret securely — use environment variables; never hardcode it in your codebase
- Monitor delivery — review webhook logs in your dashboard and act on failures before the retry window closes