Create Webhook
This API endpoint creates a new webhook for the incident service..

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will create a new webhook and return the webhook ID.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Request Body Parameters
  • name (optional) string
    The name of the webhook. This parameter can be provided at your discretion.
  • description (optional) string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/webhook';
const data = {
  name: "Webhook name",
  description: "Webhook description"
};

axios.post(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).