API keys
Nango has two API key types. They are not interchangeable.- Environment API keys grant access to a single environment (integrations, connections, functions, records, proxy, and related APIs). Each key can have full access or a custom set of environment scopes.
- Account API keys grant access to account-level APIs only. They do not grant access to any environment.
Environment API keys
Environment API keys authenticate requests against a single Nango environment. Use them with environment-level APIs for integrations, connections, functions, records, and proxy requests. Manage Environment API keys under Environment Settings > API Keys.Managing Environment API keys
Each environment comes with a Default - Full access key that grants access to all environment API endpoints. You can create additional keys with restricted scopes for specific use cases.Creating an Environment API key
- Go to Environment Settings > API Keys
- Click Create API Key
- Enter a display name (e.g., βCI Deploy Keyβ, βBackend serviceβ)
- Choose Full access or Custom permissions β custom lets you pick individual scopes
- The key is created immediately and can be revealed and copied from the key list
Rotating an Environment API key
To rotate a key:- Create a new key with the same scopes
- Update your application to use the new key
- Monitor the Last used column on the old key to confirm itβs no longer in use
- Delete the old key
Using an Environment API key
Pass the Environment API key as a Bearer token in theAuthorization header:
- Node SDK
- cURL
Scopes
Scopes control what an Environment API key can access. When creating a key with Custom permissions, you select which scopes to grant. A key without a specific scope will receive a403 Forbidden response when trying to access a protected endpoint.
Credential scopes
Some resources (Integrations and Connections) have sensitive credential data. Access to this data is controlled by dedicated_credentials scopes:
list/readβ returns the resource without sensitive credentialslist_credentials/read_credentialsβ returns the resource with credentials (access tokens, client secrets, etc.)
_credentials scopes are supersets β selecting read_credentials automatically includes read access. You donβt need to select both.
Advised profiles
Common scope combinations for typical use cases:Auth (Connect UI)
For backends that create connect sessions for the auth flow:CI/CD deploy
For CI/CD pipelines deploying syncs and actions to production:Backend service
For backend services that consume data, trigger actions, and proxy requests:
Add
environment:connections:read_credentials if the service needs access to connection tokens.
Local development
For local development, use a Full access key. This is the default key created for each environment.CLI
The Nango CLI uses theNANGO_SECRET_KEY_<ENV> environment variable for authentication. Set it to an Environment API key with the required scopes:
For most functions,
environment:connections:read is sufficient for nango dryrun β Nango injects credentials into the proxy automatically, so the function does not need them in its response. Upgrade to environment:connections:read_credentials when the function reads credential data from the connection, including:
- accessing
connection.credentialsdirectly (e.g.nango.getConnection().credentials) - calling
nango.getToken()β returns the access token fromconnection.credentials - calling
nango.getRawTokenResponse()β returnsconnection.credentials.raw
read_credentials, these helpers return empty values because the API strips the credentials field from the response.
The Default - Full access key that comes with each environment already has all required scopes for deploying and dry-running. For production CI/CD pipelines, consider creating a dedicated key with only the environment:deploy scope to follow the principle of least privilege.
All available scopes
Integrations
Connections
Connect Sessions
Syncs
Deploy
Functions
Records
Logs
The
environment:logs:read scope is currently only used by the Logs tools in the Management MCP server.Actions
Proxy
Variables
Webhooks
MCP
Account API keys
Account API keys authenticate requests against account-level APIs. They do not grant access to any environment. They always have full account access and can only be managed by account administrators. Manage Account API keys from Account API keys in the Nango dashboard (also available from the profile menu).Using an Account API key
Pass the Account API key as a Bearer token in theAuthorization header. Account API keys cannot call environment-level endpoints β use an Environment API key for those.