> ## 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 Operations in Route

> List all operations of a route, ordered by step. Drivers assigned to the route can read it whatever their company.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or the route belongs to a company you cannot access
- **404**: No route with this ID

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



## OpenAPI

````yaml /api-reference/openapi.json get /operations/routes/{route_id}/operations
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/routes/{route_id}/operations:
    get:
      tags:
        - Routing Operations
      summary: List Operations in Route
      description: >-
        List all operations of a route, ordered by step. Drivers assigned to the
        route can read it whatever their company.


        **Failure Modes:**

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

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

        - **404**: No route with this ID


        **Required Auth Scopes:**

        - `routing-operations:read`
      operationId: list_route_operations
      parameters:
        - name: route_id
          in: path
          required: true
          schema:
            type: integer
            description: Route ID, from the session detail or the route list.
            title: Route Id
          description: Route ID, from the session detail or the route list.
      responses:
        '200':
          description: Operations retrieved. Returns the list ordered by step.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OperationPublic'
                title: Response List Route Operations
              example:
                - id: 9031
                  step: 1
                  task_type: battery_swap
                  latitude: 45.4642
                  longitude: 9.1856
                  provider: acme-mobility
                  address: Via Torino 2, 20123 Milano MI
                  vehicle_properties:
                    id: acme-sc-0193
                    licence_plate: SC0193
                    lat: 45.4642
                    lon: 9.1856
                    vehicle_type: scooter
                    vehicle_model: S-200
                    battery_level: 12
                    last_seen: '2026-11-30T07:50:12Z'
                    last_moved: '2026-11-30T06:41:03Z'
                    status: available
                  routing_parameters:
                    capacity_delta:
                      charged_battery: -1
                      empty_battery: 1
                    profit: 2.4
                  additional_notes: Battery level (12.0%) below threshold (20.0%)
                  estimated_arrive: '2026-11-30T08:14:00Z'
                  completed_at: '2026-11-30T08:17:42Z'
                - id: 9032
                  step: 2
                  task_type: pickup
                  latitude: 45.4671
                  longitude: 9.1883
                  provider: acme-mobility
                  address: Via Mazzini 9, 20123 Milano MI
                  routing_parameters:
                    capacity_delta:
                      vehicles: 1
                    profit: 2.1
                  additional_notes: 'Zone surplus 1.0 vehicles (threshold: 1.5)'
                  estimated_arrive: '2026-11-30T08:23:00Z'
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '404':
          description: Not Found. Route not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    OperationPublic:
      properties:
        id:
          type: integer
          title: Id
          description: Operation ID.
        step:
          type: integer
          title: Step
          description: Position of the operation in the route.
        task_type:
          type: string
          title: Task Type
          description: What the operator does at the stop, e.g. `pickup`.
        latitude:
          type: number
          title: Latitude
          description: Latitude of the stop (WGS84).
        longitude:
          type: number
          title: Longitude
          description: Longitude of the stop (WGS84).
        provider:
          type: string
          title: Provider
          description: Fleet the vehicle belongs to.
        address:
          type:
            - string
            - 'null'
          title: Address
          description: Street address, if known.
        vehicle_properties:
          $ref: '#/components/schemas/VehicleWithoutZone'
          description: Snapshot of the vehicle at planning time.
        estimated_arrive:
          type: string
          format: date-time
          title: Estimated Arrive
          description: Estimated arrival time.
        routing_parameters:
          additionalProperties: true
          type: object
          title: Routing Parameters
          description: Free-form data of the stop, as dispatched.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Completed At
          description: When the operation was completed; absent while open.
        cancelled:
          type:
            - string
            - 'null'
          title: Cancelled
          description: Cancellation reason; absent unless cancelled.
        additional_notes:
          type:
            - string
            - 'null'
          title: Additional Notes
          description: Free-text notes.
      type: object
      required:
        - id
        - step
        - task_type
        - latitude
        - longitude
        - provider
        - estimated_arrive
        - routing_parameters
      title: OperationPublic
      description: Operation as returned in session detail responses.
      examples:
        - additional_notes: Battery level (12.0%) below threshold (20.0%)
          address: Via Torino 2, 20123 Milano MI
          completed_at: '2026-11-30T08:17:42Z'
          estimated_arrive: '2026-11-30T08:14:00Z'
          id: 9031
          latitude: 45.4642
          longitude: 9.1856
          provider: acme-mobility
          routing_parameters:
            capacity_delta:
              charged_battery: -1
              empty_battery: 1
            profit: 2.4
          step: 1
          task_type: battery_swap
          vehicle_properties:
            battery_level: 12
            id: acme-sc-0193
            last_moved: '2026-11-30T06:41:03Z'
            last_seen: '2026-11-30T07:50:12Z'
            lat: 45.4642
            licence_plate: SC0193
            lon: 9.1856
            status: available
            vehicle_model: S-200
            vehicle_type: scooter
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VehicleWithoutZone:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the vehicle
        licence_plate:
          type:
            - string
            - 'null'
          title: Licence Plate
          description: Licence plate number of the vehicle
        lat:
          type:
            - number
            - 'null'
          title: Lat
          description: Latitude of the vehicle's current location
        lon:
          type:
            - number
            - 'null'
          title: Lon
          description: Longitude of the vehicle's current location
        vehicle_type:
          type:
            - string
            - 'null'
          title: Vehicle Type
          description: Type of the vehicle, e.g., 'scooter', 'bike', 'car'
        vehicle_model:
          type:
            - string
            - 'null'
          title: Vehicle Model
          description: Model of the vehicle, e.g., 'Model X', 'Model Y'
        battery_level:
          type:
            - integer
            - 'null'
          title: Battery Level
          description: Battery level of the vehicle, e.g., 100 for 100%
        battery_level_master:
          type:
            - integer
            - 'null'
          title: Battery Level Master
          description: >-
            Master battery level percentage (custom MDS setup only). None when
            not reported by the provider.
        last_seen:
          type:
            - string
            - 'null'
          format: date-time
          title: Last Seen
          description: Timestamp of the last time the vehicle was seen in the system
        last_moved:
          type:
            - string
            - 'null'
          format: date-time
          title: Last Moved
          description: Timestamp of the last time the vehicle moved
        status:
          type:
            - string
            - 'null'
          title: Status
          description: Current status of the vehicle, e.g., 'available', 'in-use'
      type: object
      required:
        - id
        - battery_level
      title: VehicleWithoutZone
      description: >-
        Represents a vehicle without zone assignment.


        Base schema containing all vehicle attributes except zone_id.

        Used when a grid service is not available and spatial zone mapping is
        skipped.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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.