SFTP API Configuration
Request
POST https://api.fivetran.com/v1/connections
{
"group_id": "group_id",
"service": "sftp",
"trust_certificates": true,
"trust_fingerprints": true,
"run_setup_tests": true,
"paused": false,
"pause_after_trial": false,
"sync_frequency": 1440,
"data_delay_sensitivity": "NORMAL",
"data_delay_threshold": 0,
"daily_sync_time": "14:00",
"schedule_type": "auto",
"connect_card_config": {
"redirect_uri": "https://your.site/path",
"hide_setup_guide": true
},
"proxy_agent_id": "proxy_agent_id",
"private_link_id": "private_link_id",
"networking_method": "Directly",
"hybrid_deployment_agent_id": "hybrid_deployment_agent_id",
"destination_configuration": {
"virtual_warehouse": "virtual_warehouse"
},
"destination_schema_names": "SOURCE_NAMING",
"config": {
"file_handling": "structured",
"quote_character_enabled": true,
"prefix": "folder_path",
"pattern": "file_pattern",
"json_delivery_mode": "Packed | Unpacked",
"skip_after": 0,
"quote_char": "string",
"empty_header": true,
"password": "password",
"use_pgp_encryption_options": true,
"skip_before": 0,
"tunnel_port": 0,
"signer_public_key": "",
"delimiter": "string",
"file_type": "tsv | xml | csv | spreadsheet | json | jsonl | avro | parquet",
"host": "sftp.company.com",
"file_mapping_method": "EXTRACT_TABLES | DEFINE_PER_TABLE",
"on_error": "fail | skip",
"extraction_pattern": "(?\\w+)/.*",
"archive_pattern": "regex_pattern",
"pgp_secret_key": "",
"append_file_option": "upsert_file_with_primary_keys | upsert_file | append_file",
"selected_range": "'Sheet1'!A1",
"escape_char": "string",
"connection_method": "SSH_TUNNEL | DIRECT",
"tunnel_user": "string",
"line_separator": ";",
"null_sequence": "string",
"port": 22,
"is_single_table_mode": true,
"tunnel_host": "string",
"files": [
{
"file_pattern": "string",
"table_name": "string",
"archive_pattern": "string"
}
],
"is_keypair": true,
"compression": "zip | gz | tar_gz | tar | infer | gzip | uncompressed | bz2 | tar_bz2",
"user": "user_name",
"pgp_pass_phrase": "",
"schema": "schema_name",
"table_group_name": "string"
}
}Config parameters
Name Description file_handlingFiles will be processed and synced according to the selected file handling option. Supported values:
structured- (Default) Extract structured data into destination tables for analysis. Commonly used.
unstructured- Replicate files in their original format. Best for PDFs, images, and other unstructured content. Learn more about unstructured file replication in our documentation.. quote_character_enabledIf you don’t want to use an enclosing character while processing the files, set the value to false. By default, the value is set to true and is considered " as quote character. prefixAll files and folders under this folder path will be searched for files to sync. patternAll files in your search path matching this regular expression will be synced. We have discontinued this field, and will delete it by August 31, 2025. json_delivery_modeControl how your JSON data is delivered into your destination skip_afterWe will skip over the number of lines specified at the end so as to not introduce aberrant data into your destination. quote_charYou can specify the enclosing character used in your CSVs here. Fivetran will consider " as the quote character if this field is empty and quote_character_enabled is set to true. empty_headerOptional. If your CSV generating software doesn't provide header line for the documents, Fivetran can generate the generic column names and sync data rows with them. passwordSFTP password. use_pgp_encryption_optionsSet to true if files present in SFTP server are encrypted using PGP. Default value: false. skip_beforeWe will skip over the number of lines specified before syncing data. tunnel_portTunnel port, specify only to connect via SSH tunnel. signer_public_keyThe contents of the signer's public key file. Must be populated if use_pgp_encryption_options is set to true and PGP encrypted files are signed. delimiterYou can specify your the delimiter that your CSVs use here. Fivetran generally tries to infer the delimiter, but in some cases this is impossible. file_typeIf your files are saved with improper extensions, you can force them to by synced as the selected file type. hostSFTP host address. file_mapping_methodThe method used to map files to destination tables. Use DEFINE_PER_TABLE to manually configure each table with its own file pattern, or EXTRACT_TABLES to automatically discover tables based on a single extraction pattern. on_errorIf you know that your files contain some errors, you can choose to have poorly formatted lines skipped. We recommend leaving the value as fail unless you are certain that you have undesirable, malformed data. extraction_patternA regular expression with a named capture group (?<table>...) to extract table names from file paths. archive_patternFiles inside of compressed archives with filenames matching this regular expression will be synced. pgp_secret_keyThe contents of your PGP secret key file. Must be populated if use_pgp_encryption_options is set to true. append_file_optionIf you know that the source completely over-writes the same file with new data, you can append the changes instead of upserting based on filename and line number. selected_rangeCell reference that will be used to sync all contiguous data starting from the top-left cell in all the spreadsheets matching the name. Cell reference is in the '<sheetName>'!<startColumnName><startRowName> format. escape_charIf your CSV generator follows non-standard rules for escaping quotation marks, you can set the escape character here. connection_methodThe connection method used to connect to SFTP Server. tunnel_userTunnel user, specify only to connect via SSH tunnel. line_separatorYou can specify the custom line separator for your CSV files. The line separator is used in files to separate one row from the next. null_sequenceIf your CSVs use a special value indicating null, you can specify it here. portSFTP port. is_single_table_modeAllows the creation of connector using the specified Sync strategy. tunnel_hostTunnel host address, specify only to connect via SSH tunnel. filesMapped file name patterns to a destination table. files[0].file_patternAll files in your search path matching this regular expression will be synced per table. files[0].table_nameAll files matching the above pattern will be synced to this table. files[0].archive_patternAll Files inside of compressed archives with filenames matching this regular expression will be synced. is_keypairWhether to use a key pair for authentication. When true, do not use password. compressionThe secrets that should be passed to the function at runtime. userSFTP user. pgp_pass_phraseThe PGP passphrase used to create the key. Must be populated if use_pgp_encryption_options is set to true. schema (required)Destination schema name. Schema name is permanent and cannot be changed after connection creation table_group_name (required)Combined with the schema to form the Fivetran connection name <schema>.<table_group_name>. Lets you create multiple Merge Mode connections per schema.
Authorization
There are two ways to authorize this connector type:
- By specifying the values for the
host, port, user and password parameters in the request.POST https://api.fivetran.com/v1/connections
{
"service": "sftp",
"group_id": "group_id",
"config": {
"host": "sftp.company.com",
"port": 22,
"user": "user_name",
"password": "password"
}
}
By using the Connect Card or the Fivetran dashboard.