Add a New Webhook

Xray REST APIs

ft:sourceType
Paligo

Description: Add a new webhook to the system.

Security: Requires an admin user

Usage: POST /xray/api/v1/webhooks

Consumes: application/json

Produces: application/json

Parameters:

Parameter

Type

Description

name

string

Webhook name

url

string

Platform URL

description

string

Webhook description

Use_proxy (optional)

boolean

Optional, Default is false

Auth (optional)

Parameter

Type

Description

user_name

string

Optional User name

password

string

Optional password

Headers (optional) - you can have as many as you want.

Parameter

Type

Description

name

string

Optional Name of webhook header

Response codes:

Status code

Description

200

OK

201

Success - Webhook has been successfully created

400

<<Invalid Input>> The message could vary,

  1. Failed to parse the request body.

  2. Webhook data is not valid, either Url is not valid or Name contains special characters

  3. Mandatory fields are missing.

409

  1. Webhook with the name already exists.(When the name is duplicated)

  2. Webhook with URL already exists.(When the same URL is reused)

401

Insufficient privileges, you need a user with admin privileges to create a webhook

500

Failed to create the webhook. Internal server issues.

Sample request:

{

"name": "Webhook Name", //required

"url": "http://somehost", //required

"description": "",

"use_proxy": false, // Optional, Default is false

"auth": { //Optional

"user_name": "",

"password": ""

},

"headers": { // Optional, underlying type is a map, so you can have as many as you want.

"name": "value"

 }

}

Successful response:

{

"info": "Webhook has been successfully created"

}