Incident Management
The incident management section is a vital component of the system, designed to effectively oversee all aspects of incident-related operations.

This section includes three key categories that work together to streamline incident management:

  • Ruleset Management and Event Handling

    This category facilitates the automation of incident responses through rulesets and webhook integrations, allowing for timely and efficient handling of incidents based on predefined criteria.
    Learn more


  • Incident Tracking

    Focused on monitoring incidents throughout their lifecycle, this category provides tools for tracking incident statuses, actions taken, and overall performance, ensuring effective resolution and accountability.
    Learn more


  • Incident Schedule Management

    This category enables the organization and management of on-call schedules for incident response teams, ensuring that appropriate personnel are available to respond to incidents at all times.
    Learn more

Ruleset Management and Event Handling
Ruleset management and event handling allows automated incident creation based on predefined rules. By configuring actions to send HTTP requests to your Pinghome webhook, incidents are generated automatically when specific conditions are met. This functionality supports integration with alerts from AWS, GCP, Azure, and other platforms, streamlining your incident management process and ensuring that incidents are effectively created and resolved.
ENDPOINTS
Expand all
  • Ruleset configuration and management
    GET/rulesets
    POST/ruleset
    PUT/ruleset/{id}
    DELETE/ruleset/{id}
    GET/ruleset/{id}/actions
    PUT/ruleset/{id}/actions
  • Webhook handling
Get Rulesets
This API endpoint retrieves the rulesets associated with the team or organization. The rulesets include information such as rule type, name, description, urgency, and assignees.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return ruleset data for both team and organization.
  • If the request is unauthorized, the system will return an authentication error message.
