Incident Tracking
Incident tracking encompasses essential functionalities for monitoring and managing incidents. It allows customers to verify the operational status of the system through a dedicated endpoint. You can retrieve incidents associated with specific teams, view actions related to particular incidents, create new incidents, and update existing ones. This structure ensures a comprehensive approach to tracking and managing incidents effectively.
ENDPOINTS
Expand all
  • Health check
    GET/health-check
  • Incident management
Check Service Health Status
This API endpoint checks the health status of the incident service and ensures it is operational.

Expected Behavior:


  • On success, the system will return a confirmation message indicating that the service is operational.
JavaScript
Response codes
const axios = require('axios');

const url = "https://incident-query.api.pinghome.io/default/v1/health-check";

axios.get(url)
.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).
Create New Incident
This API endpoint creates a new incident for a specific team. The id of the team must be provided as a path parameter. The request body requires the incident name, description, urgency to be specified.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will create a new incident and return the incident ID.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Path Parameters
  • id string
    The ID of the team for which the incident is being created. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • name string
    The name of the incident.
  • description string
  • urgency string
  • assignees (optional) array of objects
  • actions (optional) array of objects
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/default/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/incident';
const data = {
  name: "Incident name",
  description: "Incident description",
  urgency: "medium",
  assignees: [
    {
      type: "team",
      id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
    }
  ],
  actions: [
    {
      type: "trigger-alerts",
      settings: [
        {
          status_page_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
          component_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
        }
      ]
    }
  ]
};

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).
Update Incident
This API endpoint updates an existing incident for the specified incident ID. The request body includes fields for updating the incident's name, description, urgency.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the incident and return a success message.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Path Parameters
  • id string
    The unique ID of the incident to be updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • name string
    The updated name of the incident.
  • description string
  • urgency string
  • assignees (optional) array of objects
  • actions (optional) array of objects
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/default/v1/incident/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';
const data = {
  name: "Incident name",
  description: "Incident description",
  urgency: "medium",
  assignees: [
    {
      type: "team",
      id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
    }
  ],
  actions: [
    {
      id: "",
      type: "trigger-alerts",
      settings: [
        {
          id: "",
          status_page_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
          component_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
        }
      ]
    }
  ]
};

axios.put(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).