---
title: "Get Dispatch Plan Optimization"
method: GET
path: "/v1/plans/{planId}/optimizations/{activityId}"
tags: ["Dispatch plans"]
---

# Get Dispatch Plan Optimization

`GET /v1/plans/{planId}/optimizations/{activityId}`

## Request

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

The status of one of the plan's optimization runs; 404 `ACTIVITY_NOT_FOUND` for any other run.

## Path parameters

- `planId` string, required
- `activityId` string, required: The optimization run id from its start.

## Response `200`

OK

- DispatchPlanOptimization
  - `status` 'queued' | 'running' | 'succeeded' | 'failed', required: `queued` and `running` are still working; `succeeded` and `failed` are final. `succeeded` means the run finished: take it. Take can still refuse it with reason `not_takeable`, which is final for that run.
  - `error` string, nullable, required: Why a `failed` run failed, when it recorded a reason.

## 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)
