{"openapi":"3.1.0","info":{"title":"Tinue Native API","version":"0.1.0","description":"Official Tinue product API for Web, apps, and generated SDK. Trakt-compatible player routes are separate adapters."},"servers":[{"url":"https://tinue-api.887969.xyz"}],"components":{"schemas":{"User":{"type":"object","properties":{"userId":{"type":"string","example":"usr_123"},"email":{"type":"string","format":"email"},"name":{"type":"string"}},"required":["userId","email","name"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Home":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"continueWatching":{"type":"array","items":{"$ref":"#/components/schemas/PlaybackItem"}},"recentActivity":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}}},"required":["user","continueWatching","recentActivity"]},"PlaybackItem":{"allOf":[{"$ref":"#/components/schemas/MediaSummary"},{"type":"object","properties":{"id":{"type":"number"},"status":{"type":"string","enum":["playing","paused","stopped"]},"eventAt":{"type":"string"}},"required":["status","eventAt"]}]},"MediaSummary":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"}]},"kind":{"type":"string","enum":["movie","episode"]},"title":{"type":"string"},"year":{"type":["number","null"]},"season":{"type":["number","null"]},"number":{"type":["number","null"]},"progress":{"type":"number"},"externalIds":{"type":"object","additionalProperties":{"type":"string"}},"showId":{"type":["string","null"]},"showTitle":{"type":["string","null"]},"showKey":{"type":["string","null"]},"posterUrl":{"type":["string","null"]},"displayTitle":{"type":["string","null"]}},"required":["id","kind","title","year","season","number","progress","externalIds"]},"HistoryItem":{"allOf":[{"$ref":"#/components/schemas/MediaSummary"},{"type":"object","properties":{"id":{"type":"string"},"watchedAt":{"type":"string"}},"required":["watchedAt"]}]},"HistoryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["items","nextCursor","hasMore"]},"PlaybackList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlaybackItem"}}},"required":["items"]},"ConnectionsList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}}},"required":["items"]},"Connection":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["active","revoked"]},"createdAt":{"type":"string"},"connectedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"]}},"required":["id","clientId","label","status","createdAt","connectedAt","revokedAt","lastUsedAt"]},"LibraryBundle":{"type":"object","properties":{"watched":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"watchedHasMore":{"type":"boolean"},"ratings":{"type":"array","items":{}},"watchlist":{"type":"array","items":{}},"collection":{"type":"array","items":{}}},"required":["watched","watchedHasMore","ratings","watchlist","collection"]},"MediaDetail":{"type":"object","properties":{"catalogKey":{"type":"string"},"found":{"type":"boolean"},"metadata":{}},"required":["catalogKey","found"]},"SearchResult":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"]},"Export":{"type":"object","properties":{"schemaVersion":{"type":"string"},"generatedAt":{"type":"string"},"userId":{"type":"string"},"authorizations":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}},"playback":{"type":"array","items":{"$ref":"#/components/schemas/PlaybackItem"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"activities":{"type":"array","items":{}},"events":{"type":"array","items":{}}},"required":["schemaVersion","generatedAt","userId","authorizations","playback","history","activities","events"]}},"parameters":{}},"paths":{"/me":{"get":{"tags":["Account"],"summary":"Current user","responses":{"200":{"description":"Authenticated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/home":{"get":{"tags":["Home"],"summary":"Home aggregate for first paint","responses":{"200":{"description":"Home payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Home"}}}},"401":{"description":"Session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/history":{"get":{"tags":["History"],"summary":"Watch history (cursor pagination)","parameters":[{"schema":{"type":"string","description":"Opaque cursor from previous page"},"required":false,"description":"Opaque cursor from previous page","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"example":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"History page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryPage"}}}},"400":{"description":"Invalid cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/history/{id}":{"get":{"tags":["History"],"summary":"Single history entry","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"History item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryItem"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/playback":{"get":{"tags":["Playback"],"summary":"In-progress playback","responses":{"200":{"description":"Playback list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybackList"}}}}}}},"/playback/{id}":{"delete":{"tags":["Playback"],"summary":"Remove a playback checkpoint","parameters":[{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/watched":{"get":{"tags":["Watched"],"summary":"Watched media summary (via history sample)","responses":{"200":{"description":"Watched page (history-backed for v1)","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["items","nextCursor","hasMore"]}}}}}}},"/connections":{"get":{"tags":["Connections"],"summary":"Player connections (OAuth grants)","responses":{"200":{"description":"Connections","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionsList"}}}}}}},"/connections/{id}":{"delete":{"tags":["Connections"],"summary":"Revoke a player connection","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoked"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/library":{"get":{"tags":["Library"],"summary":"User library bundle","responses":{"200":{"description":"Library","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryBundle"}}}}}}},"/media/{catalogKey}":{"get":{"tags":["Media"],"summary":"Media metadata by catalog key","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":512},"required":true,"name":"catalogKey","in":"path"},{"schema":{"type":"string","minLength":2,"maxLength":32},"required":false,"name":"locale","in":"query"}],"responses":{"200":{"description":"Media detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDetail"}}}}}}},"/search":{"get":{"tags":["Search"],"summary":"Local-first media search","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120},"required":true,"name":"q","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":32},"required":false,"name":"locale","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Search hits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}}}}},"/export":{"get":{"tags":["Account"],"summary":"Export user data JSON","responses":{"200":{"description":"Export payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Export"}}}}}}},"/import":{"post":{"tags":["Account"],"summary":"Import user data (reserved)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"string"},"history":{"type":"array","items":{}}}}}}},"responses":{"501":{"description":"Not implemented in v1","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}