POST
/
apps
/
{appId}
/
webhooks
Create Webhook
curl --request POST \
  --url https://apimgmt.cometchat.io/apps/{appId}/webhooks \
  --header 'Content-Type: application/json' \
  --header 'key: <key>' \
  --header 'secret: <secret>' \
  --data '{
  "id": "<string>",
  "name": "<string>",
  "useBasicAuth": true,
  "username": "<string>",
  "password": "<string>",
  "webhookURL": "<string>",
  "enabled": true,
  "retryOnFailure": false
}'
[
  {
    "data": {
      "id": "test_webhook201",
      "name": "test_webhook201",
      "webhookURL": "https://example.com/test",
      "createdAt": 1684141151,
      "updatedAt": 1684141151
    }
  }
]

Headers

key
string
required

Authorization Key

secret
string
required

Authorization Secret

X-Webhook-Version
integer

The "X-Webhook-Version" header is an optional integer property.When this header is omitted from the request, the system defaults to the legacy webhook, ensuring backward compatibility and seamless operation.Conversely, setting the value of this header to "2" indicates the preference for the new webhook implementation.

Path Parameters

appId
string
required

AppID in which the extension has to be enabled/disabled

Body

application/json
id
string
required

Id of the Webhook.

name
string
required

name of the Webhook.

webhookURL
string
required

Webhook URL of the app

useBasicAuth
boolean

Boolean value for Basic Auth.

username
string

Username of the user

password
string

Password of the user

enabled
boolean

Webhook should be enabled/ disabled

retryOnFailure
boolean
default:false

Enables automatic retries for failed webhook deliveries due to non-2xx HTTP responses or network errors.

Response

200 - application/json

Created Webhook

data
object