{"components":{"requestBodies":{"CreateLink":{"content":{"application/json":{"schema":{"properties":{"destination":{"format":"uri","type":"string"},"expires_at":{"type":"integer"},"host":{"type":"string"},"slug":{"pattern":"^[a-z0-9-]{3,64}$","type":"string"}},"required":["destination"],"type":"object"}}},"required":true},"PatchLink":{"content":{"application/json":{"schema":{"properties":{"destination":{"format":"uri","type":"string"},"expires_at":{"type":["integer","null"]},"if_version":{"type":"integer"}},"type":"object"}}},"required":true}},"schemas":{"Batch":{"properties":{"batch_id":{"type":"string"},"count":{"type":"integer"},"created_at":{"type":"integer"},"hold":{"type":["string","null"]},"state":{"type":"string"},"stopped_at":{"type":["integer","null"]},"updated_at":{"type":"integer"}},"type":"object"},"BatchEnvelope":{"properties":{"batch":{"$ref":"#/components/schemas/Batch"},"items":{"items":{"type":"object"},"type":"array"}},"type":"object"},"DayCount":{"properties":{"count":{"type":"integer"},"day":{"type":"string"}},"required":["day","count"],"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"Link":{"properties":{"class":{"enum":["editable","bulk"],"type":"string"},"created_at":{"type":"integer"},"destination":{"format":"uri","type":"string"},"expires_at":{"type":["integer","null"]},"safety":{"type":["string","null"]},"slug":{"type":["string","null"]},"state":{"enum":["active","expired","revoked","stopped"],"type":"string"},"token":{"type":"string"},"updated_at":{"type":"integer"},"url":{"format":"uri","type":"string"}},"required":["token","url","class","destination","state"],"type":"object"},"LinkEnvelope":{"properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"],"type":"object"},"LinkList":{"properties":{"links":{"items":{"$ref":"#/components/schemas/Link"},"type":"array"},"next":{"type":["string","null"]}},"required":["links"],"type":"object"},"Me":{"properties":{"limits":{"type":"object"},"plan":{"enum":["free","paid"],"type":"string"},"quota":{"type":"object"},"tenant":{"type":"object"},"usage":{"type":"object"}},"type":"object"},"Stats":{"properties":{"days":{"items":{"$ref":"#/components/schemas/DayCount"},"type":"array"},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"token":{"type":"string"},"total":{"type":"integer"}},"required":["total","days"],"type":"object"},"TenantStats":{"properties":{"batches":{"properties":{"active":{"type":"integer"},"total":{"type":"integer"}},"type":"object"},"from":{"type":"string"},"human":{"type":"integer"},"links":{"properties":{"active":{"type":"integer"},"total":{"type":"integer"}},"type":"object"},"period_days":{"type":"integer"},"series":{"items":{"$ref":"#/components/schemas/DayCount"},"type":"array"},"to":{"type":"string"},"total":{"type":"integer"}},"required":["from","to","period_days","total","human","links","batches","series"],"type":"object"}},"securitySchemes":{"bearer":{"scheme":"bearer","type":"http"},"cookieAuth":{"in":"cookie","name":"__Host-lyk_session","type":"apiKey"}}},"info":{"title":"lyk.sh API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/healthz":{"get":{"responses":{"200":{"description":"ok"}},"security":[]}},"/openapi.json":{"get":{"responses":{"200":{"description":"OpenAPI"}},"security":[]}},"/v1/auth/logout":{"post":{"responses":{"204":{"description":"logged out"}},"security":[{"cookieAuth":[]}],"summary":"end the session"}},"/v1/auth/logout-all":{"post":{"responses":{"204":{"description":"logged out everywhere"},"403":{"description":"csrf or session required"}},"security":[{"cookieAuth":[]}],"summary":"end every session of the user"}},"/v1/auth/magic-link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"202":{"description":"accepted"},"422":{"description":"invalid email"},"429":{"description":"rate limited"},"503":{"description":"mail delivery failed"}},"security":[],"summary":"send a magic link"}},"/v1/auth/oauth/{provider}/callback":{"get":{"responses":{"302":{"description":"redirect to dashboard or signup error"}},"security":[],"summary":"complete an OAuth login flow"}},"/v1/auth/oauth/{provider}/start":{"get":{"responses":{"302":{"description":"redirect to provider"},"503":{"description":"provider is not configured"}},"security":[],"summary":"start an OAuth login flow"}},"/v1/auth/providers":{"get":{"responses":{"200":{"description":"provider flags"}},"security":[],"summary":"list enabled authentication providers"}},"/v1/auth/session":{"get":{"responses":{"200":{"description":"session and csrf token"},"401":{"description":"no session"}},"security":[{"cookieAuth":[]}],"summary":"current session"}},"/v1/auth/verify":{"post":{"responses":{"200":{"description":"session cookie and csrf token"},"401":{"description":"invalid or used token"},"403":{"description":"invalid origin"}},"security":[],"summary":"verify a magic link and start a session"}},"/v1/batches":{"get":{"responses":{"200":{"description":"list batches"}}},"post":{"responses":{"200":{"description":"created"}}}},"/v1/batches/{id}":{"get":{"responses":{"200":{"description":"batch"}}}},"/v1/batches/{id}/stats":{"get":{"responses":{"200":{"description":"stats"}}}},"/v1/batches/{id}/stop":{"post":{"responses":{"200":{"description":"stopped"}}}},"/v1/contact":{"post":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"category":{"enum":["general","abuse","business"],"type":"string"},"email":{"type":"string"},"lang":{"enum":["ja","en"],"type":"string"},"message":{"type":"string"},"name":{"type":"string"},"target_url":{"description":"required when category is abuse","type":"string"},"turnstile_token":{"type":"string"}},"required":["category","email","message"],"type":"object"}}},"required":true},"responses":{"200":{"description":"accepted and sent"},"403":{"description":"origin, content-type, or turnstile check failed"},"413":{"description":"request body is too large"},"422":{"description":"validation failed"},"429":{"description":"rate limited"},"502":{"description":"mail delivery failed"},"503":{"description":"mail is not configured, or the contact form is disabled"}},"security":[],"summary":"send a contact inquiry by email"}},"/v1/domains":{"get":{"responses":{"200":{"description":"domains"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"list custom domains"},"post":{"responses":{"201":{"description":"pending domain with TXT and CNAME"},"403":{"description":"paid plan required"},"409":{"description":"limit or duplicate"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"register a custom domain (paid)"}},"/v1/domains/{host}":{"delete":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"removed or removing"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"remove a domain"},"get":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"domain"},"404":{"description":"not found"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"get a domain"}},"/v1/domains/{host}/verify":{"post":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"pending or active"},"403":{"description":"paid plan required"},"429":{"description":"throttled"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"verify TXT and create the Cloudflare hostname"}},"/v1/links":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"maximum":1000,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkList"}}},"description":"links"}}},"post":{"parameters":[{"description":"同じ key の再送は同じ link を返す","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/CreateLink"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkEnvelope"}}},"description":"replayed (same link)"},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkEnvelope"}}},"description":"created"},"422":{"description":"invalid destination"}}}},"/v1/links/{token}":{"delete":{"responses":{"200":{"description":"revoked"}}},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkEnvelope"}}},"description":"link"}}},"patch":{"requestBody":{"$ref":"#/components/requestBodies/PatchLink"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkEnvelope"}}},"description":"updated"},"429":{"description":"patch limit"}}}},"/v1/links/{token}/stats":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}},"description":"stats"}}}},"/v1/me":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"me"}}}},"/v1/me/keys":{"get":{"responses":{"200":{"description":"keys"}},"security":[{"cookieAuth":[]}],"summary":"list the tenant's keys"},"post":{"responses":{"201":{"description":"created, key shown once"},"409":{"description":"free plan limit"}},"security":[{"cookieAuth":[]}],"summary":"create a key (free: 1)"}},"/v1/me/keys/{id}":{"delete":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"revoked"},"404":{"description":"not found"}},"security":[{"cookieAuth":[]}],"summary":"revoke a key"}},"/v1/stats":{"get":{"parameters":[{"in":"query","name":"days","required":false,"schema":{"default":30,"maximum":90,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantStats"}}},"description":"tenant stats"}}}}},"security":[{"bearer":[]}],"servers":[{"url":"https://api.lyk.jp"}]}