---
title: "Assign one accounting class to a batch of transactions, posted rows included"
method: POST
path: "/accountant/companies/{customerId}/transactions/bulk-assign-class"
tags: ["Accountant Portal"]
---

# Assign one accounting class to a batch of transactions, posted rows included

`POST /accountant/companies/{customerId}/transactions/bulk-assign-class`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/transactions/bulk-assign-class`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Sets the class on up to 100 transactions per request (#2125; each row is its own database transaction, and a batch must finish inside the 30s request timeout). Each row goes through the same audited assignment as PATCH /accountant/companies/{customerId}/transactions/{transactionId} with only classId: the transaction and its owned journal_lines get the class and one transaction.class_assignment audit_logs row is written, in one database transaction per row. Amounts, accounts, dates and posting status never change, and nothing is voided. A row in a filing-locked period, a reconciled row, or a row whose journal entry has an ambiguous source is reported as failed with the reason, and the rest of the batch still runs. Rows already on the class are skipped, so re-running a request is safe. An inactive or foreign classId is refused with 404 before any row is touched. To class a date range (for example the last N months), page transaction ids with GET /accountant/companies/{customerId}/transactions?dateFrom=&dateTo= and send them in batches of 100 or fewer. To clear a class, use the single-row PATCH.

## Request body

- object
  - `transactionIds` string[], required: Duplicates are ignored.
  - `classId` string, uuid, required: An active class of this company.

## Response `200`

Per-row outcome. Same summary shape as bulk-approve, bulk-recategorize and bulk-reject.

- object
  - `success` boolean
  - `data` object
    - `requested` integer, required
    - `processed` integer, required
    - `skipped` integer, required
    - `failed` integer, required
    - `results` object[], required
      - `transactionId` string, uuid, required
      - `status` 'processed' | 'skipped' | 'failed', required
      - `reason` string

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `422`: Validation error (empty or more than 100 transactionIds, non-uuid ids)

---

[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/20090ea32b0d?raw)
