{"openapi":"3.1.0","info":{"title":"QRLynx Public API","version":"1.0.0","description":"Automate dynamic URL QR creation, destination updates, scan summaries and SVG output with scoped API keys on Business and Enterprise. Per-key allowances per 60 seconds: 120 shared reads/SVG renders, 60 creates, 20 shared destination/name updates. An additional 300-request IP backstop per 60 seconds applies before key authentication. These are steady-state budgets, not strict instantaneous-burst guarantees. Plan active-code capacity applies separately to creation. The public OpenAPI document is exempt from API-key authentication and its IP backstop."},"servers":[{"url":"https://qrlynx.com/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Send your key as `Authorization: Bearer qrl_live_...`. Scopes: qr:read, qr:write."}},"headers":{"RateLimitLimit":{"description":"Configured allowance for the current per-key bucket.","schema":{"type":"integer"}},"RateLimitRemaining":{"description":"Remaining requests in the current per-key bucket.","schema":{"type":"integer"}},"RateLimitReset":{"description":"Per-key bucket reset time in Unix seconds.","schema":{"type":"integer","format":"int64"}},"RetryAfter":{"description":"Seconds to wait before retrying after a 429 response.","schema":{"type":"integer"}}},"responses":{"RateLimited":{"description":"Request budget exceeded. Honor Retry-After in seconds before retrying. Per-key rejections include the three X-RateLimit headers and a string error with retryAfterSeconds. Earlier IP rejections return an error-code object and omit the per-key headers.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/PerKeyRateLimitError"}]},"examples":{"perKey":{"summary":"Per-key bucket exhausted, example 60-second wait","value":{"error":"Too many requests. Please slow down and try again.","retryAfterSeconds":60}},"perIp":{"summary":"IP backstop rejected before authentication","value":{"error":{"code":"rate_limited"}}}}}}}},"schemas":{"Qr":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["url"]},"name":{"type":"string","nullable":true},"destination":{"type":"string","nullable":true},"short_url":{"type":"string"},"created_at":{"type":"string","nullable":true}}},"QrDetail":{"allOf":[{"$ref":"#/components/schemas/Qr"},{"type":"object","properties":{"scans":{"type":"integer"},"unique_scans":{"type":"integer"},"last_scanned_at":{"type":"string","nullable":true},"active":{"type":"boolean"}}}]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"PerKeyRateLimitError":{"type":"object","required":["error","retryAfterSeconds"],"properties":{"error":{"type":"string"},"retryAfterSeconds":{"type":"integer"}}}}},"paths":{"/qr":{"post":{"summary":"Create a dynamic URL QR code","description":"60 requests per API key per 60 seconds in the create bucket. Plan active dynamic QR capacity applies separately.","security":[{"bearerAuth":["qr:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["destination"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["url"]},"destination":{"type":"string","format":"uri","description":"http(s) URL the code redirects to"},"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Qr"},{"type":"object","properties":{"svg":{"type":"string"}}}]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing/invalid key"},"402":{"description":"Plan limit reached"},"403":{"description":"Insufficient scope or plan"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/qr/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a QR code (details + scan counts)","description":"120 requests per API key per 60 seconds, shared with SVG rendering.","security":[{"bearerAuth":["qr:read"]}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrDetail"}}}},"400":{"description":"Unsupported QR type (including GS1 Digital Link)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing/invalid key"},"403":{"description":"Insufficient scope or plan"},"404":{"description":"Not found"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"summary":"Repoint the destination and/or rename","description":"20 requests per API key per 60 seconds, shared across destination and name updates.","security":[{"bearerAuth":["qr:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"destination":{"type":"string","format":"uri"},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrDetail"}}}},"400":{"description":"Invalid request or unsupported QR type (including GS1 Digital Link)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing/invalid key"},"403":{"description":"Insufficient scope or plan"},"404":{"description":"Not found"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/qr/{id}.svg":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Render the QR code as an SVG image","description":"120 requests per API key per 60 seconds, shared with QR detail reads.","security":[{"bearerAuth":["qr:read"]}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"image/svg+xml":{"schema":{"type":"string"}}}},"400":{"description":"Unsupported QR type (including GS1 Digital Link)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing/invalid key"},"403":{"description":"Insufficient scope or plan"},"404":{"description":"Not found"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}