# API reference (Developers)

URL: https://qrdx.dev/docs/developers/api
Source: https://github.com/bucharitesh/qrdx/blob/main/apps/docs/content/docs/developers/api/index.mdx

Every QRdx REST API endpoint, with code samples in curl, JavaScript and Python and a Try it panel that sends real requests.

{/* Generated by pnpm openapi:generate from public\/openapi.json. Edit lib\/openapi, then run it again. */}

Every endpoint of the QRdx REST API, generated from its [OpenAPI 3.1 document](https://qrdx.dev/openapi.json), which is built from the same schemas the API validates requests with. Each page has code samples in curl, JavaScript and Python, and a **Try it** panel that sends real requests.

New to the API? The [quickstart](https://qrdx.dev/docs/developers/quickstart) gets you from nothing to a first request in under two minutes.

## Base URL [#base-url]

```txt
https://api.qrdx.dev/v1
```

The same routes also answer at `https://qrdx.dev/api/v1`. Requests and responses are JSON, except the image API, which returns images.

## Try it [#try-it]

Try it sends real requests from your browser to this site's `/api/v1` (the same API as `api.qrdx.dev/v1`), and never with your QRdx sign-in cookie:

- **No token needed:** [Render a QR code image](https://qrdx.dev/docs/developers/api/get-qr-image) works straight away.
- **Everything else** needs an OAuth access token. Paste it into the **Authorization** field as `Bearer <token>`. [How to get a token](https://qrdx.dev/docs/developers/quickstart#get-an-access-token).

Requests made with a token act on real data in the token owner's personal workspace and count against its daily quota, exactly as they would from your own code.

## Authentication [#authentication]

Send an OAuth 2.0 access token in the `Authorization` header. Each endpoint below lists the scope it needs; `codes:write` also allows everything `codes:read` does. API keys aren't available yet, so for now you get a token by registering an OAuth app: see [REST API and OAuth](https://qrdx.dev/docs/developers/rest-api#get-an-access-token).

## Errors and limits [#errors-and-limits]

Errors are JSON: `{ "code", "message", "status" }`, plus `docs` when a page explains the fix. The [errors page](https://qrdx.dev/docs/developers/errors) lists every code with its fix. Each workspace has a daily request quota, reported in the `X-RateLimit-*` headers; see [rate limits](https://qrdx.dev/docs/developers/rest-api#rate-limits).

## Endpoints [#endpoints]

### QR images [#qr-images]

Keyless QR code images for `<img>` tags, emails and scripts.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [Render a QR code image](https://qrdx.dev/docs/developers/api/get-qr-image) | `GET /qr` | None |

### Codes [#codes]

Dynamic QR codes: a short link you can point anywhere after printing.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [List codes](https://qrdx.dev/docs/developers/api/list-codes) | `GET /codes` | `codes:read` |
| [Create codes](https://qrdx.dev/docs/developers/api/create-codes) | `POST /codes` | `codes:write` |
| [Get a code](https://qrdx.dev/docs/developers/api/get-code) | `GET /codes/{id}` | `codes:read` |
| [Update a code](https://qrdx.dev/docs/developers/api/update-code) | `PATCH /codes/{id}` | `codes:write` |
| [Delete a code](https://qrdx.dev/docs/developers/api/delete-code) | `DELETE /codes/{id}` | `codes:write` |

### Scans [#scans]

Scan analytics of a code.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [Get scan analytics](https://qrdx.dev/docs/developers/api/get-code-scans) | `GET /codes/{id}/scans` | `codes:read` |

### Conversions [#conversions]

Sales and sign-ups attributed to the scan behind them.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [Report a conversion](https://qrdx.dev/docs/developers/api/create-conversion) | `POST /conversions` | `codes:write` |

### Hooks [#hooks]

REST Hooks subscriptions for Zapier, Make and n8n.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [List hooks](https://qrdx.dev/docs/developers/api/list-hooks) | `GET /hooks` | `codes:read` |
| [Subscribe to events](https://qrdx.dev/docs/developers/api/create-hook) | `POST /hooks` | `codes:write` |
| [Get a hook](https://qrdx.dev/docs/developers/api/get-hook) | `GET /hooks/{id}` | `codes:read` |
| [Unsubscribe](https://qrdx.dev/docs/developers/api/delete-hook) | `DELETE /hooks/{id}` | `codes:write` |
| [Get sample events](https://qrdx.dev/docs/developers/api/get-hook-samples) | `GET /hooks/sample` | `codes:read` |

### Themes [#themes]

The user's saved QR designs.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [List themes](https://qrdx.dev/docs/developers/api/list-themes) | `GET /themes` | `themes:read` |
| [Get a theme](https://qrdx.dev/docs/developers/api/get-theme) | `GET /themes/{themeId}` | `themes:read` |

### Profile [#profile]

The user behind the token.

| Endpoint | Request | Scope |
| --- | --- | --- |
| [Get the token's user](https://qrdx.dev/docs/developers/api/get-profile) | `GET /me` | `profile:read` |

## OpenAPI document [#openapi-document]

Download the document at [`https://qrdx.dev/openapi.json`](https://qrdx.dev/openapi.json) (also served at `https://api.qrdx.dev/openapi.json`) to generate a client, import the API into Postman or Insomnia, or give an AI agent the full contract.
