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