> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lead.bank/llms.txt
> Use this file to discover all available pages before exploring further.

# SFTP Setup

> Steps for setting up SFTP with Lead.

<Steps>
  <Step title="Generate Keypair">
    Use the following command:

    `ssh-keygen -t [rsa|ecdsa|ed25519]`

    The following keys are accepted:

    * `rsa`
    * `ecdsa`
    * `ed25519`

    Once generated, you'll have access to a public key (in a `.pub` file).

    Run `cat <public_key_file>` to view the public key to send to Lead.

    **Example Public Key**

    ```text theme={null}
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJOuq4BpCsr4KQyPd06oGNJyV5rWmpV7QjWAWz8imZIC27MypB37p9ahFUqlaT80qKIeoR8Zb/uamvdMxp9yKThjbvVKXUpPb0LmwGk3Dxnm0bdR21vrgujje3Y5kD3DJKOLNMuKGEzc6tU0F0l4BXE8PoW0VWRx+A0QWsVPhULzXuuEE51WqYE+Aru0UWEpJnC+HF2QcuWPfKfU6xiZ5Skma3DH5cLrGUKiv7jMyfEKBzPSmtO4cYvS6Mc1L6DbH33mBGu476r4ptzTqjP9T1MZdfubyCRLQTtPDIUSbJ0C0c8RFBwm3AePrbmZtbCymVlkaL8De9gRqTg2+cNox2oL30xOxStxGX/8t1Rs7L00jFgLAd18cyeyFSyCUJbRVlNuHzPW0DROwf7KO7kvHYSvisUYYT+oM7Ye0mLmrux7JBvuaR1uYOkC3ux+D9mt/LZH7iEJGlhEcTsJSQjftBtot1bvPicnpT599xym3GVCAx59YSO4qU6tu0D27u2o0= user@user-MW7DGQQ445
    ```
  </Step>

  <Step title="Send Public Key To Lead">
    Once your public key has been generated, send it to your Lead Implementation Manager as a plain text email.
  </Step>

  <Step title="Validate Lead Public Key (Host Key Generation)">
    Verify the fingerprint and add the public key to your ***known\_hosts*** file by following the below steps:

    1. Generate a public key fingerprint by running the below command:

           <Tabs>
             <Tab title="Prod">
               ssh-keyscan [sftp.lead.bank](http://sftp.lead.bank) 2>&1 | ssh-keygen -lf -
             </Tab>

             <Tab title="Sandbox">
               ssh-keyscan [sftp.sandbox.lead.bank](http://sftp.sandbox.lead.bank) 2>&1 | ssh-keygen -lf -
             </Tab>
           </Tabs>

    <Info>
      The above command generates a public key fingerprint
    </Info>

    2. Use the public key fingerprint and compare it with the fingerprint below:

           <Tabs>
             <Tab title="Prod">
               2048 SHA256:PWqq5lPPd0zWCawxwSnqOkyy168esipmaPy2t3H1uFE [sftp.lead.bank](http://sftp.lead.bank) (RSA)
             </Tab>

             <Tab title="Sandbox">
               2048 SHA256:rCdk4LeHvxn5G3j7VDJvqH6oEMh844E7sHxoaxih2dE [sftp.sandbox.lead.bank](http://sftp.sandbox.lead.bank) (RSA)
             </Tab>
           </Tabs>
  </Step>

  <Step title="Add Lead Public Key To Your Known Hosts file">
    After the fingerprint is verified, run the below command to add the public key to your ***known\_hosts*** file:

    <Tabs>
      <Tab title="Prod">
        ssh-keyscan [sftp.lead.bank](http://sftp.lead.bank) >> \~/.ssh/known\_hosts
      </Tab>

      <Tab title="Sandbox">
        ssh-keyscan [sftp.sandbox.lead.bank](http://sftp.sandbox.lead.bank) >> \~/.ssh/known\_hosts
      </Tab>
    </Tabs>
  </Step>

  <Step title="Connect To SFTP Server">
    Connect by running the following command:

    <Tabs>
      <Tab title="Prod">
        sftp -v -i \\\~/.ssh/your\\\_key [username@sftp.lead.bank](mailto:username@sftp.lead.bank)
      </Tab>

      <Tab title="Sandbox">
        sftp -v -i \\\~/.ssh/your\\\_key [username@sftp.sandbox.lead.bank](mailto:username@sftp.sandbox.lead.bank)

        <Tip>
          **Tips**

          * Replace `~/.ssh/your_key` with the path to your key generated in step 1
          * Replace `username` with the username provided by Lead
        </Tip>
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Connectivity Details

| **Environment** | **SFTP Server Hostname**                                | **Port** |
| --------------- | ------------------------------------------------------- | -------- |
| Sandbox         | [sftp.sandbox.lead.bank](http://sftp.sandbox.lead.bank) | 22       |
| Production      | [sftp.lead.bank](http://sftp.lead.bank)                 | 22       |

<Check>
  **Set-up Checks**

  * Static IP addresses are strongly encouraged for the [IP allowlist](/api-integrations/overview#ip-allowlist).
  * CSV files should use a pipe (|) delimiter.
  * You may provide multiple SSH public keys for each environment.
  * Lead supports RSA, ECDSA, and ED25519 keys.
  * Both 2048 and 4096 bits are supported.
  * It is strongly recommended to do periodic key rotation.
  * Rotation of these keys can be processed upon request.
</Check>

## Folder Structure

All [program related files](/file-integrations/program-files) will be dropped into folders on the SFTP server with the following access:

* **Read/Write:** For all folders where you are the submitter
* **Read Only:** For folders where Lead is the submitter

<Note>
  We do not use the root directory of the SFTP server to store or handle files.
</Note>

<Warning>
  **Missing Directories?**

  When your SFTP is initially set up, you may not see all directories.

  Create the required directories by uploading a file to the desired path.
</Warning>

<Info>
  All dates in filenames must use the `YYYY-MM-DD` format (e.g., `2025-12-31`).
</Info>

| **File**                       | **Submitter**            | **Folder Name**                                                                                    | **File Example**                                                                                                                                                     |
| ------------------------------ | ------------------------ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Customer                       | You                      | customer                                                                                           | `2025-12-31_customer_v1.csv`                                                                                                                                         |
| Customer Relationship          | You                      | customer-relationship                                                                              | `2025-12-31_customer_relationship_v1.csv`                                                                                                                            |
| Authorized Users               | You                      | authorized-users                                                                                   | `2025-12-31_authorized_users_v1.csv`                                                                                                                                 |
| Applications                   | You                      | applications                                                                                       | `2025-12-31_applications_v1.csv`                                                                                                                                     |
| Accounts                       | You                      | accounts                                                                                           | `2025-12-31_accounts_v1.csv`                                                                                                                                         |
| Cards                          | You                      | cards                                                                                              | `2025-12-31_cards_v1.csv`                                                                                                                                            |
| Documents                      | You                      | documents                                                                                          | Refer to `Documents` row in `Customer` `Applications` `Accounts` `Balances` data schema                                                                              |
| Balances                       | You                      | balances                                                                                           | `2025-12-31_balances_v1.csv`                                                                                                                                         |
| Transactions                   | You                      | transactions                                                                                       | `2025-12-31_transactions_v1.csv`                                                                                                                                     |
| Non-Posted Transactions        | You                      | non-posted transactions                                                                            | `2025-12-31_non_posted_transactions_v1.csv`                                                                                                                          |
| Transactions Update            | You                      | transactions-update                                                                                | `2025-12-31_transactions_update_v1.csv`                                                                                                                              |
| Collaterals                    | You                      | collaterals                                                                                        | `2025-12-31_collaterals_v1.csv`                                                                                                                                      |
| Network Settlement (Primary)   | You or Issuing Processor | network-settlement/\<primary network name> <br /><br />Example:<br />*network-settlement/visa*     | Format varies based on network.                                                                                                                                      |
| Network Settlement (Secondary) | You or Issuing Processor | network-settlement/\<secondary network name><br /><br />Example:<br />*network-settlement/maestro* | Format varies based on network.                                                                                                                                      |
| Sales Request                  | Lead                     | sales-request                                                                                      | `2025-12-31_sales_request_v1.csv`                                                                                                                                    |
| Sales Response                 | You                      | sales-response                                                                                     | `2025-12-31_sales_response_v1.csv`                                                                                                                                   |
| ACH Outgoing                   | You                      | ach/outgoing                                                                                       | `2025-12-31_outgoing_ach_v1.ach`                                                                                                                                     |
| ACH Failed                     | Lead                     | ach/failed                                                                                         | `2025-12-31_outgoing_ach_v1.ach`                                                                                                                                     |
| ACH Incoming                   | Lead                     | ach/incoming                                                                                       | `2025-12-31_incoming_ach_return_noc_v1.ach`  `2025-12-31_incoming_ach_return_v1.ach`  `2025-12-31_incoming_ach_noc_v1.ach`  `2025-12-31_incoming_ach_forward_v1.ach` |
| ACH Processed                  | Lead                     | ach/processed                                                                                      | `2025-12-31_outgoing_ach_v1.ach`                                                                                                                                     |
| Daily Activity Report          | Lead                     | bank-account-reports                                                                               | `2025-12-31_[partnername]-daily-activity-report_[epoch].csv`                                                                                                         |
| Daily Balance Report           | Lead                     | bank-account-reports                                                                               | `2025-12-31_[clientname]-daily-balance-report_[epoch].csv`                                                                                                           |
| ACH Cash Recon Report          | Lead                     | bank-account-reports                                                                               | `2025-12-31_[clientname]-ach-cash-recon-report_[UNIQUE-POSTFIX].csv`                                                                                                 |

## File Naming

We utilize a consistent filename format that aims to:

* Indicate the type of file
* Indicate the content represented in the particular file
* Prevent filename collisions for similar files

#### **Example File Format**

`20260115T171640Z_incoming_ach_forwards_1768497400.ach`

| **20260115T171640Z**                                                                                                                                                 | **incoming\_ach\_forwards**                        | **1768497400**                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Content Identifier                                                                                                                                                   | File Type                                          | Epoch Time of File Generation                                                                                         |
| This will correspond to the content of the file.<br /><br />For loan origination files, this will be a date.<br /><br />For ACH files, this will be a date and time. | This indicates the meaning and format of the file. | This serves to prevent similar files from colliding and preserves generation time ordering for similarly named files. |

<Tip>
  File versions can be represented by either an epoch timestamp (not ISO 8601) or an incremental version label such as v1, v2, etc. Each subsequent submission must use a higher version value.
</Tip>

#### Example Invalid File Name

If the initial file version is invalid or changes are required, you must submit the updated version of the file — with an updated epoch time of version label, such as "v2".

| **Original**             | 20260115T171640Z\_incoming\_ach\_forwards\_**1768497400**.ach                                                 |
| ------------------------ | :------------------------------------------------------------------------------------------------------------ |
| **Updated Resubmission** | 20260115T171640Z\_incoming\_ach\_forwards\_**1768642400**.ach<br /><br />*Notice the updated epoch timestamp* |

## Common Pitfalls

You may receive the below error if your **key permissions are too open**:

<Danger>
  Permissions 0777 for '/Users/username/.ssh/id\_rsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored.
</Danger>

This error indicates that your public key is read/writable by any system user rather than just the current user. You may resolve this error by running:

`chmod 600 ~/.ssh/id_rsa`
