Exports

The Exports API provides endpoints for downloading generated reports, raw transaction data, original uploaded documents, and structured analysis results. These endpoints are designed for integrating Banklyze output into your own reporting systems, compliance archives, or downstream workflows.

The PDF report and CSV export endpoints return binary file data, not JSON. Use the -o flag with curl (or equivalent in your HTTP client) to save the response body to a file. The Content-Disposition header includes a suggested filename.

Reports

Download a professionally formatted PDF underwriting report for a deal. The report includes the business summary, financial metrics, transaction screening results, health score breakdown, and the underwriting recommendation with factor-level scores. The deal must be in ready status for the report to be available.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

Example

curl
curl -X GET https://api.banklyze.com/v1/deals/42/report \
  -H "X-API-Key: your_api_key_here" \
  -o underwriting_report.pdf

Response Headers

Response — 200 OK (application/pdf)
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="deal_42_underwriting_report.pdf"
Content-Length: 184320
The response body is the raw PDF binary. Set Accept: application/pdf in your request headers for explicit content negotiation.

Stream all transactions for a deal as a CSV file. The CSV includes all transaction fields: date, description, amount, balance, type, NSF/overdraft flags, screening bucket, flag reason, category, and source document ID. Transactions are ordered by date ascending across all documents.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

Example

curl
curl -X GET https://api.banklyze.com/v1/deals/42/transactions/csv \
  -H "X-API-Key: your_api_key_here" \
  -o deal_42_transactions.csv

Response Headers

Response — 200 OK (text/csv)
HTTP/1.1 200 OK
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="deal_42_transactions.csv"
Transfer-Encoding: chunked

CSV Sample

CSV output (first 5 rows)
date,description,amount,balance,transaction_type,is_nsf_fee,is_overdraft_fee,screening_bucket,flag_reason,category,document_id
2026-01-03,ACH DEPOSIT - STRIPE PAYMENTS,4250.00,32750.00,credit,false,false,,,revenue,15
2026-01-05,ACH DEBIT - MERCHANT CASH ADVANCE REPAY,-1250.00,31500.00,debit,false,false,repeat_charge,Daily recurring debit pattern,debt_service,15
2026-01-07,WIRE TRANSFER IN - FLEET SERVICES CO,18500.00,47200.00,credit,false,false,large_unusual_deposit,Deposit exceeds 3x average daily deposit,revenue,15
2026-01-08,CHECK #1042 - OFFICE DEPOT,-342.50,46857.50,debit,false,false,,,operating_expense,15
2026-01-10,ACH DEPOSIT - STRIPE PAYMENTS,3180.00,38900.00,credit,false,false,,,revenue,15
The response uses chunked transfer encoding for large datasets. The CSV is streamed directly — there is no pagination. All transactions for the deal are included in a single download.

Document Downloads

Download the original uploaded document file (PDF, PNG, JPG, or TIFF). This returns the exact file that was uploaded, unmodified. Useful for archival purposes or when you need to review the source material alongside the extracted data.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Example

curl
curl -X GET https://api.banklyze.com/v1/documents/15/download \
  -H "X-API-Key: your_api_key_here" \
  -o statement_jan.pdf

Response Headers

Response — 200 OK (original MIME type)
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="statement_jan.pdf"
Content-Length: 245780

Export the complete analysis for a document as a single structured JSON payload. This combines the document metadata, extraction results, computed analysis metrics, and screening flags into one response. The transaction list is not included inline to keep the payload manageable — use the transactions endpoint to fetch those separately.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Example

curl
curl -X GET https://api.banklyze.com/v1/documents/15/export \
  -H "X-API-Key: your_api_key_here"

Response

Response — 200 OK
{
  "document": {
    "id": 15,
    "deal_id": 42,
    "filename": "statement_jan.pdf",
    "document_type": "bank_statement",
    "status": "completed"
  },
  "extraction": {
    "method": "llm",
    "model": "claude-haiku-4-5",
    "confidence": 0.96,
    "bank_name": "Chase",
    "account_number_last_four": "4821",
    "account_holder": "Acme Trucking LLC",
    "statement_period_start": "2026-01-01",
    "statement_period_end": "2026-01-31",
    "opening_balance": 28500.00,
    "closing_balance": 41200.00
  },
  "analysis": {
    "total_deposits": 125430.00,
    "total_withdrawals": 112840.00,
    "net_cash_flow": 12590.00,
    "avg_daily_balance": 34500.00,
    "min_daily_balance": 8200.00,
    "max_daily_balance": 62400.00,
    "ending_balance": 41200.00,
    "deposit_count": 34,
    "withdrawal_count": 53,
    "nsf_count": 1,
    "nsf_total_fees": 36.00,
    "overdraft_count": 0,
    "overdraft_total_fees": 0.00,
    "deposit_frequency_per_month": 34,
    "avg_deposit_amount": 3689.12,
    "largest_deposit": 18500.00
  },
  "screening": {
    "total_flags": 2,
    "buckets": {
      "large_unusual_deposit": 1,
      "repeat_charge": 1
    },
    "flagged_transactions": [
      {
        "id": 205,
        "date": "2026-01-07",
        "description": "WIRE TRANSFER IN - FLEET SERVICES CO",
        "amount": 18500.00,
        "screening_bucket": "large_unusual_deposit",
        "flag_reason": "Deposit exceeds 3x average daily deposit"
      },
      {
        "id": 215,
        "date": "2026-01-12",
        "description": "ACH DEBIT - MERCHANT CASH ADVANCE REPAY",
        "amount": -1250.00,
        "screening_bucket": "repeat_charge",
        "flag_reason": "Daily recurring debit pattern"
      }
    ]
  },
  "transactions": {
    "total": 87,
    "included": false,
    "download_url": "/v1/documents/15/transactions"
  },
  "exported_at": "2026-02-16T11:00:00Z"
}