---
title: "Import Routes Into Dispatch Plan"
method: POST
path: "/v1/plans/{planId}/routes:import"
tags: ["Dispatch plans"]
---

# Import Routes Into Dispatch Plan

`POST /v1/plans/{planId}/routes:import`

## Request

- Base URL: `https://api.sandbox.usenash.com`
- URL: `https://api.sandbox.usenash.com/v1/plans/{planId}/routes:import`
- Auth: none declared

Take up to 1,500 whole undispatched routes per request into the plan's draft, archiving each live source route; its orders join the plan. Routes the plan already took are reported as unchanged, so a retry is safe. The whole selection is refused when any id is unknown or ineligible (400 `PLAN_SELECTION_INVALID`, naming the ids) or another plan holds one of its orders (409 `ORDER_HELD_BY_PLAN`). More ids than one request takes fail with 422 `VALIDATION_ERRORS`. A plan holds at most 22,000 orders, 1,500 routes and 24,000 stops; an import that would grow it past them is refused with 400 `PLAN_DOCUMENT_INVALID`. Fails with 409 `PLAN_LEASE_HELD` (naming `heldBy`) while anyone has the plan open in the Planner, and with 409 `PLAN_REVISION_STALE` (naming `currentRevision`) when the plan changed since `expectedRevision`.

## Path parameters

- `planId` string, required

## Request body

- ImportDispatchPlanRoutes
  - `expectedRevision` integer, required: The `revision` of the plan you last read.
  - `routeIds` string[], required: Undispatched routes to take.

## Response `200`

OK

- ImportedDispatchPlanRoutes
  - `planId` string, required
  - `revision` integer, required
  - `contentHash` string, required
  - `routes` ImportedDispatchPlanRoute[], required
    - `sourceRouteId` string, required
    - `draftRouteId` string, nullable, required
  - `importedRouteIds` string[], required: Routes taken into the plan and archived.
  - `unchangedRouteIds` string[], required: Routes the plan already took, left as they were.
  - `importedOrderIds` string[], required: Orders that joined the plan with the taken routes.
  - `memberCount` integer, required: Orders the plan holds now.

## Other responses

- `422`: Unprocessable Content

---

[API](https://skmtc.dev/nash/apis/nash-api.md) - [All operations](https://skmtc.dev/nash/apis/nash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nash/apis/nash-api/revisions/e3713837c5c9?raw)
