Remap bank import columns

POSThttps://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

idstringrequired
Bank import ID (e.g. bimp_42). Must be in pending status.

Body parameters

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

Response

200Re-parsed successfully. Returns updated row counts, preview, schema, and balance proof.
Show response fields
balanceProofobject
Show child attributes
closingBalanceinteger
deltainteger
openingBalanceinteger
statusstring
stepwisePassboolean
dateRangeobject
Show child attributes
fromstring
tostring
duplicatesinteger
errorRowsinteger
ignoredRowsinteger
importIdstring
previewarray<object>
Show child attributes
amountinteger
balanceinteger
datestring
descriptionstring
duplicateMatchstringnullable
errorstringnullable
rowIndexinteger
statusstring
schemaobject
Show child attributes
amountModelstring
dateFormatstring
fingerprintstring
provenancestring
totalRowsinteger
validRowsinteger

Error codes

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