SendpositoryDocs

API keys

Creating keys, the two permission levels, and what to do when one leaks.

Updated

Every request authenticates with an API key sent as a bearer token:

Authorization: Bearer sp_your_api_key

Creating a key

API keys → Create API key. The full key is shown on creation and stays on the API keys page for up to one hour in that tab, until sign-out or revocation. Use Copy when you are ready; creation does not replace your clipboard. Save it in server-side environment settings before the reveal expires.

The API keys page

We store only a SHA-256 hash and the first 11 characters - enough to show you sp_Hi3uTL8o... in the list, not enough to reconstruct the key. The copy that survives briefly in the tab is held in that tab's own storage and never reaches us, so once it is gone nobody can recover it: create a new one and revoke the old.

The API behaves the same way it always has - POST /v1/api-keys returns the plaintext token exactly once, in that response, and never again.

If you use two-factor authentication

Creating a key asks for a code from your authenticator app, and so does approving npx sendpository init. A key keeps working after you sign out, so it is treated like changing your authenticator rather than like ordinary dashboard work - and Google sign-in also asks for your enrolled local factor.

You will not be asked twice in a row: proving it once covers the next fifteen minutes. Accounts without two-factor are never asked.

Permissions

PermissionCan do
sendingSend email and read delivery status for messages created by this exact key. No message bodies, recipients, or subjects.
full_accessSend, read message content across the account, and manage domains, keys, webhooks and logs.

Use sending for your application. A sending key that leaks can send email you didn't intend - bad, but recoverable by revoking it. A full-access key that leaks can mint more keys, which outlive the revocation of the original.

Keep full-access keys for scripts and tooling you run yourself.

Keeping keys safe

  • Store keys in environment variables, never in source control
  • Never put a key in browser or mobile code - anyone can read it there; call your own backend, and have that call us
  • Use a separate key per environment, so revoking staging doesn't stop production
  • Revoke immediately if a key is exposed; revocation takes effect on the next request

Revoking

Revoking marks a key dead rather than deleting the row, so your request logs keep their meaning. A key cannot revoke itself - use another key or the dashboard.

See the API keys API for programmatic access.

Rotating a sending key does not transfer read access to messages created by its predecessor. Use an explicitly authorized full-access key for account-wide history; keep application sending credentials limited.

SDK emails.get() and emails.list() reflect these restricted and content-bearing shapes. Check "to" in email before using recipient/content fields. Updating types prevents a missing recipient field from being mistaken for an array.

The plan's per-second API limit applies to each API key. Per-account monthly, daily, domain and sandbox allowances are shared across keys.

On this page