---
title: "Queue a bookkeeping question for the accountant"
method: POST
path: "/accountant/companies/{customerId}/agent/tasks"
tags: ["Accountant Portal"]
---

# Queue a bookkeeping question for the accountant

`POST /accountant/companies/{customerId}/agent/tasks`

## Request

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

Agent key only. Creates one `bookkeeping_question` task per source key on the company's primary accountant, with a proposal and one question. One question per source key for good: a key whose question is still open returns that question, and a key whose question was answered or closed returns it closed and unchanged (never reopened, never a second one). `data.created` is true only when this request created the question. One question per payee: with `waitingOnTaskId`, the transaction named by the source key is recorded as waiting on that open question about another transaction of the same payee, and no question is created; `data.attached` is then true and `data.id` is that question. The API decides this for itself and records it only when that question is this company's, open and asked because the category could not be told (a grouped review code); both transactions are still in review and move money the same way; neither is a split row; and both are the same payee by the API's own reading: every key a row carries (merchant name, description) names a payee (not only generic bank words, stop words and words of three letters or fewer), neither is the company's own name (legal form and punctuation aside), with a merchant name the merchant key and the description key are both equal, and with no merchant name the two descriptions are the same text, digits included (trimmed, case aside). When this request creates the transaction's own question, any record of it waiting on another question is removed in the same write. Otherwise the question is created as without the field, `data.attached` is false and `data.attachRefusal` says why (`question_not_open`, `question_not_grouped`, `transaction_not_waiting`, `direction_differs`, `payee_not_usable`, `payee_is_company`, `payee_differs`). 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

## Request body

- BookkeepingAgentTaskInput
  - `sourceKey` string, required
  - `transactionId` string, uuid
  - `proposal` string, required
  - `question` string, required
  - `waitingOnTaskId` string, uuid: An open bookkeeping question about another transaction of the same payee. When it can take this transaction, the transaction waits on it and no second question is created.

## Response `201`

Success envelope

- object

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: No accountant assigned, 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/tasks/post.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)
