Overview
The connection object is the part of your automation configuration that tells the engine how to reach the external system. Whether your vendor gives you an FTP server to download inventory files from, exposes a REST API, or sends data via email, the connection configuration handles the details of authenticating and transferring data.
Every automation requires a connection, and every connection requires a type. The type you choose determines which other fields are available. This guide covers each connection type in detail, with complete JSON examples and guidance on when to use each one.
Connection Features by Type
Not every connection type supports every operation. Before choosing a type, check what you need:
| Connection Type | Get Single File | Get Multiple Files (Regex) | Send File / Data |
|---|---|---|---|
| FTP | Yes | Yes | Yes |
| SFTP | Yes | Yes | Yes |
| FTPS | Yes | No | No |
| SureDone SFTP | Yes | Yes | Yes |
| S3 | Yes | Yes | Yes |
| HTTP | Yes | No | Yes |
| Yes | Yes | Yes |
FTP
FTP (File Transfer Protocol) is the most common connection type for file-based vendor integrations. Many suppliers and distributors provide FTP credentials for exchanging inventory, catalog, and order files.
When to Use FTP
Your vendor gives you an FTP server address, username, and password. You need to download files from or upload files to their server.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "ftp" |
"ftp" |
address |
string | Yes | -- | FTP server hostname or IP | "ftp.vendor.com" |
username |
string | Yes | -- | FTP login username | "myuser" |
password |
string | Yes | -- | FTP login password | "{{ftp password}}" |
path |
string | Yes | -- | Directory path on the server | "/outbound/inventory" |
port |
number | No | 21 |
FTP server port | 21 |
ssl_ftp |
boolean | No | false |
Open an explicit SSL-FTP connection | true |
use_pasv_address |
boolean | No | true |
Use the address returned by the FTP server for passive mode | true |
Complete Example
"connection": {
"type": "ftp",
"address": "ftp.acmedistributor.com",
"username": "{{ftp username}}",
"password": "{{ftp password}}",
"path": "/outbound/inventory",
"port": 21
}
{{ftp password}}) for credentials instead of hardcoding them. Parameters with "encrypted": true are stored securely and never exposed in logs.SFTP
SFTP (SSH File Transfer Protocol) works similarly to FTP but runs over an encrypted SSH connection. It is the preferred choice when security is a priority, and many modern vendors have moved exclusively to SFTP.
When to Use SFTP
Your vendor provides SFTP access (often on port 22) for secure file exchange. Some vendors may also provide an SSH key file instead of a password.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "sftp" |
"sftp" |
address |
string | Yes | -- | SFTP server hostname | "sftp.vendor.com" |
username |
string | Yes | -- | SFTP login username | "suredone_user" |
password |
string | Yes | -- | Password or key file contents | "{{sftp password}}" |
path |
string | Yes | -- | Directory path on the server | "/data/exports" |
port |
number | No | 22 |
SFTP server port | 22 |
is_key_file |
boolean | No | false |
Set to true if password contains the contents of an SSH key file |
true |
Complete Example
"connection": {
"type": "sftp",
"address": "sftp.vendor.com",
"username": "{{sftp username}}",
"password": "{{sftp password}}",
"port": 22,
"path": "/data/exports"
}
Key File Authentication
If your vendor provides an SSH private key instead of a password, paste the full key contents into the password parameter and set is_key_file to true:
"connection": {
"type": "sftp",
"address": "sftp.vendor.com",
"username": "suredone_user",
"password": "{{ssh key}}",
"is_key_file": true,
"path": "/data"
}
FTPS
FTPS (FTP over Explicit SSL) is a variant of FTP that adds SSL/TLS encryption. It has limited capabilities in the Automation Engine compared to standard FTP -- it supports downloading a single file only. You cannot use regex to match multiple files, and you cannot upload.
When to Use FTPS
Your vendor requires an explicit SSL connection and you only need to download a single named file.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "ftps" |
"ftps" |
address |
string | Yes | -- | FTPS server hostname | "ftp.ekeystone.com" |
username |
string | Yes | -- | Login username | "{{ftp username}}" |
password |
string | Yes | -- | Login password | "{{ftp password}}" |
path |
string | No | "/" |
Directory path on the server | "/outbound" |
port |
number | No | 990 |
FTPS server port | 990 |
Complete Example
"connection": {
"type": "ftps",
"address": "ftp.ekeystone.com",
"username": "{{ftp username}}",
"password": "{{ftp password}}",
"path": "/outbound",
"port": 990
}
HTTP / HTTPS
HTTP connections are for integrating with REST APIs. This is the most feature-rich connection type, supporting authentication flows, pagination, request chaining (triggers), and throttling. Use it whenever your vendor provides an API rather than file downloads.
When to Use HTTP
Your vendor has a REST API that returns JSON or XML data, or accepts data via HTTP POST/PUT requests.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "http" |
"http" |
address |
string | Yes | -- | API endpoint URL | "https://api.vendor.com/v1/inventory" |
method |
string | Yes | "POST" |
HTTP method: GET, POST, PUT, PATCH, DELETE | "GET" |
headers |
object | No | -- | HTTP headers (auth tokens, content type, etc.) | See example below |
payload |
object | No | -- | GET query parameters or POST body fields | See example below |
username |
string | No | -- | Sent to login_address as part of authentication |
"api_user" |
password |
string | No | -- | Sent to login_address as part of authentication |
"{{api password}}" |
login_address |
string | No | -- | URL for initial login/authentication request | "https://api.vendor.com/auth/login" |
login_credentials |
object | No | -- | Custom login body (replaces default username/password) | See below |
ssl_http |
boolean | No | true |
Verify SSL peer certificate | true |
Basic API Example
A simple GET request with an API key in the headers:
"connection": {
"type": "http",
"address": "https://api.vendor.com/v2/products",
"method": "GET",
"headers": {
"Authorization": "Bearer {{api key}}",
"Content-Type": "application/json",
"Accept": "application/json"
}
}
Login Flow
Some APIs require you to first authenticate by posting credentials to a login endpoint. The engine sends username and password to login_address, then uses the session/token from that response for the main request to address:
"connection": {
"type": "http",
"address": "https://www.vendor.com/export.php",
"username": "{{api username}}",
"password": "{{api password}}",
"login_address": "https://www.vendor.com/user/login",
"method": "POST",
"headers": {
"Host": "www.vendor.com"
},
"payload": {
"stockExport": "items"
}
}
If your login endpoint requires fields other than username and password, use login_credentials to define a custom login body:
"login_credentials": {
"api_key": "{{vendor api key}}",
"account_id": "{{account id}}",
"grant_type": "api_key"
}
OAuth
For APIs that use OAuth 2.0, configure the oauth object inside the connection:
"connection": {
"type": "http",
"address": "https://api.vendor.com/v1/inventory",
"method": "GET",
"headers": {
"Content-Type": "application/json"
},
"oauth": {
"address": "https://api.vendor.com/v1/token",
"method": "POST",
"grant_type": "client_credentials",
"client_id": "{{oauth client id}}",
"client_secret": "{{oauth client secret}}"
}
}
The engine obtains an access token automatically before making the main request. For advanced OAuth flows (authorization code grants, redirect-based flows), consult the advanced configuration guide.
Pagination
Many APIs return data across multiple pages. Enable pagination to automatically fetch all pages:
"connection": {
"type": "http",
"address": "https://api.vendor.com/v1/products",
"method": "GET",
"paginate": true,
"pagination": {
"next_token": "$.meta.next_page_url",
"page_per_second": 2
}
}
| Pagination Field | Type | Default | Description |
|---|---|---|---|
next_token |
string | "next" |
Key or JSONPath in the response pointing to the next page URL |
next_parameter |
string | -- | Use this if the next token gives a query parameter value instead of a full URL |
page_parameter |
string | "page" |
Query parameter name for page-based pagination |
page_start |
number | 1 |
Page number to begin from |
page_iterator |
number | 1 |
Amount to increment the page number each call |
page_per_second |
number | -- | Rate limit: maximum paginated requests per second |
ignore_errors |
boolean | false |
End pagination gracefully on HTTP errors instead of failing |
Throttling
To avoid hitting vendor rate limits, configure a throttle:
"connection": {
"type": "http",
"address": "https://api.vendor.com/v1/orders",
"method": "POST",
"throttle": {
"request_limit": 5,
"time_period": 1
}
}
This limits the automation to 5 requests per second.
Complete HTTP Example
Here is a full HTTP connection that authenticates via OAuth, paginates results, and respects rate limits:
"connection": {
"type": "http",
"address": "https://api.turn14.com/v1/shipping/item_estimation",
"method": "GET",
"paginate": true,
"headers": {
"Content-Type": "application/json",
"User-Agent": "SureDone/3.0"
},
"oauth": {
"address": "https://api.turn14.com/v1/token",
"method": "POST",
"grant_type": "client_credentials",
"client_id": "{{turn14_id}}",
"client_secret": "{{turn14_secret}}"
},
"throttle": {
"request_limit": 10,
"time_period": 1
}
}
Email connections let your automation send data as email messages (for exports) or read data from email attachments (for imports). This is useful when a vendor or internal team communicates via email rather than through a server or API.
When to Use Email
Your vendor sends you inventory updates as email attachments, or you need to email order reports to a team or supplier who does not have an FTP server or API.
Configuration Fields for Exports (Sending Emails)
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "email" |
"email" |
address |
string or array | Yes | -- | Recipient address(es) | "vendor@example.com" or ["a@ex.com", "b@ex.com"] |
subject |
string | No | -- | Email subject line (supports {{field}} variables) |
"Purchase Order {{oid}}" |
body |
string | No | -- | Email body text (supports {{field}} variables) |
"Order {{oid}} is attached." |
sender_address |
string | No | -- | Custom sender email address | "orders@yourstore.com" |
sender_name |
string | No | -- | Custom sender display name | "Your Store Orders" |
send_as_attachment |
boolean | No | false |
Attach data as a file instead of placing it in the body | true |
cc |
string or array | No | -- | CC address(es) | "manager@yourstore.com" |
bcc |
string or array | No | -- | BCC address(es) | "archive@yourstore.com" |
reply-to |
string | No | -- | Reply-to header address | "support@yourstore.com" |
Configuration Fields for Imports (Reading Emails)
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
address |
string | Yes | -- | IMAP mailbox address to connect to | "imap.gmail.com" |
username |
string | Yes | -- | Mailbox login username | "orders@yourstore.com" |
password |
string | Yes | -- | Mailbox login password | "{{email password}}" |
port |
number | No | 993 |
IMAP port | 993 |
mailbox |
string | No | "INBOX" |
Mail folder to check | "INBOX" |
mark_as_seen |
boolean | No | false |
Mark email as read after successful import | true |
email_search |
object | No | -- | Criteria to filter which emails to process | See below |
Email Search
The email_search object lets you narrow down which emails the automation processes. Common filters:
"email_search": {
"unseen": true,
"since": "-10 days",
"subject": "Inventory Update",
"from": "vendor@distributor.com"
}
Available search criteria include from, subject, body, to, cc, bcc, since, before, on, unseen, seen, new, recent, flagged, answered, and more.
Export Example (Sending an Order Email)
"connection": {
"type": "email",
"address": [
"purchasing@vendor.com",
"backup@vendor.com"
],
"cc": "orders@yourstore.com",
"subject": "Purchase Order {{oid}}",
"body": "Please find the attached purchase order for order {{oid}}.",
"send_as_attachment": true,
"sender_name": "Your Store Ordering"
}
subject and body fields support dynamic variables from your exported data. Wrap any SureDone field name in {{}} to insert its value for each record.Import Example (Reading Vendor Emails)
"connection": {
"type": "email",
"address": "imap.gmail.com",
"username": "{{email address}}",
"password": "{{email password}}",
"port": 993,
"mailbox": "INBOX",
"mark_as_seen": true,
"email_search": {
"unseen": true,
"from": "noreply@vendor.com",
"subject": "Daily Inventory"
}
}
S3 (sds3)
The S3 connection type allows your automation to read from or write to Amazon S3 buckets. This is useful when your vendor stages files in S3, or when you use S3 as an intermediate storage layer for large data transfers.
When to Use S3
Files are stored in an Amazon S3 bucket -- either placed there by a vendor, another system, or a separate SureDone process.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "sds3" |
"sds3" |
bucket |
string | Yes | -- | S3 bucket name | "vendor-data-feeds" |
path |
string | No | -- | Path prefix within the bucket | "/inventory" |
Complete Example
"connection": {
"type": "sds3",
"bucket": "suredone-bulk-staging"
}
file_regex pattern in your file_configs to match multiple files by name within the bucket path.SureDone SFTP (sdsftp)
SureDone provides a managed SFTP endpoint for customers. This is useful when a vendor or partner needs to push files directly to a location SureDone can read from, without the customer managing their own SFTP server.
When to Use SureDone SFTP
You want vendors or partners to push files to your SureDone-managed SFTP folder, rather than setting up your own SFTP server.
Configuration Fields
| Field | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
type |
string | Yes | -- | Must be "sdsftp" |
"sdsftp" |
path |
string | Yes | -- | Directory path on the SureDone SFTP server | "/incoming/vendor" |
user_id |
number | Yes | -- | Your SureDone User ID | 12345 |
Complete Example
"connection": {
"type": "sdsftp",
"path": "/incoming/vendor-inventory",
"user_id": 12345
}
Common Fields Across Connection Types
A few fields appear across multiple connection types:
| Field | Used By | Description |
|---|---|---|
address |
FTP, SFTP, FTPS, HTTP, Email | Server hostname, API URL, or email address |
username |
FTP, SFTP, FTPS, HTTP, Email (import) | Login username |
password |
FTP, SFTP, FTPS, HTTP, Email (import) | Login password (use encrypted parameters) |
path |
FTP, SFTP, FTPS, SDSFTP, S3 | Directory or path on the remote system |
port |
FTP, SFTP, FTPS, Email | Server port number |
Choosing the Right Connection Type
| Scenario | Recommended Type |
|---|---|
| Vendor provides FTP credentials for file exchange | FTP or SFTP |
| Vendor requires encrypted file transfer | SFTP |
| Vendor has an SSL-only FTP server (single file download) | FTPS |
| Vendor has a REST API | HTTP |
| You need to authenticate with OAuth before accessing an API | HTTP (with oauth) |
| Vendor sends or receives data via email | |
| Files are staged in an Amazon S3 bucket | S3 (sds3) |
| You want vendors to push files to a SureDone-managed server | SureDone SFTP (sdsftp) |
"encrypted": true for passwords, API keys, and secrets. See Your First Automation for details on parameters.