{"openapi":"3.1.0","info":{"title":"wir.bi URL shortener","version":"2.0.0","description":"Free URL shortener and QR code generator by Wirbi. Creating links over REST is not available: the web form requires a CAPTCHA. To create links programmatically, use the MCP endpoint at https://wir.bi/mcp (tool shorten_url), which also returns the editToken needed by customizeShortUrl. This spec covers checking codes, customizing a link you created and resolving short links. Rate limits apply per IP.","contact":{"name":"Wirbi","url":"https://www.wirbi.com"}},"servers":[{"url":"https://wir.bi"}],"paths":{"/api/shorten/check/{code}":{"get":{"operationId":"checkShortCode","summary":"Check whether a custom code is available","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-Za-z_-]{3,32}$"}}],"responses":{"200":{"description":"Availability verdict","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"type":["string","null"],"enum":["invalid","reserved","forbidden","taken",null]}},"required":["available"]}}}},"429":{"description":"Rate limit exceeded (120 requests / 15 min per IP)"}}}},"/api/shorten/{short}":{"patch":{"operationId":"customizeShortUrl","summary":"Customize (rename) the code of a short link","description":"Requires the editToken returned when the link was created. The previous code is released.","parameters":[{"name":"short","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-Za-z_-]{3,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["newShort","editToken"],"properties":{"newShort":{"type":"string","pattern":"^[0-9A-Za-z_-]{3,32}$"},"editToken":{"type":"string","minLength":16,"maxLength":128}}}}}},"responses":{"200":{"description":"Link renamed (previousShort) or unchanged (reason: same)","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Link"},{"type":"object","properties":{"previousShort":{"type":["string","null"]},"reason":{"type":["string","null"]}}}]}}}},"400":{"description":"Invalid, reserved or forbidden code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid editToken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Link not found"},"409":{"description":"Code already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (20 requests / 15 min per IP)"}}}},"/{short}":{"get":{"operationId":"resolveShortUrl","summary":"Resolve a short link","description":"Redirects (302) to the destination URL and counts the visit. 404 if the code does not exist or is inactive.","parameters":[{"name":"short","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-Za-z_-]{3,32}$"}}],"responses":{"302":{"description":"Redirect to destination","headers":{"Location":{"schema":{"type":"string","format":"uri"}}}},"404":{"description":"Unknown or inactive code"}}}}},"components":{"schemas":{"Link":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"short":{"type":"string","pattern":"^[0-9A-Za-z_-]{3,32}$","description":"Short code"},"shortUrl":{"type":"string","format":"uri","description":"Full short link, e.g. https://wir.bi/aB3xY9z"},"url":{"type":"string","format":"uri","description":"Destination URL"},"qr":{"type":"string","description":"QR code as data:image/png;base64 URI. Points to the short link."},"customized":{"type":"boolean"},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["status","short","shortUrl","url"]},"Error":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"reason":{"type":["string","null"],"description":"invalid | reserved | forbidden | taken | same | token | conflict"},"message":{"type":["string","null"]},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"msg":{"type":"string"}}}}}}}}}