Create API key
Use this endpoint to create a new API key programmatically with an existing API key. Use this when you need to mint a key for a new integration, for key rotation, or to scope access to specific Accounts.
Required fields
name- display name of the API key (must be unique within the Company)
Optional fields
expirationInDays- number of days until the key expires. Accepted values:30,60,90,180,365. Default:90.enforceMtls- whentrue, requests with this key must use mTLS. Default:false.permissions- array of permission scopes the new key should have. See the permission reference.accountsAccess-{ scope: "all-accounts" | "specific-accounts", ids: [] }to scope the key to specific Accounts.
Optional headers
Snappy-Account-Id- optional account scoping
Behavior Notes
- The API key secret is visible only in this response. Store it securely - it cannot be retrieved later.
- Max 100 active API keys per Company. Delete an existing key before creating the 101st.
Permissions
- Requires:
apiKeys:create
Authorizations
Company Level Authentication
Include your API key in the X-Api-Key header for every request:
Body
Create API key request body.
The name of the API key. Must be unique within the company.
1"My API"
API key expiration period in days. Default: 90 days.
0.00069 <= x <= 365If true, the API key will be enforced to use mTLS.
false
The permissions of the API key.
gifts:create, gifts:create:demo, gifts:update, gifts:read:unmasked, gifts:read:masked, digitalCards:read, orders:create, orders:cancel, orders:read:unmasked, orders:read:masked, campaigns:create, campaigns:update, campaigns:read, collections:read, products:read, products:read:prices, recipients:create, recipients:update, recipients:read:unmasked, recipients:read:masked, recipients:delete, accounts:create, accounts:read, billingMethods:read, apiKeys:read, apiKeys:create, apiKeys:delete Response
Created API key including the secret.
JSON:API single-resource envelope for a created API key.
API key object including the secret returned on create.