Skip to main content
POST
Import a bank statement file

Authorizations

Authorization
string
header
required

OAuth 2.1 authorization code flow with PKCE (S256 only) and exact redirect-URI matching. Clients register by Dynamic Client Registration (/api/oauth/register) or a Client ID Metadata Document. Discovery: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource/mcp. Access tokens last one hour and refresh tokens rotate. Tokens carry the audience https://api.ai2fin.com/mcp and are accepted on /mcp and /api/integrations/v1 only. A request with no scope gets read:transactions write:transactions read:bills write:bills; write:expenses and webhooks:manage must be asked for explicitly.

Scopes

write:transactions

MCP: the write tools. Integration API: POST /transactions and POST /statements.

Headers

Idempotency-Key
string

Optional. 1 to 128 characters of letters, digits, _, ., : or -. Stored in the database for 24 hours per account and endpoint. A completed request with the same key is replayed (200, Idempotency-Replayed: true); a request still in progress with the same key returns 409 IDEMPOTENCY_IN_PROGRESS. A failed request releases its key so a retry runs. A key that does not match the pattern is ignored (the request runs without idempotency).

Maximum string length: 128
Pattern: ^[\w.:-]+$

Query Parameters

account
string

Your label for the account.

Maximum string length: 128

Body

The body is of type file.

Response

Statement read (also returned, with duplicate: true, for a file already received)

success
boolean
format
enum<string>
Available options:
camt053,
camt054,
mt940,
ofx
received
integer
skippedPending
integer
accounts
string[]

Masked

balances
object[]
created
integer
duplicates
integer
errors
integer
unreadable
integer
duplicate
boolean
importId
string | null