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 email_delivered, 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

ParametersData TypeDescription
webhookJSON ObjectContains all the details pertaining to the webhook.
is_activeBooleanReturns a true or false value indicating if the webhook is active or not.
webhook_idStringUnique ID of a webhook that can be used in APIs.
nameStringName of the webhook.
typeStringDepicts the request type of the API. Example: POST, PUT, etc.
urlStringThe URL to which information about emails should be sent.
responseJSON ObjectContains the response details of the API.
codeIntegerSuccess or failure code.
messageStringSuccess or failure message returned by the API.

Possible Errors

Error Codes

Description

400204Webhook 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

400212Invalid 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"
    }
}