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,
|
409 |
|
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" }