Modify a Webhook
Use this API to modify a webhook name, URL, action and more. When modifying a webhook URL, any webhook action already queued for delivery will not be affected and it will work for the previous URL until a call with the new URL is initiated.
Request Type
PUT
Request URL
https://campaigns.zoho.com/emailapi/v2/settings/webhook/{webhook_id}
Webhook ID is an auto generated ID that will be returned as a response for a successfully created webhook API request. This ID denotes the webhook that has to be modified.
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 PUT 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. The 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. |
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. |
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 | Webhook name already exists |
400205 | Invalid webhook ID |
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 new webhook",
"type": "POST",
"url": "https://zylker.com/bouncetwo",
"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 - Success
Copied{
"webhook": {
"is_active": true,
"webhook_id": "5000000352001",
"name": "Bounce new webhook",
"type": "POST",
"url": "https://zylker.com/bouncetwo"
},
"response": {
"code": 200204,
"message": "Webhook edited successfully"
}
}