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

# List routes

> GET /dn/routes lists all routes for a given date with pagination. Returns vehicles, planned jobs, distance, time, and status per route.

Retrieve every route scheduled for a specific date. Each route includes the assigned vehicle, depot, planned and unplanned jobs, and computed totals such as distance and duration. Use the `page` and `limit` query parameters to paginate through large result sets.

Each route has two levels:

* **The plan** (the top-level object) holds the plan's `status`, depot, and totals across all vehicles.
* **`planned_routes`** has one entry per vehicle, with that vehicle's `status`, `start_time`, `completion_time`, time window, and its `planned_jobs` in delivery order (`job_sequence`, `eta_time`).

Jobs that couldn't be placed on any vehicle are in the plan-level `unplanned_jobs`. The plan-level `vehicle` shows one of the plan's vehicles; use `planned_routes[].vehicle` to see which vehicle drives which route. See [Route status](/concepts/routes#route-status) for what each `status` value means.


## OpenAPI

````yaml GET /dn/routes
openapi: 3.0.3
info:
  title: Detrack REST API v2
  version: '2.0'
  description: >-
    Detrack REST API v2. Checked against detrack-webapp origin/main (production)
    on 2026-09-29: dn_jobs.rb @ d246ad006, dn_depots.rb @ 2a5f387, dn_routes.rb
    @ 50a73a9, app_helper.rb @ d745ad2, dn_jobs_helper.rb @ d296e30,
    job_decorator.rb @ 3041da7, run_location_decorator.rb @ 0f0274d,
    vehicle_route_plan_decorator.rb and tsp_route_decorator.rb @ 7d1f3ef,
    data_export.rb @ ed4e135.
servers:
  - url: https://app.detrack.com/api/v2
security:
  - apiKey: []
tags:
  - name: Jobs
    description: Deliveries and collections.
  - name: Depots
    description: Saved warehouse and pickup locations.
  - name: Routes
    description: Optimized multi-stop plans across vehicles.
paths:
  /dn/routes:
    get:
      tags:
        - Routes
      summary: List routes
      description: Returns the route plans for a date, newest first.
      operationId: listRoutes
      parameters:
        - name: date
          in: query
          required: true
          schema:
            type: string
            format: date
            example: '2026-09-15'
          description: Route date (`YYYY-MM-DD`).
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Route plans for the date.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          description: '`date` is missing or isn''t `YYYY-MM-DD`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: invalid_date
                message: date parameter is required
        default:
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
      description: Page number.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 25
      description: Records per page. The API doesn't cap it, but keep it to 100 or fewer.
  schemas:
    RouteList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RoutePlan'
        links:
          $ref: '#/components/schemas/Links'
        total_count:
          type: integer
          example: 1
    Error:
      type: object
      properties:
        code:
          type: string
          example: not_found
        message:
          type: string
          example: Could not find job with this DO number
    RoutePlan:
      type: object
      properties:
        id:
          type: string
          example: 69001c6de8ec5410e2570bb3
        name:
          type: string
          example: sample_run
        date:
          type: string
          format: date
          example: '2026-09-15'
        mode:
          type: string
          example: drive
        status:
          type: string
          description: >-
            Plan status: `new` or `routing_in_progress` while optimizing, then
            `to_be_confirm`, `routing_completed`, or `routing_failed`. See
            [Route status](/concepts/routes#route-status).
          example: to_be_confirm
        message:
          type: string
          nullable: true
        vehicle:
          type: object
          additionalProperties: true
          description: >-
            One of the plan's vehicles. Use `planned_routes[].vehicle` to see
            which vehicle drives which route.
        job_ids:
          type: array
          items:
            type: string
        depot_location:
          $ref: '#/components/schemas/Depot'
        end_depot_location:
          type: object
          allOf:
            - $ref: '#/components/schemas/Depot'
          nullable: true
        total_distance:
          type: number
          description: Meters, across all vehicles.
          example: 15107
        total_time:
          type: number
          description: Seconds, across all vehicles.
          example: 4373.497
        total_planned:
          type: integer
          example: 3
        total_unplanned:
          type: integer
          example: 0
        type:
          type: string
          example: balanced
        jobs:
          type: array
          description: >-
            Only while the plan is still optimizing (`new` or
            `routing_in_progress`): the jobs being planned, in place of
            `planned_routes`.
          items:
            $ref: '#/components/schemas/PlannedJob'
        planned_routes:
          type: array
          description: One entry per vehicle, once optimization has finished.
          items:
            $ref: '#/components/schemas/VehicleRoute'
        unplanned_jobs:
          type: array
          description: Jobs that couldn't be placed on any vehicle.
          items:
            $ref: '#/components/schemas/PlannedJob'
    Links:
      type: object
      properties:
        first:
          type: string
          nullable: true
        last:
          type: string
          nullable: true
        next:
          type: string
          nullable: true
        prev:
          type: string
          nullable: true
    Depot:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          example: 68f0d416e8ec54cbf4a04dba
        name:
          type: string
          example: Main Depot
        address:
          type: string
          example: >-
            SM Megamall, EDSA corner Doña Julia Vargas Ave, Mandaluyong, 1550
            Metro Manila
        addr_1:
          type: string
          nullable: true
        addr_2:
          type: string
          nullable: true
        addr_3:
          type: string
          nullable: true
        zip_code:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country_id:
          type: string
          nullable: true
          readOnly: true
        location:
          type: array
          readOnly: true
          description: Coordinates as `[longitude, latitude]`.
          items:
            type: number
          example:
            - 121.055626
            - 14.583941
        address_lat:
          type: number
          readOnly: true
          example: 14.583941
        address_lng:
          type: number
          readOnly: true
          example: 121.055626
    PlannedJob:
      type: object
      properties:
        id:
          type: string
          example: 68e0bac7e8ec545357500616
        type:
          type: string
          example: Delivery
        status:
          type: string
          example: dispatched
        do_number:
          type: string
          example: DO-10001
        address:
          type: string
          example: Vicente Sotto St, CCP Complex, Pasay 1307
        deliver_to_collect_from:
          type: string
          nullable: true
        phone_number:
          type: string
          nullable: true
        time_window_from:
          type: string
          nullable: true
          example: '09:00'
        time_window_to:
          type: string
          nullable: true
          example: '12:00'
        job_sequence:
          type: integer
          example: 1
        eta_time:
          type: string
          example: '07:05'
        run_number:
          type: string
          example: '1'
        service_time:
          type: integer
          nullable: true
          example: 10
        geocoded_lat:
          type: number
          example: 14.5542
        geocoded_lng:
          type: number
          example: 120.9839
        has_latlng:
          type: boolean
          example: true
    VehicleRoute:
      type: object
      description: One vehicle's route within a plan.
      properties:
        id:
          type: string
          example: 69001c6fe8ec5410e2570bc0
        vrp_id:
          type: string
          example: 69001c6de8ec5410e2570bb3
        name:
          type: string
          example: '1'
        date:
          type: string
          format: date
          example: '2026-09-15'
        status:
          type: string
          description: >-
            Vehicle route status: `to_be_confirm`, `route_assigned`,
            `route_assigned_without_driver`, or `unplanned_jobs`. See [Route
            status](/concepts/routes#route-status).
          example: to_be_confirm
        vehicle:
          type: object
          additionalProperties: true
          description: The vehicle and its driver details.
        time_window_from:
          type: string
          example: '07:00'
        time_window_to:
          type: string
          example: '23:50'
        start_time:
          type: string
          example: '07:00'
        completion_time:
          type: string
          example: '08:12'
        total_distance:
          type: number
          description: Meters.
          example: 15107
        total_time:
          type: number
          description: Seconds.
          example: 4373.497
        total_planned:
          type: integer
          example: 3
        total_unplanned:
          type: integer
          example: 0
        planned_jobs:
          type: array
          description: Jobs in delivery order.
          items:
            $ref: '#/components/schemas/PlannedJob'
        unplanned_jobs:
          type: array
          items:
            $ref: '#/components/schemas/PlannedJob'
  responses:
    Unauthorized:
      description: >-
        The API key is missing or invalid. A missing `X-API-KEY` returns `{
        "error": "Missing Authorization header" }`; an invalid key returns `{
        "code": "invalid_key", "message": "Invalid key" }`.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                title: Missing key
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: Missing Authorization header
              - type: object
                title: Invalid key
                required:
                  - code
                properties:
                  code:
                    type: string
                    example: invalid_key
                  message:
                    type: string
                    example: Invalid key
          example:
            code: invalid_key
            message: Invalid key
    Forbidden:
      description: Your API key's user doesn't have permission for this action.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: forbidden
          example:
            code: forbidden
    ServerError:
      description: >-
        Unexpected server error. Retry with exponential backoff, and contact
        Detrack support if it persists.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Detrack API key, from **Integrations > API Key** in the dashboard.

````

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