BackendHTTP APIConnections

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.

POST
/connections

Upserts a connection for which you already have credentials.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.

Request Body

application/json
  1. body
provider_config_key*string

The integration ID that you created on Tenklo.

metadata?

(OAuth, required for some APIs) Metadata to be attached to the connection.

connection_id?string

The 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.

Propertiesproperties <= 10
end_user?Deprecated

Deprecated, use tags instead

Response Body

Successfully created an integrations

application/json
  1. response
id*integer
connection_id*string
provider_config_key*string
provider*string
errors*array<>
end_user?|nullDeprecated
metadata*
connection_config*
tags*

Connection tags (key/value strings). Keys are normalized to lowercase.

Propertiesproperties <= 10
created_at*string
updated_at*string
last_fetched_at*string
credentials*|||||||||||||
Example Request
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"  }}'
Example Response
{  "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": {}  }}

On this page