API Documentation

Programmatically upload and manage your bank statement documents.

Sign in or create an account to start using the API.

Getting Started

The API allows you to programmatically upload, process, and retrieve analyzed bank statements.

1. Get your API Key

Sign in and generate an API key from your account settings. Your key will be shown once - make sure to save it securely.

2. Make your first request

curl -X POST https://bankstatementtools.com/api/v1/documents \
  -H "Authorization: Bearer your_api_key_here" \
  -F "file=@statement.pdf"

Authentication

All API requests must include your API key in the Authorization header using the Bearer scheme:

Authorization: Bearer your_api_key_here

Unauthorized requests will return a 401 Unauthorized status code.

API Endpoints

POST /api/v1/documents

Upload one or more documents for full processing (including AI analysis).

Parameters

  • file - Single file to upload (multipart/form-data)
  • files[] - Multiple files to upload (multipart/form-data)

Example Request

curl -X POST https://bankstatementtools.com/api/v1/documents \
  -H "Authorization: Bearer your_api_key" \
  -F "file=@statement.pdf"

Example Response

{
  "data": {
    "id": 123,
    "filename": "statement.pdf",
    "status": "uploaded",
    "file_format": "pdf",
    "created_at": "2025-11-01T12:00:00Z"
  }
}
POST /api/v1/documents/csv_only

Upload documents for CSV conversion only (no AI analysis). This is much faster if you don't need the AI analysis.

Parameters

  • file - Single file to upload (multipart/form-data)
  • files[] - Multiple files to upload (multipart/form-data)
GET /api/v1/documents

List all your documents.

Example Response

{
  "data": [
    {
      "id": 123,
      "filename": "statement.pdf",
      "status": "processed",
      "file_format": "pdf",
      "created_at": "2025-11-01T12:00:00Z"
    }
  ]
}
GET /api/v1/documents/:id

Get details of a specific document.

GET /api/v1/documents/:id/status

Check the processing status of a document.

Example Response

{
  "data": {
    "id": 123,
    "status": "processed",
    "processed": true,
    "processing": false,
    "failed": false
  }
}
DELETE /api/v1/documents/:id

Delete a document.

Example Request

curl -X DELETE https://bankstatementtools.com/api/v1/documents/123 \
  -H "Authorization: Bearer your_api_key"

Document Status Values

Status Description
uploaded Document has been uploaded and is queued for processing
converting_to_csv Document is being converted to CSV format
adding_row_numbers Adding line numbers to the CSV data
data_analysis AI is analyzing and categorizing transactions
processed Document processing is complete
failed Processing failed (check document format)
insufficient_credits Not enough credits to process this document

Error Responses

401 Unauthorized

{
  "error": "Unauthorized",
  "message": "Invalid or missing API key"
}

404 Not Found

{
  "error": "Not Found",
  "message": "Document not found"
}

400 Bad Request

{
  "error": "Bad Request",
  "message": "Please provide at least one file"
}

Code Examples

Python

import requests

api_key = "your_api_key_here"
headers = {"Authorization": f"Bearer {api_key}"}

# Upload a document
with open("statement.pdf", "rb") as f:
    files = {"file": f}
    response = requests.post(
        "https://bankstatementtools.com/api/v1/documents",
        headers=headers,
        files=files
    )
    document = response.json()["data"]
    print(f"Uploaded document {document['id']}")

# Check status
response = requests.get(
    f"https://bankstatementtools.com/api/v1/documents/{document['id']}/status",
    headers=headers
)
status = response.json()["data"]
print(f"Status: {status['status']}")

Ruby

require 'net/http'
require 'json'

api_key = "your_api_key_here"
uri = URI("https://bankstatementtools.com/api/v1/documents")

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{api_key}"
request.set_form([["file", File.open("statement.pdf")]], "multipart/form-data")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

document = JSON.parse(response.body)["data"]
puts "Uploaded document #{document['id']}"

JavaScript (Node.js)

const FormData = require('form-data');
const fs = require('fs');
const fetch = require('node-fetch');

const apiKey = 'your_api_key_here';

// Upload a document
const form = new FormData();
form.append('file', fs.createReadStream('statement.pdf'));

fetch('https://bankstatementtools.com/api/v1/documents', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`
  },
  body: form
})
.then(res => res.json())
.then(data => {
  console.log(`Uploaded document ${data.data.id}`);

  // Check status
  return fetch(`https://bankstatementtools.com/api/v1/documents/${data.data.id}/status`, {
    headers: {'Authorization': `Bearer ${apiKey}`}
  });
})
.then(res => res.json())
.then(data => {
  console.log(`Status: ${data.data.status}`);
});

Best Practices

Store your API keys securely and never commit them to version control
Poll the status endpoint to track document processing progress
Handle errors gracefully and implement retry logic for transient failures

Copyright © 2025 Bank Statement Tools