Create data source connection

Prev Next
Post
/teams/{team_id}/data-source-connections

Creates a data source connection for a Hub transfer. This endpoint establishes a connection between a data source and a destination for use in data warehouse transfers.

Returns: Connection object with connection ID and optional OAuth URLs.

Important Notes:

  • Requires scope dwh_transfers_write
  • Your account must have dwh.transfer.edit permission. See roles and permissions.
  • Connection credentials are encrypted and stored securely
  • Some data sources may require OAuth authentication (check login_url in response)
  • The connection must be created before setting up transfers
Security
API Key: ApiKeyAuth
Header parameter nameauthorization

API Key authentication. Include the API key directly in the Authorization header: Authorization: <your-api-key>

Path parameters
team_id
integer (int64) Required

Unique identifier of the team

Minimum1
Maximum9223372036854776000
Example12345
Body parameters

Connection configuration specifying data source and destination

{
  "data_source_id": "ADM",
  "destination_type": "DWH_SNOWFLAKE"
}
object
data_source_id
string Required

Data source identifier (e.g., "GA" for Google Analytics, "ADM" for Adobe Analytics Metrics)

Max length50
Pattern^[A-Z0-9_]+$
ExampleADM
destination_type
string Required

Destination type identifier (e.g., "SQL_BQ" for BigQuery, "DWH_SNOWFLAKE" for Snowflake)

Max length50
Pattern^[A-Z0-9_]+$
ExampleDWH_SNOWFLAKE
api_key
string

API Key for authentication (optional if provided in Authorization header). This is a reserved framework parameter and will be automatically handled.

Max length255
Pattern^[\s\S]+$
Examplesk_your_api_key_here
Responses
201

Connection created successfully

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
Location
string
URI of the created connection resource
Max length2048
Pattern^https?://[\s\S]+$
Examplehttps://dts-api.supermetrics.com/v1/teams/12345/data-source-connections/019461A0-0000-7000-8000-000000000000
success

Successful connection creation

{
  "meta": {
    "request_id": "019461A0-0000-7000-8000-000000000000"
  },
  "data": {
    "connection_id": "019461A0-0000-7000-8000-000000000001",
    "login_url": null,
    "connect_url": null
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
data
object (DataSourceConnection)
connection_id
string (uuid)

Unique identifier for the created connection

Max length36
Pattern^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
Example019461A0-0000-7000-8000-000000000001
login_url
string (uri) | null

URL for OAuth login flow (used when data source requires user authentication). In the current V1 implementation, this is always null.

Max length2048
Example
connect_url
string (uri) | null

URL for connection flow (used when additional authentication steps are required). In the current V1 implementation, this is always null.

Max length2048
Example
400

Bad Request - The request was invalid or cannot be served.

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "01892A4D-7586-7000-8000-000000000000"
  },
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "Invalid Parameter",
    "description": "The request contains invalid or malformed parameters."
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255
401

Unauthorized - Authentication is required and has failed or has not been provided.

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "019461A0-0000-7000-8000-000000000000"
  },
  "error": {
    "code": "API_KEY_INVALID",
    "message": "Invalid API key",
    "description": "Provided API key was invalid."
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255
403

Forbidden - The request is understood, but access is not allowed

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "01892A4D-7586-7000-8000-000000000000"
  },
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access Denied",
    "description": "You do not have permission to perform this operation."
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255
422

Unprocessable Entity - request validation failed

Headers
Content-Type
string
HTTP response content type
Valid values[ "application/json" ]
Max length255
Exampleapplication/json
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example100
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example49
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255
429

Too Many Requests - Rate limit exceeded.

Headers
Retry-After
integer
Number of seconds to wait before making another request
Minimum1
Maximum3600
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "019461A0-0000-7000-8000-000000000000"
  },
  "error": {
    "code": "API_ROW_QUOTA_EXCEEDED",
    "message": "Row quota exceeded",
    "description": "You have exceeded your row-quota limit of rows for this month. Please log into Supermetrics Hub at https://hub.supermetrics.com/ and upgrade your plan, or contact our Supermetrics support team."
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255
500

Internal Server Error - An error occurred on the server.

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
{
  "meta": {
    "request_id": "01892A4D-7586-7000-8000-000000000000"
  },
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "Internal Server Error",
    "description": "An unexpected error occurred. Please try again later or contact support."
  }
}
Expand All
object
meta
object (ResponseMeta)
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
error
object (Error)
code
string

Error code

Max length100
message
string

Error message

Max length255
description
string

Error description

Max length255