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

# List Routes in Session

> List the routes of a routing session, paginated with `page` and `size`, with their status, progress and drivers. Set `include_children_companies` to read a session of one of your child companies.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or the session belongs to a company you cannot access
- **404**: No session with this slug
- **422**: Invalid page parameters

**Required Auth Scopes:**
- `routing-sessions:read`



## OpenAPI

````yaml /api-reference/openapi.json get /operations/sessions/{slug}/routes
openapi: 3.1.0
info:
  title: SWITCH API
  version: '1.0'
  description: >-
    The SWITCH API gives mobility and logistics teams programmatic access to
    SWITCH forecasts, fleet operations, routing and analytics. Every request is
    authenticated with an API key sent as a bearer token.
servers:
  - url: https://stage-api.getswitch.io
    description: Stage
security: []
tags:
  - name: Forecast
    description: Demand forecasts per zone and time window.
  - name: Operations
    description: Fleet imbalance, rebalancing suggestions and generated tasks.
  - name: Routing
    description: Route optimisation for single and multiple fleets.
  - name: Routing Sessions
    description: Saved routing sessions, their routes and drivers.
  - name: Routing Operations
    description: Complete, undo and re-route the stops of a route.
  - name: Fleet Management
    description: Your depots, stations, drivers and cargo vehicles.
  - name: Integrations
    description: Vehicles, statuses and commands on your fleet platform.
  - name: Station Based Analytics
    description: Analytics for station-based (docked) services.
  - name: Zone Based Analytics
    description: Analytics for free-floating services, by zone.
  - name: Free Float Analytics
    description: Trip history for free-floating services.
  - name: Transit Analytics
    description: Punctuality and service delivery for public transit.
  - name: Live
    description: Real-time fleet, delivery and transit status.
  - name: Grids
    description: Spatial grids used by forecasts and analytics.
  - name: API Keys
    description: Create and manage the API keys you call this API with.
paths:
  /operations/sessions/{slug}/routes:
    get:
      tags:
        - Routing Sessions
      summary: List Routes in Session
      description: >-
        List the routes of a routing session, paginated with `page` and `size`,
        with their status, progress and drivers. Set
        `include_children_companies` to read a session of one of your child
        companies.


        **Failure Modes:**

        - **401**: Token is missing or invalid

        - **403**: Insufficient permissions, or the session belongs to a company
        you cannot access

        - **404**: No session with this slug

        - **422**: Invalid page parameters


        **Required Auth Scopes:**

        - `routing-sessions:read`
      operationId: list_session_routes
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            description: Session identifier, as sent when it was dispatched.
            title: Slug
          description: Session identifier, as sent when it was dispatched.
        - name: include_children_companies
          in: query
          required: false
          schema:
            type: boolean
            description: Also include the records of your child companies.
            default: false
            title: Include Children Companies
          description: Also include the records of your child companies.
      responses:
        '200':
          description: >-
            Routes retrieved. Returns a paginated list with computed status,
            progress, driver names, and operation counts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page__T_Customized_RouteListItem_'
              example:
                items:
                  - id: 412
                    session_slug: 3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13
                    route_identifier: R1
                    reroute_enabled: true
                    start_at: '2026-11-30T08:00:00Z'
                    end_at: '2026-11-30T09:40:00Z'
                    total_distance: 14.2
                    status: active
                    total_operations: 2
                    completed_operations: 1
                    progress: 0.5
                    drivers:
                      - id: 57
                        full_name: Marco Bianchi
                        email: marco.bianchi@acme-mobility.com
                total: 1
                page: 1
                size: 10
                pages: 1
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '404':
          description: Not Found. No session with this slug.
        '422':
          description: Unprocessable Entity. Invalid parameters.
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    Page__T_Customized_RouteListItem_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/RouteListItem'
          type: array
          title: Items
        total:
          type: integer
          minimum: 0
          title: Total
        page:
          type: integer
          minimum: 1
          title: Page
        size:
          type: integer
          minimum: 1
          title: Size
        pages:
          type: integer
          minimum: 0
          title: Pages
      type: object
      required:
        - items
        - total
        - page
        - size
        - pages
      title: Page[~T]Customized[RouteListItem]
    RouteListItem:
      properties:
        id:
          type: integer
          title: Id
          description: Route ID.
        session_slug:
          type: string
          title: Session Slug
          description: Session the route belongs to.
        route_identifier:
          type: string
          title: Route Identifier
          description: Your name for the route.
        reroute_enabled:
          type: boolean
          title: Reroute Enabled
          description: Whether the route can be re-optimized while it runs.
        start_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Start At
          description: Planned start.
        end_at:
          type:
            - string
            - 'null'
          format: date-time
          title: End At
          description: Planned end.
        total_distance:
          type:
            - number
            - 'null'
          title: Total Distance
          description: Total planned distance in kilometres.
        status:
          $ref: '#/components/schemas/RouteStatus'
          description: >-
            `completed` when no operation is left open. Otherwise `expired` when
            the route's last estimated arrival is older than the expiration
            window (24 hours by default), `late` when an open operation is past
            its estimated arrival, and `active` otherwise.
        total_operations:
          type: integer
          title: Total Operations
          description: Number of operations.
        completed_operations:
          type: integer
          title: Completed Operations
          description: Completed operations.
        progress:
          type: number
          title: Progress
          description: 'Completion ratio: completed/total (0.0–1.0).'
        drivers:
          items:
            $ref: '#/components/schemas/RouteDriverPublic'
          type: array
          title: Drivers
          description: Assigned drivers.
          default: []
      type: object
      required:
        - id
        - session_slug
        - route_identifier
        - reroute_enabled
        - status
        - total_operations
        - completed_operations
        - progress
      title: RouteListItem
      description: >-
        Route as it appears in paginated list endpoints (with computed
        metadata).
      examples:
        - completed_operations: 1
          drivers:
            - email: marco.bianchi@acme-mobility.com
              full_name: Marco Bianchi
              id: 57
          end_at: '2026-11-30T09:40:00Z'
          id: 412
          progress: 0.5
          reroute_enabled: true
          route_identifier: R1
          session_slug: 3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13
          start_at: '2026-11-30T08:00:00Z'
          status: active
          total_distance: 14.2
          total_operations: 2
    RouteStatus:
      type: string
      enum:
        - active
        - late
        - expired
        - completed
      title: RouteStatus
      description: |-
        Computed route status based on operation state and timing.

        Assigned per-route in list responses. Display priority is
        ``completed > late > active > expired``.
    RouteDriverPublic:
      properties:
        id:
          type: integer
          title: Id
          description: User ID of the driver.
        full_name:
          type: string
          title: Full Name
          description: Driver's full name.
        email:
          type: string
          title: Email
          description: Driver's email.
      type: object
      required:
        - id
        - full_name
        - email
      title: RouteDriverPublic
      description: Driver assigned to a route.
      examples:
        - email: marco.bianchi@acme-mobility.com
          full_name: Marco Bianchi
          id: 57
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        An API key, sent as `Authorization: Bearer <key>`. Create one in the
        SWITCH Copilot under **Settings → API keys** (needs the API keys
        permission in your company), or with `POST /auth/api-keys`. The key is
        shown once, at creation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.