Connections API
Manage OAuth and API key connections for integrations
Connections API
Manage OAuth connections to external services. Connections are used by workflows to authenticate with integrated providers like Stripe, Salesforce, HubSpot, and more.
List Connections
Retrieve all connections for your company.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
provider | string | - | Filter by provider: stripe, salesforce, hubspot, etc. |
status | string | - | Filter: active, pending, error, expired, disconnected |
limit | number | 50 | Number of results (1-100) |
Response
Example
Get Auth URL
Generate an OAuth authorization URL for a provider. This creates a pending connection and returns the URL to redirect the user to.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
provider | string | Provider name: stripe, salesforce, hubspot, quickbooks, pandadoc, netsuite, slack, gmail |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
redirectUrl | string | No | URL to redirect after OAuth completion |
connectionName | string | No | Custom name for the connection |
Response
Example
Re-authorization
If a connection already exists but is in error or disconnected status, calling this endpoint will return a new auth URL for re-authorization:
Error Response (Active Connection Exists)
OAuth Callback
Handle the OAuth callback from the provider. This endpoint is called by Nango after the user completes authorization.
This endpoint does not require authentication as it handles redirects from the OAuth provider.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | The connection ID from the auth flow |
success | string | "true" or "false" |
error | string | Error message if authorization failed |
redirectUrl | string | URL to redirect the user to |
Successful Authorization
If redirectUrl is provided, redirects to:
Otherwise returns:
Failed Authorization
If redirectUrl is provided, redirects to:
Create Connection
Initiate a new connection (starts OAuth flow).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the connection |
provider | string | Yes | Provider name |
metadata | object | No | Additional metadata |
Example Request
Response (201 Created)
Get Connection
Retrieve details of a specific connection.
Response
Delete Connection
Revoke and delete a connection. This also removes the connection from Nango.
Response
Deleting a connection will cause workflows using this connection to fail. Make sure to update or pause affected workflows first.
Refresh Connection
Manually refresh connection credentials. Useful when credentials are about to expire.
Response
Error Response (Refresh Failed)
If the refresh fails, the connection status is updated to error:
Verify Connection
Test connection health by verifying credentials with the provider.
Response (Healthy Connection)
Response (Unhealthy Connection)
Response (Not Yet Authorized)
Connection Statuses
| Status | Description |
|---|---|
pending | OAuth flow started but not completed |
active | Connection is working properly |
error | Connection has an issue (check errorMessage) |
expired | OAuth token has expired, needs re-authorization |
disconnected | User revoked access or connection was disconnected |
Supported Providers
| Provider | OAuth | Description |
|---|---|---|
stripe | Yes | Payment processing |
salesforce | Yes | CRM |
hubspot | Yes | Marketing/CRM |
quickbooks | Yes | Accounting |
pandadoc | Yes | Document signing |
netsuite | Yes | ERP |
slack | Yes | Messaging |
gmail | Yes | Email (Google) |
OAuth Flow
The typical OAuth flow for connecting a provider: