Create a Webhook
Create a webhook to get information about your emails and view them in the URL you've defined.
Request Type
POST
Request URL
https://campaigns.zoho.com/emailapi/v2/settings/webhook
Content-Type
application/json
List of Request Body Attributes
Parameters | Data Type | Description |
name* | String | Name of the webhook. |
type* | String | Type of the authentication during request, i.e, here it is POST to send data to the target URL. |
url* | String | The URL to which information about emails should be sent. |
webhook_actions* | JSON Array | The action for which a webhook is called in your application. List of actions include bounce, spam, email_open, email_click, unsubscribed. |
custom_headers | JSON Object | Additional information to be sent to your application as request headers. |
custom_data | JSON Object | Additional information to be sent to your application as request data. |
authorization | JSON Object | If provided, it will be used to make the call to your application, so that you can verify whether it is coming from the right sender. ➤ auth_type - 'Username' or 'Auth Token' ➤ auth_password - Required if auth_type is 'Username' ➤ auth_username - Required if auth_type is 'Username' ➤ auth_token - Required if auth type is 'Auth Token' |
List of Response Body Attributes
Parameters | Data Type | Description |
webhook | JSON Object | Contains all the details pertaining to the webhook. |
created_time | String | Time at which webhook was created (in milliseconds). |
is_active | Boolean | Returns a true or false value indicating if the webhook is active or not. |
webhook_id | String | Unique ID of a webhook that can be used in APIs. |
name | String | Name of the webhook. |
type | String | Depicts the request type of the API. Example: POST, PUT, etc. |
created_by | String | Name of the user from whose account webhook was created using API. |
url | String | The URL to which information about emails should be sent. |
response | JSON Object | Contains the response details of the API. |
code | Integer | Success or failure code. |
message | String | Success or failure message returned by the API. |
Possible Errors
Error Codes | Description |
400204 | Duplicate webhook name |
400206 | Invalid webhook name |
400207 | Invalid URL |
400208 | Invalid request type |
400209 | Invalid webhook action |
400210 | Invalid webhook custom data |
400211 | Invalid webhook custom header |
400212 | Invalid webhook auth type |
Sample Request Payload
Copied{
"name": "Bounce webhook",
"type": "POST",
"url": "https://zylker.com/bounceone",
"webhook_actions": ["bounce"],
"custom_headers": {
"headers": {
"Webhook-Type": "Bounce"
},
"status": true
},
"custom_data": {
"data": {
"module": "workflow",
"region": "EU"
},
"status": true
},
"authorization": {
"auth_type": "Username",
"auth_username": "zylker",
"auth_password": "zylker",
}
}
Sample Response
Copied{
"webhook": {
"created_time": "1676194453469",
"is_active": true,
"webhook_id": "5000000352001",
"name": "Bounce webhook 33",
"type": "POST",
"created_by": "Zylker",
"url": "https://zylker.com/bounceone"
},
"response": {
"code": 200203,
"message": "Webhook created successfully"
}
}