---
title: "Upload a bank or card file into the account's Bank Feeds card"
method: POST
path: "/bank-accounts/{bankAccountId}/bank-feed-csv"
tags: ["Banking", "Imports"]
---

# Upload a bank or card file into the account's Bank Feeds card

`POST /bank-accounts/{bankAccountId}/bank-feed-csv`

## Request

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

The account needs a Bank Feeds card (connected to a bank, files only, or both) that is not hidden. Any dates are allowed. Rows an earlier upload already added (same date, amount, and cleaned description) are skipped by count; new rows that look like an existing bank or file row (same amount, dates within 3 days) are added and paired as possible duplicates. Added rows get rules, the AI pass, auto-post, and posting exactly like bank rows. Preview first; it writes nothing. When the date or amount column can't be found, the preview returns needsColumns with the headers, sample rows, and a suggested mapping; send the confirmed mapping with preview and commit. The mapping is remembered for the account.

## Path parameters

- `bankAccountId` string, uuid, required

## Request body

- object
  - `mode` 'preview' | 'commit'
  - `fileName` string, nullable
  - `content` string, required
  - `format` 'csv' | 'tsv' | 'qif' | 'ofx' | 'qfx' | 'qbo' | 'null', nullable
  - `flipSigns` boolean: Reverse every amount, for files that list card charges as positive
  - `mapping` object: Source column headings for CSV/TSV files: date, description, amount, or debit and credit, plus optional balance, reference, payee, counterparty
    - `date` string
    - `description` string
    - `amount` string
    - `debit` string
    - `credit` string
    - `balance` string
    - `reference` string
    - `payee` string
    - `counterparty` string

## Response `200`

Preview, or a commit that added nothing

## Other responses

- `201`: Rows added to Bank Feeds
- `409`: bank_feed_not_created (no Bank Feeds card) or bank_feed_hidden
- `422`: bank_feed_upload_unreadable, or bank_feed_upload_needs_columns on commit
- `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)
