{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getuptimely-com/json-schema/getuptimely-com-on-call-current-schema.json",
  "title": "OnCallCurrent",
  "description": "Live on-call rosters for every schedule.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getuptimely-com-on-call-api-openapi.yml#/components/schemas/OnCallCurrent",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OnCallScheduleRoster"
      },
      "description": "One entry per on-call schedule in the project."
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false,
  "$defs": {
    "OnCallScheduleRoster": {
      "type": "object",
      "properties": {
        "schedule_id": {
          "type": "string",
          "description": "On-call schedule id."
        },
        "schedule_name": {
          "type": "string",
          "description": "Schedule name."
        },
        "description": {
          "description": "Optional schedule description.",
          "type": [
            "string",
            "null"
          ]
        },
        "current_user": {
          "anyOf": [
            {
              "$ref": "#/$defs/OnCallUserRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "Who is on call right now; null when nobody is."
        },
        "next_user": {
          "anyOf": [
            {
              "$ref": "#/$defs/OnCallUserRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "Who takes over next; null when unknown."
        },
        "handoff_at": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "When the current roster hands off, ISO-8601 UTC."
        },
        "next_start_at": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "When the next roster begins, ISO-8601 UTC."
        }
      },
      "required": [
        "schedule_id",
        "schedule_name",
        "description",
        "current_user",
        "next_user",
        "handoff_at",
        "next_start_at"
      ],
      "additionalProperties": false,
      "description": "The live roster of one on-call schedule."
    },
    "OnCallUserRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "User id."
        },
        "name": {
          "description": "Display name.",
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": "string",
          "description": "Email address."
        }
      },
      "required": [
        "id",
        "name",
        "email"
      ],
      "additionalProperties": false,
      "description": "A user on an on-call roster."
    }
  }
}