---
title: "Preview or undo the journal entries an import created"
method: POST
path: "/imports/{importId}/undo"
tags: ["Import/Export"]
---

# Preview or undo the journal entries an import created

`POST /imports/{importId}/undo`

## Request

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

Works for freestyle, bank-file and QuickBooks imports. confirmed=false returns the entries and register rows that would be removed plus any blockers; confirmed=true soft-deletes the entries, removes their imported register rows and frees source-row keys so a corrected file can be imported. Reconciled rows, matched feed rows, payment links and closed fiscal years block the undo.

## Path parameters

- `importId` string, uuid, required

## Request body

- object
  - `confirmed` boolean
  - `bankAccountId` string, uuid: Only remove imported entries that touch this register

## Response `200`

Removal preview or receipt

## Other responses

- `404`: Import not found in these books
- `409`: Blocked by reconciliation, matched feed rows, payments or a closed year

---

[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)
