---
title: "Report what the bookkeeping agent did for a customer"
method: GET
path: "/accountant/companies/{customerId}/agent/activity"
tags: ["Accountant Portal"]
---

# Report what the bookkeeping agent did for a customer

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

## Request

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

Human accountants only: an accountant assigned to the customer (or one with access to every customer). The bookkeeping agent's key and the shared cloud-bookkeeping service token both get 404. Read-only. One item per agent run (work item) started in [`from`, `to`), newest first, with what it tried, how it ended, the row it acted on as the customer's books show it now, the reason code it recorded, what it cited (counted by kind), its confidence and the question it raised. The model's free-text reasoning is never returned. Filters narrow the list and its `total`: `kind`, `outcome`, `q` (the acted-on row's payee or bank description contains the text, case aside), `reason` (the item's `reasonCode`) and `accountId` (the account the run categorized into or proposed). `summary` counts every run in the period and ignores the filters. Mounted only when the deployment enables the bookkeeping agent (default off); otherwise 404.

## Path parameters

- `customerId` string, uuid, required

## Query parameters

- `from` string, date-time, required
- `to` string, date-time, required
- `kind` 'categorized' | 'matched' | 'repaired' | 'reconciled' | 'asked' | 'held' | 'failed' | 'running' | 'other': What the run did. Applied runs are named by their action; the others by their outcome.
- `outcome` 'applied' | 'asked' | 'failed' | 'held' | 'running': How the run ended. `held`: stopped by a run limit, the kill switch or the patient-data flag, or failed and waiting for a fix.
- `q` string
- `reason` string
- `accountId` string, uuid
- `cursor` string
- `limit` integer

## Response `200`

Success envelope

- object
  - `success` boolean, required
  - `data` AgentActivityReport, required
    - `enabled` boolean, required: Whether the agent is switched on for this customer now. Past activity is returned either way.
    - `from` string, date-time, required
    - `to` string, date-time, required
    - `summary` object, required
      - `runs` object, required
        - `total` integer, required
        - `applied` integer, required
        - `asked` integer, required
        - `failed` integer, required
        - `held` integer, required
        - `running` integer, required
      - `categorized` integer, required
      - `matches` object, required
        - `transfers` integer, required
        - `cardPayments` integer, required
        - `documents` integer, required
      - `reconciliationsCompleted` integer, required
      - `stripeRepairs` object, required
        - `voids` integer, required: Stripe fee entries voided. Always 0; the Stripe repairs are not part of this deployment.
        - `payoutLegs` integer, required: Payout legs posted to a Stripe financial account. Always 0; the Stripe repairs are not part of this deployment.
      - `questions` object, required
        - `raised` integer, required
        - `answered` integer, required
      - `sentToPerson` object, required: p15-014. The rows the bookkeeping agent sent to a person in the period (its question and held-row tasks created then), by how the person resolved each on the Inbox. `approvedAsProposed` means approved with no change to its proposal, `edited` approved after an edit, `rejected` rejected, `open` still open or snoozed (or not on the Inbox yet), and `closedWithoutDecision` settled with no Inbox decision (answered or closed from the Task Queue). The five parts add up to `total`.
        - `total` integer, required
        - `approvedAsProposed` integer, required
        - `edited` integer, required
        - `rejected` integer, required
        - `open` integer, required
        - `closedWithoutDecision` integer, required
      - `costMicros` integer, required: Model spend in micro-USD.
    - `items` AgentActivityItem[], required
      - `id` string, uuid, required: The run's id.
      - `at` string, date-time, required
      - `finishedAt` string, date-time, nullable, required
      - `kind` 'categorized' | 'matched' | 'repaired' | 'reconciled' | 'asked' | 'held' | 'failed' | 'running' | 'other', required: What the run did. Applied runs are named by their action; the others by their outcome.
      - `outcome` 'applied' | 'asked' | 'failed' | 'held' | 'running', required: How the run ended. `held`: stopped by a run limit, the kill switch or the patient-data flag, or failed and waiting for a fix.
      - `action` 'recategorize' | 'match_document' | 'match_transfer' | 'complete_reconciliation' | 'queue_task' | 'repair_duplicate_stripe_je' | 'run_revenue' | 'run_bills' | 'run_close' | 'null', nullable, required
      - `matchType` 'transfer' | 'card_payment' | 'document' | 'null', nullable, required
      - `repairRule` unknown, required
      - `target` AgentActivityTarget, nullable, required
        - `type` 'transaction' | 'reconciliation' | 'stripe_balance_transaction', required
        - `id` string, uuid, required
        - `date` string, date, nullable, required
        - `amountCents` integer, nullable, required: Unsigned integer cents; `direction` says which way.
        - `direction` 'in' | 'out' | 'null', nullable, required
        - `currency` string, nullable, required
        - `description` string, nullable, required
        - `account` AgentActivityAccountRef, nullable, required
          - `id` string, uuid, required
          - `name` string, required
      - `counterpart` AgentActivityTarget, nullable, required
        - `type` 'transaction' | 'reconciliation' | 'stripe_balance_transaction', required
        - `id` string, uuid, required
        - `date` string, date, nullable, required
        - `amountCents` integer, nullable, required: Unsigned integer cents; `direction` says which way.
        - `direction` 'in' | 'out' | 'null', nullable, required
        - `currency` string, nullable, required
        - `description` string, nullable, required
        - `account` AgentActivityAccountRef, nullable, required
          - `id` string, uuid, required
          - `name` string, required
      - `document` object, nullable, required
        - `id` string, uuid, required
        - `name` string, nullable, required
      - `categoryFrom` AgentActivityAccountRef, nullable, required
        - `id` string, uuid, required
        - `name` string, required
      - `categoryTo` AgentActivityAccountRef, nullable, required
        - `id` string, uuid, required
        - `name` string, required
      - `reasonCode` string, nullable, required: A short code (lowercase letters, digits, underscores) for why it asked, stopped or failed. A `killed` run whose finish carried a stop reason gives it first (`window_open`, waiting on a document's date window; `pairs_not_live`, a card payment waiting for `transfers.pairs` to go live), ahead of anything an earlier attempt recorded. A stopped run with no recorded reason gives one read from its status (`switched_off`, `run_limit`, `patient_data`, `waiting_for_fix`).
      - `confidence` number, nullable, required
      - `evidence` object, required: What the run cited, counted by kind (history, document, rule, ...).
      - `question` object, nullable, required
        - `id` string, uuid, required
        - `title` string, required
        - `status` string, required
        - `answered` boolean, required
      - `attempts` integer, required
    - `total` integer, required: Runs in the period that match `kind` and `outcome`.
    - `hasMore` boolean, required
    - `nextCursor` string, nullable, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `422`: Validation failed (a bad period, filter, limit or cursor)

## Changes

- **2026-11-28** `629ac127e9e4`: 3 warning
  - added the new `run_bills` enum value to the `data/items/items/action` response property for the response status `200`
  - added the new `run_close` enum value to the `data/items/items/action` response property for the response status `200`
  - added the new `run_revenue` enum value to the `data/items/items/action` response property for the response status `200`
- **2026-11-26** `4a2098becaf9`: 1 warning, 1 info
  - added the new `repair_duplicate_stripe_je` enum value to the `data/items/items/action` response property for the response status `200`
  - added the required property `data/summary/sentToPerson` to the response with the `200` status
- **2026-10-29** `e1fc804546d3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/agent/activity/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)
