POST
/
connections
cURL
curl --request POST \
  --url https://api.nango.dev/connections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "provider_config_key": "<string>",
  "metadata": {},
  "connection_id": "<string>",
  "connection_config": {},
  "credentials": {
    "oauth_token": "<string>",
    "oauth_token_secret": "<string>",
    "type": "OAUTH1"
  },
  "end_user": {
    "id": "<string>",
    "email": "<string>",
    "display_name": "<string>",
    "tags": {}
  }
}'
{
  "id": 123,
  "connection_id": "<string>",
  "provider_config_key": "<string>",
  "provider": "<string>",
  "errors": [
    {
      "type": "auth",
      "log_id": "VrnbtykXJFckCm3HP93t"
    }
  ],
  "end_user": {
    "id": "<string>",
    "email": "<string>",
    "display_name": "<string>",
    "tags": {},
    "organization": {
      "id": "<string>",
      "display_name": "<string>"
    }
  },
  "metadata": {},
  "connection_config": {},
  "created_at": "<string>",
  "updated_at": "<string>",
  "last_fetched_at": "<string>",
  "credentials": {
    "oauth_token": "<string>",
    "oauth_token_secret": "<string>",
    "type": "OAUTH1",
    "raw": {}
  }
}

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

Authorizations

Authorization
string
header
required

The secret key from your Nango environment.

Body

application/json
provider_config_key
string
required

The integration ID that you created on Nango.

credentials
object
required

The credentials to be attached to the connection.

metadata
object

(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
object

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

end_user
object

Response

Successfully created an integrations

id
integer
required
connection_id
string
required
provider_config_key
string
required
provider
string
required
errors
object[]
required
end_user
object
required
metadata
object
required
connection_config
object
required
created_at
string
required
updated_at
string
required
last_fetched_at
string
required
credentials
object
required