{"openapi":"3.1.0","info":{"title":"FunnelKit Shortener API","version":"1.0.0","description":"Create and manage short links, domains and analytics. Authenticate with `Authorization: Bearer fks_...`."},"servers":[{"url":"https://linkapp-staging.funnelkit.com/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key starting with fks_"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}}}},"paths":{"/auth/signup":{"post":{"summary":"Create an account (invite code required during beta)","tags":["Auth"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":10,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":100},"inviteCode":{"type":"string","minLength":4,"maxLength":64},"inviteToken":{"type":"string","minLength":16,"maxLength":128}},"required":["email","password","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/login":{"post":{"summary":"Sign in with email and password","tags":["Auth"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"required":["email","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/logout":{"post":{"summary":"Sign out","tags":["Auth"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/me":{"get":{"summary":"Current user, workspace and role","tags":["Auth"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links":{"get":{"summary":"List links","tags":["Links"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"domain","in":"query","required":false,"schema":{"type":"string"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a short link","tags":["Links"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"slug":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"domain":{"type":"string","maxLength":253},"title":{"type":"string","maxLength":200},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"password":{"type":"string","minLength":8,"maxLength":128},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiredUrl":{"type":"string","minLength":1,"maxLength":2048},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"type":"string","minLength":1,"maxLength":2048},"androidUrl":{"type":"string","minLength":1,"maxLength":2048},"geo":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},"utm":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"domain":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string"},"url":{"type":"string"},"title":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"hasPassword":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"expiredUrl":{"type":["string","null"]},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"type":["string","null"]},"androidUrl":{"type":["string","null"]},"geo":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false},{"type":"null"}]},"archived":{"type":"boolean"},"banned":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","workspaceId","domain","slug","shortUrl","url","title","tags","hasPassword","expiresAt","expiredUrl","redirectType","iosUrl","androidUrl","geo","utm","archived","banned","createdAt","updatedAt"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/bulk":{"post":{"summary":"Create up to 50 links","tags":["Links"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"links":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"slug":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"domain":{"type":"string","maxLength":253},"title":{"type":"string","maxLength":200},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"password":{"type":"string","minLength":8,"maxLength":128},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiredUrl":{"type":"string","minLength":1,"maxLength":2048},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"type":"string","minLength":1,"maxLength":2048},"androidUrl":{"type":"string","minLength":1,"maxLength":2048},"geo":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},"utm":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false}},"required":["url"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}":{"get":{"summary":"Get a link","tags":["Links"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"domain":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string"},"url":{"type":"string"},"title":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"hasPassword":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"expiredUrl":{"type":["string","null"]},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"type":["string","null"]},"androidUrl":{"type":["string","null"]},"geo":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false},{"type":"null"}]},"archived":{"type":"boolean"},"banned":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","workspaceId","domain","slug","shortUrl","url","title","tags","hasPassword","expiresAt","expiredUrl","redirectType","iosUrl","androidUrl","geo","utm","archived","banned","createdAt","updatedAt"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a link (unlimited edits)","tags":["Links"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"slug":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"title":{"type":"string","maxLength":200},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"password":{"anyOf":[{"type":"string","minLength":8,"maxLength":128},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiredUrl":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]},"androidUrl":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]},"geo":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},{"type":"null"}]},"utm":{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false},"archived":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"domain":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string"},"url":{"type":"string"},"title":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"hasPassword":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"expiredUrl":{"type":["string","null"]},"redirectType":{"anyOf":[{"type":"number","const":301},{"type":"number","const":302}]},"iosUrl":{"type":["string","null"]},"androidUrl":{"type":["string","null"]},"geo":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z]{2}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2048}},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","maxLength":200},"medium":{"type":"string","maxLength":200},"campaign":{"type":"string","maxLength":200},"term":{"type":"string","maxLength":200},"content":{"type":"string","maxLength":200}},"additionalProperties":false},{"type":"null"}]},"archived":{"type":"boolean"},"banned":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","workspaceId","domain","slug","shortUrl","url","title","tags","hasPassword","expiresAt","expiredUrl","redirectType","iosUrl","androidUrl","geo","utm","archived","banned","createdAt","updatedAt"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a link","tags":["Links"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/stats":{"get":{"summary":"Click analytics for a link","tags":["Analytics"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"interval","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/qr":{"get":{"summary":"QR code (SVG)","tags":["Links"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":false,"schema":{"type":"string"}},{"name":"fg","in":"query","required":false,"schema":{"type":"string"}},{"name":"bg","in":"query","required":false,"schema":{"type":"string"}},{"name":"ecc","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stats":{"get":{"summary":"Workspace analytics","tags":["Analytics"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"interval","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stats/export":{"get":{"summary":"Raw clicks as CSV (Team plan)","tags":["Analytics"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"linkId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tags":{"get":{"summary":"List tags","tags":["Links"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"get":{"summary":"List domains","tags":["Domains"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Connect a custom domain","tags":["Domains"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hostname":{"type":"string","minLength":4,"maxLength":253}},"required":["hostname"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"summary":"Check DNS and certificate status","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"delete":{"summary":"Remove a domain","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces":{"get":{"summary":"Workspaces you belong to","tags":["Workspace"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a workspace","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace":{"get":{"summary":"Current workspace, plan limits and usage","tags":["Workspace"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/members":{"get":{"summary":"List members","tags":["Workspace"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/members/invite":{"post":{"summary":"Invite a member","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"default":"member","type":"string","enum":["admin","member","viewer"]}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys":{"get":{"summary":"List API keys","tags":["API keys"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an API key (shown once)","tags":["API keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys/{id}":{"delete":{"summary":"Revoke an API key","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing":{"get":{"summary":"Plan and billing status","tags":["Billing"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/checkout":{"post":{"summary":"Start Stripe Checkout","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"string","enum":["pro","team","scale"]},"interval":{"default":"month","type":"string","enum":["month","year"]}},"required":["plan"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/portal":{"post":{"summary":"Open the Stripe customer portal","tags":["Billing"],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}