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).