> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shiftkeeper.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List schedule shifts

> List all shifts for a schedule within a given time interval.



## OpenAPI

````yaml https://api.shiftkeeper.io/openapi.json get /schedules/{schedule_id}/shifts/
openapi: 3.1.0
info:
  title: Shiftkeeper API
  description: API reference to interact with Shiftkeeper programatically
  version: 0.0.1
servers:
  - url: https://api.shiftkeeper.io
security:
  - apiKey: []
externalDocs:
  url: https://docs.shiftkeeper.io
  description: Learn more about Shiftkeeper
paths:
  /schedules/{schedule_id}/shifts/:
    get:
      tags:
        - Schedules
      summary: List schedule shifts
      description: List all shifts for a schedule within a given time interval.
      parameters:
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 20
          in: query
          name: per_page
          description: The number of items per page.
        - schema:
            type: number
            minimum: 1
            default: 1
          in: query
          name: page
          description: The page number of the results to return.
        - schema:
            type: string
            format: date-time
          in: query
          name: from
          required: true
        - schema:
            type: string
            format: date-time
          in: query
          name: to
          required: true
        - schema:
            type: boolean
          in: query
          name: clip_to_interval
        - schema:
            type: string
          examples:
            sch_oKjoLJUl47g7OYYVPUG5t:
              value: sch_oKjoLJUl47g7OYYVPUG5t
            sch_kje7ER643ED0STVnB8Zc9:
              value: sch_kje7ER643ED0STVnB8Zc9
          in: path
          name: schedule_id
          required: true
          description: The ID of the schedule.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  shifts:
                    type: array
                    items:
                      $ref: '#/components/schemas/ScheduleShift'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
                required:
                  - shifts
                  - meta
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/NotFoundError'
                required:
                  - error
components:
  schemas:
    ScheduleShift:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: The users on-call for this shift.
        start:
          type: string
          format: date-time
          description: The start time of the on-call shift.
        end:
          type: string
          format: date-time
          description: The end time of the on-call shift.
      required:
        - users
        - start
        - end
    PaginationMeta:
      type: object
      properties:
        total:
          type: number
          description: The total number of items in the collection.
        page:
          type: number
          description: The current page number.
        per_page:
          type: number
          description: The number of items per page.
      required:
        - total
        - page
        - per_page
      examples:
        - total: 100
          page: 1
          per_page: 20
    NotFoundError:
      type: object
      properties:
        message:
          type: string
        docs_url:
          type: string
        status:
          type: number
          const: 404
        code:
          type: string
          const: not_found
      required:
        - message
        - status
        - code
      example:
        code: not_found
        status: 404
        message: The requested resource was not found
    User:
      type: object
      properties:
        id:
          type: string
          description: The ID of the user.
        name:
          type: string
          description: The name of the user.
        email:
          type: string
          format: email
          description: The email of the user.
        time_zone:
          type: string
          description: >-
            The preferred time zone of the user. If not set, the organization's
            time zone will be used.
        role:
          type: string
          enum:
            - owner
            - standard
          description: >-
            The role of the user. Learn more about roles in [our
            docs](/shiftkeeper/workspace/users#roles).
        seat:
          type: string
          enum:
            - viewer
            - member
          description: >-
            The seat of the user. Learn more about seat in [our
            docs](/shiftkeeper/workspace/users#seats).
        slack_id:
          type: string
          description: The Slack ID of the user.
      required:
        - id
        - name
        - email
        - role
        - seat
      examples:
        - id: usr_bq7CmsOKLmkMeZkUUu1hy
          name: Rick
          email: rick@example.org
          time_zone: Europe/Paris
          role: owner
          seat: member
          slack_id: U082KENSEQ3
        - id: usr_C0GwCFdk0I4pBMRny4qYV
          name: Dena
          email: dena@example.org
          role: standard
          seat: member
          slack_id: U082GMAFR1T
        - id: usr_YlxrjoB1JqUsollScfFYT
          name: Lily
          email: lily@example.org
          time_zone: America/New_York
          role: standard
          seat: viewer
          slack_id: U0529FWNCG2
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Enter your API key which starts with 'keeper_'

````