Remap bank import columns

POST https://app.speybooks.com/api/v1/bank-imports/{id}/remap

Overrides the auto-detected column mapping for a pending import. Re-runs the entire UIE pipeline with the corrected schema: re-parses the stored file, re-classifies rows, re-detects duplicates, and re-computes the balance proof. Returns the same rich payload as the upload endpoint — there is no need for a subsequent GET call after remapping.

The provenance downgrades to USER_CORRECTED.

The column mapping is an object where keys are zero-based column indices and values are roles: date, description, reference, amount, debit, credit, balance, type, or skip.

At minimum, assign one date column and either amount or both debit and credit.

Path parameters

id string required
Bank import ID (e.g. bimp_42). Must be in pending status.

Body parameters

columnMapping object required
Map of column index to role. Roles: date, description, amount, debit, credit, balance, reference, type, skip. E.g. {"0": "date", "1": "description", "2": "amount"}.
amountModel string optional
Amount model override (SIGNED_SINGLE, DUAL_COL_DR_CR, SIGN_FLIPPER). Auto-inferred from column roles if omitted.
dateFormat string optional
Date format override (e.g. DD/MM/YYYY, YYYY-MM-DD, MM/DD/YYYY). Uses detected format if omitted.

Response

200 Re-parsed successfully. Returns updated row counts, preview, schema, and balance proof.
Show response fields
balanceProof object
Show child attributes
closingBalance integer
delta integer
openingBalance integer
status string
stepwisePass boolean
dateRange object
Show child attributes
from string
to string
duplicates integer
errorRows integer
ignoredRows integer
importId string
preview array<object>
Show child attributes
amount integer
balance integer
date string
description string
duplicateMatch string nullable
error string nullable
rowIndex integer
status string
schema object
Show child attributes
amountModel string
dateFormat string
fingerprint string
provenance string
totalRows integer
validRows integer

Error codes

400 Invalid column mapping, parse errors, or no valid transactions with corrected mapping.
404 Import not found.
409 Import already completed or file data no longer available.