---
title: "Get the history of commands the robot has finished"
method: GET
path: "/v1/vehicles/{vehicleId}/command-history"
tags: ["Vehicle Autonomy"]
---

# Get the history of commands the robot has finished

`GET /v1/vehicles/{vehicleId}/command-history`

## Request

- Base URL: `https://api.polymathrobotics.dev`
- URL: `https://api.polymathrobotics.dev/v1/vehicles/{vehicleId}/command-history`
- Auth: HTTP bearer

Returns command records that have reached a terminal state, newest first, from cortex's bounded history ring. Each record carries the command id that was returned when the command was submitted, so a caller can look up how one of its own commands ended. Filters are optional and combine.

## Path parameters

- `vehicleId` string, required

## Query parameters

- `max_count` integer: Maximum number of records to return. Zero means no limit.
- `since_sec` integer: Only return records completed at or after this time, in seconds. Zero disables.
- `since_nanosec` integer: Nanosecond part of the since filter.
- `command_id` string: Only return the record with this command id. Empty disables the filter.

## Response `200`

Terminal command records, newest first.

- CommandHistoryResponse
  - `status` string, required
  - `message` string, required
  - `data` CommandHistoryData, required
    - `records` CortexCommandRecordModel[]: Terminal command records, newest first.
      - `id` string, required: Cortex-assigned command id, in canonical UUID string form.
      - `summary` string: Short human-readable description of the command.
      - `state` unknown
      - `state_text` string: Name of the state, e.g. TERMINAL.
      - `outcome` unknown
      - `outcome_text` string: Name of the outcome, e.g. REJECTED.
      - `detail` string: Outcome context, e.g. the validation message for a rejection.
      - `queued_time` Stamp, required
        - `sec` integer
        - `nanosec` integer
      - `started_time` Stamp, required
        - `sec` integer
        - `nanosec` integer
      - `completed_time` Stamp, required
        - `sec` integer
        - `nanosec` integer

## Other responses

- `422`: Validation Error
- `500`: Internal server error

## Changes

- **2026-09-09** `7bb062ddb622`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/polymathrobotics/apis/polymath-api/changes/v1/vehicles/:vehicleId/command-history/get.md)

---

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