{"openapi":"3.1.0","info":{"title":"Limen API","version":"1.1.0","description":"Create and manage Limen links, read your stats and register webhooks. Authenticate with `Authorization: Bearer lmn_…` (keys from Settings → API). Money is in cents. Limit: 60 requests per minute per key; replies carry X-RateLimit-* headers.","contact":{"url":"https://limen.ad/contact"},"termsOfService":"https://limen.ad/terms"},"servers":[{"url":"https://limen.ad/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"links","description":"Your locker links"},{"name":"stats","description":"Account totals"},{"name":"webhooks","description":"Get told when something happens"}],"paths":{"/links":{"get":{"tags":["links"],"summary":"List your links","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["links"],"summary":"Create a link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","url"],"properties":{"title":{"type":"string","maxLength":80},"url":{"type":"string","format":"uri","description":"The real destination (https://…)"},"slug":{"type":"string","pattern":"^[a-z0-9-]{3,32}$","description":"Optional custom name"},"steps":{"type":"integer","minimum":3,"maximum":5,"default":3},"release_at":{"type":"string","format":"date-time","nullable":true,"description":"Limited drop: closed until this moment"},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"Limited drop: closed after this moment"},"max_unlocks":{"type":"integer","minimum":1,"nullable":true,"description":"Limited drop: closed after this many unlocks"}}}}}},"responses":{"201":{"description":"The new link","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The custom name is already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Something in the data isn't valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{slug}":{"get":{"tags":["links"],"summary":"One link with its stats","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The link's name (the part after /s/)"}],"responses":{"200":{"description":"The link","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No link with that name in your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["links"],"summary":"Change a link (stats and address are kept)","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The link's name (the part after /s/)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Send only the fields you want to change","properties":{"title":{"type":"string","maxLength":80},"url":{"type":"string","format":"uri"},"slug":{"type":"string","pattern":"^[a-z0-9-]{3,32}$"},"steps":{"type":"integer","minimum":3,"maximum":5},"release_at":{"type":"string","format":"date-time","nullable":true,"description":"null clears it"},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"null clears it"},"max_unlocks":{"type":"integer","minimum":1,"nullable":true,"description":"null clears it"}}}}}},"responses":{"200":{"description":"The updated link","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Link"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No link with that name in your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Nothing to change, or a value isn't valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["links"],"summary":"Delete a link","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The link's name (the part after /s/)"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"},"slug":{"type":"string"}}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No link with that name in your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stats":{"get":{"tags":["stats"],"summary":"Totals for your account","parameters":[{"name":"days","in":"query","schema":{"type":"integer","enum":[7,28,90],"default":28}}],"responses":{"200":{"description":"Totals over the chosen period","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"days":{"type":"integer"},"views":{"type":"integer"},"unlocks":{"type":"integer"},"premium_unlocks":{"type":"integer"},"premium_checkouts":{"type":"integer"},"premium_earnings":{"$ref":"#/components/schemas/Money"},"ad_earnings":{"$ref":"#/components/schemas/Money"},"balance":{"type":"object","properties":{"total":{"type":"integer"},"available":{"type":"integer"},"on_hold":{"type":"integer"},"currency":{"type":"string"}}}}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"tags":["webhooks"],"summary":"List your webhooks","responses":{"200":{"description":"Your webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["webhooks"],"summary":"Add a webhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"https:// address, or a Discord channel webhook"},"events":{"type":"array","items":{"type":"string","enum":["*","link.unlocked","link.premium_unlocked","premium.sale"]},"default":["*"]}}}}}},"responses":{"201":{"description":"The webhook, including its secret (shown once)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The address can't be used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"delete":{"tags":["webhooks"],"summary":"Remove a webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed"},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A read-only key tried to change something","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No webhook with that id in your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (60 per minute per key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Your key from Settings → API (starts with lmn_)"}},"schemas":{"Link":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"destination_url":{"type":"string","format":"uri"},"steps":{"type":"integer","minimum":3,"maximum":5},"url":{"type":"string","format":"uri","description":"The locker page to share"},"premium_url":{"type":"string","format":"uri","description":"Straight to Premium checkout, credited to you"},"stats":{"type":"object","properties":{"views":{"type":"integer"},"unlocks":{"type":"integer"},"premium_unlocks":{"type":"integer"}}},"status":{"type":"string","enum":["open","scheduled","ended","sold_out"],"description":"Whether visitors can unlock it right now"},"release_at":{"type":"string","format":"date-time","nullable":true,"description":"Limited drop: closed until this moment"},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"Limited drop: closed after this moment"},"max_unlocks":{"type":"integer","nullable":true,"description":"Limited drop: closed after this many unlocks"},"remaining_unlocks":{"type":"integer","nullable":true,"description":"Unlocks left under max_unlocks; null when there is no cap"},"security_check":{"type":"object","nullable":true,"description":"Result of the destination's VirusTotal check; null until the first check has run","properties":{"status":{"type":"string","enum":["pending","clean","flagged","error"]},"engines_flagged":{"type":"integer","nullable":true},"engines_total":{"type":"integer","nullable":true},"checked_at":{"type":"string","format":"date-time","nullable":true}}},"created_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Money":{"type":"object","properties":{"amount":{"type":"integer","description":"cents"},"currency":{"type":"string"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"failures":{"type":"integer"},"last_status":{"type":"integer","nullable":true},"last_error":{"type":"string","nullable":true},"last_attempt_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"Only returned when the webhook is created"}}}}},"x-webhooks":{"description":"Deliveries are POSTs with JSON {id, type, created_at, data}. Headers: X-Limen-Event and X-Limen-Signature (t=<ms>,v1=<hex HMAC-SHA256 of `${t}.${body}` with your secret>). Answer 2xx within 5 seconds.","events":["link.unlocked","link.premium_unlocked","premium.sale"]}}