Why use the webhook?

When integrating Prelude, you might want your system to receive events as they occur in your Prelude apps, so that your backend systems can execute actions accordingly.

To register a webhook, you need to provide a callback_url along with your Authentication request. After registration, Prelude can push real-time event data to your webhook endpoint when events happen in your app.

The event object

There are three types of events that can be sent to your webhook endpoint:

  • Authentication events: sent when an Authentication is created.
  • Attempt events: sent when a message is sent to the user.
  • Delivery status events: sent when we receive a delivery status from the carrier.

How to set up your Webhook

To start receiving webhook events in your app, create and register a webhook endpoint by following the steps below. You can register and create one endpoint to handle several different event types at once, or set up individual endpoints for specific events.

1

Implement the handler

Develop a webhook endpoint function to receive event data POST requests.

2

Pass the URL

Add your webhook endpoint URL to your Authentication requests to start receiving events.

3

Return OK

Return a 200 OK HTTP response to the POST request to acknowledge receipt of the event. If you don’t, Prelude will retry sending the event for 2 weeks.

To avoid replaying events, we recommend that you use the *_uuid field to identify and deduplicate individual events.


Next steps

Follow the API reference to get detailed information about the Prelude API.

API Reference

Learn more about Prelude’s API endpoints.