Upload Statement
POST /api/v1/statements
Uploads a bank statement file and starts the processing pipeline. The file is
stored, a statement record is created, and a read_file job is queued. This is
the API equivalent of the in-app drag-and-drop upload.
Requires the statements:create permission.
Request
The body must be multipart/form-data.
| Field | Type | Required | Description |
|---|---|---|---|
| file | file | Yes | The statement file. Accepted: pdf, csv, xls, xlsx |
| account_id | string | No | Pre-assign the statement to an account in your org (skips auto-detection) |
| parser_type | string | No | Force a specific parser (e.g. hdfc_savings__pdf) instead of auto-detecting |
Example Request
curl -X POST "https://statements.finopsbricks.com/api/v1/statements" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx" \
-F "[email protected]" \
-F "account_id=acc123xyz"
Response
202 Accepted:
{
"data": {
"id": "stmt123xyz",
"job_id": "01HPXYZ...",
"step": "read_file"
}
}
The id is the new statement. Poll GET /api/v1/statements/:id
to follow the statement's step field as it moves through the pipeline.
Errors
| Code | Description |
|---|---|
| 400 | Body is not multipart/form-data, file is missing, or the file type is not supported |
| 401 | Invalid or missing API credentials |
| 403 | API key lacks statements:create permission |
| 404 | account_id was provided but no such account exists in your org |
| 502 | The file could not be stored or the processing job could not be queued |