Catalog/sched-fair-shift-distribution

Scheduling

Fair shift distribution API

Distributes shifts fairly across people honoring per-person weights and unavailability, greedily assigning each slot to whoever is furthest below their fair target, returning assignment, per-person counts vs target, and max deviation. Answers 'How do I split shifts fairly by weight?', 'Did anyone get an unfair share?'.

Price$0.03per request
MethodPOST
Route/v1/scheduling/fair-shift-distribution
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
schedulingshiftsfairnessdistributionweightedrotastaffingagents
API URLhttps://x402.hexl.dev/v1/scheduling/fair-shift-distribution
Integration docs
Example request
{
  "people": [
    {
      "id": "a",
      "weight": 2
    },
    {
      "id": "b",
      "weight": 1
    }
  ],
  "slotCount": 6
}
Example response
{
  "assignment": [
    {
      "slot": 0,
      "person": "a"
    },
    {
      "slot": 1,
      "person": "a"
    },
    {
      "slot": 2,
      "person": "b"
    },
    {
      "slot": 3,
      "person": "a"
    },
    {
      "slot": 4,
      "person": "b"
    },
    {
      "slot": 5,
      "person": "a"
    }
  ],
  "perPerson": [
    {
      "id": "a",
      "assigned": 4,
      "target": 4,
      "deviation": 0
    },
    {
      "id": "b",
      "assigned": 2,
      "target": 2,
      "deviation": 0
    }
  ],
  "unfilledSlots": 0,
  "maxDeviation": 0,
  "fair": true,
  "interpretation": "All 6 slots filled; max deviation from fair target 0."
}
Input schema
{
  "type": "object",
  "required": [
    "people",
    "slotCount"
  ],
  "properties": {
    "people": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "slotCount": {
      "type": "number",
      "examples": [
        6
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}