Getting a key
Create keys in the dashboard. The plaintext secret is shown once at creation and stored only as a SHA-256 hash afterward — copy it then, because it can’t be retrieved later. The SDK and CLI read the key from theSENDERKIT_API_KEY environment variable.
Live and test keys
Keys carry ansk_live_ or sk_test_ prefix that selects the environment:
sk_live_delivers real notifications through your connected providers.sk_test_never calls providers — use it for local development and CI.
Scopes
API keys carry an optional scope set that limits what a credential can do. You pick scopes in the dashboard at creation time; all four are selected by default.
A key created without selecting any explicit scope is unscoped and has full
access — all keys minted before scope enforcement are unscoped by default and
continue to work without changes. A scoped key used outside its grant returns
403
with code: "insufficient_scope". The SDK surfaces this as
SenderKitPermissionError, distinct from the
SenderKitAuthenticationError raised for 401s, so you can handle the two cases
separately.
Revocation
To retire a key, revoke it in the dashboard — a revoked or otherwise invalid key returns401 Unauthorized. There’s no in-place rotation: to rotate, create a new
key, deploy it, then revoke the old one.