{"openapi":"3.0.3","info":{"title":"QR-Byte API","version":"1.0.0","description":"Render a QR image for any text with no API key at POST \/api\/v1\/qr. Create, read, update, and delete saved QR codes, fetch scan stats, and render PNG or SVG images of a tracking URL with an API key. Send that key in the X-Api-Key header or as Authorization: Bearer. Create and revoke keys on the Settings page after you sign in. QR routes are limited to 60 requests per minute. Saved-code images encode the tracking URL, which records a scan and redirects to the destination. The keyless render is not stored."},"servers":[{"url":"https:\/\/qr-byte.com\/api","description":"QR-Byte API"}],"tags":[{"name":"QR codes"},{"name":"API keys"}],"paths":{"\/v1\/qr":{"post":{"tags":["QR codes"],"summary":"Render a QR code for any text","description":"No API key. The code is not stored and scans are not counted. format json returns svg and png_base64. format png or svg returns the image bytes. Limited to 60 requests per minute per address.","security":[],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["payload"],"properties":{"payload":{"type":"string","maxLength":2048,"example":"https:\/\/example.com"},"format":{"type":"string","enum":["json","png","svg"],"default":"json"},"size":{"type":"integer","minimum":64,"maximum":1024,"default":320},"foreground":{"type":"string","example":"#000000"},"background":{"type":"string","example":"#ffffff"}}}}}},"responses":{"200":{"description":"JSON with the SVG and a base64 PNG, or the image bytes when format is png or svg","content":{"application\/json":{"schema":{"type":"object","properties":{"payload":{"type":"string"},"svg":{"type":"string"},"png_base64":{"type":"string"}}}},"image\/png":{"schema":{"type":"string","format":"binary"}},"image\/svg+xml":{"schema":{"type":"string","format":"binary"}}}},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/qr.{format}":{"parameters":[{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["svg","png"]}},{"name":"payload","in":"query","required":true,"schema":{"type":"string","maxLength":2048},"description":"Exact text encoded in the QR code."},{"name":"size","in":"query","schema":{"type":"integer","minimum":64,"maximum":1024,"default":320}},{"name":"foreground","in":"query","schema":{"type":"string","example":"#000000"}},{"name":"background","in":"query","schema":{"type":"string","example":"#ffffff"}}],"get":{"tags":["QR codes"],"summary":"Render a PNG or SVG for any text","description":"No API key. The code is not stored. Limited to 60 requests per minute per address.","security":[],"responses":{"200":{"description":"SVG or PNG image of the payload","content":{"image\/svg+xml":{"schema":{"type":"string","format":"binary"}},"image\/png":{"schema":{"type":"string","format":"binary"}}}},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/qr-codes":{"get":{"tags":["QR codes"],"summary":"List your QR codes","security":[{"apiKey":[]}],"responses":{"200":{"description":"Up to 100 newest codes","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/QrCode"}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}},"post":{"tags":["QR codes"],"summary":"Create a QR code","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["destination_url"],"properties":{"destination_url":{"type":"string","format":"uri","example":"https:\/\/example.com\/welcome"},"foreground_color":{"type":"string","example":"#112233"},"background_color":{"type":"string","example":"#ffffff"}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/QrCode"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/qr-codes\/{id}":{"parameters":[{"$ref":"#\/components\/parameters\/codeId"}],"get":{"tags":["QR codes"],"summary":"Read a QR code","security":[{"apiKey":[]}],"responses":{"200":{"description":"The code","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/QrCode"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}},"patch":{"tags":["QR codes"],"summary":"Update a destination or colors","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"destination_url":{"type":"string","format":"uri"},"foreground_color":{"type":"string"},"background_color":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/QrCode"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}},"delete":{"tags":["QR codes"],"summary":"Delete a QR code","security":[{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/qr-codes\/{id}\/stats":{"parameters":[{"$ref":"#\/components\/parameters\/codeId"},{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start date, YYYY-MM-DD. Send to and timezone with it."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end date, YYYY-MM-DD."},{"name":"timezone","in":"query","schema":{"type":"string","example":"America\/Chicago"}}],"get":{"tags":["QR codes"],"summary":"Fetch scan stats","security":[{"apiKey":[]}],"responses":{"200":{"description":"Scan count, locations, destination history, and time breakdown","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ScanStats"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/qr-codes\/{id}\/image.{format}":{"parameters":[{"$ref":"#\/components\/parameters\/codeId"},{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["svg","png"]}},{"name":"size","in":"query","schema":{"type":"integer","minimum":64,"maximum":1024,"default":320}}],"get":{"tags":["QR codes"],"summary":"Render a QR code image","security":[{"apiKey":[]}],"responses":{"200":{"description":"SVG or PNG image of the tracking URL","content":{"image\/svg+xml":{"schema":{"type":"string","format":"binary"}},"image\/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/Unprocessable"},"429":{"$ref":"#\/components\/responses\/TooManyRequests"}}}},"\/v1\/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys","description":"Uses the account access token from sign-in, not an API key. Secrets are not returned.","security":[{"accountToken":[]}],"responses":{"200":{"description":"Keys for the signed-in account","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ApiKey"}}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}},"post":{"tags":["API keys"],"summary":"Generate an API key","security":[{"accountToken":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":80,"example":"CI"}}}}}},"responses":{"201":{"description":"The token is returned once","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKeyCreated"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"422":{"$ref":"#\/components\/responses\/Unprocessable"}}}},"\/v1\/api-keys\/{id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","security":[{"accountToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Revoked","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiKey"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/Unprocessable"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"},"accountToken":{"type":"http","scheme":"bearer","description":"Access token from POST \/api\/auth\/login."}},"parameters":{"codeId":{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Public code id"}},"responses":{"Unauthorized":{"description":"Missing or invalid credentials","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}},"NotFound":{"description":"Not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}},"Unprocessable":{"description":"Validation failed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}},"TooManyRequests":{"description":"Rate limit exceeded","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}},"schemas":{"Message":{"type":"object","properties":{"message":{"type":"string"}}},"QrCode":{"type":"object","properties":{"id":{"type":"string"},"destination_url":{"type":"string"},"foreground_color":{"type":"string"},"background_color":{"type":"string"},"tracking_url":{"type":"string"},"image":{"type":"object","properties":{"svg":{"type":"string"},"png":{"type":"string"}}},"stats_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ScanStats":{"type":"object","properties":{"code_id":{"type":"string"},"destination_url":{"type":"string"},"foreground_color":{"type":"string"},"background_color":{"type":"string"},"scan_count":{"type":"integer"},"locations":{"type":"array","items":{"type":"object"}},"history":{"type":"array","items":{"type":"object"}},"time":{"type":"object"}}},"ApiKey":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"prefix":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":"string","format":"date-time","nullable":true},"revoked_at":{"type":"string","format":"date-time","nullable":true}}},"ApiKeyCreated":{"allOf":[{"$ref":"#\/components\/schemas\/ApiKey"},{"type":"object","properties":{"token":{"type":"string","description":"Shown once. Store it now."}}}]}}}}