---
title: "Generate a QR code (JSON body)"
method: POST
path: "/v1/qr"
---

# Generate a QR code (JSON body)

`POST /v1/qr`

## Request body

- object
  - `data` string, required — Text or URL to encode.
  - `format` 'svg' | 'png'
  - `size` integer
  - `margin` integer
  - `dark` string — Foreground hex, e.g. 232E3A.
  - `light` string — Background hex, e.g. FFFFFF.
  - `theme` string — A saved theme id or name (applies its colours/margin).

## Response `200`

The rendered QR code.

## Other responses

- `400` — Invalid request — malformed JSON, a missing/invalid required field, or a disallowed dynamic-code destination (destinations must be public http(s) URLs; private/internal hosts and oqr.to self-loops are rejected).
- `401` — The `Authorization: Bearer oqr_…` header is missing or the API key is invalid or revoked.
- `500` — An unexpected server-side error.

## Changes

- **2026-08-22** `25dd10d901ca` — 1 breaking
  - the `size` request property's min was increased to `96.00`

[Change history](https://skmtc.dev/openqr/apis/openqr-api/changes/v1/qr/post.md)

---

[API](https://skmtc.dev/openqr/apis/openqr-api.md) · [All operations](https://skmtc.dev/openqr/apis/openqr-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openqr/openqr-api/revisions/25dd10d901ca/schema)
