API Keys
All Partner API requests require a Bearer token in theAuthorization header. API keys are prefixed with pk_live_.
Generating an API Key
- Log in to the Puffle dashboard
- Navigate to Settings → API
- Click Generate API Key
- Copy and store the key — it is shown only once
Revoking an API Key
Keys can be revoked from the dashboard or via the API:401.
Session Authentication
A small set of account-management endpoints — specifically those that create, view, and revoke API keys (/api/v1/partners/api-key) — use session-based authentication (browser cookies) rather than Bearer tokens. These are designed to be called from the Puffle dashboard UI, not from your backend.
The webhook portal endpoint (/api/v1/partners/portal) uses Bearer token authentication.
Security Best Practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys grant full access to your Puffle account. Always make API calls from your backend — never from browser JavaScript or mobile apps where the key could be extracted.
Use environment variables
Use environment variables
Store your key in an environment variable (
PUFFLE_API_KEY) and reference it in code. Never hard-code keys or commit them to version control.Rotate keys periodically
Rotate keys periodically
Generate a new key and update your services before revoking the old one to avoid downtime.
Monitor for unauthorized access
Monitor for unauthorized access
Error Responses
| Status | Code | Cause |
|---|---|---|
401 | unauthorized | Missing, malformed, or revoked Bearer token |
403 | forbidden | Valid token but insufficient permissions |