Create API key
POST
https://app.speybooks.com/api/v1/api-keys/Generate a new API key. The full plaintext key is returned exactly once in the response — it cannot be retrieved again. Store it securely immediately.
The key is hashed with Argon2id before storage. Default scopes
grant full access (["*"]). Invalid scopes are rejected with
a validation error listing the bad values.
Body parameters
environmentstringoptionalKey environment. Live keys use sk_live_ prefix, test keys use sk_test_.
livetestnamestringoptionalHuman-readable name for the key (e.g. Production Backend).
scopesarray<string>optionalPermission scopes. Use ["*"] for full access, or specific scopes like ["invoices:read", "contacts"].
Response
201API key created. The full key is returned ONCE in this response and cannot be retrieved again.
Show response fields
createdAtstringdate-timeenvironmentstringidintegerkeystringkeyPreviewstringnamestringscopesarray<string>scopesSummarystringwarningstringError codes
400Validation error: invalid scope(s) or missing required fields.