{"components":{"headers":{"RetryAfter":{"description":"Seconds until the window recovers. Windows are sliding, so the limit recovers within this many seconds; it may recover sooner.","required":true,"schema":{"format":"int64","minimum":0,"type":"integer"}},"XRateLimitLimit":{"description":"The limit of the window that was hit. Present only when exactly one limit applies.","required":false,"schema":{"format":"int64","minimum":1,"type":"integer"}},"XRateLimitRemaining":{"description":"Always 0 on a 429.","required":false,"schema":{"enum":[0],"type":"integer"}},"XRateLimitReset":{"description":"Unix seconds. The window recovers by then; equals now + Retry-After.","required":false,"schema":{"format":"int64","type":"integer"}}},"requestBodies":{"CreateLink":{"content":{"application/json":{"schema":{"properties":{"destination":{"format":"uri","type":"string"},"expires_at":{"type":"integer"},"folder_id":{"description":"所属フォルダの id。省略または null は未分類。","type":["string","null"]},"host":{"type":"string"},"slug":{"pattern":"^[a-z0-9-]{3,64}$","type":"string"},"tags":{"items":{"maxLength":32,"type":"string"},"maxItems":10,"type":"array"},"targets":{"items":{"$ref":"#/components/schemas/LinkTarget"},"maxItems":2,"type":"array"},"title":{"maxLength":120,"type":"string"}},"required":["destination"],"type":"object"}}},"required":true},"PatchLink":{"content":{"application/json":{"schema":{"properties":{"destination":{"format":"uri","type":"string"},"expires_at":{"type":["integer","null"]},"folder_id":{"description":"省略すると現在のフォルダを保持する。null または空文字で未分類に戻す。","type":["string","null"]},"if_version":{"type":"integer"},"slug":{"description":"作成から 10 分以内・クリック 0 件・active のときだけ変更できる。旧 slug は残り、転送を続ける。既に使われている slug は 409 conflict。省略 / null は変更なし。","pattern":"^[a-z0-9-]{3,64}$","type":["string","null"]},"tags":{"items":{"maxLength":32,"type":"string"},"maxItems":10,"type":"array"},"targets":{"description":"省略すると現在の targets を保持する。null または [] で全件削除する。配列を送ると全置換になる（android だけ送ると ios は消える）。","items":{"$ref":"#/components/schemas/LinkTarget"},"maxItems":2,"type":["array","null"]},"title":{"maxLength":120,"type":["string","null"]}},"type":"object"}}},"required":true}},"responses":{"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited. Retry-After is always present. X-RateLimit-Limit / Remaining / Reset are present together only when a single window limit applies (daily link quota, per-link patch limit, daily patch quota, hourly batch quota). Quota (plan) limits and anti-abuse paths return Retry-After only.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}}}},"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":{"$ref":"#/components/schemas/BatchItem"},"type":"array"},"next_cursor":{"description":"次のページの cursor。null なら最後のページ","type":["string","null"]}},"type":"object"},"BatchItem":{"properties":{"batch_id":{"type":"string"},"class":{"enum":["bulk"],"type":"string"},"created_at":{"type":"integer"},"destination":{"format":"uri","type":"string"},"expires_at":{"type":["integer","null"]},"hold":{"type":["string","null"]},"host":{"type":"string"},"index":{"description":"POST /v1/batches の items 配列と同じ 0 始まりの順番","type":"integer"},"slug":{"type":["string","null"]},"state":{"enum":["active","revoked","stopped","held"],"type":"string"},"token":{"type":"string"},"updated_at":{"type":"integer"},"url":{"format":"uri","type":"string"},"url_host":{"type":"string"}},"required":["index","token","url","class","destination","state"],"type":"object"},"BulkLinksRequest":{"properties":{"action":{"enum":["delete","archive","unarchive","add_tags","move"],"type":"string"},"folder_id":{"description":"action=move のときだけ使う。null または空文字は未分類へ移動する。key が無いと 422。","type":["string","null"]},"tags":{"description":"action=add_tags のときだけ使う。","items":{"maxLength":32,"type":"string"},"maxItems":10,"type":"array"},"tokens":{"description":"tenant が所有する editable link の token。所有しない token は skipped になる。","items":{"type":"string"},"maxItems":100,"minItems":1,"type":"array"}},"required":["action","tokens"],"type":"object"},"BulkLinksResult":{"properties":{"action":{"type":"string"},"skipped":{"type":"integer"},"tokens":{"items":{"type":"string"},"type":"array"},"updated":{"type":"integer"}},"type":"object"},"ClickCatalog":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/ClickCatalogColumn"},"type":"array"},"masking":{"properties":{"ipv4":{"type":"string"},"ipv6":{"type":"string"}},"type":"object"},"plan":{"enum":["free","starter","pro","business"],"type":"string"},"updated":{"type":"string"},"version":{"type":"integer"}},"required":["version","updated","plan","masking","columns"],"type":"object"},"ClickCatalogColumn":{"properties":{"default_visible":{"description":"一覧で既定表示にするか","type":"boolean"},"display":{"enum":["list","detail","masked"],"type":"string"},"export":{"type":"boolean"},"format":{"enum":["badge","code","ua",null],"type":["string","null"]},"key":{"type":"string"},"label_en":{"type":"string"},"label_ja":{"type":"string"},"raw_display":{"type":"boolean"},"type":{"type":"string"}},"required":["key","label_ja","label_en","type","display","default_visible","export","raw_display"],"type":"object"},"ClickDetail":{"properties":{"catalog_version":{"type":"integer"},"class":{"type":["string","null"]},"event_id":{"type":"string"},"ip":{"description":"マスク値。include=raw かつ許可された plan のときだけ生値","type":["string","null"]},"ip_masked":{"type":"boolean"},"raw_available":{"description":"この plan が生 IP を見られるか","type":"boolean"},"raw_served":{"description":"今回の応答で生 IP を返したか","type":"boolean"},"referer_host":{"type":["string","null"]},"ts":{"description":"クリック時刻（UTC 秒）","type":["integer","null"]}},"required":["event_id","ip","ip_masked","raw_served","raw_available"],"type":"object"},"DayCount":{"properties":{"count":{"type":"integer"},"day":{"type":"string"}},"required":["day","count"],"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"detail":{"additionalProperties":true,"description":"Machine-readable extra fields for this code (for example items / limit_items on batch validation errors, or limit_month on quota errors).","type":"object"},"message":{"type":"string"},"request_id":{"description":"Request id; also returned in the X-Request-Id response header.","type":"string"}},"required":["code","message","request_id"],"type":"object"}},"required":["error"],"type":"object"},"Folder":{"properties":{"created_at":{"type":"integer"},"id":{"type":"string"},"link_count":{"description":"このフォルダに入っている link の数。一覧のみ。","type":"integer"},"name":{"maxLength":64,"type":"string"},"updated_at":{"type":"integer"}},"required":["id","name","created_at","updated_at"],"type":"object"},"FolderEnvelope":{"properties":{"folder":{"$ref":"#/components/schemas/Folder"}},"required":["folder"],"type":"object"},"FolderList":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/Folder"},"type":"array"},"limit":{"type":"integer"}},"required":["folders"],"type":"object"},"Link":{"properties":{"class":{"enum":["editable","bulk"],"type":"string"},"clicks":{"description":"click_daily / AE から集計した累計クリック数（一覧のみ）","type":"integer"},"created_at":{"type":"integer"},"destination":{"format":"uri","type":"string"},"expires_at":{"type":["integer","null"]},"folder_id":{"description":"所属フォルダの id。null は未分類。","type":["string","null"]},"safety":{"type":["string","null"]},"slug":{"type":["string","null"]},"state":{"enum":["active","expired","limit_reached","revoked","stopped","held","archived"],"type":"string"},"tags":{"items":{"maxLength":32,"type":"string"},"maxItems":10,"type":"array"},"targets":{"items":{"$ref":"#/components/schemas/LinkTarget"},"maxItems":2,"type":"array"},"title":{"maxLength":120,"type":["string","null"]},"title_source":{"description":"auto = 遷移先から自動取得、user = 利用者が入力、null = 未設定。","enum":["auto","user",null],"type":["string","null"]},"token":{"type":"string"},"updated_at":{"type":"integer"},"url":{"format":"uri","type":"string"}},"required":["token","url","class","destination","targets","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"]},"next_cursor":{"type":["string","null"]},"next_offset":{"type":["integer","null"]}},"required":["links"],"type":"object"},"LinkTarget":{"description":"editable link の OS 別の飛び先。最大 2 件（ios / android 各 1 件）。","properties":{"destination":{"format":"uri","maxLength":2048,"pattern":"^https://","type":"string"},"os":{"enum":["ios","android"],"type":"string"}},"required":["os","destination"],"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"},"Webhook":{"properties":{"active":{"description":"1 = active. The list endpoint returns active endpoints only.","enum":[0,1],"type":"integer"},"created_at":{"description":"unix seconds","type":"integer"},"id":{"type":"string"},"url":{"format":"uri","type":"string"}},"required":["id","url","active","created_at"],"type":"object"},"WebhookCreated":{"properties":{"id":{"type":"string"},"secret":{"description":"HMAC signing secret. Returned only in this response; store it when you create the endpoint.","type":"string"},"url":{"format":"uri","type":"string"}},"required":["id","url","secret"],"type":"object"},"WebhookList":{"properties":{"webhooks":{"items":{"$ref":"#/components/schemas/Webhook"},"type":"array"}},"required":["webhooks"],"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":{"$ref":"#/components/responses/RateLimited"},"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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"batch_id was already used with a different body (conflict)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"invalid batch (invalid json, missing or invalid batch_id, empty items, more items than the plan allows, invalid item, or a destination that is not https / not public / blocked); code is validation_failed. detail.plan, detail.items and detail.limit_items are present for count limits."},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/batches/{id}":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"description":"前のページの next_cursor","in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchEnvelope"}}},"description":"batch with paged items"}}}},"/v1/batches/{id}/stats":{"get":{"responses":{"200":{"description":"stats"}}}},"/v1/batches/{id}/stop":{"post":{"responses":{"200":{"description":"stopped"}}}},"/v1/click-catalog":{"get":{"description":"クリック項目カタログ。plan で見せられる列だけを返す。","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClickCatalog"}}},"description":"click catalog"}}}},"/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":{"$ref":"#/components/responses/RateLimited"},"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}/allowlist":{"put":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"hosts":{"items":{"type":"string"},"maxItems":100,"type":["array","null"]}},"required":["hosts"],"type":"object"}}},"required":true},"responses":{"200":{"description":"allowlist updated"},"404":{"description":"not found"},"422":{"description":"invalid allowlist entry"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"set the destination host allowlist"}},"/v1/domains/{host}/security":{"get":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"domain security settings"},"404":{"description":"not found"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"get the destination allowlist and signing settings"}},"/v1/domains/{host}/signing":{"patch":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"signing settings, with the secret only when it is first issued"},"404":{"description":"not found"},"422":{"description":"invalid ttl_seconds"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"enable or disable link signing and set the expiry window"}},"/v1/domains/{host}/signing/rotate":{"post":{"parameters":[{"in":"path","name":"host","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"new secret and signing settings"},"404":{"description":"not found"},"409":{"description":"signing is not enabled"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"rotate the link signing secret"}},"/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":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearer":[]},{"cookieAuth":[]}],"summary":"verify TXT and create the Cloudflare hostname"}},"/v1/folders":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderList"}}},"description":"folders"}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"description":"tenant 内で大文字小文字を無視して一意。","maxLength":64,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderEnvelope"}}},"description":"created"},"409":{"description":"同じ名前のフォルダがある、または上限（200）に達した"},"422":{"description":"invalid name"}}}},"/v1/folders/{id}":{"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"moved":{"type":"integer"},"name":{"type":"string"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"deleted。中の link は消さず未分類に戻す。"},"404":{"description":"not found"}}},"patch":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"maxLength":64,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderEnvelope"}}},"description":"renamed"},"404":{"description":"not found"},"409":{"description":"同じ名前のフォルダがある"}}}},"/v1/links":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"maximum":1000,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"sort","schema":{"default":"created_desc","enum":["created_desc","created_asc","clicks_desc","clicks_asc"],"type":"string"}},{"description":"sort と組み合わせるページング。created_desc は cursor も使える。clicks_* は offset + limit <= 500。","in":"query","name":"offset","schema":{"default":0,"maximum":10000,"minimum":0,"type":"integer"}},{"description":"このタグを持つ link だけを返す。","in":"query","name":"tag","schema":{"type":"string"}},{"description":"フォルダ id。`none` で未分類だけを返す。省略すると全件。","in":"query","name":"folder","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"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/links/bulk":{"post":{"description":"最大 100 件の editable link を一括で削除（revoke）/ アーカイブ / 解除 / タグ付けする。tenant が所有しない token は skipped。更新した件数と token は audit（delete は link.bulk_revoke など）に残す。","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLinksRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLinksResult"}}},"description":"updated"},"401":{"description":"unauthorized"},"403":{"description":"forbidden（scope 不足、CSRF 不一致、tenant_under_review）"},"422":{"description":"invalid action, tokens, or tags"}}}},"/v1/links/{token}":{"delete":{"description":"Editable links require links:write. Bulk links require batches:write.","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":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/links/{token}/clicks/{event_id}":{"get":{"description":"クリック 1 件の詳細。IP は既定でマスクする。生値（include=raw）は Pro / Business の dashboard session だけが取得でき、閲覧は audit_events に残る。API key で include=raw を指定すると 403。","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}},{"in":"path","name":"event_id","required":true,"schema":{"type":"string"}},{"description":"raw は dashboard session のみ。API key は 403。","in":"query","name":"include","required":false,"schema":{"default":"masked","enum":["raw","masked"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClickDetail"}}},"description":"click detail"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"plan limit"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"forbidden（API key で include=raw）"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"not found"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"raw storage unavailable"}}}},"/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/audit":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"before","schema":{"type":"integer"}},{"in":"query","name":"before_id","schema":{"type":"string"}},{"in":"query","name":"category","schema":{"enum":["link","batch","key","domain","webhook","tenant","billing"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"events":{"items":{"properties":{"action":{"type":"string"},"actor_id":{"type":["string","null"]},"actor_type":{"type":"string"},"created_at":{"type":"integer"},"id":{"type":"string"},"target_id":{"type":["string","null"]},"target_type":{"type":"string"}},"type":"object"},"type":"array"},"next_before":{"type":["integer","null"]},"next_id":{"type":["string","null"]}},"type":"object"}}},"description":"audit events"},"401":{"description":"unauthorized"},"403":{"description":"session required"},"422":{"description":"invalid parameter"}},"summary":"tenant audit log"}},"/v1/me/export":{"get":{"description":"Session only. API keys receive 403. The payload omits password hashes and internal body hashes.","responses":{"200":{"description":"account export"},"401":{"description":"unauthorized"},"403":{"description":"session required"}},"security":[{"cookieAuth":[]}],"summary":"Export account data"}},"/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/me/webhooks":{"get":{"description":"Returns the tenant's active endpoints. The signing secret is not included. Creating endpoints requires Pro or Business; on Free the list is empty.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}},"description":"webhooks"},"403":{"description":"scope required: an API key needs both links:write and stats:read (forbidden)"}},"security":[{"bearer":["links:write","stats:read"]},{"cookieAuth":[]}],"summary":"list webhook endpoints"},"post":{"description":"The URL must be https and must not point at a private host. The signing secret is returned once, in this response.","requestBody":{"content":{"application/json":{"schema":{"properties":{"url":{"description":"https URL on a public host, up to 2048 characters","format":"uri","type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}},"description":"created. secret is returned once"},"403":{"description":"scope required (forbidden), Pro or Business plan required (plan_required), tenant under review (tenant_under_review), or a missing/invalid session CSRF token or Origin (forbidden)"},"409":{"description":"endpoint limit reached (conflict)"},"422":{"description":"invalid body or url (invalid json, url missing or not a string, url is not a valid URL, url is not https, url has no host, url is a private host, or url is longer than 2048 characters); code is validation_failed"}},"security":[{"bearer":["links:write","stats:read"]},{"cookieAuth":[]}],"summary":"register a webhook endpoint (Pro: 1, Business: 5)"}},"/v1/me/webhooks/{id}":{"delete":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"deactivated"},"403":{"description":"scope required: an API key needs both links:write and stats:read (forbidden), or a missing/invalid session CSRF token or Origin (forbidden)"},"404":{"description":"not found"}},"security":[{"bearer":["links:write","stats:read"]},{"cookieAuth":[]}],"summary":"deactivate a webhook endpoint"}},"/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-stg.lyk.jp"}]}