JavaScript
Response codes
const axios = require('axios');

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

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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 Ruleset
This API endpoint allows creating a new ruleset in the incident service. The request body requires details such as the rule type, conditions, team ID, and other related information.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will create a new ruleset and return the ruleset ID.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Request Body Parameters
  • rule_type string
    The type of rule being created. Accepted values: 'state-change' or 'webhook'.
  • conditions array of objects
  • level string
  • team_id string
  • name string
  • description string
  • urgency string
  • assignees (optional) array of objects
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/ruleset';
const data = {
  rule_type: 'state-change',
  conditions: [{ values: ['10'], operator: 'equal', type: 'json-check', key: 'products[0].count' }],
  level: 'team',
  team_id: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8',
  name: 'Name',
  description: 'Description',
  urgency: 'medium',
  assignees: [{ type: 'team', 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 Ruleset
This API endpoint allows updating an existing ruleset in the incident service. The request body requires the rule type, conditions, team ID, and other related information.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the ruleset 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 ID of the ruleset to be updated. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
Request Body Parameters
  • rule_type string
    The type of rule being created. Accepted values: 'state-change' or 'webhook'.
  • conditions array of objects
  • level string
  • team_id string
  • name string
  • description string
  • urgency string
  • assignees (optional) array of objects
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8';
const data = {
  rule_type: 'state-change',
  conditions: [{ values: ['10'], operator: 'equal', type: 'json-check', key: 'products[0].count' }],
  level: 'team',
  team_id: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8',
  name: 'Name',
  description: 'Description',
  urgency: 'medium',
  assignees: [{ type: 'team', 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).
Delete Ruleset
This API endpoint allows deleting an existing ruleset in the incident service. The id of the ruleset to be deleted must be provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will delete the specified ruleset and return a confirmation message.
  • If the request is unauthorized or the ruleset is not found, the system will return an error message.
Path Parameters
  • id string
    The ID of the ruleset to be deleted. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8';

axios.delete(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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).
Get Ruleset Actions
This API endpoint retrieves the actions associated with a specific ruleset. The ruleset ID is provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return the actions tied to the ruleset, including action type and settings.
  • If the request is unauthorized, the system will return an authentication error message.
Path Parameters
  • id string
    The unique ID of the ruleset for which actions are being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = "https://incident-query.api.pinghome.io/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8/actions";

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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 Ruleset Actions
This API endpoint updates the actions for a specific ruleset. The id of the ruleset must be provided as a path parameter. The request body should contain the updated actions and their settings.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the actions for the specified ruleset.
  • 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 ruleset to be updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • actions array of objects
    An array of actions to be updated, each containing an ID, type, and settings.
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/ruleset/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/actions';
const data = {
  actions: [
    {
      type: 'trigger-alerts',
      settings: [
        {
          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).
Get Webhooks
This API endpoint retrieves the list of webhooks created for the incident service.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return a list of webhooks with details such as webhook name, description, and URL.
  • If the request is unauthorized, the system will return an authentication error message.
JavaScript
Response codes
const axios = require('axios');

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

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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).
Get Webhook Events
This API endpoint retrieves the events related to a specific webhook. The webhook ID is provided as a path parameter. Query parameters like last_received_at and limit can be used to control pagination and the number of events retrieved.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return webhook event details such as content type, body, IP, and received time.
  • If the request is unauthorized, the system will return an authentication error message.
Path Parameters
  • id string
    The unique ID of the webhook for which events are being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
Query Parameters
  • limit (optional) positive integer
    Specifies the maximum number of webhook events to return, such as '10'. You can choose to include this parameter as needed.
  • last_received_at (optional) string
JavaScript
Response codes
const axios = require('axios');

const url = "https://incident-query.api.pinghome.io/v1/webhook/c03b02ec-244f-4d2c-8f68-3910071ed5c8/events?limit=10&last_received_at=2024-03-15T19:09:39Z";

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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 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).
Submit Webhook Event Data
This API endpoint allows you to submit data to a specific webhook by providing the webhook ID in the path. The request body accepts arbitrary key-value data to be processed by the webhook.

Expected Behavior:


  • On success, the webhook will process the data and return a confirmation message along with additional meta information such as the IP address and content type.
  • If the webhook ID is invalid, an error message will be returned.
Path Parameters
  • id string
    The unique ID of the webhook created earlier.
Request Body Parameters
  • body object
    Key-value data to be submitted to the webhook.
JavaScript
Response codes
const axios = require('axios');

const url = 'https://data-gateway.api.pinghome.io/v1/incident/webhook/{id}';
const data = {
  example_key: 'example_value'
};

axios.post(url, data, {
  headers: {
    '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).
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/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).
Retrieve Incident Data
This API endpoint retrieves a list of incidents for a specific team. The id of the team must be provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return a list of incidents associated with the specified team.
  • If the request is unauthorized, the system will return an error message.
  • If the incident is not found, a 404 error will be returned.
Path Parameters
  • id string
    The ID of the team for which incidents are being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-query.api.pinghome.io/v1/team/c03b02ec-244f-4d2c-8f68-3910071ed5c8/incidents';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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).
Retrieve Incident Actions
This API endpoint retrieves the actions associated with a specific incident. The id of the incident must be provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return the actions data associated with the specified incident.
  • If the request is unauthorized, the system will return an error message.
  • If the incident is not found, a 404 error will be returned.
Path Parameters
  • id string
    The ID of the incident for which actions are being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-query.api.pinghome.io/v1/incident/c03b02ec-244f-4d2c-8f68-3910071ed5c8/actions';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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/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/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).
Incident Schedule Management
Incident schedule management focuses on organizing and managing on-call schedules for incident response teams. It retrieves schedules for specific customers, create new on-call schedules for teams, update existing schedules, and delete schedules as needed. This ensures that teams are effectively organized and available to respond to incidents, providing continuous coverage and support.
ENDPOINTS
Collapse all
  • On-call schedule management
    GET/customer/{id}/schedule
    POST/team/{id}/schedule
    PUT/team/{id}/schedule
    DELETE/team/{id}/schedule
Get Customer Schedules
This API endpoint retrieves the schedule data associated with a specific customer. The customer ID is provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return the schedule data, including start and end dates, months, weeks, and days of the schedule.
  • If the request is unauthorized, the system will return an authentication error message.
Path Parameters
  • id string
    The unique ID of the customer whose schedule is being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = "https://incident-query.api.pinghome.io/v1/customer/c03b02ec-244f-4d2c-8f68-3910071ed5c8/schedule";

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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 On-Call Schedule
This API endpoint creates a new on-call schedule for a team. The request body requires fields such as the team member ID, start and end dates, months of the year, weeks of the month, week days, and time range.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will create a new schedule and return a confirmation 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 team for which the schedule is being created. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • team_member_id string
    The unique ID of the team member assigned to the schedule.
  • start_date (advanced) string
  • end_date (advanced) string
  • months_of_year (advanced) array of positive integers
  • weeks_of_month (advanced) array of integers
  • week_days array of positive integers and zero
  • start_time string
  • end_time string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';
const data = {
  team_member_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
  start_date: "2024-01-01T00:00:00Z",
  end_date: "2024-01-31T23:59:59Z",
  months_of_year: [1],
  weeks_of_month: [1],
  week_days: [1],
  start_time: "00:00:00",
  end_time: "23:59:59"
};

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 On-Call Schedule
This API endpoint updates an existing on-call schedule for a team. The request body requires fields such as the team member ID, start and end dates, and recurrence settings such as months of the year, weeks of the month, and days of the week.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the existing schedule and return a confirmation 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 team for which the schedule is being updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • team_member_id string
    The unique ID of the team member assigned to the schedule.
  • start_date (advanced) string
  • created_at string
  • end_date (advanced) string
  • months_of_year (advanced) array of positive integers
  • weeks_of_month (advanced) array of integers
  • week_days array of positive integers and zero
  • start_time string
  • end_time string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';
const data = {
  team_member_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
  created_at: "2024-01-01T00:00:00Z",
  start_date: "2024-01-01T00:00:00Z",
  end_date: "2024-01-31T23:59:59Z",
  months_of_year: [1],
  weeks_of_month: [1],
  week_days: [1],
  start_time: "00:00:00",
  end_time: "23:59:59"
};

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).
Delete On-Call Schedule
This API endpoint deletes an existing on-call schedule for a team member. The request requires query parameters such as team_member_id and created_at to be provided for the schedule to be deleted.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will delete the specified on-call schedule and return a confirmation 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 team for which the schedule is being deleted. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Query Parameters
  • team_member_id string
    The unique ID of the team member whose schedule is being deleted. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
  • created_at string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';

axios.delete(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  params: {
    'team_member_id': '445a5c1f-c0eb-403a-96d7-3976e5dc74ed',
    'created_at': '2024-01-01T00:00:00Z'
  }
})
.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).