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.
| Field | Type | Required | Description |
|---|
workspaceId | number | Yes | Workspace this schedule belongs to |
name | string | Yes | Schedule name |
description | string | No | Schedule description |
timezone | string | No | Timezone for handoff times (default: UTC) |
handoffNotificationMinutes | number | No | Minutes before handoff to notify incoming person (default: 15, null to disable) |
enabled | boolean | No | Whether the schedule is active (default: true) |
rotations | array | No | Rotations to create with the schedule (see below) |
| Field | Type | Required | Description |
|---|
name | string | No | Rotation name |
type | string | Yes | daily, weekly, or custom |
layerPosition | number | Yes | Priority within the schedule (0 = highest) |
effectiveFrom | string | Yes | ISO datetime when this rotation starts |
effectiveUntil | string | No | ISO datetime when this rotation ends (null = indefinite) |
handoffTime | string | Yes | Time of day for shift changes (e.g., 09:00) |
handoffDay | number | No | Day of week for weekly rotations (1=Mon, 7=Sun, default: 1) |
customShiftHours | number | No | Shift length in hours for custom rotations |
participants | array | No | Ordered list of participants (see below) |
| Field | Type | Required | Description |
|---|
userId | number | Yes | User to include in the rotation |
position | number | Yes | Order in the rotation (0-indexed) |
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 }
]
}
]
}'
| Parameter | Type | Required | Description |
|---|
workspaceId | number | Yes | Filter by workspace |
curl -H "Authorization: Bearer ionh_your_key" \
"https://api.ionhour.com/api/on-call-schedules?workspaceId=1"
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
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 /on-call-schedules/:id
curl -X DELETE https://api.ionhour.com/api/on-call-schedules/1 \
-H "Authorization: Bearer ionh_your_key"
| Field | Type | Required | Description |
|---|
scheduleId | number | Yes | Schedule to override |
overrideUserId | number | Yes | User who will cover |
startAt | string | Yes | ISO datetime when override begins |
endAt | string | Yes | ISO datetime when override ends |
replacedUserId | number | No | User being replaced (null = unconditional override) |
reason | string | No | Reason 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 /on-call-overrides/:id
curl -X DELETE https://api.ionhour.com/api/on-call-overrides/3 \
-H "Authorization: Bearer ionh_your_key"