Accountant Portal

Start a bookkeeping agent run

Changed on

Agent key only. One run per work item: the work item key is the lease. A run that ended without writing anything may be handed back under its key (failed with attempts left, or stopped by the patient-data flag or the kill switch), and only to a start with the trigger it was started with; any other start answers 409 AGENT_WORK_ITEM_TAKEN. A stopped run with no decision recorded under its attempt is handed back under the same attempts: it uses none of the three. One writing run per company: a start with any trigger but simulation answers 409 AGENT_COMPANY_LEASE_HELD while another work item's writing run is open on the company; simulation runs neither take nor respect this. A run still open 8 minutes after it started is ended as failed before the start is decided. Mounted only when the deployment enables the bookkeeping agent (default off); otherwise 404. The shared cloud-bookkeeping service token gets 404 here.

post/accountant/companies/{customerId}/agent/runs

Request

  • Base URL
    https://api.medianfi.com/api/v1
  • Auth
    HTTP bearer

Path parameters

customerId, string uuid required

Request body

BookkeepingAgentRunInput required
workItemKey, string required
trigger, 'transaction' | 'task_answer' | 'replay' | 'held' | 'simulation' required

Response

Success envelope

object required

Changes