Overview
After a user completes an authorization flow, Nango creates a connection that stores their credentials for a specific integration. This guide covers the operations you can perform on connections from your backend using the Node SDK or REST API. Install the Node SDK if you haven’t already:List connections
Retrieve a list of all connections in your environment, optionally filtered by connection ID, integration, or tags:- TypeScript
- cURL
Get a connection and its credentials
Retrieve a specific connection including its current, valid credentials. Nango automatically refreshes OAuth tokens before returning them if they are expired or close to expiry.- TypeScript
- cURL
credentials object includes access_token and raw (the full token response from the provider). For API key connections, it includes apiKey. For basic auth, it includes username and password.
Force a token refresh by passing forceRefresh: true:
Delete a connection
Deleting a connection removes all credentials and associated data. This cannot be undone.- TypeScript
- cURL
Set and update metadata
Metadata is arbitrary key-value data you can attach to a connection. Use it to store per-connection configuration, such as a user’s preferences or API-specific settings. Set metadata (replaces all existing metadata):- TypeScript
- cURL
- TypeScript
- cURL
Connection tags
Tags are key-value strings that attribute a connection to entities in your system — users, organizations, workspaces, and so on. They are set when creating a connect session and copied to the resulting connection.Why use tags?
Nango uses random UUIDs as connection IDs. Tags bridge the gap between a Nango connection ID and the entities in your application. Their primary purpose is attribution: when a user completes auth, Nango sends a webhook containing the tags you set, letting you match theconnectionId with the right user or org.
Tags are also useful for:
- Filtering connections via
listConnections()to find all connections for a given user or organization - Navigating the Nango dashboard — all tags are displayed on the Connections page
- Routing webhooks or background jobs based on connection context
Recommended tags
Most apps start with these three tags:workspace_id, project_id, or plan.
Set tags when creating a session
Read tags from an auth webhook
Auth webhooks from Nango include the tags you set:connectionId alongside the corresponding entity in your database.
Filter connections by tags
Update tags on an existing connection
To update tags after a connection is created, patch the connection. Updating tags replaces the entire tag object, so include all tags you want to keep:- TypeScript
- cURL
Special tag keys
Two tag keys receive special treatment in the Nango dashboard:| Key | Effect |
|---|---|
end_user_display_name | Shown in place of the connection ID in the connections list |
end_user_email | Shown alongside the display name; the email domain is used to display the user’s company logo |
Tag rules and limits
- Keys are automatically lowercased (
End_User_Emailbecomesend_user_email) - Keys must start with a letter and contain only alphanumerics, underscores, hyphens, periods, or slashes
- Keys can be up to 64 characters long
- Values must be non-empty strings up to 255 characters long
- A maximum of 10 tag keys per connection are allowed
- Avoid storing secrets or large free-form payloads in tags
Next steps
Implement auth
Set up the full authorization flow for your users.
Connect UI
Customize the Connect UI and use connect links.