Email API Configuration
For more information about authentication, accessing the Fivetran REST API, and request and response formats, see Getting Started with the Fivetran REST API.
Request
POST https://api.fivetran.com/v1/connections
{ "group_id": "group_id", "service": "email", "trust_certificates": true, "trust_fingerprints": true, "run_setup_tests": true, "paused": false, "pause_after_trial": false, "sync_frequency": 1440, "data_delay_sensitivity": "LOW", "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, "all_fields": 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": "FIVETRAN_NAMING", "external_secrets_manager_id": "esm_id", "config": { "allowed_senders_list": [ "string" ], "append_file_option": "upsert_file_with_primary_keys | append_file", "archive_pattern": "regex_pattern", "azure_credential": { "container_name": "string", "prefix": "string", "storage_account": "string" }, "cloud_storage_option": "FIVETRAN | S3 | AZURE | GCS", "compression": "zip | gz | tar_gz | tar | infer | gzip | uncompressed | bz2 | tar_bz2", "connection_type": "Directly | PrivateLink | SshTunnel | ProxyAgent", "delimiter": "string", "empty_header": true, "escape_char": "string", "file_type": "tsv | xml | csv | spreadsheet | json | jsonl | avro | parquet", "files": [ { "archive_pattern": "string", "email_subject": "string", "file_pattern": "string", "file_source": "ATTACHMENT", "link_pattern": "string", "selected_range": "'Sheet1'!A1", "table_name": "string" } ], "gcs_credential": { "gcs_bucket": "string", "prefix": "string" }, "json_delivery_mode": "Packed | Unpacked", "line_separator": ";", "null_sequence": "string", "pattern": "file_pattern", "quote_char": "string", "quote_character_enabled": true, "s3_credential": { "prefix": "string", "s3_bucket": "string", "s3_external_id": "string", "s3_role_arn": "string" }, "selected_range": "'Sheet1'!A1", "skip_after": 0, "skip_before": 0, "sync_inconsistent_rows": true, "schema": "schema_name", "table_group_name": "string" } }
Config parameters
| Name | Description |
|---|---|
allowed_senders_list | Restrict ingestion to emails from these senders only. Supports exact addresses (e.g. reports@vendor.com) or domains (e.g. @vendor.com). Applies to all tables. |
append_file_option | If 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. |
archive_pattern | Files inside of compressed archives with filenames matching this regular expression will be synced. We have discontinued this field, and will stop supporting it by August 31, 2026. |
azure_credential | Configuration for Azure Blob storage. |
azure_credential.container_name | Azure Blob container name. |
azure_credential.prefix | Optional path prefix within the container. Defaults to the root if not set. |
azure_credential.storage_account | Azure storage account name. |
cloud_storage_option | Choose where Fivetran stores your attachments. Default value: FIVETRAN. |
compression | The secrets that should be passed to the function at runtime. |
connection_type | Connection method. Default value: Directly. |
delimiter | You can specify your the delimiter that your CSVs use here. Fivetran generally tries to infer the delimiter, but in some cases this is impossible. |
empty_header | Optional. 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. |
escape_char | If your CSV generator follows non-standard rules for escaping quotation marks, you can set the escape character here. |
file_type | If your files are saved with improper extensions, you can force them to by synced as the selected file type. |
files | Mapped file name patterns to a destination table. |
files[0].archive_pattern | All Files inside of compressed archives with filenames matching this regular expression will be synced. |
files[0].email_subject | Only attachments from emails with this subject will be synced. Leave this field blank to sync all attachments. |
files[0].file_pattern | All files in your search path matching this regular expression will be synced per table. |
files[0].file_source | The source of files to sync. ATTACHMENT (default) syncs email attachments; LINKED_URL_ATTACHMENT fetches files from URLs in the email body. |
files[0].link_pattern | URLs present in email bodies matching this pattern will be fetched and synced as files to this table. Leave this field blank to match all URLs. |
files[0].selected_range | Cell 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><startRowNumber> format. |
files[0].table_name | All files matching the above pattern will be synced to this table. |
gcs_credential | Configuration for Google Cloud Storage. |
gcs_credential.gcs_bucket | Google Cloud Storage bucket name. |
gcs_credential.prefix | Optional path prefix within the bucket. Defaults to the root if not set. |
json_delivery_mode | Control how your JSON data is delivered into your destination |
line_separator | You 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_sequence | If your CSVs use a special value indicating null, you can specify it here. |
pattern | All files in your search path matching this regular expression will be synced. We have discontinued this field, and will stop supporting it by August 31, 2026. |
quote_char | You 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. |
quote_character_enabled | If 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. |
s3_credential | Configuration for Amazon S3 storage. |
s3_credential.prefix | Optional path prefix within the bucket. Defaults to the root if not set. |
s3_credential.s3_bucket | Amazon S3 bucket name. |
s3_credential.s3_external_id | Fivetran-generated external ID. |
s3_credential.s3_role_arn | Amazon S3 Role ARN required for authentication. |
selected_range | Cell 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. |
skip_after | We will skip over the number of lines specified at the end so as to not introduce aberrant data into your destination. |
skip_before | We will skip over the number of lines specified before syncing data. |
sync_inconsistent_rows | When enabled, Fivetran syncs rows with fewer or more columns than the header row. For rows with fewer columns, Fivetran adds NULL values for the missing columns. For rows with extra columns, Fivetran names them column_<position>. When disabled, Fivetran handles inconsistent rows according to your error-handling settings. |
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
This type of connector can only be authorized through the Connect Card or through the Fivetran dashboard.