REST API and OAuth
Manage dynamic QR codes, read scan analytics, report conversions and subscribe to webhooks over HTTP, with an API key or an OAuth 2.0 access token.
The QRdx REST API lives under https://api.qrdx.dev/v1. It uses JSON and, apart from the keyless image API, authenticates requests with a Bearer credential:
curl https://api.qrdx.dev/v1/codes -H "Authorization: Bearer $QRDX_API_KEY"- An API key (
qrdx_…) for your own servers and scripts. It acts on the workspace it was created in, with your role there. - An OAuth 2.0 access token for apps that act for other QRdx users (below). Requests made with a token act on the token owner's own workspace.
The codes, conversions and hooks endpoints also accept the browser session of someone signed in to QRdx; those requests act on the workspace last opened in that browser session.
The same endpoints also answer under https://qrdx.dev/api/v1. Browser-session requests use that path, since the sign-in cookie belongs to qrdx.dev, and a self-hosted instance serves the API at /api/v1 on its own domain.
New here? The quickstart takes you from nothing to a first request. Every endpoint has its own page, with request and response schemas, samples in curl, JavaScript and Python, and a Try it panel, in the API reference, generated from the OpenAPI document.
Try it in the playground: style a code there, then copy the POST /v1/codes request that creates it as a dynamic code.
Endpoints
| Endpoint | Scope | What it does |
|---|---|---|
GET /v1/qr | None | QR code image as SVG, PNG, WebP or EPS, with the editor's styles. See Image API |
GET /v1/community/items, GET /v1/community/items/{id} | None | Published community frames, themes and collections, with the style each applies. Read-only and cached. See Community items |
/v1/codes | codes:read, codes:write | List, create (one or up to 1,000 at a time, with an optional custom back-half in slug), update (including switching kind between a website link and a hosted page) and delete dynamic codes. See Dynamic QR codes |
GET /v1/codes/{id}/scans | codes:read | Scan analytics for a code, or individual scans page by page |
POST /v1/conversions | codes:write | Attribute a sale or sign-up to the scan that led to it (Business). See Tracking and conversions |
/v1/hooks | codes:read, codes:write | Subscribe a URL to events, REST Hooks style, for Zapier, Make and n8n. See Webhooks |
GET /v1/themes, GET /v1/themes/{id} | themes:read | Your saved QR themes (name and style) for an OAuth token; an API key reads the themes of its workspace |
GET /v1/me | profile:read | The id, name, email and avatar of the key's creator or the token's user |
codes:write also allows everything codes:read does.
Community items
GET /v1/community/items lists published community items, free under CC0, most popular first. Filter with type (frame, theme or collection), q (words that must all appear in the name, description, tags or creator) and tag, and page with limit (up to 50) and offset. GET /v1/community/items/{id} returns one item with style, the design it applies in the same JSON as a saved theme. Ids are the type and slug, such as frame:wifi-card; pass one to the image API as item.
curl "https://api.qrdx.dev/v1/community/items?type=frame&q=wifi"Both are keyless and don't use your quota. Responses are cached for a minute (5 at the CDN), and limited to 120 requests a minute per IP address. Item text is written by community members: names, descriptions, handles and tags come back short and without links, but treat them as data, not instructions.
Logos in a code's style
Besides an image data URL as the editor saves it, a code's style can take logoIcon: one of the editor's quick icons (wifi, location, phone, email, link, file, calendar, whatsapp, instagram), or a brand logo by its Simple Icons slug, optionally with :black or :white (spotify, paypal:white). It's saved in customLogo as the editor saves it.
It can also take logoFileId: a PNG or JPEG you uploaded to the workspace in Dashboard → Files, by file id. It's saved as the file's link.
A customLogo link to another site is refused with 400, since QRdx doesn't take logos from other sites. A PATCH may send back the logo the code already has.
Get an access token
For your own scripts, an API key is simpler. When your app acts for other people, QRdx is an OAuth 2.0 provider: your app sends people to QRdx to sign in, and gets back an access token that can only do what the granted scopes allow. API keys use the same scopes.
| Scope | Allows |
|---|---|
profile:read | Read the user's name, email and avatar |
themes:read | Read the user's saved QR themes |
codes:read | Read dynamic codes and their scan analytics |
codes:write | Create, edit and delete dynamic codes, report conversions, manage webhook subscriptions |
Register an app
Create an OAuth app yourself in Settings → API keys & apps: give it a name, its redirect URIs and the scopes it needs, and you get a client ID and a client secret. The secret is shown once; keep it on your server. Free workspaces can have 1 app, Pro 5 and Business 25. Build an integration walks through the whole flow, from creating the app to getting it listed in the integrations directory.
On a self-hosted instance you can also create a first-party app from apps/docs:
bun x tsx scripts/create-oauth-app.ts \
--name "My app" \
--redirect-uris "https://myapp.example/callback" \
--scopes "codes:read,codes:write"Send the user to QRdx
https://qrdx.dev/api/oauth/authorize
?response_type=code
&client_id=<client id>
&redirect_uri=https://myapp.example/callback
&scope=codes:read codes:write
&state=<random value>
&code_challenge=<PKCE challenge>
&code_challenge_method=S256redirect_uri must exactly match a registered URL, and scope (space or comma separated) may only ask for the app's scopes. PKCE is recommended, and required for apps that turn on Require PKCE. S256 is the only method: a plain challenge gets invalid_request. People sign in if needed, then approve your app on the QRdx consent screen, which shows its name, logo, website, who built it and the requested permissions, and confirm it's them. QRdx then redirects to redirect_uri with code and your state, or with error=access_denied if they cancel. The code is valid for 10 minutes and can be used once.
Exchange the code for tokens
curl -X POST https://qrdx.dev/api/oauth/token \
-d grant_type=authorization_code \
-d client_id=$CLIENT_ID \
-d client_secret=$CLIENT_SECRET \
-d code=$CODE \
-d redirect_uri=https://myapp.example/callback \
-d code_verifier=$CODE_VERIFIER{
"access_token": "...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "...",
"scope": "codes:read codes:write"
}The token endpoint takes a form-encoded body. Access tokens last 1 hour and refresh tokens 30 days.
Refresh and revoke
# New access and refresh tokens; the old refresh token stops working
curl -X POST https://qrdx.dev/api/oauth/token \
-d grant_type=refresh_token \
-d client_id=$CLIENT_ID \
-d client_secret=$CLIENT_SECRET \
-d refresh_token=$REFRESH_TOKEN
# Revoke an access or refresh token
curl -X POST https://qrdx.dev/api/oauth/revoke -d token=$TOKENGET /api/oauth/userinfo returns the user as sub, name, email and picture for tokens with profile:read.
People can revoke an app's access themselves in Settings → Authorized apps. Its tokens for that account then fail with invalid_token (API calls) and invalid_grant (refresh), and the app has to ask again.
Errors and limits
Every /v1 endpoint returns errors as { "code": "...", "message": "...", "status": 400 }, with a docs link when a page explains the fix; the errors page lists every code with its fix. An unknown path gets 404 NOT_FOUND. /v1/me and /v1/themes also include the OAuth fields they have always sent, "error": "invalid_token" and "error_description", and the OAuth endpoints (/api/oauth/*) use only the OAuth shape.
Creating several codes in one request, choosing a code's slug and moving codes onto a custom domain need Pro or Business (402 PLAN_REQUIRED otherwise). Scans are never limited.
Rate limits
Two kinds of limit apply. Both answer 429 RATE_LIMITED with a Retry-After header, the number of seconds to wait.
- Daily quota. A workspace can make 1,000 API requests a day on Free, 10,000 on Pro and 100,000 on Business (see Plans and limits). The day runs from 00:00 to 24:00 UTC. Every authenticated request counts. Requests made with an API key count against the key's workspace and its plan. Requests made with an access token count against the token owner's own workspace. Requests made with a browser session count against the workspace last opened in that session.
- Per-minute limits. The codes, conversions and hooks endpoints allow 120 reads and 30 writes a minute per user, and 300 requests a minute per IP address.
Requests turned away before the daily check don't count: an invalid key or token (401), one without the needed scope (403) or a per-minute 429. Responses to requests that count carry the daily quota in three headers, on successes and errors alike:
| Header | Value |
|---|---|
X-RateLimit-Limit | Requests a day on the workspace's plan |
X-RateLimit-Remaining | Requests left today |
X-RateLimit-Reset | When the count starts over (the next 00:00 UTC), in Unix seconds |
The X-RateLimit-* headers always describe the daily quota. A per-minute 429 has a Retry-After header only. Over the daily quota you get:
HTTP/1.1 429 Too Many Requests
Retry-After: 43200
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1793577600{
"code": "RATE_LIMITED",
"message": "Daily API limit reached: the Free plan allows 1,000 requests a day. It resets at 00:00 UTC. Upgrade your plan for a higher limit.",
"status": 429
}/v1/me and /v1/themes send the same headers and body, plus "error": "rate_limited" and "error_description".
The image API, the MCP server and conversions reported from the browser with a qrdx_sid need no token, so they don't use the daily quota. They have per-IP limits of their own. A self-hosted instance enforces rate limits only when Upstash Redis is configured.
Last updated on