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

# List scheduled routes

> Returns scheduled routes (legacy `scheduled_routes`) for your org, ordered by `scheduled_start_time` desc.



## OpenAPI

````yaml /openapi.json get /routes
openapi: 3.1.0
info:
  title: United Logistics API
  version: 0.1.0
  description: >-
    Industry-grade public API for fleet, fuel, and toll operations. Every
    endpoint is scoped to the organization owning the API key. Authentication:
    bearer API key (`ulk_<prefix>_<secret>`). Rate limit: 60 requests/minute/key
    by default (override per key via the dashboard).
  contact:
    name: United Logistics Engineering
    email: sfuentes@assetmg.tech
servers:
  - url: https://app.unitedlogistics.com.do/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /routes:
    get:
      tags:
        - Scheduled Routes
      summary: List scheduled routes
      description: >-
        Returns scheduled routes (legacy `scheduled_routes`) for your org,
        ordered by `scheduled_start_time` desc.
      parameters:
        - schema:
            type: string
            pattern: ^\d+$
          required: false
          name: limit
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
        - schema:
            type: string
          required: false
          name: status
          in: query
        - schema:
            type: string
            pattern: ^\d+$
          required: false
          name: vehicle_external_id
          in: query
        - schema:
            type: string
            format: date-time
          required: false
          name: start
          in: query
        - schema:
            type: string
            format: date-time
          required: false
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledRouteListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ScheduledRouteListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledRoute'
        pagination:
          $ref: '#/components/schemas/PaginationCursor'
      required:
        - data
        - pagination
    ErrorObject:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: unauthorized
            message:
              type: string
              example: Missing Authorization header.
            details: {}
          required:
            - code
            - message
      required:
        - error
    ScheduledRoute:
      type: object
      properties:
        id:
          type: integer
        route_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Logical route id (groups versions of the same route).
        org_id:
          type: string
          format: uuid
        fleet_id:
          type:
            - integer
            - 'null'
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        vehicle_external_id:
          type:
            - integer
            - 'null'
          description: Vehicle assigned to the route (legacy `vehicle_id`).
        driver_external_id:
          type:
            - integer
            - 'null'
        status:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        scheduled_start_time:
          type:
            - string
            - 'null'
        planned_start_at:
          type:
            - string
            - 'null'
        actual_departure_at:
          type:
            - string
            - 'null'
        completed_at:
          type:
            - string
            - 'null'
        cancelled_at:
          type:
            - string
            - 'null'
        started_at:
          type:
            - string
            - 'null'
        ended_at:
          type:
            - string
            - 'null'
        estimated_duration_minutes:
          type:
            - integer
            - 'null'
        actual_duration_minutes:
          type:
            - integer
            - 'null'
        estimated_distance_km:
          type:
            - number
            - 'null'
        actual_distance_km:
          type:
            - number
            - 'null'
        telemetry_health:
          type:
            - string
            - 'null'
        start_message_id:
          type:
            - integer
            - 'null'
        end_message_id:
          type:
            - integer
            - 'null'
        current_message_id:
          type:
            - integer
            - 'null'
        start_telemetry_timestamp:
          type:
            - string
            - 'null'
        end_telemetry_timestamp:
          type:
            - string
            - 'null'
        current_plan_version_id:
          type:
            - integer
            - 'null'
        scheduler_tolerance_seconds:
          type:
            - integer
            - 'null'
        flags: {}
        notes:
          type:
            - string
            - 'null'
        created_by_user_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - route_id
        - org_id
        - fleet_id
        - name
        - description
        - vehicle_external_id
        - driver_external_id
        - status
        - state
        - scheduled_start_time
        - planned_start_at
        - actual_departure_at
        - completed_at
        - cancelled_at
        - started_at
        - ended_at
        - estimated_duration_minutes
        - actual_duration_minutes
        - estimated_distance_km
        - actual_distance_km
        - telemetry_health
        - start_message_id
        - end_message_id
        - current_message_id
        - start_telemetry_timestamp
        - end_telemetry_timestamp
        - current_plan_version_id
        - scheduler_tolerance_seconds
        - notes
        - created_by_user_id
        - created_at
        - updated_at
    PaginationCursor:
      type: object
      properties:
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor for the next page. Null when there are no more
            results.
          example: eyJpZCI6IjAxQUI...
        has_more:
          type: boolean
      required:
        - next_cursor
        - has_more
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: ulk_<prefix>_<secret>
      description: >-
        Authorization: Bearer ulk_<prefix>_<secret>. Cree la clave en
        Configuración → API.

````