Create Template
Creates a new QR code design template in the current workspace. Templates let you save and reuse design configurations across multiple QR code generations.
POST
/v1/qr/templates qr:write Parameters
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the template. |
description | string | No | Optional description of the template. |
design | object | No | Design configuration (see below). |
Design object
| Parameter | Type | Default | Description |
|---|---|---|---|
foreground_color | string | #000000 | Foreground (dot) color as hex. |
background_color | string | #FFFFFF | Background color as hex. |
error_correction | string | M | Error correction level: L, M, Q, or H. |
dot_style | string | square | Dot shape style (e.g. square, rounded, dots, classy). |
corner_style | string | square | Corner square style (e.g. square, rounded, dot). |
logo_url | string | — | URL of a logo image to overlay at center. |
logo_size | number | 0.2 | Logo size as a fraction of the QR code (0.1–0.4). |
quiet_zone | integer | 1 | Number of module-width quiet zone around the code. |
Request examples
curl -X POST https://xqr.co/api/v1/qr/templates \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Brand Primary", "description": "Main brand QR style with purple dots", "design": { "foreground_color": "#8B5CF6", "background_color": "#FFFFFF", "error_correction": "H", "dot_style": "rounded", "corner_style": "rounded", "logo_url": "https://cdn.xqr.co/logos/brand.png", "logo_size": 0.25, "quiet_zone": 2 } }'const res = await fetch("https://xqr.co/api/v1/qr/templates", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Brand Primary", description: "Main brand QR style with purple dots", design: { foreground_color: "#8B5CF6", background_color: "#FFFFFF", error_correction: "H", dot_style: "rounded", corner_style: "rounded", logo_url: "https://cdn.xqr.co/logos/brand.png", logo_size: 0.25, quiet_zone: 2, }, }),});
const { data, meta } = await res.json();import httpx
res = httpx.post( "https://xqr.co/api/v1/qr/templates", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "name": "Brand Primary", "description": "Main brand QR style with purple dots", "design": { "foreground_color": "#8B5CF6", "background_color": "#FFFFFF", "error_correction": "H", "dot_style": "rounded", "corner_style": "rounded", "logo_url": "https://cdn.xqr.co/logos/brand.png", "logo_size": 0.25, "quiet_zone": 2, }, },)
template = res.json()["data"]Response
201 Created
{ "data": { "id": "tpl_abc123", "name": "Brand Primary", "description": "Main brand QR style with purple dots", "design": { "foreground_color": "#8B5CF6", "background_color": "#FFFFFF", "error_correction": "H", "dot_style": "rounded", "corner_style": "rounded", "logo_url": "https://cdn.xqr.co/logos/brand.png", "logo_size": 0.25, "quiet_zone": 2 }, "created_at": "2026-03-21T10:30:00Z", "updated_at": "2026-03-21T10:30:00Z" }, "meta": { "request_id": "req_9c4e1a", "rate_limit": { "remaining": 47, "reset_at": "2026-03-21T12:01:00Z" } }}Was this page helpful?
Thanks for your feedback!