Create an event subscription
To add event notifications to your integration, use our API to create an event subscription and handle the notification that we send by webhook when an event occurs.
Important: To receive notifications, your server must be able to handle POST requests.
To create an event subscription, send the following information in your request:
- Event type - The event that you want to subscribe to. You can subscribe to more than one event within the same request.
- URI - The endpoint that we send notifications to. The endpoint must be publicly available.
- Secret - A secret that we return in the header of webhook requests to verify that it is a genuine request.
- Event status - The status of the event subscription.
- Email address - An email address that we contact if we can’t communicate with the endpoint that you provided.
Note: For a complete list of events that you can subscribe to, go to Events list.
Integration steps
Step 1. Create an event subscription
Step 2. Send a 200 response code
Step 3. Handle the notification content
Before you begin
Authenticate your requests before making API calls. If your request fails, see Errors.
Step 1. Create an event subscription
To create an event subscription, send a POST request to our event subscriptions endpoint.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we send you the ID of the subscription. You can use the ID to update, retrieve, or delete the event subscription.
The response contains the following fields:
Response
Example response
Step 2. Send a 200 response code
We send notifications by webhook request to the URI endpoint that you provided when you created the subscription.
You must return a 200 status code when you receive the request.
If we do not receive a 200 response, we retry the request five times. After the fifth attempt, we send an email to the support email address that you provided when you created the subscription.
Note: We send an email only when a single instance of an event notification fails to deliver. If the event occurs again, we send another notification.
Step 3. Handle the notification content
Each notification follows the CloudEvents standard, and we use the data object to communicate information about the event that occurred, for example:
You can view our event notifications on the Events page.