Accountant Portal

Record one decision of the agent, to learn from

Changed on

Agent key only, into an open run that is not a simulation run (trigger simulation: 409 AGENT_RUN_NOT_OPEN). Keeps what the model was shown (ids and hashes) and answered (account, confidence, citations), how the decision was reached and its cost. One row per run attempt: a retry returns the row already recorded (200). Every transaction and account named must belong to the company, and the evidence to the run (422 otherwise). 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/{runId}/decisions

Request

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

Path parameters

customerId, string uuid required
runId, string uuid required

Request body

BookkeepingAgentDecisionInput required

One decision of the agent, kept to learn from. Ids, codes, numbers and hashes only: free text in any field is refused (422).

transactionId, string uuid
evidenceId, string uuid
decisionPath, 'model' | 'answer_rule' | 'precedent_rule' | 'guard' | 'model_timeout' | 'model_error' | 'skipped' required
finalAction, 'recategorize' | 'match_document' | 'match_transfer' | 'complete_reconciliation' | 'queue_task' | 'repair_duplicate_stripe_je' | 'run_revenue' | 'run_bills' | 'run_close'
reasonCode, string
modelAction, string
proposedGlAccountId, string uuid
modelConfidence, number
cited, object[]
shown, object
payloadSha256, string
instructionsSha256, string
policySha256, string
workerCommit, string
model, string
provider, string
params, object
promptTokens, integer
completionTokens, integer
cachedTokens, integer
reasoningTokens, integer
costMicros, integer
latencyMs, integer
httpAttempts, integer
finishReason, string

Response

The decision this run attempt already recorded

object required

Changes

    • info

      added the new optional request property shown/clientContext

    • info

      added the new run_bills enum value to the request property finalAction

    • info

      added the new run_close enum value to the request property finalAction

    1 more change in this revision