Catalog/sched-oncall-rotation

Scheduling

On-call rotation API

Generates an on-call rotation assigning people to back-to-back shifts of a given length from a start instant, returning each shift's person with ISO start/end and next-handoff plus a fairness tally. Answers 'Who is on call for each shift?', 'When is the next handoff?'.

Price$0.02per request
MethodPOST
Route/v1/scheduling/oncall-rotation
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
schedulingshiftson-callrotationhandoffoncallcoverageagents
API URLhttps://x402.hexl.dev/v1/scheduling/oncall-rotation
Integration docs
Example request
{
  "start": "2026-06-04T00:00:00Z",
  "people": [
    "alice",
    "bob"
  ],
  "shifts": 3,
  "shiftLengthHours": 24
}
Example response
{
  "rotation": [
    {
      "shift": 1,
      "person": "alice",
      "start": "2026-06-04T00:00:00.000Z",
      "end": "2026-06-05T00:00:00.000Z",
      "nextHandoff": "2026-06-05T00:00:00.000Z"
    },
    {
      "shift": 2,
      "person": "bob",
      "start": "2026-06-05T00:00:00.000Z",
      "end": "2026-06-06T00:00:00.000Z",
      "nextHandoff": "2026-06-06T00:00:00.000Z"
    },
    {
      "shift": 3,
      "person": "alice",
      "start": "2026-06-06T00:00:00.000Z",
      "end": "2026-06-07T00:00:00.000Z",
      "nextHandoff": "2026-06-07T00:00:00.000Z"
    }
  ],
  "shiftCounts": {
    "alice": 2,
    "bob": 1
  },
  "shiftLengthHours": 24,
  "balanced": true,
  "interpretation": "3 shift(s) of 24h across 2 people from 2026-06-04T00:00:00.000Z."
}
Input schema
{
  "type": "object",
  "required": [
    "start",
    "people",
    "shifts"
  ],
  "properties": {
    "start": {
      "type": "string",
      "examples": [
        "2026-06-04T00:00:00Z"
      ]
    },
    "people": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "examples": [
        [
          "alice",
          "bob"
        ]
      ]
    },
    "shifts": {
      "type": "number",
      "examples": [
        3
      ]
    },
    "shiftLengthHours": {
      "type": "number",
      "examples": [
        24
      ]
    },
    "handoffOffsetHours": {
      "type": "number",
      "examples": [
        0
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}