# Categorize and tag a transaction

Assign a saved category identifier and tags to a selected-account bank transaction. Read the transaction first, pass detail.classification_revision as expectedRevision (zero if absent), and preserve tags when changing only the category. An empty categoryId clears the category; JSON null is also accepted. An optional note (at most 2000 characters) sets the line's own note; leave it out to keep the existing note, send "" to clear it. A stale revision returns a conflict; reload before retrying. This classification does not move money or change allocations and supports undo. Takes the brokerage's books: an owner or admin, or a seat holding an accounting grant (`get_accounting_me_access`); anyone else is refused with 403. A grant scoped to some linked bank accounts reaches only those accounts' lines.

Access class: `workspace:books`.

## Endpoint

`PUT /v1/accounting/bank-transactions/{id}/classification`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "categoryId": "",
  "expectedRevision": 1.5,
  "note": "string",
  "tags": [
    "string"
  ]
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "accountLast4": "string",
    "accountName": "string",
    "allocatedMinor": 1,
    "amountMinor": 1,
    "createdAt": "2026-01-01T00:00:00Z",
    "currency": "string",
    "description": "string",
    "detail": {},
    "direction": "string",
    "externalId": "",
    "fullyAllocated": true,
    "id": 1,
    "memo": "string",
    "postedOn": "2026-01-01T00:00:00Z",
    "source": "string",
    "unallocatedMinor": 1,
    "updatedAt": "2026-01-01T00:00:00Z"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
