BanklyzeBanklyze/Developer Docs
Sign In

Exports

Export deal analysis results in multiple formats. The PDF export produces a fully formatted underwriting report suitable for sharing with stakeholders or archiving in a loan management system. The CSV exports produce flat transaction data with all screening flags and classification metadata included as columns, making them easy to load into spreadsheets or data pipelines.

All export endpoints stream the file body directly — no intermediate JSON wrapper. Responses carry the appropriate Content-Type and Content-Disposition: attachment headers. A deal must be in ready status before its PDF report can be generated.

Generate and download a complete PDF underwriting report for a deal. The report includes business information, coverage summary, financial metrics, transaction screening results, composite health score, factor-level score breakdown, and the underwriting recommendation. Use the -o flag with curl to write the PDF directly to disk.

The deal must be in ready status. If the deal is still processing, the endpoint returns 409 Conflict. Report generation is synchronous and typically completes in under one second for deals with fewer than 500 transactions.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

Example

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

Response

Response — 200 OK (application/pdf)
HTTP/2 200
Content-Type: application/pdf
Content-Disposition: attachment; filename="deal_42_acme_trucking_report.pdf"
Content-Length: 184320

<binary PDF data>

Export all transactions across every processed document in a deal as a single CSV file. Each row represents one transaction. Transactions are ordered by date ascending, then by document upload order for same-date entries.

The CSV includes all screening flag columns as boolean values (true / false), the resolved screening_bucket label, and the flag_reason explanation string. Empty cells indicate no value — not false.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

CSV Columns

NameTypeRequiredDescription
StatementstringOptionalOriginal filename of the source document
DatestringOptionalTransaction date formatted YYYY-MM-DD
DescriptionstringOptionalRaw transaction description extracted from the statement
AmountnumberOptionalTransaction amount in USD. Positive for credits, negative for debits.
BalancenumberOptionalRunning account balance after the transaction
TypestringOptionalTransaction direction: credit or debit
NSF FeebooleanOptionalWhether this transaction is classified as an NSF fee
Overdraft FeebooleanOptionalWhether this transaction is classified as an overdraft fee
Large DepositbooleanOptionalWhether this deposit is flagged as unusually large relative to the account average
Large StrangebooleanOptionalWhether this transaction is flagged as a large or anomalous amount
Repeat ChargebooleanOptionalWhether this debit matches a recurring charge pattern (e.g. MCA repayment)
SuspiciousbooleanOptionalWhether this transaction has been manually flagged as suspicious
Screening BucketstringOptionalThe resolved screening category label. Empty if no flag applies.
Flag ReasonstringOptionalHuman-readable explanation for why the transaction was flagged. Empty if no flag applies.

Example

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

Response

Response — 200 OK (text/csv)
Statement,Date,Description,Amount,Balance,Type,NSF Fee,Overdraft Fee,Large Deposit,Large Strange,Repeat Charge,Suspicious,Screening Bucket,Flag Reason
statement_jan.pdf,2026-01-03,ACH DEPOSIT - STRIPE PAYMENTS,4250.00,32750.00,credit,false,false,true,false,false,false,,
statement_jan.pdf,2026-01-05,ACH DEBIT - MERCHANT CASH ADVANCE REPAY,-1250.00,31500.00,debit,false,false,false,false,true,false,repeat_charge,Daily recurring debit pattern
statement_jan.pdf,2026-01-09,ACH DEPOSIT - SQUARE INC,2875.00,34375.00,credit,false,false,false,false,false,false,,
statement_feb.pdf,2026-02-04,ACH DEBIT - NSF FEE,-35.00,412.00,debit,true,false,false,false,false,false,nsf_fee,NSF fee detected
statement_feb.pdf,2026-02-12,WIRE TRANSFER IN - CLIENT PAYMENT,18500.00,22100.00,credit,false,false,true,true,false,false,large_unusual_deposit,Large unusual deposit amount exceeds 3x average

Document Exports

In addition to deal-level exports, individual documents can be exported independently. Use the document CSV export to download transactions for a single bank statement, or the document PDF endpoint to retrieve the original uploaded file from object storage.

Export all transactions extracted from a single document as a CSV file. The output format is identical to the deal-level CSV export but scoped to one document. Only available for documents in completed status.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Example

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

Response

Response — 200 OK (text/csv)
Statement,Date,Description,Amount,Balance,Type,NSF Fee,Overdraft Fee,Large Deposit,Large Strange,Repeat Charge,Suspicious,Screening Bucket,Flag Reason
statement_jan.pdf,2026-01-03,ACH DEPOSIT - STRIPE PAYMENTS,4250.00,32750.00,credit,false,false,true,false,false,false,,
statement_jan.pdf,2026-01-05,ACH DEBIT - MERCHANT CASH ADVANCE REPAY,-1250.00,31500.00,debit,false,false,false,false,true,false,repeat_charge,Daily recurring debit pattern
statement_jan.pdf,2026-01-09,ACH DEPOSIT - SQUARE INC,2875.00,34375.00,credit,false,false,false,false,false,false,,
statement_jan.pdf,2026-01-14,ZELLE TRANSFER IN,950.00,35325.00,credit,false,false,false,false,false,false,,
statement_jan.pdf,2026-01-18,ACH DEBIT - PAYROLL DIRECT DEP,-8400.00,26925.00,debit,false,false,false,false,false,false,,

Download the original PDF file that was uploaded for this document. The file is streamed directly from object storage. This is the raw uploaded file — not a generated report. Use this endpoint to retrieve the source statement for manual review or archival purposes.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Example

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

Response

Response — 200 OK (application/pdf)
HTTP/2 200
Content-Type: application/pdf
Content-Disposition: attachment; filename="statement_jan.pdf"
Content-Length: 94208

<binary PDF data>