Skip to content

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

ParameterTypeRequiredDescription
namestringYesDisplay name for the template.
descriptionstringNoOptional description of the template.
designobjectNoDesign configuration (see below).

Design object

ParameterTypeDefaultDescription
foreground_colorstring#000000Foreground (dot) color as hex.
background_colorstring#FFFFFFBackground color as hex.
error_correctionstringMError correction level: L, M, Q, or H.
dot_stylestringsquareDot shape style (e.g. square, rounded, dots, classy).
corner_stylestringsquareCorner square style (e.g. square, rounded, dot).
logo_urlstringURL of a logo image to overlay at center.
logo_sizenumber0.2Logo size as a fraction of the QR code (0.1–0.4).
quiet_zoneinteger1Number of module-width quiet zone around the code.

Request examples

Terminal window
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
}
}'

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?