Skip to main content

Create a Webhook Endpoint

This endpoint creates a Webhook Endpoint and connects it to the given webhook events.

info

This operation requires authentication and admin role.

HTTP Request

POST /api/v2/webhook/endpoint/

Parameters

NameInTypeRequiredDescription
» is_activebodybooleanfalseEndpoint active status
» targetbodystring(uri)trueEndpoint target
» descriptionbodystringfalseEndpoint description
» eventsbodylist[object]trueEndpoint events objects
»» typebodystringtrueThe webhook event type
» ssl_cert_verificationbodybooleanfalseIf true, the SSL certificates for HTTPS requests must be enabled

Example Body Parameters

{
"is_active": "boolean",
"target": "https://example.com",
"description": "string",
"events": [
{
"type": "string"
}
],
"ssl_cert_verification": "boolean"
}

Example Request

const inputBody = '{
"is_active": "boolean",
"target": "https://example.com",
"description": "string",
"events": [
{
"type": "string"
}
],
"ssl_cert_verification": "boolean"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/webhook/endpoint/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
201CreatedResponse status codeEndpoint

Example responses

{
"id": "integer",
"created_at": "string",
"updated_at": "string",
"is_active": "boolean",
"target": "string",
"description": "string",
"events": [
{
"type": "string",
"added_at": "string"
}
],
"ssl_cert_verification": "boolean"
}