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.

FieldTypeRequiredDescription
filefileYesThe statement file. Accepted: pdf, csv, xls, xlsx
account_idstringNoPre-assign the statement to an account in your org (skips auto-detection)
parser_typestringNoForce 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

CodeDescription
400Body is not multipart/form-data, file is missing, or the file type is not supported
401Invalid or missing API credentials
403API key lacks statements:create permission
404account_id was provided but no such account exists in your org
502The file could not be stored or the processing job could not be queued