---
title: "Change an uploaded statement"
method: PATCH
path: "/bank-statements/{statementId}"
tags: ["Banking"]
---

# Change an uploaded statement

`PATCH /bank-statements/{statementId}`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/bank-statements/{statementId}`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Changes the month or replaces the file on an adopted uploaded statement. File replacement queues fresh OCR. change_period also files an upload waiting for review (see /statement-intakes): it is adopted in the chosen month and coverage is checked again. A review upload with no account needs bankAccountId or chartAccountId; only review uploads may change account. The chosen month stands over the printed closing month. One statement is kept per account and month; an occupied month returns 409.

## Path parameters

- `statementId` string, uuid, required

## Request body

- union
  - object
    - `action` 'change_period', required
    - `periodYear` integer, required
    - `periodMonth` integer, required
    - `bankAccountId` string, uuid: Bank register for an upload waiting for review
    - `chartAccountId` string, uuid: Chart account for an upload waiting for review with no bank register
  - object
    - `action` 'replace_file', required
    - `fileKey` string, required
    - `fileSize` integer, required
    - `mimeType` string, required

## Response `200`

Statement changed

## Other responses

- `409`: A statement already exists for the requested month
- `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/9a8269f0a586?raw)
