---
title: "Record a bookkeeping agent finding's filing and lifecycle"
method: PATCH
path: "/accountant/companies/{customerId}/agent/findings/{findingId}"
tags: ["Accountant Portal"]
---

# Record a bookkeeping agent finding's filing and lifecycle

`PATCH /accountant/companies/{customerId}/agent/findings/{findingId}`

## Request

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

Agent key only. `claimFiling` takes the set-once filing claim (it lapses after 10 minutes; `data.claimed` says whether this caller holds it). `issueNumber` is set, or moved to a lower number only. `statusCommentId` is the agent's status comment in this environment. `fixSeenLive: true` is refused with 409 `AGENT_FIX_NOT_LIVE` unless this build carries the finding's fix; `false` clears it (a rollback). `state: closed` and `abandoned` are refused with 409 `AGENT_FINDING_NOT_CLOSABLE` while work is held (and, for a defect, while its fix is not live in this build); `cleared` only for a finding that clears by itself. `githubWrite` records a GitHub write about to be made. `minRelease` raises the release (never lowers it) of a finding whose fix was not yet seen live, moving the items it holds with it: sent when the finding joins an issue whose fix for its release is already live. Findings writes do not count against the agent's write rate limit. Refused with 403 `AGENT_PHI_RESTRICTED` for a patient-data-restricted company. 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
- `findingId` string, uuid, required

## Request body

- object
  - `claimFiling` string, uuid
  - `issueNumber` integer
  - `statusCommentId` integer
  - `fixSeenLive` boolean
  - `minRelease` integer
  - `state` 'cleared' | 'closed' | 'abandoned'
  - `githubWrite` 'create_issue' | 'edit_body' | 'comment' | 'edit_comment' | 'label' | 'close' | 'reopen'

## Response `200`

Success envelope

- object

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: Fix not live in this build, finding not closable, or the agent is disabled or stopped
- `422`: Validation failed

## Changes

- **2026-10-29** `e1fc804546d3`: 1 info
  - endpoint added

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