Azure Cosmos DB for NoSQL 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": "cosmos", "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": { "account_key": "account_key", "data_access_method": "ACCOUNT_KEY | RESOURCE_TOKEN", "resource_token": "resource_token", "sync_pack_mode": "STANDARD_UNPACKED_MODE | PACKED_MODE", "token_authenticated_container": "token_authenticated_container", "token_authenticated_database": "token_authenticated_database", "uri": "cosmos_host_uri", "schema_prefix": "prefix" } }
Config parameters
| Name | Description |
|---|---|
account_key | The read-only primary or secondary account key for the database account. Required for the ACCOUNT_KEY data access method. |
data_access_method | The source data access method. Supported values:ACCOUNT_KEY- Data access method that uses account keys to authenticate to the source database. It comes in both read-write and read-only variants.RESOURCE_TOKEN- Fine-grained permission model based on native Azure Cosmos DB users and permissions.Learn more in our Azure Cosmos DB Data Access Methods documentation. |
resource_token | A token that provides access to a specific Azure Cosmos DB resource. Required for the RESOURCE_TOKEN data access method. |
sync_pack_mode | The packing mode type. Supported values:STANDARD_UNPACKED_MODE- Unpacks one layer of nested fields and infers types.PACKED_MODE- Delivers packed data as a single destination column value.Learn more in our Azure Cosmos DB Sync Pack Mode Options documentation. |
token_authenticated_container | The container name. Required for the RESOURCE_TOKEN data access method. |
token_authenticated_database | The database name. Required for the RESOURCE_TOKEN data access method. |
uri | Cosmos resource instance address. |
schema_prefix (required) | Destination schema prefix. Prefix for each replicated schema. For example with prefix 'x', source schemas 'foo' and 'bar' get replicated as 'x_foo' and 'x_bar'. The prefix is permanent and cannot be changed after connection creation |
Authorization
There are three ways to authorize this connector type:
- Account Key: By specifying the
data_access_methodas"ACCOUNT_KEY"and the value for theaccount_keyparameter in the request.POST https://api.fivetran.com/v1/connections{ "service": "cosmos", "group_id": "group_id", "config": { "account_key": "account_key", "data_access_method": "ACCOUNT_KEY" } } - Resource Key: By specifying the
data_access_methodas"RESOURCE_TOKEN"and the values for theresource_token,token_authenticated_databaseandtoken_authenticated_containerparameters in the request.POST https://api.fivetran.com/v1/connections{ "service": "cosmos", "group_id": "group_id", "config": { "resource_token": "resource_token", "token_authenticated_database": "token_authenticated_database", "token_authenticated_container": "token_authenticated_container", "data_access_method": "RESOURCE_TOKEN" } } By using the Connect Card or the Fivetran dashboard.