---
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.

---

[API](https://skmtc.net/openqr/apis/openqr-api.md) · [All operations](https://skmtc.net/openqr/apis/openqr-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openqr/openqr-api/versions/f1b3796cd1f6/schema)
