# Retrieve results

Retrieve an optimisation run and its result.

> **Proposed public API.** The direct submission contract is a design proposal. Its examples are illustrative.

## Request

Use planId and runId from the previous responses.

```bash
API_BASE=https://api.coordigator.io
curl --fail-with-body -sS "$API_BASE/plans/$PLAN_ID/solves/$RUN_ID" \
  -H "Authorization: Bearer $COORDIGATOR_API_KEY"
```

## Run status

| Status | Meaning |
| --- | --- |
| queued | Waiting to execute |
| running | Optimisation in progress |
| completed | Result available |
| failed | Optimisation failed |

These states are documented in the supplied implementation reference. The proposed result representation below is illustrative, not the current encrypted result envelope.

## 200 OK — completed

```json
{
  "runId": "22222222-2222-4222-8222-222222222222",
  "status": "completed",
  "createdAt": "2026-12-01T08:00:00Z",
  "expiresAt": "2026-12-02T08:00:00Z",
  "result": {
    "routes": [
      {
        "vehicleId": "van-1",
        "jobIds": [
          "job-1",
          "job-2"
        ]
      }
    ],
    "unassignedJobIds": []
  }
}
```

jobIds are shown in visit order in this proposed minimal response. No solver was executed to produce this example. The exact result schema, geometry, timings, loads and secure result delivery remain to be defined.

## Failure

The current implementation returns error solve_failed when a run fails. Applying a completed result to a saved solution is a separate operation today; automatic application behaviour for the proposed interface must be agreed.
