API keys authenticate your requests to the Nuntly API and SMTP server. Every key starts with ntly_.
Create an API key
- In the dashboard, go to API Keys
- Enter a descriptive name for the key (for example, “Production” or “Development”)
- Click Create
The key value is displayed once at creation. Copy it before closing. You will not be able to retrieve it again.
Store your API key in an environment variable or a secrets manager. Never hardcode it in your source code or commit it to version control.
Use your API key
With the SDK
Pass your key when initializing the Nuntly client:
import { Nuntly } from '@nuntly/sdk';
const nuntly = new Nuntly({
apiKey: process.env.NUNTLY_API_KEY,
});
See SDK setup for full installation instructions.
With the REST API
Include the key in the Authorization header of every request:
curl -X POST https://api.nuntly.com/emails \
-H 'Authorization: Bearer ntly_your_api_key_here' \
-H 'Content-Type: application/json' \
-d '{ ... }'
With SMTP
Use your API key as the SMTP password. See Send emails with SMTP for the full configuration.
Best practices
- Use a separate key for each environment (development, staging, production)
- Store keys in environment variables. Never put them in source code.
- If a key is compromised, create a new one and update your configuration