API Authentication
Secure your API requests with bearer token authentication.
API Keys
All API requests require authentication via an API key. You can generate API keys on the API Keys page in the app. The full key is shown once, when you create it.
Key Types
| Type | Prefix | Use Case |
|---|---|---|
| Live | qwz_live_ | Production requests |
| Test | qwz_test_ | Labelling keys you use while developing |
Test keys work exactly like live keys. They're a label, not a sandbox: QR codes made with a test key are real, live, and count toward your plan.
Using Your API Key
Include your API key in the Authorization header of every request:
Authorization: Bearer qwz_live_xxxxxxxxxxxxxxxxxxxx Example Request
curl https://api.seriousqr.com/v1/qrcodes \
-H "Authorization: Bearer qwz_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" Security Best Practices
Keep Keys Secret
- Never commit API keys to version control
- Use environment variables in your code
- Do not expose keys in client-side JavaScript
Using Environment Variables
# .env file (do not commit this!)
SERIOUSQR_API_KEY=qwz_live_xxxxxxxxxxxxxxxxxxxx // Node.js example
const apiKey = process.env.SERIOUSQR_API_KEY;
fetch('https://api.seriousqr.com/v1/qrcodes', {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
}); Rotate Keys Regularly
We recommend rotating your API keys periodically:
- Generate a new key in your settings
- Update your application to use the new key
- Verify everything works
- Revoke the old key
Revoking Compromised Keys
If you suspect a key has been compromised:
- Immediately revoke the key in your API settings
- Generate a new key
- Update your applications
- Review your audit logs for unauthorized access
Rate Limits
API requests are rate-limited per key to ensure fair usage:
| Plan | Per minute | Per day |
|---|---|---|
| Free | 10 | 100 |
| Pro | 60 | 10,000 |
| Business | 120 | 50,000 |
| Enterprise | 300 | 500,000 |
Rate Limit Headers
Every response includes rate limit information:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 55
X-RateLimit-Reset: 1699574400 When Rate Limited
If you exceed the rate limit, you will receive a 429 Too Many Requests response:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please retry after 60 seconds."
}
} Scopes
Each key has a list of scopes chosen when it's created, such as
qrcodes:read or qrcodes:write, or the
read / write bundles. A request outside the
key's scopes gets 403 with code INSUFFICIENT_SCOPE.
Roles
A key acts as the person who created it. Whatever its scopes, it can never do more than that person's current role in the organization allows: the same rules as the dashboard.
- Viewer — read QR codes, analytics, pages, files and projects
- Editor — also create and edit them
- Admin — also delete, reset analytics, and view or change integrations (webhooks)
- Owner — everything
Changes to the person's role apply to their keys on the next request. A
request the role doesn't allow gets 403 with code
INSUFFICIENT_ROLE.
Shared platform data
A few things are shared by every SeriousQR customer, such as the design
themes and curated brand kits used for template generation. Your keys can
read and use the themes, but changing them, or using curated brand kits,
is reserved for SeriousQR staff: other keys get
403 with code PLATFORM_ADMIN_REQUIRED or
PLATFORM_STAFF_REQUIRED. No organization role changes this.
Organizations
A key normally belongs to one organization. A key created for several
organizations must send an X-Organization-Id header saying
which one each request is for, and acts with the creator's role there.
When someone is removed from an organization, their keys for it stop
working; a key that also covers other organizations keeps working there.
IP Allowlist
A key can be limited to a list of IP addresses or ranges. Requests from
anywhere else get 403 with code IP_NOT_ALLOWED.
Authentication Errors
401 Unauthorized
UNAUTHORIZED (missing or malformed Authorization
header), INVALID_API_KEY (unknown, revoked or misconfigured
key) or EXPIRED_API_KEY. For example:
{
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
} 403 Forbidden
Valid key, but not allowed: INSUFFICIENT_SCOPE (the key's
scopes), INSUFFICIENT_ROLE (its owner's role),
ORGANIZATION_ACCESS_REVOKED, ORGANIZATION_NOT_ALLOWED
or ORGANIZATION_NOT_FOUND (multi-organization keys),
ACCOUNT_DISABLED or IP_NOT_ALLOWED. For example:
{
"error": {
"code": "INSUFFICIENT_ROLE",
"message": "This action needs the editor role or higher; the API key's owner has the viewer role.",
"required_role": "editor",
"current_role": "viewer",
"documentation_url": "https://seriousqr.com/docs/api/authentication#roles"
}
} Get Started with the API
API access is included on every plan, including Free. View the developer guide or compare plan limits.