API Keys

Authentication and security for your API requests.

To interact with the Sendlib API, you must include a valid API key in your request header.

Generating a Key

  • Go to the API Keys section in your dashboard.
  • Click Generate New Key.
  • Copy the key immediately. For security reasons, it will never be fully visible again.

Restrict a key to one sender

Choose a Sender account when generating or editing a key. A restricted key can only send from that connected email address, including batch sends. Attempts to use a different sender return HTTP 403. For single sends, you can omit from to use the assigned email automatically; batch requests still require from.

Existing keys continue to allow all connected accounts until you restrict them. You can update a key without changing its secret. Disconnecting its assigned account blocks sending until that email is reconnected or you change the restriction; it never falls back to another account. Restrictions apply to delivery and do not limit access to other API endpoints.

Security Warning: Never commit your API keys to version control (e.g., GitHub). Always use environment variables (e.g., process.env.SL_API_KEY).