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

# Send file to SFTP destination

> Learn how to create a integration that extracts data and sends it as a file to a SFTP server

This guide walks you through creating a working integration that extracts user data from a public API and delivers it to in CSV format to a SFTP server. By the end, you'll understand how sftp connections work inside RWS Integration.

## What you'll build

You'll create an integration that:

1. **Extracts** user records from JSONPlaceholder (a free test API)
2. **Transforms** the data to a simpler format
3. **Loads** the results to a SFTP server in CSV format

Time required: approximately 5 minutes.

## Prerequisites

* Access to an RWS Integration Workspace
* A web browser
* A SFTP server

## Step 1: Create the source Connection

Connections define how RWS Integration communicates with external systems. You'll create one for the source API.

1. In the sidebar, click **Connections**
2. Click **New Connection**
3. Configure the connection:

| Field          | Value                                  |
| -------------- | -------------------------------------- |
| Name           | `JSONPlaceholder API`                  |
| Type           | `API`                                  |
| URL            | `https://jsonplaceholder.typicode.com` |
| Base Path      | `/`                                    |
| Authentication | `No authentication`                    |

4. Click **Save**

The JSONPlaceholder API doesn't require authentication, so the **No authentication** option (already selected by default for new connections) is all you need.

## Step 2: Create the destination Connection

Now create a Connection for your webhook.site destination.

1. Click **New Connection**
2. Configure the connection:

| Field           | Value              |
| --------------- | ------------------ |
| Name            | `SFTP Connection`  |
| Type            | `SFTP`             |
| URL             | `sftp.example.com` |
| Base Path       | `/uploads`         |
| Port            | `22`               |
| Username        | `username`         |
| SSH Private Key | `private_key`      |

3. Click **Save**

## Step 3: Create the Integration

With both Connections ready, create the Integration that moves data between them.

1. In the sidebar, click **Integrations**
2. Click **New Integration**

### General settings

Configure the basic integration properties:

| Field       | Value                                          |
| ----------- | ---------------------------------------------- |
| Name        | `Load File to SFTP`                            |
| Version     | `1.0.0`                                        |
| Type        | `Full`                                         |
| Environment | `Staging`                                      |
| Schedule    | Daily, at a time of your choice (e.g. `09:00`) |

### Extract phase

The Extract phase retrieves data from your source system.

1. Expand the **Extract** section
2. Configure these fields:

| Field      | Value                 |
| ---------- | --------------------- |
| Connection | `JSONPlaceholder API` |
| Method     | `GET`                 |
| Path       | `/users`              |

3. Set the **Datapoint Path in Response** to `root`

4. Set the **Pagination**:

| Field                  | Value    |
| ---------------------- | -------- |
| Pagination Type        | `Simple` |
| Page size parameter    | `_limit` |
| Page size value        | `10`     |
| Initial page parameter | `_page`  |
| Initial page value     | `1`      |
| Pagination end type    | `Object` |

5. Check the **Extract Preview** panel on the right side. It should show:

* Status: `200 OK`
* A single user record (the Datapoint) like this:

```json theme={null}
{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "Sincere@april.biz",
}
```

<Note>
  SFTP integrations doesn't support Enrichment phase.
</Note>

### Transform phase

The Transform phase maps source fields to your destination format. For this guide, create a simple mapping with three fields.

1. Expand the **Transform** section
2. Click **Add Transformation** and configure:

| Type   | To             | From    |
| ------ | -------------- | ------- |
| Simple | `userId`       | `id`    |
| Simple | `fullName`     | `name`  |
| Simple | `emailAddress` | `email` |

3. Check the **Transform Preview** panel. It should display:

```json theme={null}
{
  "userId": 1,
  "fullName": "Leanne Graham",
  "emailAddress": "Sincere@april.biz"
}
```

This confirms your mappings are working correctly with real data from the Extract phase.

### Load phase

The Load phase sends transformed data to your destination.

1. Expand the **Load** section
2. Configure these fields:

| Field      | Value             |
| ---------- | ----------------- |
| Connection | `SFTP Connection` |
| Path       | `/guides`         |
| File name  | `users.csv`       |

<Note>
  RWS Integration will create the file in the `/guides` directory. If the directory does not exist, it will be created. The only format supported is CSV.
</Note>

## Step 4: Deploy the Integration

1. Toggle **Deployment** to enabled
2. Click **Create Integration**

The integration will now run automatically every day at the time you chose.

## Step 5: Run it now

You don't need to wait for the schedule. Trigger the first run manually:

1. Open your integration from the **Integrations** list
2. Click **Run now**, next to the **Save** button
3. Confirm in the dialog, and a **Run started** message appears

## Step 6: Verify the results

Go to your SFTP server and check if the file `users.csv` was created in the `/guides` directory.

You should see a file with this structure:

```csv theme={null}
userId,fullName,emailAddress
1,Leanne Graham,Sincere@april.biz
2,Ervin Howell,Shanna@melissa.tv
3,Clementine Bauch,Nathan@yesenia.net
```

Congratulations, you've built and run your first SFTP integration!

## What you learned

* **SFTP connections** store configuration for SFTP servers and can be reused across multiple Integrations
* **Integrations** follow the Extract → Transform → Load pattern
* **Preview panels** automatically update as you configure each phase, letting you validate before running
* **Simple transformations** map fields from source to destination using JSONPath notation
* **File format** CSV is supported for SFTP integrations

## Next steps

<CardGroup cols={2}>
  <Card title="Connections" icon="plug" href="/en/features/connections/api">
    Learn about different authentication methods
  </Card>

  <Card title="Pagination" icon="arrows-rotate" href="/en/features/extract/pagination">
    Handle pagination and complex API responses
  </Card>

  <Card title="Business Rules" icon="code" href="/en/features/business-rules/overview">
    Master field transformations with JavaScript
  </Card>

  <Card title="Scheduling" icon="clock" href="/en/features/extract/scheduling">
    Schedule your integrations to run automatically
  </Card>
</CardGroup>
