Code preference:
Curl
Ruby
Php
Python
Node.js
C#
Java

Webhooks

Developers can access their webhook information as well as manage it using this API. Following are the various operations supported by this API.

This API call will let you create a webhook. The url for each webhook should be unique.

Input Parameter Description
notify_url URL that will be triggered by a webhook [Mandatory].
content Webook description [Optional].
events Set of events. You can use commas to separate multiple events.
Possible values for Transactional webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, opened, unique_opened & unsubscribed.
Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce, list_addition & delivered ( case sensitive ) [Mandatory].
is_plat Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional].

Example :

Sample Output :

If successful, it returns the ID of the created webhook.

This API call will let you access your created campaigns information.

a. To retrieve details of any particular webhook : get_webhook()

Input Parameter Description
id Id of webhook to get details [Mandatory].

Example :

Sample Output :

b. To retrieve details of all webhooks : get_webhooks()

Input Parameter Description
is_plat Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat=”” [Optional].

Example :

Sample Output :

Now that you have registered the webhook, you will need a script to get the details of the events when the call is made.
A sample php script is given for your reference.
Place the script on your webserver at the location where you have registered your webhook.

Example :

Lets say an event happens and a call is made, if everything goes well: you will receive data in JSON:

Note: “reason” and “link” fields are optional, and they will appear in case of hard_bounce/soft_bounce/deferred and click events respectively.
You can use above output to log into any file or db, or in whichever desired way.

The event types are explained below. Last two columns signify whether event info is available for transactional or marketing platforms.

Event Description Transactional Marketing
request Emails sent by Sendinblue SMTP.
delivered Delivered emails.
hard_bounce Emails which were not delivered and which will never arrive at destination. Emails are misspelled or do not exist.
soft_bounce Emails which were not temporarily delivered. The reason maybe a temporary unavailability of the mail server addressee or a full box.
blocked These are spam report emails + hard bounce emails when they are repeated.
spam When a person who received your email reported that it is a spam.
invalid_email If a ISP again indicated us that the email is not valid or if we discovered that the email is not valid.
deferred These are emails which are not sent because of temporary failure.
opened When a person who received your email, opens it.
click When a person clicks any link in email received.
unsubscribe When a person unsubscribes from the email received.
list_addition When a contact is added to a list.
unique_opened When an email received by a person is uniquely opened.

Note: If “X-Mailin-custom” is passed with some defined value in Sendinblue headers, then it will be received as “X-Mailin-custom”, but in case of “X-Mailin-Tag”, it will be received as only “tag” in the JSON response.

This API call will let you update a webhook.

Input Parameter Description
id Id of webhook to be modified [Mandatory].
notify_url URL that will be triggered by a webhook [Mandatory].
content Webook description [Optional].
events Set of events. You can use commas to separate multiple events.
Possible values for Transactional webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, opened, unique_opened & unsubscribed.
Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce, list_addition & delivered ( case sensitive ) [Mandatory].

Example :

Sample Output :

This API call will let you delete a webhook.

Input Parameter Description
id Id of webhook to be deleted [Mandatory].

Example :

Sample Output :