POST

/connection

Bearer*
curl --request POST \
  --url https://api.nango.dev/connection \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "connection_id": "<connection_id>",
  "provider_config_key": "<provider_config_key>"
}'
This response has no body data.

When to use

Use this API endpoint to import existing access tokens into Nango. It is mostly meant for one-off import scripts.

To trigger OAuth flows with Nango use the Nango 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.

Body

access_token
string

(OAuth 2, required) Existing access token.

api_key
string

(API Key, required) API key to be attached to the connection.

connection_config
object

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

connection_idrequired
string

The connection ID used to create the connection.

expires_at
Date

(OAuth 2, optional) Safer and preferred.

expires_in
integer

(OAuth 2, optional) In seconds.

metadata
object

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

oauth_token
string

(OAuth 1, required) The client token to be attached to the connection.

oauth_token_secret
string

(OAuth 1, required) The client token secret to be attached to the connection.

password
string

(Basic, required) password to be attached to the connection.

provider_config_keyrequired
string

The integration ID that you created on Nango.

refresh_token
string

(OAuth 2, optional) Pass the refresh token if you have it.

username
string

(Basic, required) username to be attached to the connection.