---
title: "List the bookkeeping agent's stopped runs"
method: GET
path: "/accountant/companies/{customerId}/agent/runs"
tags: ["Accountant Portal"]
---

# List the bookkeeping agent's stopped runs

`GET /accountant/companies/{customerId}/agent/runs`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/agent/runs`
- Auth: HTTP bearer

Agent key only; anyone else gets 403 (AGENT_ONLY). The company's runs, any trigger but `simulation`, whose latest attempt ended `killed` with a stop reason (`window_open`, `pairs_not_live`, `categorize_not_live` or `source_paused`) and started within the last `withinSeconds`: rows the agent left in review. A `categorize_not_live` stop follows the agent's judgment, so it is listed only when that attempt recorded its decision. Newest first, at most 1000. Work item keys, stop reasons and times only. A restarted worker reads it once per company so it does not run those rows again. Mounted only when the deployment enables the bookkeeping agent (default off); otherwise 404. The shared cloud-bookkeeping service token gets 404 here.

## Path parameters

- `customerId` string, uuid, required

## Query parameters

- `withinSeconds` integer, required

## Response `200`

Success envelope with `runs`, each `{ workItemKey, stopReason, startedAt, ageSeconds }`

- object
  - `success` true, required
  - `data` object, required
    - `runs` object[], required
      - `workItemKey` string, required
      - `stopReason` 'window_open' | 'pairs_not_live' | 'categorize_not_live' | 'source_paused', required
      - `startedAt` string, date-time, required
      - `ageSeconds` integer, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `422`: Request failed validation

## Changes

- **2026-11-26** `4a2098becaf9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/agent/runs/get.md)

---

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