Skip to main content

Templates

Templates store reusable QR code styling (qrOptions) so you can apply a consistent look across links. The same qrOptions object is used when you patch a link's QR code.

All endpoints require an API key with the scope noted on each.


QR options

The qrOptions object describes the QR appearance. It follows the qr-code-styling schema. All fields are optional — omit any you don't want to customize, and the default is used.

Top-level

FieldTypeAllowed valuesDefaultDescription
widthnumberpx300Output width.
heightnumberpx300Output height.
typestringcanvas, svgcanvasRender mode.
datastringanyEncoded data (usually the link's dynamic URL). Normally set automatically.
imagestringURL / data URInullLogo/image overlaid in the center.
marginnumber≥ 0 (px)8Quiet-zone margin around the code.

qrOptions (encoding)

FieldTypeAllowed valuesDefault
typeNumbernumber040 (0 = auto-size)0
modestringNumeric, Alphanumeric, Byte, KanjiByte
errorCorrectionLevelstringL (7%), M (15%), Q (25%), H (30%)Q

dotsOptions (the body pattern)

FieldTypeAllowed valuesDefault
typestringsquare, dots, rounded, extra-rounded, classy, classy-roundedclassy-rounded
colorstringCSS color / hexblack

cornersSquareOptions (the eye frames)

FieldTypeAllowed valuesDefault
typestringsquare, dot, extra-roundedsquare
colorstringCSS color / hexblack

cornersDotOptions (the eye centers)

FieldTypeAllowed valuesDefault
typestringsquare, dotsquare
colorstringCSS color / hexblack

backgroundOptions

FieldTypeAllowed valuesDefault
colorstringCSS color / hexwhite

imageOptions (center logo placement)

FieldTypeAllowed valuesDefault
hideBackgroundDotsbooleantrue, falsefalse
imageSizenumber01 (fraction of QR size)0.5
marginnumber≥ 0 (px)0
crossOriginstringanonymous, use-credentialsanonymous
note

The ProLinksQR dashboard exposes a curated subset of these (e.g. dot patterns square / dots / rounded / extra-rounded and eye styles built from square, dot, and extra-rounded). The API accepts any value supported by qr-code-styling — see its documentation for the full range and gradient options.

Example qrOptions:

{
"width": 300,
"height": 300,
"margin": 8,
"qrOptions": { "typeNumber": 0, "mode": "Byte", "errorCorrectionLevel": "Q" },
"dotsOptions": { "color": "#1E88D4", "type": "rounded" },
"backgroundOptions": { "color": "#ffffff" },
"cornersSquareOptions": { "color": "#155f94", "type": "extra-rounded" },
"cornersDotOptions": { "color": "#155f94", "type": "dot" },
"imageOptions": { "imageSize": 0.4, "margin": 4, "crossOrigin": "anonymous" }
}

List templates

GET /templates

Scope: templates.read

curl https://api.prolinksqr.com/templates \
-H "Authorization: Basic key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response 200

{
"data": [
{ "id": "f12...903", "name": "Brand QR style", "qrOptions": { "width": 300 } }
]
}

Get a template

GET /templates/:id

Scope: templates.read

curl https://api.prolinksqr.com/templates/f12...903 \
-H "Authorization: Basic key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Create a template

POST /templates

Scope: templates.create

FieldTypeRequiredNotes
namestringyesMax 255 chars.
qrOptionsobjectyesSee QR options.
curl -X POST https://api.prolinksqr.com/templates \
-H "Authorization: Basic key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Brand QR style",
"qrOptions": {
"dotsOptions": { "color": "#1E88D4", "type": "rounded" },
"backgroundOptions": { "color": "#ffffff" }
}
}'

Response 200

{ "data": { "id": "f12...903", "name": "Brand QR style", "qrOptions": { "dotsOptions": { "color": "#1E88D4" } } } }

Update a template

PUT /templates/:id

Scope: templates.update

Both fields are optional on update.

FieldTypeRequiredNotes
namestringnoMax 255 chars.
qrOptionsobjectnoSee QR options.
curl -X PUT https://api.prolinksqr.com/templates/f12...903 \
-H "Authorization: Basic key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "name": "Brand QR style v2" }'

Delete a template

DELETE /templates/:id

Scope: templates.delete

curl -X DELETE https://api.prolinksqr.com/templates/f12...903 \
-H "Authorization: Basic key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"