Skip to main content
BosonMail authenticates API requests with Bearer tokens passed in the Authorization header. This page covers what is known about key scopes, how to store keys safely, and how to rotate them without downtime.
BosonWare has not published the exact steps for creating, revoking, or scoping API keys in the dashboard. The guidance below is based on general security practices. Contact support@bosonware.com to confirm BosonWare’s specific key management UI and capabilities.

Known scopes

The BosonMail README mentions two permission scopes: Apply the principle of least privilege: use a key with only the scopes needed for a given service. For example, a status dashboard might only need email:read, while a transactional backend needs email:send.
The full list of available scopes, and whether BosonWare supports scoped keys, requires confirmation from BosonWare.

Storing API keys

Never hardcode keys in source code or commit them to version control. Use one of the following approaches.

Environment variables

Load the key from the environment at runtime and validate it before constructing the client.
lib/bosonmail.ts

Platform secrets

Do not prefix the variable with NEXT_PUBLIC_, VITE_, or any framework-specific public prefix. That would bundle the key into client-side JavaScript.

Key rotation

Rotate keys periodically and immediately after any suspected leak. The general procedure is:
1

Create a new key

Generate a new API key in the BosonWare dashboard or by contacting support. Do not delete the old key yet.
2

Update your services

Deploy the new key to all environments that use BosonMail. Keep the old key active during the transition.
3

Verify traffic

Confirm that emails are sending and status lookups are working with the new key.
4

Revoke the old key

Remove the old key from the dashboard or request revocation via support@bosonware.com.
The exact BosonWare dashboard steps for creating and revoking keys require confirmation. Contact support@bosonware.com for assistance.

If a key is leaked

  1. Revoke the leaked key immediately via the dashboard or by emailing support@bosonware.com.
  2. Rotate to a new key using the procedure above.
  3. Audit recent send logs and status checks for unexpected activity.
  4. Review access controls to prevent recurrence.

Next steps

Security best practices

Server-side-only usage, PII handling, and dependency hygiene.

Client configuration

Configure API base URL, timeouts, and other options.

Error codes

Understand unauthorized and not_found errors.

Troubleshooting

Fix common authentication and configuration problems.