{"openapi":"3.1.0","info":{"title":"N3ONDefense Leaderboard API","version":"0.1.0"},"servers":[{"url":"https://api.n3ondefense.org","description":"Production"},{"url":"http://localhost:8010","description":"Local development"}],"paths":{"/health":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/auth/anonymous":{"post":{"tags":["auth"],"summary":"Anonymous","operationId":"anonymous_v1_auth_anonymous_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnonymousRegistration"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","operationId":"refresh_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs":{"post":{"tags":["runs"],"summary":"Create Run","operationId":"create_run_v1_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStartRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/runs/{run_id}/milestones":{"post":{"tags":["runs"],"summary":"Milestone","operationId":"milestone_v1_runs__run_id__milestones_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"X-Run-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Run-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilestoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}/complete":{"post":{"tags":["runs"],"summary":"Complete","operationId":"complete_v1_runs__run_id__complete_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"X-Run-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Run-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leaderboards/me/bests":{"get":{"tags":["leaderboards"],"summary":"Personal Bests","operationId":"personal_bests_v1_leaderboards_me_bests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalBestsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/leaderboards/{category}/around-me":{"get":{"tags":["leaderboards"],"summary":"Near Me","operationId":"near_me_v1_leaderboards__category__around_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category","in":"path","required":true,"schema":{"enum":["highest_round","enemies_destroyed","bomb_sites_destroyed"],"type":"string","title":"Category"}},{"name":"radius","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":3,"title":"Radius"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leaderboards/{category}":{"get":{"tags":["leaderboards"],"summary":"Leaderboard","operationId":"leaderboard_v1_leaderboards__category__get","parameters":[{"name":"category","in":"path","required":true,"schema":{"enum":["highest_round","enemies_destroyed","bomb_sites_destroyed"],"type":"string","title":"Category"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/runs":{"get":{"tags":["admin"],"summary":"Review Runs","operationId":"review_runs_v1_admin_runs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RunStatus","default":"flagged"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminRunSummary"},"title":"Response Review Runs V1 Admin Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/runs/{run_id}":{"patch":{"tags":["admin"],"summary":"Decide Run","operationId":"decide_run_v1_admin_runs__run_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRunDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRunSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdminRunDecision":{"properties":{"status":{"type":"string","enum":["verified","flagged","rejected"],"title":"Status"},"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason"}},"type":"object","required":["status","reason"],"title":"AdminRunDecision"},"AdminRunSummary":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"public_player_id":{"type":"string","title":"Public Player Id"},"display_name":{"type":"string","title":"Display Name"},"status":{"type":"string","title":"Status"},"highest_round":{"type":"integer","title":"Highest Round"},"enemies_destroyed":{"type":"integer","title":"Enemies Destroyed"},"bomb_sites_destroyed":{"type":"integer","title":"Bomb Sites Destroyed"},"verification_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Reason"}},"type":"object","required":["run_id","public_player_id","display_name","status","highest_round","enemies_destroyed","bomb_sites_destroyed","verification_reason"],"title":"AdminRunSummary"},"AnonymousRegistration":{"properties":{"display_name":{"type":"string","maxLength":24,"minLength":3,"title":"Display Name"}},"type":"object","required":["display_name"],"title":"AnonymousRegistration"},"CompleteRunRequest":{"properties":{"highest_round":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Highest Round"},"rounds_completed":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Rounds Completed"},"enemies_destroyed":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Enemies Destroyed"},"bomb_sites_destroyed":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Bomb Sites Destroyed"},"credits_earned":{"type":"integer","maximum":2000000000.0,"minimum":0.0,"title":"Credits Earned"},"elapsed_ms":{"type":"integer","maximum":2592000000.0,"minimum":0.0,"title":"Elapsed Ms"},"idempotency_key":{"type":"string","maxLength":64,"minLength":16,"title":"Idempotency Key"},"outcome":{"type":"string","enum":["victory","player_dead","bomb_defused","quit"],"title":"Outcome"}},"type":"object","required":["highest_round","rounds_completed","enemies_destroyed","bomb_sites_destroyed","credits_earned","elapsed_ms","idempotency_key","outcome"],"title":"CompleteRunRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LeaderboardEntry":{"properties":{"rank":{"type":"integer","title":"Rank"},"public_player_id":{"type":"string","title":"Public Player Id"},"display_name":{"type":"string","title":"Display Name"},"value":{"type":"integer","title":"Value"},"run_id":{"type":"string","title":"Run Id"}},"type":"object","required":["rank","public_player_id","display_name","value","run_id"],"title":"LeaderboardEntry"},"LeaderboardResponse":{"properties":{"category":{"type":"string","enum":["highest_round","enemies_destroyed","bomb_sites_destroyed"],"title":"Category"},"entries":{"items":{"$ref":"#/components/schemas/LeaderboardEntry"},"type":"array","title":"Entries"}},"type":"object","required":["category","entries"],"title":"LeaderboardResponse"},"MilestoneRequest":{"properties":{"highest_round":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Highest Round"},"rounds_completed":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Rounds Completed"},"enemies_destroyed":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Enemies Destroyed"},"bomb_sites_destroyed":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Bomb Sites Destroyed"},"credits_earned":{"type":"integer","maximum":2000000000.0,"minimum":0.0,"title":"Credits Earned"},"elapsed_ms":{"type":"integer","maximum":2592000000.0,"minimum":0.0,"title":"Elapsed Ms"},"sequence":{"type":"integer","maximum":1000000.0,"minimum":1.0,"title":"Sequence"}},"type":"object","required":["highest_round","rounds_completed","enemies_destroyed","bomb_sites_destroyed","credits_earned","elapsed_ms","sequence"],"title":"MilestoneRequest"},"PersonalBestsResponse":{"properties":{"highest_round":{"anyOf":[{"$ref":"#/components/schemas/LeaderboardEntry"},{"type":"null"}]},"enemies_destroyed":{"anyOf":[{"$ref":"#/components/schemas/LeaderboardEntry"},{"type":"null"}]},"bomb_sites_destroyed":{"anyOf":[{"$ref":"#/components/schemas/LeaderboardEntry"},{"type":"null"}]}},"type":"object","required":["highest_round","enemies_destroyed","bomb_sites_destroyed"],"title":"PersonalBestsResponse"},"PlayerIdentity":{"properties":{"public_id":{"type":"string","title":"Public Id"},"display_name":{"type":"string","title":"Display Name"}},"type":"object","required":["public_id","display_name"],"title":"PlayerIdentity"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","maxLength":300,"minLength":32,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"RunStartRequest":{"properties":{"game_version":{"type":"string","maxLength":32,"minLength":1,"title":"Game Version"}},"type":"object","required":["game_version"],"title":"RunStartRequest"},"RunStartResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"seed":{"type":"integer","title":"Seed"},"run_token":{"type":"string","title":"Run Token"},"run_token_expires_in_seconds":{"type":"integer","title":"Run Token Expires In Seconds"},"status":{"type":"string","const":"pending","title":"Status","default":"pending"}},"type":"object","required":["run_id","seed","run_token","run_token_expires_in_seconds"],"title":"RunStartResponse"},"RunStatus":{"type":"string","enum":["pending","verified","flagged","rejected"],"title":"RunStatus"},"RunStatusResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"status":{"type":"string","enum":["pending","verified","flagged","rejected"],"title":"Status"},"verification_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Reason"}},"type":"object","required":["run_id","status"],"title":"RunStatusResponse"},"TokenResponse":{"properties":{"player":{"$ref":"#/components/schemas/PlayerIdentity"},"access_token":{"type":"string","title":"Access Token"},"access_expires_in_seconds":{"type":"integer","title":"Access Expires In Seconds"},"refresh_token":{"type":"string","title":"Refresh Token"},"refresh_expires_in_seconds":{"type":"integer","title":"Refresh Expires In Seconds"}},"type":"object","required":["player","access_token","access_expires_in_seconds","refresh_token","refresh_expires_in_seconds"],"title":"TokenResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}