{"openapi":"3.0.3","info":{"title":"ShortIQ API","version":"1.1.0","description":"Create, list, retrieve, update, and delete ShortIQ short URLs from server-side applications."},"servers":[{"url":"/api/v1"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_..."}},"schemas":{"GeoRule":{"type":"object","required":["countryCode","destinationUrl"],"properties":{"countryCode":{"type":"string","pattern":"^[A-Za-z]{2}$"},"destinationUrl":{"type":"string","format":"uri"}}},"CreateShortUrl":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"customAlias":{"type":"string","nullable":true,"pattern":"^[a-z0-9-]{3,30}$"},"geoRules":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/GeoRule"}}}},"UpdateShortUrl":{"type":"object","minProperties":1,"properties":{"url":{"type":"string","format":"uri"},"customAlias":{"type":"string","nullable":true,"pattern":"^[a-z0-9-]{3,30}$"},"geoRules":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/GeoRule"}}}},"ShortUrl":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"slug":{"type":"string"},"shortUrl":{"type":"string","format":"uri"},"customAlias":{"type":"string","nullable":true},"totalClicks":{"type":"integer"},"geoRules":{"type":"array","items":{"$ref":"#/components/schemas/GeoRule"}},"creationSource":{"type":"string","enum":["dashboard","api"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}},"ShortUrlList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ShortUrl"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}},"paths":{"/short-urls":{"get":{"summary":"List short URLs","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Paginated short URLs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortUrlList"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"403":{"description":"Plan, account, or feature restriction"},"404":{"description":"Short URL not found"},"409":{"description":"Alias conflict"},"429":{"description":"Request or creation limit reached"}}},"post":{"summary":"Create a short URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShortUrl"}}}},"responses":{"201":{"description":"Short URL created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortUrl"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"403":{"description":"Plan, account, or feature restriction"},"404":{"description":"Short URL not found"},"409":{"description":"Alias conflict"},"429":{"description":"Request or creation limit reached"}}}},"/short-urls/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"get":{"summary":"Retrieve a short URL","responses":{"200":{"description":"Short URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortUrl"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"403":{"description":"Plan, account, or feature restriction"},"404":{"description":"Short URL not found"},"409":{"description":"Alias conflict"},"429":{"description":"Request or creation limit reached"}}},"patch":{"summary":"Update a short URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateShortUrl"}}}},"responses":{"200":{"description":"Updated short URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortUrl"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"403":{"description":"Plan, account, or feature restriction"},"404":{"description":"Short URL not found"},"409":{"description":"Alias conflict"},"429":{"description":"Request or creation limit reached"}}},"delete":{"summary":"Delete a short URL","responses":{"204":{"description":"Short URL deleted"},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"403":{"description":"Plan, account, or feature restriction"},"404":{"description":"Short URL not found"},"409":{"description":"Alias conflict"},"429":{"description":"Request or creation limit reached"}}}}}}