curl --request POST \
--url https://app.sahlfinancial.com/api/v1/statements/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'reference=<string>' \
--form 'environment=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('reference', '<string>');
form.append('environment', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.sahlfinancial.com/api/v1/statements/extract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/statements/extract"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"reference": "<string>",
"environment": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"statement_id": null,
"status": "completed",
"environment": "sandbox",
"reference": "client-0001",
"bank": "Specimen Bank",
"account_holder": "Test Client",
"account_number": "000000000000",
"rib": null,
"iban": null,
"currency": "MAD",
"period_start": "2026-10-01",
"period_end": "2026-10-31",
"opening_balance": 10000,
"closing_balance": 10850,
"transactions": [
{
"date": "2026-10-03",
"value_date": "2026-10-03",
"label": "SALAIRE OCTOBRE",
"debit": null,
"credit": 12000,
"amount": 12000,
"balance": 22000
},
{
"date": "2026-10-05",
"value_date": "2026-10-05",
"label": "LOYER",
"debit": 11150,
"credit": null,
"amount": -11150,
"balance": 10850
}
],
"reconciliation": {
"opening_balance": 10000,
"movements_total": 850,
"expected_closing_balance": 10850,
"closing_balance": 10850,
"difference": 0,
"passed": true,
"gaps": [],
"totals": {}
},
"warnings": [],
"read": {
"pages": 1,
"scanned": false,
"source": "text",
"model_calls": 0
},
"billing": {
"documents_billed": 1,
"pages": 1,
"environment": "sandbox"
},
"latency_ms": 2100
}{
"statement_id": "4d7e1a93-2b6c-4f08-9a15-8c3e5f0b7d21",
"status": "queued",
"environment": "sandbox",
"reference": "client-0001",
"pages": 24,
"poll_url": "/api/v1/statements/4d7e1a93-2b6c-4f08-9a15-8c3e5f0b7d21",
"webhook_event": "statement.extracted",
"billing": {
"documents_billed": 3,
"pages": 24,
"environment": "sandbox"
}
}{
"detail": {
"code": "empty_file",
"message": "modele_j is empty."
}
}{
"detail": "Invalid or revoked API key"
}{
"detail": {
"code": "production_api_not_approved",
"message": "This workspace is not yet approved for Production API calls. Request production access in Settings → API. Sandbox stays open meanwhile."
}
}{
"detail": {
"code": "statement_too_long",
"message": "The statement has 80 pages; the API reads up to 60. Split it by period."
}
}{
"detail": {
"code": "sandbox_specimen_required",
"message": "Sandbox only accepts specimen documents. Use Production for real documents."
}
}{
"detail": {
"code": "sandbox_daily_cap_reached",
"message": "Sandbox fair use is 200 documents a day per workspace; 200 read today. Retry after 00:00 UTC, or use Production.",
"current": 200,
"limit": 200
}
}{
"code": "internal_error",
"message": "An unexpected error occurred",
"details": null
}{
"detail": {
"code": "storage_unavailable",
"message": "Could not queue the statement; retry."
}
}Read a bank statement
Required scope: statements:read.
Send one statement as multipart file (native PDF, scanned PDF, JPEG, PNG, WebP or TIFF). Up to 6 pages (the default limit) the answer is the statement itself (200, status: completed): header data, every transaction, and a reconciliation of the balances. A longer statement is queued: 202 with a statement_id; the statement.extracted webhook fires when it is read and GET /v1/statements/{statement_id} returns it. A synchronous read stores nothing; a queued result is kept for 7 days by default.
Billed per started block of 10 pages (1 to 10 pages is 1 document, 11 to 20 is 2). Over 60 pages (the default maximum) the call answers 413 statement_too_long; split the statement by period.
Choose the environment with the X-Sahl-Environment header or the environment field/parameter; the Sandbox is the default. Two values that disagree are refused (422 environment_conflict). In Production the workspace must be approved by Sahl (403 production_api_not_approved until then), its subscription must be active (403 production_requires_paid_plan), and a Free workspace needs a verified work email (403 work_email_required). The Sandbox is always open.
A workspace created on or after 2026-10-24 reads only specimen documents in the Sandbox: take them from GET /v1/sandbox/specimens. Anything else answers 422 sandbox_specimen_required; use Production for real documents.
curl --request POST \
--url https://app.sahlfinancial.com/api/v1/statements/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'reference=<string>' \
--form 'environment=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('reference', '<string>');
form.append('environment', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.sahlfinancial.com/api/v1/statements/extract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/statements/extract"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"reference": "<string>",
"environment": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"statement_id": null,
"status": "completed",
"environment": "sandbox",
"reference": "client-0001",
"bank": "Specimen Bank",
"account_holder": "Test Client",
"account_number": "000000000000",
"rib": null,
"iban": null,
"currency": "MAD",
"period_start": "2026-10-01",
"period_end": "2026-10-31",
"opening_balance": 10000,
"closing_balance": 10850,
"transactions": [
{
"date": "2026-10-03",
"value_date": "2026-10-03",
"label": "SALAIRE OCTOBRE",
"debit": null,
"credit": 12000,
"amount": 12000,
"balance": 22000
},
{
"date": "2026-10-05",
"value_date": "2026-10-05",
"label": "LOYER",
"debit": 11150,
"credit": null,
"amount": -11150,
"balance": 10850
}
],
"reconciliation": {
"opening_balance": 10000,
"movements_total": 850,
"expected_closing_balance": 10850,
"closing_balance": 10850,
"difference": 0,
"passed": true,
"gaps": [],
"totals": {}
},
"warnings": [],
"read": {
"pages": 1,
"scanned": false,
"source": "text",
"model_calls": 0
},
"billing": {
"documents_billed": 1,
"pages": 1,
"environment": "sandbox"
},
"latency_ms": 2100
}{
"statement_id": "4d7e1a93-2b6c-4f08-9a15-8c3e5f0b7d21",
"status": "queued",
"environment": "sandbox",
"reference": "client-0001",
"pages": 24,
"poll_url": "/api/v1/statements/4d7e1a93-2b6c-4f08-9a15-8c3e5f0b7d21",
"webhook_event": "statement.extracted",
"billing": {
"documents_billed": 3,
"pages": 24,
"environment": "sandbox"
}
}{
"detail": {
"code": "empty_file",
"message": "modele_j is empty."
}
}{
"detail": "Invalid or revoked API key"
}{
"detail": {
"code": "production_api_not_approved",
"message": "This workspace is not yet approved for Production API calls. Request production access in Settings → API. Sandbox stays open meanwhile."
}
}{
"detail": {
"code": "statement_too_long",
"message": "The statement has 80 pages; the API reads up to 60. Split it by period."
}
}{
"detail": {
"code": "sandbox_specimen_required",
"message": "Sandbox only accepts specimen documents. Use Production for real documents."
}
}{
"detail": {
"code": "sandbox_daily_cap_reached",
"message": "Sandbox fair use is 200 documents a day per workspace; 200 read today. Retry after 00:00 UTC, or use Production.",
"current": 200,
"limit": 200
}
}{
"code": "internal_error",
"message": "An unexpected error occurred",
"details": null
}{
"detail": {
"code": "storage_unavailable",
"message": "Could not queue the statement; retry."
}
}Authorizations
API key created in the console. Scopes: kyc:extract, kyc:verify, kyc:eid; kyb:onboard, kyb:ice; statements:read; webhooks:manage; requests:read, requests:write; bank:read, bank:write (Growth plan, enabled per workspace by Sahl); registry:read; cases:read; scoring:read, scoring:write; policy:read, policy:write; usage:read. The Sandbox specimen routes, GET /v1/partner/me and GET /v1/partner/errors need any valid key.
Headers
Body
Response
The statement, read synchronously.
A statement read synchronously (200).