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

> ## Agent Instructions
> Nash exposes two MCP servers. The docs MCP server at https://docs.usenash.com/mcp searches this documentation and needs no credentials. The Nash MCP server at https://mcp.usenash.com/mcp operates an organization's deliveries and needs a Nash API key. See https://docs.usenash.com/reference/build-with-ai.
> Use the Sandbox environment (https://api.sandbox.usenash.com/v1) for anything that creates or dispatches deliveries during development.

# Find Nearby Couriers

> Find the drivers on active routes nearest to a point.

Use this when a route needs help: a van has broken down, or a driver is running out of hours, and you need to know who else is close. Send the point as `lat` and `lng`, and Nash returns the nearest drivers on routes that are assigned, started, or in progress, nearest first, each with their route and their distance from the point in meters.

Distance is a straight line from each driver's latest GPS position, not a driving distance. A driver with no recorded position is left out, and so is one whose position is older than `max_location_age_minutes` (30 by default). Narrow the search to one depot with `store_location_id`, and leave out the route you're rescuing, and its drivers, with `exclude_route_ids`.

Unlike most of the API, this endpoint's query parameters and response fields are snake\_case.


## OpenAPI

````yaml get /v1/routes/nearby-couriers
openapi: 3.1.0
info:
  title: Nash API
  version: 1.0.0
servers:
  - url: https://api.sandbox.usenash.com
    description: Sandbox API
  - url: https://api.sandbox.ap-southeast-2.usenash.com
    description: Sandbox API (Australia)
  - url: https://api.usenash.com
    description: Production API
  - url: https://api.ap-southeast-2.usenash.com
    description: Production API (Australia)
security: []
tags:
  - name: Notifications
    description: Notifications
    x-nash-topic: config
  - name: Annotate
    description: Annotate
    x-nash-topic: wismo
  - name: Notifications — Send
    description: One-off notification send without a NotificationTrigger.
    x-nash-topic: notifications
  - name: Shipping
    description: Shipping operations
    x-nash-topic: shipping
  - name: Workflow
    description: Workflow automation management
    x-nash-topic: scheduling
  - name: Workflow Execution
    description: Workflow execution history and monitoring
    x-nash-topic: scheduling
  - name: Optimization Strategies
    description: Create, read, update, and delete route optimization strategies.
    x-nash-topic: scheduling
  - name: AI Agents
    description: AI agent management — create, read, update, and delete agents
    x-nash-topic: config
  - name: AI Functions
    description: LLM-backed domain tools
    x-nash-topic: ai
  - name: Webhooks
    description: Webhook delivery inspection
    x-nash-topic: webhooks
  - name: Miscellaneous
    description: Miscellaneous
  - name: Job
    description: Job
    x-nash-topic: wismo
  - name: Batch Job
    description: Batch Job
    x-nash-topic: wismo
  - name: Order
    description: Order
    x-nash-topic: wismo
  - name: Provider
    description: Provider
    x-nash-topic: provider
  - name: Dispatch Strategies
    description: Dispatch Strategies
    x-nash-topic: scheduling
  - name: Store Locations
    description: Store Locations
    x-nash-topic: config
  - name: Delivery Windows
    description: Delivery Windows
    x-nash-topic: config
  - name: Templates
    description: Templates
    x-nash-topic: config
  - name: Zones
    description: Zones
    x-nash-topic: config
  - name: Feedback
    description: Feedback
    x-nash-topic: reporting
  - name: Organizations
    description: Organizations
    x-nash-topic: config
  - name: Store Catalog
    description: Store Catalog
    x-nash-topic: config
  - name: Route
    description: Route
    x-nash-topic: scheduling
  - name: Messaging
    description: Messaging
    x-nash-topic: config
  - name: Billing
    description: Invoice-aligned customer billing usage
    x-nash-topic: config
  - name: Contracts
    description: Provider contract pricing and version listings
    x-nash-topic: provider
  - name: Couriers
    description: Couriers
    x-nash-topic: provider
  - name: Fleet
    description: >-
      Inbound endpoints fleets call to manage their drivers and update in-flight
      deliveries.
    x-nash-topic: driver
  - name: Embed Sessions
    description: >-
      Mint short-lived, browser-safe sessions for embedded Nash Widgets.
      Authenticated with an org embed credential, which must stay on your
      backend.
    x-nash-topic: config
  - name: Event Timeline
    description: Entity-scoped event timeline + outbound provider traffic for one entity.
    x-nash-topic: internal
  - name: Optimization Fleet Projection
    description: >-
      Optimizer-facing projection of the effective fleet for a single-store
      solve
    x-nash-topic: scheduling
  - name: Hub Scanning
    description: Scan physical packages onto their route rack at a hub.
    x-nash-topic: scheduling
  - name: Inventory
    description: Store inventory catalog sync to SFTP retail destinations (e.g. Uber).
    x-nash-topic: store_catalog
  - name: Optimization Activities
    description: Optimization runs launched from the portal or the API
    x-nash-topic: scheduling
  - name: Route Restrictions
    description: Org-scoped geographic areas the route optimizer must avoid traversing.
    x-nash-topic: config
  - name: Shifts
    description: Shifts
    x-nash-topic: provider
  - name: Users
    description: User, role, and organization-membership management.
    x-nash-topic: config
  - name: Vehicles
    description: Vehicles
    x-nash-topic: provider
  - name: Widgets
    description: >-
      Org configuration for embedded Nash Widgets: parent origins, enablement,
      and embed credentials.
    x-nash-topic: config
  - name: Provider Chat
    description: Carrier-chat context for a route, scoped to the caller's organization.
    x-nash-topic: internal
  - name: Order Ingestion
    description: >-
      Internal validate, commit, and reconciliation boundary for governed Order
      imports.
    x-nash-topic: internal
paths:
  /v1/routes/nearby-couriers:
    get:
      tags:
        - Route
      summary: Find Nearby Couriers
      description: >-
        Nearest couriers on active routes (assigned, started, in progress) to a
        point, ranked by straight-line distance from each courier's latest GPS
        ping. Couriers with no recorded ping are omitted. Scope to one depot
        with store_location_id, and leave out the route being rescued with
        exclude_route_ids.
      operationId: routes_v1_find_nearby_couriers_route_routes_nearby_couriers_get
      parameters:
        - name: lat
          in: query
          description: Latitude to measure from, e.g. the stranded driver.
          required: true
          schema:
            title: Lat
            maximum: 90
            minimum: -90
            type: number
            description: Latitude to measure from, e.g. the stranded driver.
        - name: lng
          in: query
          description: Longitude to measure from.
          required: true
          schema:
            title: Lng
            maximum: 180
            minimum: -180
            type: number
            description: Longitude to measure from.
        - name: limit
          in: query
          description: Maximum couriers to return.
          required: false
          schema:
            title: Limit
            maximum: 50
            minimum: 1
            type: integer
            description: Maximum couriers to return.
            default: 5
        - name: store_location_id
          in: query
          description: Only routes carrying an order picked up at this store location.
          required: false
          schema:
            title: Store Location Id
            anyOf:
              - minLength: 1
                type: string
              - type: 'null'
            description: Only routes carrying an order picked up at this store location.
            default: null
        - name: exclude_route_ids
          in: query
          description: >-
            Comma-separated route ids to leave out, along with their couriers,
            e.g. the route that needs rescuing.
          required: false
          schema:
            title: Exclude Route Ids
            anyOf:
              - maxLength: 4096
                type: string
              - type: 'null'
            description: >-
              Comma-separated route ids to leave out, along with their couriers,
              e.g. the route that needs rescuing.
            default: null
        - name: max_location_age_minutes
          in: query
          description: Ignore couriers whose latest ping is older than this.
          required: false
          schema:
            title: Max Location Age Minutes
            maximum: 1440
            minimum: 1
            type: integer
            description: Ignore couriers whose latest ping is older than this.
            default: 30
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NearbyCouriersResponse'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NashValidationError'
components:
  schemas:
    NearbyCouriersResponse:
      title: NearbyCouriersResponse
      required:
        - couriers
      type: object
      properties:
        couriers:
          title: Couriers
          type: array
          items:
            $ref: '#/components/schemas/NearbyCourier'
          description: Nearest first.
    NashValidationError:
      title: NashValidationError
      required:
        - error
        - response_status
        - RequestID
      type: object
      properties:
        error:
          $ref: '#/components/schemas/NashErrorDetails'
        response_status:
          title: Response Status
          type: string
        RequestID:
          title: Requestid
          type: string
    NearbyCourier:
      title: NearbyCourier
      required:
        - courier_id
        - courier_name
        - route_id
        - route_name
        - route_status
        - lat
        - lng
        - captured_at
        - distance_meters
      type: object
      properties:
        courier_id:
          title: Courier Id
          type: string
        courier_name:
          title: Courier Name
          anyOf:
            - type: string
            - type: 'null'
        route_id:
          title: Route Id
          type: string
        route_name:
          title: Route Name
          anyOf:
            - type: string
            - type: 'null'
        route_status:
          $ref: '#/components/schemas/RouteStatus'
        lat:
          title: Lat
          type: number
        lng:
          title: Lng
          type: number
        captured_at:
          title: Captured At
          type: string
          format: date-time
        distance_meters:
          title: Distance Meters
          type: integer
          description: Straight-line distance from the query point.
    NashErrorDetails:
      title: NashErrorDetails
      required:
        - code
        - message
      type: object
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
        details:
          title: Details
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          description: >-
            Structured error context; shape depends on `code`. For
            `VALIDATION_ERRORS` (HTTP 422) it is `{"fields": [{"loc": [...],
            "msg": "...", "type": "..."}]}` — one entry per invalid field, where
            `loc` is the field path, `msg` the human-readable message, and
            `type` the machine-readable error type (e.g. `string_type`,
            `missing`).
          default: null
    RouteStatus:
      title: RouteStatus
      enum:
        - created
        - assigned
        - started
        - in_progress
        - completed
        - failed
        - canceled
      type: string
      description: Status enum for Routes.

````

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