# POST /api/v1/transactions/batch/mark-reviewed-by-filter

> Mark machine-categorized transactions reviewed by filter

- **Tag:** transactions
- **Operation ID:** `mark_transactions_reviewed_by_filter`

## Description

Mark every unreviewed transaction a machine categorized (bank rule, counterparty rule, merchant pattern, history, AI) that matches a filter as reviewed: by who categorized it, a confidence floor, counterparties, an amount ceiling or a date range. Rows a person categorized, transfers and uncategorized rows are never selected. `dry_run` returns the count and a sample. The ids-based `PATCH /batch/review-status` is unchanged.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `TransactionReviewByFilterRequest`

- `categorized_by` (array · string) — Who categorized the row (default: any machine layer). `rules` = a bank rule, `counterparty_default` = a counterparty rule, `merchant` = a known merchant pattern, the rest are learned or AI guesses.
- `min_confidence` (number) — Guesses (AI, history, similarity) need a stored confidence at or above this; bank rules, merchant patterns and counterparty defaults are exact matches and always pass.
- `counterparties` (array · string) — Only these counterparties (case-insensitive exact names).
- `min_amount_cents` (integer) — Only rows of at least this absolute amount.
- `max_amount_cents` (integer) — Only rows of at most this absolute amount.
- `date_from` (string · date) — Earliest transaction date.
- `date_to` (string · date) — Latest transaction date.
- `limit` (integer) — Most transactions to mark in one call.
- `dry_run` (boolean) — Return the count, amount and a sample; change nothing.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_TransactionReviewByFilterResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (TransactionReviewByFilterResponse)

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/transactions/batch/mark-reviewed-by-filter' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "categorized_by": [],
  "min_confidence": 0,
  "counterparties": [],
  "min_amount_cents": 0,
  "max_amount_cents": 0,
  "date_from": "2026-01-01"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/transactions/batch/mark-reviewed-by-filter', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "categorized_by": [],
  "min_confidence": 0,
  "counterparties": [],
  "min_amount_cents": 0,
  "max_amount_cents": 0,
  "date_from": "2026-01-01"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {'categorized_by': [],
 'min_confidence': 0,
 'counterparties': [],
 'min_amount_cents': 0,
 'max_amount_cents': 0,
 'date_from': '2026-01-01'}

response = httpx.post("https://api.ondayzero.com/api/v1/transactions/batch/mark-reviewed-by-filter", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/transactions/mark-transactions-reviewed-by-filter
- OpenAPI slice: https://www.ondayzero.com/docs/reference/transactions/mark-transactions-reviewed-by-filter/openapi.json
- Other endpoints in **transactions**: https://www.ondayzero.com/docs/reference/transactions (markdown bundle: https://www.ondayzero.com/docs/reference/transactions.md, OpenAPI: https://www.ondayzero.com/docs/reference/transactions/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
