---
title: "Get Schedule By Index"
method: GET
path: "/schedules/{schedule_id}/index/{index}"
---

# Get Schedule By Index

`GET /schedules/{schedule_id}/index/{index}`

Return one previously retained schedule without advancing generation.

Args:
    schedule_id: Unique identifier of the containing generation session.
    index: Zero-based index into schedules generated so far.

Returns:
    The stored serialized schedule, requested index, and current total count.

Raises:
    HTTPException: Status 404 when either the session or requested index does not
        exist; the detail identifies the currently available index interval.

Behavior:
    Results are read directly from the append-only serialized schedule list. No
    scheduler initialization or generation lock is required, and retrieving a
    result refreshes the session's idle-expiry timestamp.

## Path parameters

- `schedule_id` string, required
- `index` integer, required

## Response `200`

Successful Response

- ScheduleResponse — Response model for schedule retrieval requests. **Usage:** ```python ScheduleResponse(schedule_id='...', schedule=[...], index=0, total_generated=1) ``` **Fields:** - schedule_id: Unique identifier for the schedule session - schedule: Generated schedule as `list[CourseInstanceResponse]` (typed JSON rows) - index: Index of this schedule in the generation sequence - total_generated: Total number of schedules generated so far
  - `schedule_id` string, required
  - `schedule` CourseInstanceResponse[], required
    - `course` string, required — Course id with section, e.g. `"CS101.01"`.
    - `faculty` string, required
    - `times` TimeInstanceResponse[], required
      - `day` integer, required — Weekday as `Day` enum value (1=Monday … 5=Friday).
      - `start` integer, required — Start time in minutes since midnight.
      - `duration` integer, required — Duration in minutes.
      - `delivery` 'in_person' | 'online', required — Meeting delivery mode.
    - `room` string, nullable — Assigned room when present.
    - `lab` string, nullable — Assigned lab when present.
    - `lab_index` integer, nullable — Index into `times` for the lab meeting.
    - `reserve_room_during_lab` boolean, required — Whether the lab meeting also occupies the assigned room.
  - `index` integer, required
  - `total_generated` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mucsci/apis/course-scheduler-api.md) · [All operations](https://skmtc.net/mucsci/apis/course-scheduler-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mucsci/course-scheduler-api/revisions/f728bfcee693/schema)
