Docs/REST API
API keys →
RESTJSONHTTPSBearer

REST API

Generate QR codes from your apps. One production endpoint today — POST /api/v1/generate. OpenAPI-style discovery via GET /api/v1/generate.

Introduction

How the API fits into QR TheCode²

Authenticate with a Bearer API key (Business plan). The API creates QR codes in your account and returns the image as a base64 PNG data URL or SVG string.

Discovery

GET https://qrthecode2.com/api/v1/generate

Create QR

POST https://qrthecode2.com/api/v1/generate

Authentication

Send your API key in the Authorization header.

Headers
Authorization: Bearer qrm_your_api_key
Content-Type: application/json

Never expose API keys in front-end code or public repos. Use server-side calls and environment variables.

Generate a QR code

POST/api/v1/generate

Body (JSON)

FieldRequiredDescription
typeNoQR type (default URL). See data schemas.
dataYesPayload for the chosen type (e.g. { "url": "https://…" }).
nameNoLabel in your dashboard.
isDynamicNoDynamic QR with scan URL and stats (Business).
fgColor / bgColorNoHex colors (#000000, #ffffff).
formatNopng (default) or svg.
cURL
curl -X POST https://qrthecode2.com/api/v1/generate \
  -H "Authorization: Bearer qrm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "URL",
    "data": { "url": "https://example.com" },
    "name": "Homepage QR",
    "fgColor": "#001533",
    "bgColor": "#ffffff",
    "format": "png"
  }'

Response (201)

JSON
{
  "id": "clx…",
  "name": "Homepage QR",
  "type": "URL",
  "isDynamic": false,
  "shortCode": null,
  "scanUrl": null,
  "qrImage": "data:image/png;base64,iVBOR…",
  "format": "png",
  "createdAt": "2026-03-12T10:00:00.000Z"
}

Data schemas

Fields inside the data object per type

Loading schemas from the API…

Errors

HTTP status codes returned by the API

HTTPMeaning
401Missing or invalid API key
403Business plan required
429QR code limit reached
500Internal server error

Ready to integrate?

Upgrade to Business, create an API key, and call the endpoint from your backend.