# SFTP upload for CSV files

Bulk-upload audience and personalization data from CSV files to your Airship project over SFTP.

## What you can upload

SFTP upload supports the following tasks:

- Creating an [uploaded list](https://www.airship.com/docs/reference/glossary/#uploaded_list) — See [Uploaded lists](https://www.airship.com/docs/guides/audience/audience-lists/uploaded/).
- Setting and removing [attributes](https://www.airship.com/docs/reference/glossary/#attribute) — See [CSV upload](https://www.airship.com/docs/guides/audience/attributes/setting/#csv-upload) in *Setting and removing attributes*.
- Associating [channels](https://www.airship.com/docs/reference/glossary/#channel_term) with [named users](https://www.airship.com/docs/reference/glossary/#named_user) — See [CSV upload](https://www.airship.com/docs/guides/audience/named-users/#csv-upload) in *Named users*.
- Adding more codes for a [Coupons](https://www.airship.com/docs/reference/glossary/#coupons) campaign — See [Managing campaigns and adding more codes](https://www.airship.com/docs/guides/personalization/sources/coupons/) in *Coupons*.

All uploaded files are encrypted in transit and at rest.

## Generate an SSH key pair

Airship's SFTP implementation uses SSH key pairs for authentication: a private key for your client and a public key for Airship.

First, generate your key pair:

1. Open a terminal. On Windows, use PowerShell or Command Prompt.
1. At the command line, enter `ssh-keygen -t rsa`. You can set other options, but the key type must be set to RSA (`-t rsa`).
1. Enter the directory and file name for your new keys, without an extension. For example: `/Users/your_username/Documents/rsa_keys/<filename>`.
1. (Optional) Set a passphrase and confirm.

The output of the process generates two files:
* `<filename>` contains your private key.
* `<filename>.pub` contains your public key.

Copy the contents of your `.pub` file. You'll paste it when adding the key to Airship.

## Add your public key to Airship

Add your public key to Airship so it can authenticate your SFTP transfers:

1. Next to your project name, select the dropdown menu (), then **Settings**.
1. Under **Project settings**, select **SFTP**.
1. Select **Add key**.
1. For **Purpose**, select the type of transfers you intend to make using the key:
   * Attributes or Attributes snapshot — For processing details, see [Setting and removing attributes](https://www.airship.com/docs/guides/audience/attributes/setting/#csv-upload).
   * Coupons
   * Named users — Use for named user association
   * Static lists — Use for [uploaded lists](https://www.airship.com/docs/reference/glossary/#uploaded_list)
1. For **Name**, enter a value that helps you identify the key in the dashboard.
1. For **Public key**, paste the contents of the `<filename>.pub` file you saved in the [previous step](#generate-an-ssh-key-pair).
1. Select **Save key**.

> **Note:** Repeat this process for each additional purpose. You can reuse the same key pair, but each purpose needs its own key entry.


After saving, select the view icon () for a key and copy the values you need to configure SSH or an SFTP client:
   - For SFTP clients, copy the username, address, and port values.
   - For SSH-based connections, copy the SSH command line value. It combines the username, address, and port into one string.

For all SFTP connections, the port is `5222`, and the address is `sftp.airship.com`, or `sftp.airship.eu` for EU customers.

## Configure a connection and transfer files

Set up SFTP transfer at the command line or with an SFTP client using the [values copied from the Airship dashboard](#add-your-public-key-to-airship) and [your private key](#generate-an-ssh-key-pair). Many CRM platforms natively support SFTP.

Once your connection is established, transfer your CSV files to Airship.

![SFTP client configuration](https://www.airship.com/docs/images/sftp-client-setup_hu_86bc6d506ba22424.webp)

*SFTP client configuration*

## Verify transfer

After transfer, find each upload type at the following dashboard locations:

| Upload type | Dashboard path |
| --- | --- |
| Attributes | Go to **Audience**, then **Attributes**, then **Upload History**. |
| Named user association | Go to **Audience**, then **Attributes**, then **Upload History**. |
| Uploaded lists | Go to **Audience**, then **Lists**, then **Uploaded**. |
| Coupons | Next to your project name, select the dropdown menu (), then **Settings**. Under **Project settings**, select **Coupons**. |
{class="table-col-1-20"}
