Ionhour Docs

On-Call Schedules API

Create and manage on-call schedules, rotations, participants, and overrides.

On-call schedules define who is responsible for responding to incidents at any given time. See On-Call Schedules for conceptual documentation.

Create Schedule

POST /on-call-schedules

Request Body

FieldTypeRequiredDescription
workspaceIdnumberYesWorkspace this schedule belongs to
namestringYesSchedule name
descriptionstringNoSchedule description
timezonestringNoTimezone for handoff times (default: UTC)
handoffNotificationMinutesnumberNoMinutes before handoff to notify incoming person (default: 15, null to disable)
enabledbooleanNoWhether the schedule is active (default: true)
rotationsarrayNoRotations to create with the schedule (see below)

Rotation Object

FieldTypeRequiredDescription
namestringNoRotation name
typestringYesdaily, weekly, or custom
layerPositionnumberYesPriority within the schedule (0 = highest)
effectiveFromstringYesISO datetime when this rotation starts
effectiveUntilstringNoISO datetime when this rotation ends (null = indefinite)
handoffTimestringYesTime of day for shift changes (e.g., 09:00)
handoffDaynumberNoDay of week for weekly rotations (1=Mon, 7=Sun, default: 1)
customShiftHoursnumberNoShift length in hours for custom rotations
participantsarrayNoOrdered list of participants (see below)

Participant Object

FieldTypeRequiredDescription
userIdnumberYesUser to include in the rotation
positionnumberYesOrder in the rotation (0-indexed)

Example

curl -X POST https://api.ionhour.com/api/on-call-schedules \
  -H "Authorization: Bearer ionh_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": 1,
    "name": "Primary On-Call",
    "timezone": "America/New_York",
    "handoffNotificationMinutes": 15,
    "rotations": [
      {
        "name": "Weekly Rotation",
        "type": "weekly",
        "layerPosition": 0,
        "effectiveFrom": "2025-01-06T09:00:00Z",
        "handoffTime": "09:00",
        "handoffDay": 1,
        "participants": [
          { "userId": 1, "position": 0 },
          { "userId": 2, "position": 1 },
          { "userId": 3, "position": 2 }
        ]
      }
    ]
  }'

List Schedules

GET /on-call-schedules

Query Parameters

ParameterTypeRequiredDescription
workspaceIdnumberYesFilter by workspace
curl -H "Authorization: Bearer ionh_your_key" \
  "https://api.ionhour.com/api/on-call-schedules?workspaceId=1"

Get Schedule

GET /on-call-schedules/:id

Returns a schedule with its rotations, participants, and overrides.

curl -H "Authorization: Bearer ionh_your_key" \
  https://api.ionhour.com/api/on-call-schedules/1

Update Schedule

PUT /on-call-schedules/:id
curl -X PUT https://api.ionhour.com/api/on-call-schedules/1 \
  -H "Authorization: Bearer ionh_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Schedule", "timezone": "Europe/London"}'

Delete Schedule

DELETE /on-call-schedules/:id
curl -X DELETE https://api.ionhour.com/api/on-call-schedules/1 \
  -H "Authorization: Bearer ionh_your_key"

Overrides

Create Override

POST /on-call-overrides
FieldTypeRequiredDescription
scheduleIdnumberYesSchedule to override
overrideUserIdnumberYesUser who will cover
startAtstringYesISO datetime when override begins
endAtstringYesISO datetime when override ends
replacedUserIdnumberNoUser being replaced (null = unconditional override)
reasonstringNoReason for the override
curl -X POST https://api.ionhour.com/api/on-call-overrides \
  -H "Authorization: Bearer ionh_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduleId": 1,
    "overrideUserId": 5,
    "replacedUserId": 2,
    "startAt": "2025-03-10T09:00:00Z",
    "endAt": "2025-03-17T09:00:00Z",
    "reason": "Alice on vacation"
  }'

Delete Override

DELETE /on-call-overrides/:id
curl -X DELETE https://api.ionhour.com/api/on-call-overrides/3 \
  -H "Authorization: Bearer ionh_your_key"