QR codes API
Examples for the common calls. The reference has every field.
Create a code
curl -X POST https://your-domain/api/v1/qr-codes \
-H "Authorization: Bearer $QRHOOKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Spring flyer","type":"url","data":{"url":"https://example.com/spring"}}'
The response has the new code, including the shortCode that goes into https://your-domain/s/<shortCode>.
Add "utmParams":{"utmSource":"flyer","utmContent":"front-door"} to tag a code. The values go on url destinations and on each recorded scan.
List codes
curl -H "Authorization: Bearer $QRHOOKS_API_KEY" \
"https://your-domain/api/v1/qr-codes?limit=20&offset=0&type=url&isActive=true"
Returns { "data": [...], "pagination": {...} }.
Change the destination
curl -X PATCH https://your-domain/api/v1/qr-codes/$ID \
-H "Authorization: Bearer $QRHOOKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"url":"https://example.com/summer"}}'
The printed code keeps working and scans go to the new URL straight away.
Get the image
curl -H "Authorization: Bearer $QRHOOKS_API_KEY" \
"https://your-domain/api/v1/qr-codes/$ID/image?format=png&size=1024" -o code.png
format is svg (default) or png, and size is 64 to 2048 pixels, default 512. Images are plain black on white. Dashboard styling isn't applied.
Delete a code
curl -X DELETE https://your-domain/api/v1/qr-codes/$ID \
-H "Authorization: Bearer $QRHOOKS_API_KEY"
Deleting removes the code and its scans. Printed copies then show a "not found" page. To stop a code but keep its history, send {"isActive":false} in a PATCH instead.