{"openapi":"3.1.0","info":{"title":"Mintoly API","version":"1.0.0-alpha","description":"日時は UTC ISO 8601。金額は整数 `amount_minor` + `currency` + `exponent`（JPY の内部最小単位は銭 = exponent 2）。\n\nレスポンスは `{data, request_id}`、エラーは `{error:{code,message}, request_id}`。409=競合、422=審査未完、403=権限不足。\n\n購入・出品・出金・広告予算変更は `Idempotency-Key` 必須。売買/出金は AI エージェント単独では確定できない。"},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"OAuth 2.1 アクセストークン（開発時は /auth/dev-login）"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error","request_id"]},"Video":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["processing","in_review","published","unlisted","paused","archived","removed","failed"]},"rights_status":{"type":["string","null"],"enum":["pending","approved","rejected","disputed",null]},"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"category":{"type":["string","null"]},"language":{"type":["string","null"]},"duration_ms":{"type":["integer","null"]},"stream_uid":{"type":["string","null"]},"playback_url":{"type":["string","null"],"format":"uri","description":"再生できる動画ファイルの URL。未対応・未アップロードは null"},"thumbnail_url":{"type":["string","null"],"format":"uri"},"caption_langs":{"type":"array","items":{"type":"string"},"description":"字幕のある言語"},"view_count":{"type":"integer"},"owner":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"}},"required":["id","display_name"]},"original_creator":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"}},"required":["id","display_name"]},"channel":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"icon_url":{"type":["string","null"],"format":"uri"}},"required":["id","name","icon_url"],"description":"動画を公開しているチャンネル"},"published_at":{"type":["string","null"],"format":"date-time"},"last_sale":{"type":["object","null"],"properties":{"price":{"$ref":"#/components/schemas/Money"},"settled_at":{"type":"string","format":"date-time"}},"required":["price","settled_at"],"description":"直近に成立した売買（完了済み取引のみ）。評価額・出品価格ではない。履歴なしは null"},"ask_price":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"],"description":"所有者が決めた販売価格（USDC）。売りに出していなければ null"}]},"listing":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","reserved"]}},"required":["id","status"],"description":"販売価格で買える出品。active なら購入でき、reserved はほかの人が購入手続き中。売買が始まっていない・条件を満たさないときは null"}},"required":["id","status","rights_status","title","description","tags","category","language","duration_ms","stream_uid","playback_url","thumbnail_url","caption_langs","view_count","owner","original_creator","channel","published_at","last_sale","ask_price","listing"]},"Money":{"type":"object","properties":{"amount_minor":{"type":"integer"},"currency":{"type":"string","enum":["JPY","USDC"]},"exponent":{"type":"integer"}},"required":["amount_minor","currency","exponent"]},"Channel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"handle":{"type":"string","description":"URL に使う名前（/@handle）"},"description":{"type":"string"},"icon_url":{"type":["string","null"],"format":"uri"},"owner_id":{"type":"string","format":"uuid"},"video_count":{"type":"integer","description":"公開中の動画の本数"},"subscriber_count":{"type":"integer"}},"required":["id","name","handle","description","icon_url","owner_id","video_count","subscriber_count"]},"Comment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"body":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"}},"required":["id","display_name"]},"can_delete":{"type":"boolean","description":"書いた本人か動画の所有者なら true"}},"required":["id","body","created_at","author","can_delete"]},"Wallet":{"type":["object","null"],"properties":{"address":{"type":"string"},"chain":{"type":"string"},"verified_at":{"type":"string","format":"date-time"},"ad_partner":{"type":"boolean","description":"広告収益プログラムに参加しているか（ウォレット登録で参加）"}},"required":["address","chain","verified_at","ad_partner"]},"Payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["sale","ad_budget"]},"status":{"type":"string","enum":["requires_payment","confirmed","failed","expired"]},"amount":{"$ref":"#/components/schemas/Money"},"chain":{"type":"string","description":"solana-mainnet / solana-devnet"},"usdc_mint":{"type":["string","null"],"description":"USDC の mint"},"payer_address":{"type":"string"},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"legs":{"type":"array","items":{"type":"string"}}},"required":["address","amount","legs"]},"description":"それぞれのアドレスへ、この額の USDC を送る"},"signatures":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string","format":"date-time"}},"required":["id","purpose","status","amount","chain","usdc_mint","payer_address","recipients","signatures","expires_at"]},"AdCampaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"paused_reason":{"type":["string","null"]},"click_url":{"type":["string","null"]},"cta":{"type":"string"},"price":{"$ref":"#/components/schemas/Money"},"categories":{"type":"array","items":{"type":"string"}},"creative_ready":{"type":"boolean"},"creative_duration_ms":{"type":["integer","null"]},"playback_url":{"type":["string","null"],"format":"uri","description":"広告の動画（HLS）。処理が終わるまでは null"},"stats":{"type":"object","properties":{"impressions":{"type":"integer"},"engaged":{"type":"integer"},"clicks":{"type":"integer"},"spend":{"$ref":"#/components/schemas/Money"}},"required":["impressions","engaged","clicks","spend"]}},"required":["id","name","status","paused_reason","click_url","cta","price","categories","creative_ready","creative_duration_ms","playback_url","stats"]},"Ad":{"type":["object","null"],"properties":{"impression_id":{"type":"string","format":"uuid"},"playback_url":{"type":["string","null"],"format":"uri"},"duration_ms":{"type":"integer"},"click_url":{"type":["string","null"]},"cta":{"type":"string"},"advertiser":{"type":"string"},"skippable_after_ms":{"type":"integer"}},"required":["impression_id","playback_url","duration_ms","click_url","cta","advertiser","skippable_after_ms"]},"RecommendationReason":{"type":"object","properties":{"kind":{"type":"string","enum":["creator","subscribed","category","tag","explore","popular","fresh","quality"]},"label":{"type":["string","null"],"description":"kind が creator / subscribed / category / tag / explore のときの表示名"}},"required":["kind","label"]},"Rewards":{"type":"object","properties":{"estimated":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"推定（集計中・変動あり）"}]},"confirmed":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"確定（保留期間中）"}]},"available":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"出金可能"}]},"by_source":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ad","first_sale","resale"]},"estimated":{"$ref":"#/components/schemas/Money"},"confirmed":{"$ref":"#/components/schemas/Money"},"available":{"$ref":"#/components/schemas/Money"}},"required":["source","estimated","confirmed","available"]}},"entries":{"type":"array","items":{"type":"object","properties":{"pool_id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["ad","first_sale","resale"]},"source_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Money"},"state":{"type":"string","enum":["pending","approved","available","reserved","paid","held","reversed"]}},"required":["pool_id","source","source_id","amount","state"]}}},"required":["estimated","confirmed","available","by_source","entries"]},"Earnings":{"type":"object","properties":{"videos":{"type":"object","properties":{"ad":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"自分の動画に流れた広告の収益（広告収益プログラムの参加中のみ）"}]},"ad_charges":{"type":"integer","description":"自分の動画で課金された広告の回数"},"missed":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"広告収益プログラムに参加していなかったため受け取れなかった額"}]}},"required":["ad","ad_charges","missed"]},"viewing":{"type":"object","properties":{"ad":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"動画を見て広告を視聴したことによる報酬"}]},"ad_views":{"type":"integer","description":"報酬の対象になった広告の視聴回数"}},"required":["ad","ad_views"]},"ad_partner":{"type":"boolean"},"reward_eligible":{"type":"boolean"}},"required":["videos","viewing","ad_partner","reward_eligible"]},"Listing":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"video_id":{"type":"string","format":"uuid"},"video_title":{"type":"string"},"seller_id":{"type":"string","format":"uuid"},"price":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"出品価格（売り手の希望価格）。動画の評価額ではない"}]},"status":{"type":"string","enum":["active","reserved","sold","cancelled"]}},"required":["id","video_id","video_title","seller_id","price","status"]},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"listing_id":{"type":"string","format":"uuid"},"video_id":{"type":"string","format":"uuid"},"buyer_id":{"type":"string","format":"uuid"},"seller_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Money"},"payment":{"allOf":[{"$ref":"#/components/schemas/Payment"},{"type":["object","null"],"description":"USDC の支払いの依頼（買い手のみ）"}]},"status":{"type":"string","enum":["awaiting_payment","paid","held","settled","cancelled","refunded"]},"sequence":{"type":["integer","null"],"description":"1=初回売却, 2以上=二次流通（確定時に決定）"},"effective_at":{"type":["string","null"],"format":"date-time"}},"required":["id","listing_id","video_id","buyer_id","seller_id","amount","payment","status","sequence","effective_at"]}},"parameters":{}},"paths":{"/api/v1/auth/dev-login":{"post":{"tags":["auth"],"summary":"[開発専用] メールだけでログインしてトークン発行","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"display_name":{"type":"string","maxLength":50},"kyc_status":{"type":"string","enum":["not_started","pending","approved","rejected","recheck"],"description":"省略時は既存の値を維持（新規は not_started）"},"country":{"type":"string","minLength":2,"maxLength":2},"actor_kind":{"type":"string","enum":["user","agent"],"default":"user"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"},"account_id":{"type":"string","format":"uuid"}},"required":["access_token","token_type","expires_in","scope","account_id"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/email/start":{"post":{"tags":["auth"],"summary":"ログインリンクをメールで送る","description":"アドレスが登録済みかどうかに関わらず同じ応答を返す。送信数の上限を超えた場合も同じ応答で、メールは送らない。","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]}},"required":["sent"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/email/verify":{"post":{"tags":["auth"],"summary":"ログインリンクのトークン、またはメールの 6 桁コードでログイン（初回はアカウント作成）","description":"コードは 1 通につき 5 回まで試せる。","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":100}},"required":["token"]},{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"},"account_id":{"type":"string","format":"uuid"}},"required":["access_token","token_type","expires_in","scope","account_id"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"現在のトークンを失効させる","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me":{"get":{"tags":["auth"],"summary":"現在のアカウント","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"email":{"type":["string","null"]},"kyc_status":{"type":"string"},"onboarded":{"type":"boolean","description":"初回の「ようこそ」（表示名の入力）を済ませたか"},"actor_kind":{"type":"string","enum":["user","agent"]},"client_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","display_name","email","kyc_status","onboarded","actor_kind","client_id","scopes"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["auth"],"summary":"表示名の変更","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":50}},"required":["display_name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"email":{"type":["string","null"]},"kyc_status":{"type":"string"},"onboarded":{"type":"boolean","description":"初回の「ようこそ」（表示名の入力）を済ませたか"},"actor_kind":{"type":"string","enum":["user","agent"]},"client_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","display_name","email","kyc_status","onboarded","actor_kind","client_id","scopes"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["auth"],"summary":"退会する（元に戻せない）","description":"動画を非公開にして削除し、チャンネル・登録・あとで見るを消す。メールアドレスは消すので、同じアドレスで新しく登録できる。売買・報酬の記録は法令に従って残す。","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/onboarding":{"post":{"tags":["auth"],"summary":"初回の「ようこそ」：表示名を決め、同じ名前のチャンネルを作る","description":"チャンネルがなければ表示名で作る。仮の名前のまま作られていたチャンネルは、新しい表示名に変える。2 回目以降は表示名の変更だけ。","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":50}},"required":["display_name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"email":{"type":["string","null"]},"kyc_status":{"type":"string"},"onboarded":{"type":"boolean","description":"初回の「ようこそ」（表示名の入力）を済ませたか"},"actor_kind":{"type":"string","enum":["user","agent"]},"client_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"channel_id":{"type":"string","format":"uuid"}},"required":["id","display_name","email","kyc_status","onboarded","actor_kind","client_id","scopes","channel_id"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/email/start":{"post":{"tags":["auth"],"summary":"新しいメールアドレスに確認コードを送る","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]}},"required":["sent"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/email/verify":{"post":{"tags":["auth"],"summary":"確認コードでメールアドレスを変更する（5 回まで）","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"email":{"type":["string","null"]},"kyc_status":{"type":"string"},"onboarded":{"type":"boolean","description":"初回の「ようこそ」（表示名の入力）を済ませたか"},"actor_kind":{"type":"string","enum":["user","agent"]},"client_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","display_name","email","kyc_status","onboarded","actor_kind","client_id","scopes"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/reports":{"get":{"tags":["auth"],"summary":"自分が送った通報と対応状況（新しい順）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"video_id":{"type":"string","format":"uuid"},"video_title":{"type":"string"},"reason":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["open","resolved","dismissed"],"description":"open=確認中, resolved=対応済み（削除など）, dismissed=問題なしと判断"}},"required":["video_id","video_title","reason","created_at","status"]}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/api-keys":{"get":{"tags":["auth"],"summary":"自分の API キー（Web でログインした本人のみ）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string","description":"見分けるためのキーの先頭"},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]}},"required":["id","name","prefix","created_at","last_used_at"]}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["auth"],"summary":"API キーを発行する。キーはこのときだけ返す","description":"AI エージェントに渡して、動画の投稿やチャンネルの管理を任せるためのキー。権限は videos:write, rewards:read, wallet:read, market:read。1 人 10 個まで。","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string","description":"見分けるためのキーの先頭"},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"key":{"type":"string"}},"required":["id","name","prefix","created_at","last_used_at","key"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/api-keys/{id}":{"delete":{"tags":["auth"],"summary":"API キーを無効にする（元に戻せない）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos":{"get":{"tags":["videos"],"summary":"公開動画の一覧・検索","parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":50},"required":false,"name":"category","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":24},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"前ページの next_cursor"},"required":false,"description":"前ページの next_cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["videos"],"summary":"メタデータを確定する。エンコードが終わっていればすぐ公開","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string","format":"uuid"},"channel_id":{"type":"string","format":"uuid","description":"公開するチャンネル。省略時は最初のチャンネル（なければ作る）"},"visibility":{"type":"string","enum":["published","unlisted"],"default":"published","description":"変換が終わったときの公開範囲"},"ask_price":{"type":"object","properties":{"amount_minor":{"type":"integer","minimum":1000000,"maximum":1000000000000},"currency":{"type":"string","enum":["USDC"]}},"required":["amount_minor","currency"],"description":"販売価格。公開されて出品の条件を満たすと、この価格で出品する"},"title":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":5000,"default":""},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":30},"maxItems":15,"default":[]},"category":{"type":"string","maxLength":50,"description":"省略すると AI がタイトルと説明から決める"},"language":{"type":"string","maxLength":10,"description":"BCP 47（例: ja, en）"},"rights_declaration":{"type":"object","properties":{"owns_all_rights":{"type":"boolean","enum":[true],"description":"映像・音源・出演者を含む全権利を保有/再許諾可能であることの表明"},"contains_third_party_material":{"type":"boolean"},"agreement_version":{"type":"string","minLength":1}},"required":["owns_all_rights","contains_third_party_material","agreement_version"],"description":"任意。権利の正当性は運営が確認せず、侵害が判明した動画は削除して収益を支払わない"}},"required":["video_id","title"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Video"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/categories":{"get":{"tags":["videos"],"summary":"公開動画のカテゴリ一覧","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/videos":{"get":{"tags":["videos"],"summary":"自分が所有する動画（処理中・非公開を含む）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/videos/{id}/listing":{"get":{"tags":["videos","market"],"summary":"自分の動画が販売価格で買える状態か（出品できない理由）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"blocker":{"type":["string","null"],"enum":["no_price","not_published","trading_disabled","wallet","rights","reserved",null],"description":"null は出品中。no_price=価格なし, not_published=非公開・処理中, trading_disabled=売買の開始前, wallet=ウォレット未連携, rights=権利の問題, reserved=購入手続き中"}},"required":["blocker"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/sales":{"get":{"tags":["videos","market"],"summary":"成立した売買の履歴（古い順）","description":"完了した取引だけを返す。価格は成立した価格で、評価額や将来の価格ではない。","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"price":{"$ref":"#/components/schemas/Money"},"settled_at":{"type":"string","format":"date-time"},"sequence":{"type":"integer","description":"1=初回売却, 2以上=転売"},"seller":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"}},"required":["id","display_name"]},"buyer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"}},"required":["id","display_name"]}},"required":["price","settled_at","sequence","seller","buyer"]}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/owners/{id}":{"get":{"tags":["videos","market"],"summary":"所有者と、その人が持っている公開動画","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":60},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"owner":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"video_count":{"type":"integer","description":"持っている公開動画の本数"},"for_sale_count":{"type":"integer","description":"そのうち販売価格を決めている本数"},"bought_count":{"type":"integer","description":"買って手に入れた本数（いまも持っているもの）"}},"required":["id","display_name","video_count","for_sale_count","bought_count"]},"videos":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["owner","videos"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}":{"get":{"tags":["videos"],"summary":"動画詳細（直近成立価格を含む）","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Video"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["videos"],"summary":"動画メタデータ・公開状態の更新（所有者のみ）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":5000},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":30},"maxItems":15,"default":[]},"category":{"type":"string","maxLength":50,"description":"省略すると AI がタイトルと説明から決める"},"language":{"type":"string","maxLength":10,"description":"BCP 47（例: ja, en）"},"channel_id":{"type":"string","format":"uuid","description":"自分の別のチャンネルへ移す"},"visibility":{"type":"string","enum":["published","unlisted"],"description":"エンコード完了後のみ切替可。運営が削除した動画は戻せない"},"ask_price":{"type":["object","null"],"properties":{"amount_minor":{"type":"integer","minimum":1000000,"maximum":1000000000000},"currency":{"type":"string","enum":["USDC"]}},"required":["amount_minor","currency"],"description":"販売価格を変える。null で売りに出すのをやめる。購入手続き中は変えられない"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Video"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["videos"],"summary":"動画を削除（所有者のみ。元に戻せない）","description":"公開をやめて一覧からも消す。売買や報酬の記録は残す。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/uploads/init":{"post":{"tags":["videos"],"summary":"Cloudflare Stream 直接アップロード URL を発行","description":"下書き動画を作成し、クライアントが直接アップロードする URL を返す。アップロード後に POST /videos でメタデータと権利申告を確定する。","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"upload_length":{"type":"integer","minimum":1,"maximum":32212254720,"description":"ファイルサイズ（バイト）"},"max_duration_seconds":{"type":"integer","minimum":1,"maximum":3600,"default":3600}},"required":["upload_length"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"video_id":{"type":"string","format":"uuid"},"upload_url":{"type":"string","format":"uri"},"stream_uid":{"type":"string"}},"required":["video_id","upload_url","stream_uid"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/videos/{id}/stats":{"get":{"tags":["videos"],"summary":"自分の動画の数字（視聴回数・いいね・コメント・視聴時間と、直近 14 日の推移）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"views":{"type":"integer"},"likes":{"type":"integer"},"comments":{"type":"integer"},"watch_seconds":{"type":"integer","description":"ログインした人の有効視聴秒の合計"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"watch_seconds":{"type":"integer"},"viewers":{"type":"integer"}},"required":["date","watch_seconds","viewers"]}}},"required":["views","likes","comments","watch_seconds","daily"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/captions/{lang}":{"put":{"tags":["videos"],"summary":"字幕（WebVTT）を設定する（所有者のみ、500KB まで）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$","description":"BCP 47（例: ja, en）"},"required":true,"description":"BCP 47（例: ja, en）","name":"lang","in":"path"}],"requestBody":{"content":{"text/vtt":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"caption_langs":{"type":"array","items":{"type":"string"}}},"required":["caption_langs"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/thumbnail":{"put":{"tags":["videos"],"summary":"サムネイル画像を設定（所有者のみ）","description":"本文に JPEG / PNG / WebP の画像をそのまま送る（2MB まで）。16:9 を推奨。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Video"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/channels":{"get":{"tags":["channels"],"summary":"自分のチャンネル（作った順）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels":{"post":{"tags":["channels"],"summary":"チャンネルを作る","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":1000,"default":""}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels/{id}":{"patch":{"tags":["channels"],"summary":"チャンネル名・説明の変更（所有者のみ）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","maxLength":1000},"handle":{"type":"string","pattern":"^[a-z0-9_]{3,30}$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["channels"],"summary":"チャンネルと公開中の動画（新しい順）","description":"id には UUID か @handle を指定できる。","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/Channel"},"videos":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["channel","videos"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["channels"],"summary":"チャンネルを削除（動画がなく、最後の 1 つでない場合のみ）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels/{id}/icon":{"put":{"tags":["channels"],"summary":"チャンネルアイコンを設定（所有者のみ）","description":"本文に JPEG / PNG / WebP の画像をそのまま送る（2MB まで）。正方形を推奨。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/like":{"put":{"tags":["social"],"summary":"いいねを付ける","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["social"],"summary":"いいねを外す","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/watch-later":{"put":{"tags":["social"],"summary":"あとで見るを付ける","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["social"],"summary":"あとで見るを外す","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels/{id}/subscription":{"put":{"tags":["social"],"summary":"チャンネル登録をする","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["social"],"summary":"チャンネル登録をやめる","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/social":{"get":{"tags":["social"],"summary":"いいね数・コメント数と、ログイン中ならその人の状態","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"like_count":{"type":"integer"},"comment_count":{"type":"integer"},"subscriber_count":{"type":"integer"},"liked":{"type":"boolean"},"saved":{"type":"boolean"},"subscribed":{"type":"boolean"}},"required":["like_count","comment_count","subscriber_count","liked","saved","subscribed"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/watch-later":{"get":{"tags":["social"],"summary":"あとで見る（追加した順の新しい順）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/history":{"get":{"tags":["social"],"summary":"視聴履歴（直近 90 日、最後に見た順）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/liked":{"get":{"tags":["social"],"summary":"いいねした動画","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/feed/subscriptions":{"get":{"tags":["social"],"summary":"登録チャンネルの新着と、登録チャンネルの一覧","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"handle":{"type":"string"},"icon_url":{"type":["string","null"],"format":"uri"}},"required":["id","name","handle","icon_url"]}},"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["channels","items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/comments":{"get":{"tags":["social"],"summary":"コメント（新しい順、200 件まで）","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["social"],"summary":"コメントを書く（ログイン必須、1 日 50 件まで）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":1000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/comments/{id}":{"delete":{"tags":["social"],"summary":"コメントを消す（書いた本人か動画の所有者）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/wallet":{"get":{"tags":["payments"],"summary":"連携しているウォレット","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/Wallet"},"chain":{"type":["string","null"]},"usdc_mint":{"type":["string","null"]}},"required":["wallet","chain","usdc_mint"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["payments"],"summary":"署名を確かめてウォレットを登録し、広告収益プログラムに参加する（付け替えも同じ）","description":"ウォレットの登録をもって広告収益プログラムへの参加とする。参加規約への同意（accept_ad_partner_terms）が必要。","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{32,44}$","description":"Solana のアドレス（base58）"},"message":{"type":"string","maxLength":2000},"signature":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{64,90}$","description":"署名（base58）"},"nonce":{"type":"string"},"accept_ad_partner_terms":{"type":"boolean","enum":[true],"description":"広告収益プログラムの規約に同意"}},"required":["address","message","signature","nonce","accept_ad_partner_terms"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Wallet"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["payments"],"summary":"ウォレットの登録を外し、広告収益プログラムをやめる","description":"やめた後の広告収益は分配しない。それまでに積み立てた分は、もう一度登録すれば受け取れる。","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"unlinked":{"type":"boolean","enum":[true]}},"required":["unlinked"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chain/blockhash":{"get":{"tags":["payments"],"summary":"ウォレットで署名する取引に入れる、最近のブロックハッシュ","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"blockhash":{"type":"string"}},"required":["blockhash"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/wallet/challenge":{"post":{"tags":["payments"],"summary":"ウォレットで署名するメッセージ（Sign In With Solana）を作る","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{32,44}$","description":"Solana のアドレス（base58）"}},"required":["address"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string"},"nonce":{"type":"string"}},"required":["message","nonce"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/payments/{id}":{"get":{"tags":["payments"],"summary":"支払いの依頼（払う人のみ）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Payment"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/payments/{id}/submit":{"post":{"tags":["payments"],"summary":"送金した取引を知らせて確かめてもらう","description":"pending のときは、取引が finalized になるまで（十数秒）おいて再送する。成立すると売買なら所有権が移る。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signatures":{"type":"array","items":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{64,90}$"},"minItems":1,"maxItems":4,"description":"送金した取引の署名（base58）。分けて送ったときは全部"}},"required":["signatures"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["confirmed","pending","failed"]},"reason":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["status","payment"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/payouts/usdc":{"get":{"tags":["payments"],"summary":"USDC で受け取れる残高と、支払いの履歴","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"available":{"$ref":"#/components/schemas/Money"},"wallet":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Money"},"status":{"type":"string"},"to_address":{"type":["string","null"]},"tx_hash":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","amount","status","to_address","tx_hash","created_at"]}}},"required":["available","wallet","items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["payments"],"summary":"受け取れる USDC を、登録したウォレットへ送ってもらう（KYC 必須・最低 5 USDC）","description":"強い権限（payouts:write）。AI エージェントのトークンでは実行不可。Idempotency-Key 必須。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":8,"maxLength":255},"required":true,"name":"idempotency-key","in":"header"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"payout_id":{"type":"string","format":"uuid"},"amount":{"$ref":"#/components/schemas/Money"}},"required":["payout_id","amount"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/setup":{"get":{"tags":["ads"],"summary":"広告を出す準備の状態（引き落としの許可先・いま許可されている額）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"spender_address":{"type":["string","null"],"description":"引き落としを許可する相手（運営の引き落とし役）"},"usdc_mint":{"type":["string","null"]},"chain":{"type":["string","null"]},"wallet":{"type":["string","null"]},"allowance":{"type":["object","null"],"properties":{"delegated":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"運営に許可されている残りの額（チェーン上の値）"}]},"balance":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"ウォレットの USDC"}]},"unpaid":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"課金済みで、まだ引き落としていない額"}]},"remaining":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"これから使える額（許可額と残高の小さい方 − 未払い）"}]},"checked_at":{"type":"string","format":"date-time"}},"required":["delegated","balance","unpaid","remaining","checked_at"]}},"required":["spender_address","usdc_mint","chain","wallet","allowance"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/allowance/refresh":{"post":{"tags":["ads"],"summary":"ウォレットで許可した額をチェーンから読み直す（許可した直後に呼ぶ）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"delegated":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"運営に許可されている残りの額（チェーン上の値）"}]},"balance":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"ウォレットの USDC"}]},"unpaid":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"課金済みで、まだ引き落としていない額"}]},"remaining":{"allOf":[{"$ref":"#/components/schemas/Money"},{"description":"これから使える額（許可額と残高の小さい方 − 未払い）"}]},"checked_at":{"type":"string","format":"date-time"}},"required":["delegated","balance","unpaid","remaining","checked_at"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/campaigns":{"get":{"tags":["ads"],"summary":"自分の広告キャンペーンと成果","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaign"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ads"],"summary":"広告キャンペーンを作り、広告の動画（6〜60 秒）のアップロード先を受け取る","description":"動画の処理が終わり、ウォレットで引き落としを許可していれば配信が始まる。","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"click_url":{"type":"string","maxLength":500,"format":"uri"},"cta":{"type":"string","minLength":1,"maxLength":20,"default":"詳しく見る"},"price_minor":{"type":"integer","minimum":10000,"description":"1 回の課金の単価（USDC の最小単位。0.01 USDC = 10000）"},"categories":{"type":"array","items":{"type":"string","maxLength":50},"maxItems":20,"default":[],"description":"配信するカテゴリ。空なら全部"},"upload_length":{"type":"integer","minimum":1,"maximum":524288000}},"required":["name","price_minor","upload_length"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/AdCampaign"},"upload_url":{"type":"string","format":"uri"}},"required":["campaign","upload_url"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/campaigns/{id}":{"get":{"tags":["ads"],"summary":"自分の広告キャンペーン 1 件と成果","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdCampaign"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ads"],"summary":"広告の配信を止める・再開する","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","paused"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdCampaign"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/request":{"post":{"tags":["ads"],"summary":"動画の前（pre）や途中（mid）に流す広告を 1 本もらう。なければ null","description":"途中の広告の区切りは /ads/breaks で受け取る。同じ再生の同じ枠には同じ広告を返す。途中の広告は、その位置まで再生した（heartbeat で伝えた）セッションにだけ出す。API キー（AI エージェント）には出さない。","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"play_session_id":{"type":"string","format":"uuid"},"slot":{"type":"string","enum":["pre","mid"]},"break_index":{"type":["integer","null"],"minimum":0,"default":null}},"required":["play_session_id","slot"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ad":{"$ref":"#/components/schemas/Ad"}},"required":["ad"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/breaks":{"get":{"tags":["ads"],"summary":"動画の途中の広告の区切り（秒）","parameters":[{"schema":{"type":["number","null"],"minimum":0,"maximum":86400},"required":false,"name":"duration_sec","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"breaks":{"type":"array","items":{"type":"number"}}},"required":["breaks"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/impressions/{id}/events":{"post":{"tags":["ads"],"summary":"広告のイベント（再生中の通知・最後まで・スキップ・リンク）","description":"課金は、最後まで（30 秒未満の広告）／30 秒／リンク先への移動のうち最初の 1 回だけ。時間はサーバーが測る。","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["progress","complete","skip","click"]}},"required":["type"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"charged":{"type":"boolean"}},"required":["charged"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/reports":{"post":{"tags":["videos"],"summary":"公開中の動画を運営に通報する（ログイン必須）","description":"同じ動画への未対応の通報は 1 人 1 件。2 回目以降は既存の通報をそのまま返す。","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["sexual","violent","harassment","hate","spam","copyright","privacy","other"]},"detail":{"type":"string","maxLength":1000,"default":""}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reported":{"type":"boolean","enum":[true]},"already":{"type":"boolean","description":"未対応の通報がすでにあった"}},"required":["reported","already"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/feed/home":{"get":{"tags":["feed"],"summary":"トップページ（おすすめ・トレンド・新着・トップクリエイター）","description":"ログイン中は有効視聴の履歴・いいね・あとで見る・登録チャンネルでおすすめを個人化する。ゲストはサーバーに履歴を記録しないが、recent（この端末でさっき再生した動画）を渡せばそれを好みに使う。どちらも渡さなければ人気・品質順になる。","parameters":[{"schema":{"type":"string","maxLength":600,"description":"この端末でさっき再生した動画の ID（カンマ区切り、新しい順、12 件まで）。ゲストでも好みに使う"},"required":false,"description":"この端末でさっき再生した動画の ID（カンマ区切り、新しい順、12 件まで）。ゲストでも好みに使う","name":"recent","in":"query"},{"schema":{"type":"string","maxLength":4000,"description":"表示したのに選ばれなかった動画の記録（端末の cookie の値そのまま）。多く見送った動画ほど順位を下げる"},"required":false,"description":"表示したのに選ばれなかった動画の記録（端末の cookie の値そのまま）。多く見送った動画ほど順位を下げる","name":"seen","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"personalized":{"type":"boolean"},"because":{"type":["object","null"],"properties":{"video":{"$ref":"#/components/schemas/Video"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["video","items"],"description":"最近見た動画（video）に近い動画。近い動画が少ないときは null"},"recommended":{"type":"array","items":{"type":"object","properties":{"video":{"$ref":"#/components/schemas/Video"},"reason":{"$ref":"#/components/schemas/RecommendationReason"}},"required":["video","reason"]}},"next_offset":{"type":["integer","null"],"description":"おすすめの続きがあれば /feed/more に渡す offset。なければ null"},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Video"},"description":"登録チャンネルの、まだ見ていない最近 30 日の動画（新しい順）"},"trending":{"type":"array","items":{"$ref":"#/components/schemas/Video"}},"fresh":{"type":"array","items":{"$ref":"#/components/schemas/Video"}},"shorts":{"type":"array","items":{"$ref":"#/components/schemas/Video"},"description":"60 秒以下の短い動画（新しい順）"},"creators":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"チャンネル ID"},"display_name":{"type":"string"},"icon_url":{"type":["string","null"],"format":"uri"},"video_count":{"type":"integer"},"view_count":{"type":"integer"}},"required":["id","display_name","icon_url","video_count","view_count"]}}},"required":["personalized","because","recommended","next_offset","subscriptions","trending","fresh","shorts","creators"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/feed/more":{"get":{"tags":["feed"],"summary":"トップページのおすすめの続き","description":"/feed/home のおすすめの続きを、トップのほかの棚に出した動画を除いて返す。recent と seen は /feed/home に渡したものと同じ値を渡す（途中で変えると、同じ動画が重なったり抜けたりする）。","parameters":[{"schema":{"type":"string","maxLength":600,"description":"この端末でさっき再生した動画の ID（カンマ区切り、新しい順、12 件まで）。ゲストでも好みに使う"},"required":false,"description":"この端末でさっき再生した動画の ID（カンマ区切り、新しい順、12 件まで）。ゲストでも好みに使う","name":"recent","in":"query"},{"schema":{"type":"string","maxLength":4000,"description":"表示したのに選ばれなかった動画の記録（端末の cookie の値そのまま）。多く見送った動画ほど順位を下げる"},"required":false,"description":"表示したのに選ばれなかった動画の記録（端末の cookie の値そのまま）。多く見送った動画ほど順位を下げる","name":"seen","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":480,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":48,"default":24},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"video":{"$ref":"#/components/schemas/Video"},"reason":{"$ref":"#/components/schemas/RecommendationReason"}},"required":["video","reason"]}},"next_offset":{"type":["integer","null"]}},"required":["items","next_offset"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/feed/impressions":{"post":{"tags":["feed"],"summary":"棚の表示を数える","description":"どの棚の何番目が画面に出たかを、日ごとの合計として数える（誰が見たかは保存しない）。再生セッションの source と合わせて、棚ごとの再生率を出すのに使う。","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"shelf":{"type":"string","enum":["continue","because","recommended","subscriptions","shorts","trending","fresh","more","related","autonext","search"]},"pos":{"type":"integer","minimum":0,"maximum":999}},"required":["shelf","pos"]},"minItems":1,"maxItems":100}},"required":["items"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"counted":{"type":"integer"}},"required":["counted"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/videos/{id}/related":{"get":{"tags":["feed"],"summary":"次の動画（今の動画に近い順）","description":"exclude の動画と、ログイン中は半分以上見た動画を後ろへ回す（同じ動画の間を行き来させない）。それだけで足りなければ、見た動画も後ろに足して返す。","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":24,"default":8},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":2000,"description":"このセッションで見た動画の ID（カンマ区切り、50 件まで）"},"required":false,"description":"このセッションで見た動画の ID（カンマ区切り、50 件まで）","name":"exclude","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Video"}}},"required":["items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/play-sessions":{"post":{"tags":["playback"],"summary":"再生セッション開始","description":"ログイン中の人のみ有効視聴時間が報酬対象として記録される。ゲストと API キー（AI エージェント）は視聴できるが記録されない。","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["continue","because","recommended","subscriptions","shorts","trending","fresh","more","related","autonext","search"],"description":"どの棚から再生したか（棚ごとの効果を測るため）。直接開いたときは付けない"},"source_pos":{"type":"integer","minimum":0,"maximum":999,"description":"その棚での位置（0 始まり）"}},"required":["video_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"session_id":{"type":"string","format":"uuid"},"heartbeat_interval_ms":{"type":"integer"},"rewards_tracked":{"type":"boolean"}},"required":["session_id","heartbeat_interval_ms","rewards_tracked"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/play-sessions/{id}/events":{"post":{"tags":["playback"],"summary":"視聴イベント送信（heartbeat 等）","description":"有効視聴秒はサーバー受信時刻と再生位置の進行から算出する。クライアント申告の秒数は使わない。","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["play","pause","seek","heartbeat","ended"]},"position_ms":{"type":"integer","minimum":0},"foreground":{"type":"boolean"},"playback_rate":{"type":"number","minimum":0.25,"maximum":4,"default":1}},"required":["type","position_ms","foreground"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"session_valid_seconds":{"type":"integer"}},"required":["session_valid_seconds"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/rewards":{"get":{"tags":["rewards"],"summary":"報酬サマリ（推定/確定/出金可能・由来別）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["USDC","JPY"],"default":"USDC","description":"報酬は通貨ごとに集計する（今は USDC）"},"required":false,"description":"報酬は通貨ごとに集計する（今は USDC）","name":"currency","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rewards"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/wallet":{"get":{"tags":["wallet"],"summary":"残高・本人確認状態・利用可能な出金方法","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Wallet"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me/earnings":{"get":{"tags":["rewards"],"summary":"獲得報酬（自分の動画からの収益と、動画を見たことによる報酬を分けて）","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Earnings"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/market/listings":{"get":{"tags":["market"],"summary":"公開中の出品一覧","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50,"default":24},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"trading_enabled":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Listing"}}},"required":["trading_enabled","items"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["market"],"summary":"出品（現所有者・公開中・権利に問題のない動画のみ）","security":[{"bearer":[]}],"description":"強い権限（market:trade）。AI エージェントのトークンでは実行不可（人の承認が必要）。Idempotency-Key 必須。","parameters":[{"schema":{"type":"string","minLength":8,"maxLength":255,"description":"必須。再送時は同じ値を使う"},"required":true,"description":"必須。再送時は同じ値を使う","name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string","format":"uuid"},"price":{"type":"object","properties":{"amount_minor":{"type":"integer","exclusiveMinimum":0},"currency":{"type":"string","enum":["USDC","JPY"]}},"required":["amount_minor","currency"],"description":"USDC は 6 桁（1 USDC = 1000000）。円は将来の決済手段用"}},"required":["video_id","price"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"listing_id":{"type":"string","format":"uuid"}},"required":["listing_id"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/market/orders":{"post":{"tags":["market"],"summary":"購入注文（入金待ちで出品を確保）","security":[{"bearer":[]}],"description":"強い権限（market:trade）。AI エージェントのトークンでは実行不可（人の承認が必要）。Idempotency-Key 必須。","parameters":[{"schema":{"type":"string","minLength":8,"maxLength":255,"description":"必須。再送時は同じ値を使う"},"required":true,"description":"必須。再送時は同じ値を使う","name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"listing_id":{"type":"string","format":"uuid"}},"required":["listing_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/market/orders/{id}":{"get":{"tags":["market"],"summary":"注文・権利移転の進捗（買い手/売り手のみ）","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/market/orders/{id}/confirm":{"post":{"tags":["market"],"summary":"買い手による契約同意・取引確定（入金確認後）","security":[{"bearer":[]}],"description":"強い権限（market:trade）。AI エージェントのトークンでは実行不可（人の承認が必要）。Idempotency-Key 必須。","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":8,"maxLength":255,"description":"必須。再送時は同じ値を使う"},"required":true,"description":"必須。再送時は同じ値を使う","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/cloudflare":{"post":{"tags":["webhooks"],"summary":"Cloudflare Stream: エンコード完了通知","description":"Webhook-Signature: time=..,sig1=..（HMAC-SHA256）を検証。","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"received":{"type":"boolean"},"duplicate":{"type":"boolean"}},"required":["received","duplicate"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/payments":{"post":{"tags":["webhooks"],"summary":"決済事業者: 入金通知","description":"Webhook-Signature 検証。同一 event_id の重複到着は 1 回だけ処理する。","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"received":{"type":"boolean"},"duplicate":{"type":"boolean"}},"required":["received","duplicate"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"入力エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"未認証","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"権限不足 / 機能停止中 / 人の承認が必要","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"存在しない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"競合（所有権・在庫・冪等キー処理中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"審査未完了・前提条件未充足","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}