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.
  • visits counts every counted visit; scans are visits from the QR code and clicks are visits from the short link itself. Repeat visits from the same person within an hour count once, and bots aren't counted.
  • qrContent is the text to encode if you draw the QR code yourself. It adds ?qr=1 so scans are told apart from clicks.
  • type is "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, url is the address of the hosted page. Files, cards and pages are created in the dashboard. The API creates "url" codes, and sending a new url in a PATCH turns 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, like menu in myqr.sh/menu. Leave it out for a random one.
  • domain: one of your connected custom domains. Defaults to myqr.sh.
  • title, notes: for your own reference.
  • expiresAt and expiredUrl: 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 in url wins. Hosted pages never get them.
  • campaignId: the campaign the code belongs to (copy the id from the campaign page's address). An empty utm.campaign is filled with the campaign's slug.
  • trackConversions: true adds a signed myqr_cid token 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.

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): the myqr_cid value. 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, like purchase.
  • value and currency: 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." } }
  • 400 invalid_request, invalid_body or invalid_parameter: the message says what to fix.
  • 401 unauthorized: the key is missing, wrong or deleted.
  • 403 forbidden: the account no longer has Pro.
  • 404 not_found: no code with that id in your account.
  • 422: a conversion that can't be counted (see POST /conversions).
  • 429 rate_limited: wait for the number of seconds in the Retry-After header.

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.