Import a connection
Requires an API key with the environment:connections:create scope. Learn more about API key scopes.
When to use
Use this API endpoint to import existing access tokens into Nango. It is mostly meant for one-off bulk imports when onboarding Nango, or for migrating existing connections when a provider introduced changes to its auth flow.
If a connection with the same connection_id and provider_config_key already exists, the endpoint updates it with the provided credentials instead of creating a new one.
To trigger OAuth flows with Tenklo, use the Tenklo frontend SDK.
Request body
You can use this endpoint to import OAuth 2, OAuth 1, API Keys, and Basic auth credentials.
The required fields depend on the type of authentication of the connections you are trying to import.
Upserts a connection for which you already have credentials.
bearerAuthAuthorizationBearer <token>An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.
application/json- body
provider_config_key*stringThe integration ID that you created on Tenklo.
metadata?(OAuth, required for some APIs) Metadata to be attached to the connection.
connection_id?stringThe connection ID used to create the connection.
connection_config?(OAuth, required for some APIs) Additional configuration to be attached to the connection.
credentials*|||||||The credentials to be attached to the connection.
tags?Connection tags (key/value strings). Keys are normalized to lowercase.
properties <= 10end_user?DeprecatedDeprecated, use tags instead
Successfully created an integrations
application/json- response
id*integerconnection_id*stringprovider_config_key*stringprovider*stringerrors*array<>end_user?|nullDeprecatedmetadata*connection_config*tags*Connection tags (key/value strings). Keys are normalized to lowercase.
properties <= 10created_at*stringupdated_at*stringlast_fetched_at*stringcredentials*|||||||||||||curl -X POST 'https://api.tenklo.dev/connections' \ -H 'Content-Type: application/json' \ -d '{ "provider_config_key": "string", "credentials": { "oauth_token": "string", "oauth_token_secret": "string", "type": "OAUTH1" }}'{ "id": 0, "connection_id": "string", "provider_config_key": "string", "provider": "string", "errors": [ { "type": "auth", "log_id": "string" } ], "end_user": { "id": "string", "email": "string", "display_name": "string", "tags": {}, "organization": { "id": "string", "display_name": "string" } }, "metadata": {}, "connection_config": {}, "tags": { "property1": "string", "property2": "string" }, "created_at": "string", "updated_at": "string", "last_fetched_at": "string", "credentials": { "oauth_token": "string", "oauth_token_secret": "string", "type": "OAUTH1", "raw": {} }}