---
title: "Set the class on posted journal lines"
method: PATCH
path: "/journal-lines/class"
tags: ["Accounting"]
---

# Set the class on posted journal lines

`PATCH /journal-lines/class`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/journal-lines/class`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Retags up to 500 income or expense lines of this company with an active class, or clears it with null. Amounts and accounts are unchanged. Lines in a closed fiscal year return 422. A linked feed row keeps its class in sync, and each change is audited.

## Request body

- object
  - `lineIds` string[], required
  - `classId` string, uuid, nullable, required

## Response `200`

{ data: { updated } }

## Other responses

- `422`: Error response
- `default`: Error response

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/01c3e57d281f?raw)
