myqr REST API
Last updated November 15, 2026
Use the API to create and update dynamic QR codes from your own apps, spreadsheets or automation tools, and to read how often each code is scanned. The API is included with Pro.
Authentication
Create a key under Settings → API keys. Send it in the Authorization header of every request. A key can manage all of your codes, so keep it on a server, never in a web page or app that others can download. Delete a key there and it stops working at once.
curl https://myqr.sh/api/v1/links \
-H "Authorization: Bearer myqr_your_key"Requests and responses
- Base URL:
https://myqr.sh/api/v1 - Send JSON bodies with
Content-Type: application/json. Responses are JSON. - Dates are ISO 8601 strings in UTC. Where you send a date you can also send milliseconds since 1970.
visitscounts every counted visit;scansare visits from the QR code andclicksare visits from the short link itself. Repeat visits from the same person within an hour count once, and bots aren't counted.qrContentis the text to encode if you draw the QR code yourself. It adds?qr=1so scans are told apart from clicks.typeis"url"for a code that opens a website, or"file","card"or"site"for a code that opens a file, business card or page we host; for those,urlis the address of the hosted page. Files, cards and pages are created in the dashboard. The API creates"url"codes, and sending a newurlin aPATCHturns a hosted code into a website code.
The code object
{
"id": "k57f3m1x9c2v8b4n6q0w5e7r1t3y9u2i",
"domain": "myqr.sh",
"key": "menu",
"shortUrl": "https://myqr.sh/menu",
"qrContent": "https://myqr.sh/menu?qr=1",
"url": "https://example.com/menu",
"type": "url",
"title": "Lunch menu",
"notes": null,
"archived": false,
"passwordProtected": false,
"expiresAt": null,
"expiredUrl": null,
"visits": 128,
"scans": 112,
"clicks": 16,
"lastVisitAt": "2026-11-14T09:30:12.000Z",
"utm": { "source": "qr", "medium": "print", "campaign": "spring-menu", "term": null, "content": null },
"campaignId": "j97a2b8c4d6e1f3g5h7i9k0l2m4n6p8q",
"trackConversions": true,
"conversions": 9,
"createdAt": "2026-11-01T17:02:44.000Z"
}Endpoints
Create a codePOST/links
Creates a code. Only url is required.
url: where the code goes.https://is added if you leave it off.key: the short link ending, likemenuinmyqr.sh/menu. Leave it out for a random one.domain: one of your connected custom domains. Defaults tomyqr.sh.title,notes: for your own reference.expiresAtandexpiredUrl: stop redirecting after a date, optionally sending later visitors to another page.password: visitors must enter it before they're redirected.utm: UTM tags added to the destination when someone scans, as{ "source", "medium", "campaign", "term", "content" }. A tag already inurlwins. Hosted pages never get them.campaignId: the campaign the code belongs to (copy the id from the campaign page's address). An emptyutm.campaignis filled with the campaign's slug.trackConversions:trueadds a signedmyqr_cidtoken to the destination so your site or server can report conversions.
curl -X POST https://myqr.sh/api/v1/links \
-H "Authorization: Bearer myqr_your_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/menu", "key": "menu", "title": "Lunch menu"}'Returns 201 with the new code.
List codesGET/links
Lists your codes, newest first. Query parameters: limit (1 to 100, default 50), cursor (from the previous page) and archived=true for archived codes.
{ "data": [ { "id": "…", "shortUrl": "https://myqr.sh/menu", … } ], "nextCursor": "…" }When nextCursor is null there are no more pages.
Get a codeGET/links/{id}
Returns one code.
Update a codePATCH/links/{id}
Changes a code. Send only the fields to change: url, key, title, notes, expiresAt, expiredUrl, password, utm, campaignId, trackConversions and archived. Send null to clear title, notes, expiresAt, expiredUrl, password, utm or campaignId. A utm object replaces all the code's tags. Printed codes open the new url right away. Changing key changes the short link, so codes already printed with the old one stop working; the domain can't be changed.
curl -X PATCH https://myqr.sh/api/v1/links/k57f3m1x9c2v8b4n6q0w5e7r1t3y9u2i \
-H "Authorization: Bearer myqr_your_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/dinner"}'Delete a codeDELETE/links/{id}
Deletes a code and its visit history. Returns 204. Printed copies of a deleted code stop working.
Scan statsGET/links/{id}/stats
Visit counts for the last days days (1 to 365, default 30), including today, in UTC.
{
"id": "k57f3m1x9c2v8b4n6q0w5e7r1t3y9u2i",
"from": "2026-10-16",
"to": "2026-11-14",
"visits": 128, "scans": 112, "clicks": 16,
"daily": [ { "date": "2026-10-16", "visits": 3, "scans": 3 }, … ],
"countries": [ { "value": "CA", "visits": 97 }, … ],
"cities": […], "devices": […], "browsers": […], "os": […], "referrers": […]
}Each breakdown lists the top 10 values.
Report a conversionPOST/conversions
Reports a conversion from your server, for checkouts and CRMs. Turn on conversion tracking on the code's Settings tab and add the goal under Settings → Tracking first. Read the myqr_cid parameter when the visitor lands on your site, keep it with their session or order, and send it back when they convert.
cid(required): themyqr_cidvalue. It must come from one of your own codes and be inside your attribution window (30 days unless you change it).goal(required): a goal key, likepurchase.valueandcurrency: the amount and a three-letter currency code. Without a value, the goal's default is used. Values above 1,000,000 are capped.orderId: counts once per code and goal. Without one, each token counts once per goal.
curl -X POST https://myqr.sh/api/v1/conversions \
-H "Authorization: Bearer myqr_your_key" \
-H "Content-Type: application/json" \
-d '{"cid": "1.k57f3m1x….", "goal": "purchase", "value": 49.99, "currency": "USD", "orderId": "1234"}'Returns 201 with { "id": "…", "duplicate": false }, or 200 with "duplicate": true when it was already counted. A conversion that can't be counted returns 422 with one of these codes: invalid_token, expired, unknown_code, not_tracking, not_pro, unknown_goal, invalid_value, invalid_currency or invalid_order_id. Each code accepts about 1,000 conversions an hour.
On websites, the website tag does this for you without a key: myqr("conversion", "purchase", { value: 49.99, currency: "USD", orderId: "1234" }).
Errors
Errors use standard status codes and a body like this:
{ "error": { "code": "invalid_request", "message": "That short link is already taken." } }400invalid_request,invalid_bodyorinvalid_parameter: the message says what to fix.401unauthorized: the key is missing, wrong or deleted.403forbidden: the account no longer has Pro.404not_found: no code with that id in your account.422: a conversion that can't be counted (seePOST /conversions).429rate_limited: wait for the number of seconds in theRetry-Afterheader.
Limits
- 120 requests a minute per account.
- Creating codes, through the API or a spreadsheet import, is limited to about 2,000 an hour.
- For hundreds of codes at once, the spreadsheet import may be quicker.