A webhook enables Flagright to push real-time notifications to your app. Flagright uses HTTPS to send these notifications to your app as a JSON payload. You can then use these notifications to execute actions in your backend systems.
Webhooks are particularly useful when:
- A transaction is investigated and approved by your compliance team.
- A user’s state has changed.
- A new case is created.
- A rule action has been updated.
Steps to Receive Webhooks
You can start receiving event notifications in your app by following these steps:
- Identify the events you want to monitor and the event payloads to parse.
- Create a webhook endpoint as an HTTP endpoint (URL) on your server.
- Handle requests from Flagright by parsing each event object and returning 2xx response status codes.
- Deploy your webhook endpoint so that it is publicly accessible via an HTTPS URL.
- Register your publicly accessible HTTPS URL in the Flagright console and store the secret signing key (for verifying the payload) in a secure place.
Types of Events
Event Payloads
PROPERTY | DETAILS |
---|---|
id | Unique identifier for the event |
type | Event type (e.g., USER_STATE_UPDATED). |
data | Object containing data associated with the event. |
createdTimestamp | Time at which the event was created. Measured in ms since the Unix epoch. |