Bearer tokens
All API requests must include a Bearer token in theAuthorization header:
401 Unauthorized error.
API key format
QRKit API keys use a prefix to indicate the environment:| Prefix | Environment | Description |
|---|---|---|
qr_live_ | Production | For your production integration |
qr_test_ | Test | For development and CI — created codes are marked as test-created |
Test keys work identically to live keys and create real QR codes in your
workspace (marked internally as created by a test key), so you can verify
the full flow end to end. Delete test codes when you’re done — they appear
in your dashboard like any other code.
Scopes
Each API key has one or more scopes that control what it can access:| Scope | Description |
|---|---|
qr:read | Read QR codes and folders |
qr:write | Create, update, and delete QR codes and folders |
analytics:read | Access scan analytics |
tokens:manage | Create, list, and revoke API keys |
Creating API keys
API keys are created from the QRKit dashboard (recommended) or via the Tokens API. API access requires a paid plan. When you create a key, the full key value is returned once. Store it securely — you won’t be able to see it again. The dashboard and API only show the key prefix (e.g.,qr_live_a1b2) for identification.
Key rotation
Rotate API keys using the Rotate endpoint or the dashboard. This creates a new key with the same name, scopes and expiry, and revokes the old one.Token management endpoints (
/tokens/*) are authenticated with your QRKit
dashboard session (a Clerk session JWT), not with an API key — a leaked API
key can never mint new keys.Key expiration
API keys can optionally have an expiration date. Setexpires_in_days when creating a key:
401 Unauthorized error. Create a new key or use rotation before the current key expires.
Security best practices
Use environment variables
Never hardcode API keys in source code. Use environment variables or a secrets manager.
Use test keys for development
Use
qr_test_ keys during development and CI/CD. Switch to qr_live_ only in production.
