Add a webhook

Post /settings/webhooks


Name Description Type Mandatory
url Url used to call as event will occur String Yes
description Webhook description String Yes
events Lists of events
Event available:
  • all
  • delivered
  • rejected
  • error
  • bounced
  • opened
  • clicked
  • unsubscribed
  • complaint
Array Yes


Before adding the webhook, we test if the url is good and return a 200 http code. Else we don't save the webhook and return an error code.

Name Description Type
id Id of the webhook String
url Webhook url String
description Webhook description String
events Events used for the Webhook Array of String
success Number of call in success Int
errors Number of call in error Int
createdAt Creation date String
updatedAt Update date String
Programming language:

Request exemple:

								"url": "",
								"description": "my first webhook",
								"events": ["delivered", "opened", "clicked"]

Response exemple:

								"id": "5654654v6re54v654654648c",
								"url": "",
								"description": "Webhook description",
								"createdAt": 1452177334,
								"updatedAt": 1452177334,
								"success": 0,
								"errors": 0,
								"events": ["delivered", "opened", "clicked"],
								"status": "success"

Code example:

								curl -X POST -d '{"url":"","description":"my first webhook","events":["delivered"]}' -H "Content-Type: application/json" -H "X-Tipimail-ApiUser:YOUR_SMTP_USERNAME" -H "X-Tipimail-ApiKey:YOUR_SMTP_KEY"
require 'vendor/autoload.php';

$tipimail = new Tipimail\Tipimail('YOUR_SMTP_USERNAME', 'YOUR_API_KEY');

try {
	$result = $tipimail->getSettingsService()->getWebhooksService()->addWithAllEvents('', 'Description');
	$events = new Tipimail\Settings\Webhooks\WebhookEvents();
	$result = $tipimail->getSettingsService()->getWebhooksService()->addWithSelectedEvents('', 'Description', $events);
catch(Tipimail\Exceptions\TipimailException $e) {
	echo 'Exception received :', $e->getMessage(), "\n";