# Parse Password-Protected Bank Statement PDFs via API

> Send a password-protected bank statement PDF or Excel file with its password. Encrypted at rest with a per-job key and deleted when the job ends.

Source: https://parser.lekhavo.com/password-protected-bank-statements/

[Home](https://parser.lekhavo.com/) / Password-protected statements 

# Parse password-protected bank statements

Indian banks often email statements as password-protected PDFs. Send the file as it is and put its password in the job; the parser opens it, and the password is deleted when the job ends. 

## Sending the password

Upload the file as usual, then add `"password"` (1 to 256 characters) to the body of `POST /v1/jobs`, next to the `upload_id`. Nothing else changes: the bank is still detected from the file. If you retry the call with the same Idempotency-Key, send the same password; a different one is a different request and returns 409 `idempotency_conflict`. 

## Which files take a password

* Bank statement PDFs, from every supported bank.
* Encrypted .xls and .xlsx statements from HDFC Bank, ICICI Bank, State Bank of India, Axis Bank, Kotak Mahindra Bank, Bank of Baroda, Punjab National Bank.
* Not CSV files or NCD schedules: a password for those is refused with 422 `invalid_job`. Yes Bank's XML .xls download needs none.

## Which password your bank uses

The parser never sets the password; the bank's rules do. These guides give what each bank states on its own website, and say so where it states nothing, with a made-up example and what to do when the file will not open: 

* [HDFC bank statement PDF password](https://parser.lekhavo.com/hdfc-bank-statement-pdf-password/)
* [SBI bank statement PDF password](https://parser.lekhavo.com/sbi-bank-statement-pdf-password/)

## Wrong or missing passwords

The job still runs and ends as `failed_document`, which costs no credits. An encrypted PDF with a missing or wrong password, or an Excel file with a wrong one, reports `incorrect_password`. An encrypted Excel file sent with no password fails too: `password_required` when you name the parser, otherwise `unsupported_statement`. Upload the file again and create a new job with the right password. 

## How the password is kept

* Each password is encrypted with its own random 256-bit AES-GCM key, and that key is encrypted with a root key. Both are bound to the job.
* It is deleted in the same step that settles the job, whether it succeeds or fails, or when the job is cancelled. An unused password expires after one day.
* The API never returns it: no response or webhook has a password field. Log lines carry the job ID, not the password.

The full request format is in the [API docs](https://parser.lekhavo.com/docs/), and each [bank page](https://parser.lekhavo.com/banks/)lists the formats that bank supports. Back to the [Statement Parser API](https://parser.lekhavo.com/).
