Skip to content

Parse Import

POST
/api/v1/import/parse
curl --request POST \
--url https://example.com/api/v1/import/parse \
--header 'Content-Type: multipart/form-data' \
--form file=example

Parse uploaded CSV/ODS file and return preview data.

routes by file extension (.csv or .ods). rejects files without a date column with 422. Per SEC-2.1: streams file in chunks to prevent memory exhaustion.

Media typemultipart/form-data
Body_parse_import_api_v1_import_parse_post
object
file
required
File
string

Successful Response

Media typeapplication/json
ImportPreview

Response from the /api/import/parse endpoint.

Contains the full parsed data — accounts list (column mappings) and all parsed rows. The frontend sends this back (minus total_rows) as ImportCommitRequest on commit.

detected_bank: if the file was recognised as a French bank CSV export, contains the bank name (e.g. “Crédit Agricole”). None for generic CSV/ODS.

object
accounts
required
Accounts
Array<object>
AccountMapping

Maps a spreadsheet column header to an existing or new account.

column headers are matched case-insensitively to existing account names. account_id=None means a new account will be created on commit. institution: populated from the export’s institution header row (if present). column_index: 0-based column position in the source file — uniquely identifies a column even when duplicate headers exist (e.g., two “Courant” columns with different institutions).

object
column_name
required
Column Name
string
<= 255 characters
account_name
required
Account Name
string
<= 255 characters
institution
Any of:
string
<= 255 characters
account_id
Any of:
integer
is_new
Is New
boolean
column_index
Column Index
integer
0 <= 16384
rows
required
Rows
Array<object>
ParsedRow

A single parsed data row from the spreadsheet.

date is ISO format YYYY-MM-DD (parsed from French DD/MM/YY or DD/MM/YYYY). balance is Decimal serialized as string to match backend Decimal serialization (avoids float precision issues). column_index: 0-based column position — uniquely identifies which column this row’s balance came from, enabling correct account attribution when duplicate headers exist.

object
date
required
Date
string
<= 32 characters
account_name
required
Account Name
string
<= 255 characters
balance
required
Balance
string
<= 64 characters
column_index
Column Index
integer
0 <= 16384
total_rows
required
Total Rows
integer
detected_bank
Any of:
string

Example

{
"accounts": [
{
"is_new": false,
"column_index": 0
}
],
"rows": [
{
"column_index": 0
}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}