POST /api/v1/services/bsa/upload-statements-batch
The BSA Upload Statements Batch endpoint enables developers and financial platforms to submit multiple bank statement files in a single API call for Bank Statement Analysis (BSA). The endpoint accepts both individual PDF files and ZIP archives containing multiple PDFs, giving integrators flexibility in how they package and deliver statement data. The service processes the uploaded statements against a specified date range and notifies stakeholders via email once analysis is complete.
This endpoint is designed for high-throughput financial workflows where multiple statements — across accounts or months — need to be analysed together, eliminating the overhead of sequential uploads and providing a unified result set.
Key Benefits
from_date and to_date, ensuring only relevant transactions are processed.X-API-KEY and X-API-SECRET credentials.| Environment | Base URL |
|---|---|
| Production | https://api.finpass.ai |
Header format:
x-api-key: <YOUR_X_API_KEY>
x-api-secret: <YOUR_X_API_SECRET>
### Request Headers⚠️ Never expose your
x-api-secretin client-side code or public repositories. Always make this call from a secure server-side environment.
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your FinPass API key used for authentication. |
x-api-secret | Yes | Your FinPass API secret used for authentication. |
Content-Type | Yes | Must be multipart/form-data (set automatically by most HTTP clients when using form data). |
| Parameter | Type | Required | Description |
|---|---|---|---|
files | File (PDF or ZIP) | Yes | One or more bank statement files. Each file may be a single PDF or a ZIP archive containing multiple PDF statements. Repeat the files field for each file in the batch. |
email | String | Yes | Email address to which the analysis results or notifications will be sent upon completion. |
from_date | String (YYYY-MM-DD) | Yes | Start date of the analysis period. Only transactions on or after this date will be included in the analysis. |
to_date | String (YYYY-MM-DD) | Yes | End date of the analysis period. Only transactions on or before this date will be included in the analysis. |
| Format | MIME Type | Description |
|---|---|---|
.pdf | application/pdf | A single bank statement document. Upload one or multiple individual PDF files. |
.zip | application/zip | A ZIP archive bundling multiple PDF bank statements. The API extracts and processes all PDFs found inside. Only PDF files within the ZIP are processed; any non-PDF entries are ignored. |
ZIP File Guidelines
.pdf files and one .zip).curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
--header 'x-api-key: <X_API_KEY>' \
--header 'x-api-secret: <X_API_SECRET>' \
--form 'files=@"/path/to/statement-1.pdf"' \
--form 'files=@"/path/to/statement-2.pdf"' \
--form 'email="user@example.com"' \
--form 'from_date="2024-04-01"' \
--form 'to_date="2025-03-31"'
curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
--header 'x-api-key: <X_API_KEY>' \
--header 'x-api-secret: <X_API_SECRET>' \
--form 'files=@"/path/to/statements-bundle.zip"' \
--form 'email="user@example.com"' \
--form 'from_date="2024-04-01"' \
--form 'to_date="2025-03-31"'
curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
--header 'x-api-key: <X_API_KEY>' \
--header 'x-api-secret: <X_API_SECRET>' \
--form 'files=@"/path/to/statement-1.pdf"' \
--form 'files=@"/path/to/statements-bundle.zip"' \
--form 'email="user@example.com"' \
--form 'from_date="2024-04-01"' \
--form 'to_date="2025-03-31"'
### Response ParametersThe API returns a JSON response confirming receipt and processing initiation of the batch.
| Parameter | Type | Description |
|---|---|---|
status | String | Indicates the outcome of the request (e.g., success, error). |
message | String | Human-readable message describing the result or any issue encountered. |
batch_id | String | Unique identifier for the submitted batch, useful for tracking or support queries. |
files_received | Integer | Number of statement files successfully received in the batch. |
email | String | The email address to which results will be delivered. |
from_date | String | The start date of the analysis period as provided in the request. |
to_date | String | The end date of the analysis period as provided in the request. |
{
"status": "success",
"message": "Batch uploaded successfully. Analysis results will be sent to the provided email.",
"batch_id": "bsa_batch_a1b2c3d4e5f6",
"files_received": 2,
"email": "user@example.com",
"from_date": "2024-04-01",
"to_date": "2025-03-31"
}
curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch'
--header 'x-api-key: <X_API_KEY>'
--header 'x-api-secret: <X_API_SECRET>'
--form 'files=@"/path/to/statements-bundle.zip"'
--form 'email="user@example.com"'
--form 'from_date="2024-04-01"'
--form 'to_date="2025-03-31"'
</Tab>
<Tab title="Python">
```python
import requests
url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch"
headers = {
"x-api-key": "<X_API_KEY>",
"x-api-secret": "<X_API_SECRET>",
}
# Option 1: Upload individual PDF files
files = [
("files", ("statement-1.pdf", open("/path/to/statement-1.pdf", "rb"), "application/pdf")),
("files", ("statement-2.pdf", open("/path/to/statement-2.pdf", "rb"), "application/pdf")),
]
# Option 2: Upload a ZIP archive containing multiple PDFs
# files = [
# ("files", ("statements-bundle.zip", open("/path/to/statements-bundle.zip", "rb"), "application/zip")),
# ]
# Option 3: Mix of PDFs and a ZIP
# files = [
# ("files", ("statement-1.pdf", open("/path/to/statement-1.pdf", "rb"), "application/pdf")),
# ("files", ("statements-bundle.zip", open("/path/to/statements-bundle.zip", "rb"), "application/zip")),
# ]
data = {
"email": "user@example.com",
"from_date": "2024-04-01",
"to_date": "2025-03-31",
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json())
```javascript
const fs = require("fs");
const FormData = require("form-data");
const axios = require("axios");const url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch";
const form = new FormData();
// Option 1: Upload individual PDF files
form.append("files", fs.createReadStream("/path/to/statement-1.pdf"), "statement-1.pdf");
form.append("files", fs.createReadStream("/path/to/statement-2.pdf"), "statement-2.pdf");
// Option 2: Upload a ZIP archive containing multiple PDFs
// form.append("files", fs.createReadStream("/path/to/statements-bundle.zip"), {
// filename: "statements-bundle.zip",
// contentType: "application/zip",
// });
form.append("email", "user@example.com");
form.append("from_date", "2024-04-01");
form.append("to_date", "2025-03-31");
axios
.post(url, form, {
headers: {
"x-api-key": "<X_API_KEY>",
"x-api-secret": "<X_API_SECRET>",
...form.getHeaders(),
},
})
.then((response) => {
console.log(response.status);
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});
</Tab>
<Tab title="PHP">
```php
<?php
$url = "https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch";
$curl = curl_init();
// Option 1: Upload individual PDF files
$postFields = [
'files[0]' => new CURLFile('/path/to/statement-1.pdf', 'application/pdf', 'statement-1.pdf'),
'files[1]' => new CURLFile('/path/to/statement-2.pdf', 'application/pdf', 'statement-2.pdf'),
'email' => 'user@example.com',
'from_date' => '2024-04-01',
'to_date' => '2025-03-31',
];
// Option 2: Upload a ZIP archive containing multiple PDFs
// $postFields = [
// 'files[0]' => new CURLFile('/path/to/statements-bundle.zip', 'application/zip', 'statements-bundle.zip'),
// 'email' => 'user@example.com',
// 'from_date' => '2024-04-01',
// 'to_date' => '2025-03-31',
// ];
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postFields,
CURLOPT_HTTPHEADER => [
'x-api-key: <X_API_KEY>',
'x-api-secret: <X_API_SECRET>',
],
]);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
echo "HTTP Status: $httpCode\n";
echo $response;
Related APIs
batch_id.Compliance and Legal Considerations
email address provided. Ensure this address belongs to an authorised recipient and that your email infrastructure is secured against interception or unauthorised forwarding.batch_id values and timestamps, to support audit and dispute resolution requirements.curl --location 'https://api.finpass.ai/api/v1/services/bsa/upload-statements-batch' \
--header 'X-API-Key: YOUR API KEY' \
--header 'X-API-Secret: YOUR SECRET KEY' \
--form 'files=@""' \
--form 'passwords="YOUR PDF PASSWORDS"' \
--form 'tampering_check=""' \
--form 'from_date=""' \
--form 'to_date=""' \
--form 'salary_min_month=""' \
--form 'salary_min_occurrence=""' \
--form 'salary_keyword=""' \
--form 'emi_min_month=""' \
--form 'emi_min_occurrence=""'{
"data": {
"batch_id": "batch_e2d2f1924d24",
"status": "processing",
"total_files": 2,
"uploaded_files": 2,
"failed_files": 0,
"files": [
{
"filename": "statement_bank_statement_9e04f9ced43e.pdf",
"client_id": "bank_statement_8a192e69a43a",
"status": "uploaded",
"error": null
},
{
"filename": "statement_bank_statement_e74919f9bdea.pdf",
"client_id": "bank_statement_f98c3b15c8e7",
"status": "uploaded",
"error": null
}
],
"filter_from_date": null,
"filter_to_date": null
},
"status_code": 200,
"success": true,
"message": "Batch upload successful, processing started",
"message_code": "success"
}