A connect session is a short-lived token (30 minutes) that you create server-side and pass to your frontend to initialize the Connect UI. The session encodes which end user is authenticating, which integrations they can connect to, and any connection defaults. This design keeps your secret key off the frontend: your server mints a session token and the browser only ever sees the short-lived token.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nangohq/nango/llms.txt
Use this file to discover all available pages before exploring further.
All API requests require a secret key passed as a Bearer token. You can find your secret key in the Settings section of the Nango dashboard.
Create a session
POST /connect/sessions
Creates a new connect session. The session expires after 30 minutes. Pass the returned token to the Connect UI in your frontend.
Request body
The end user who is authenticating. Required unless you provide top-level
tags.The organization the end user belongs to.
Limit which integrations the user can connect to. If omitted, all integrations in your environment are available. Each entry is an integration
unique_key.Per-integration defaults applied when the user connects. Keys are integration
unique_keys.Key-value tags copied onto the resulting connection. Common keys:
end_user_id, end_user_email, organization_id. You can also add custom keys. When tags is provided at the top level, end_user becomes optional.Per-integration Connect UI overrides. Keys are integration
unique_keys.Response
Example response
Using the session token in your frontend
After you receive thetoken, initialize the Connect UI on your frontend with it:
Frontend (React example)
Create a reconnect session
POST /connect/sessions/reconnect
Creates a session specifically for re-authenticating an existing connection. Use this when a connection’s credentials have expired or been revoked and you need the user to re-authorize.
The resulting session opens the Connect UI pre-scoped to the specific connection being repaired, rather than allowing the user to choose any integration.
Request body
The ID of the existing connection to reconnect.
The unique key of the integration the connection belongs to.
The end user performing the reconnect.
Organization the end user belongs to.
Per-integration defaults to apply during reconnect. Same shape as Create a session.
Tags to apply or update on the connection when reconnect completes.
Per-integration Connect UI overrides. Same shape as Create a session.
Response
Example response
Get a session
GET /connect/session
Retrieves the details of a connect session. Authenticate this request with the session token (not your secret key) as the Bearer token.
This endpoint is primarily used by the Connect UI itself to load session configuration. You generally do not need to call it directly.
Headers
Bearer <SESSION_TOKEN> — the connect session token returned by Create a session.Response
Example response
Delete a session
DELETE /connect/session
Immediately invalidates a connect session. The session token can no longer be used to open the Connect UI.
Use this if the user cancels the flow on your side before completing auth and you want to clean up.
Headers
Bearer <SESSION_TOKEN> — the connect session token to invalidate.Response
Returns204 No Content on success.
Security and expiry
- Never expose your secret key to the browser. Always create sessions server-side and pass only the
tokento your frontend. - Sessions expire after 30 minutes. If a user takes longer than that to complete the flow, create a new session.
- If you want to invalidate a session early (e.g. user logs out), call Delete a session.
- Sessions are single-environment: a token from your production environment cannot be used with your development environment’s Connect UI.