{"openapi":"3.1.0","info":{"title":"Last War API","description":"\nREST API for Last War Survival game data.\n\n## Authentication\n\nAll endpoints require an API key passed via the `X-API-Key` header.\n\n## Session Keys (Recommended)\n\nSession keys allow the API to make requests using your own game account credentials.\nRequests with a session key are processed **immediately** without queuing.\n\n### Setup\n\n1. **Download the Capture Tool** from [github.com/LastWarTools/Capture-Tool](https://github.com/LastWarTools/Capture-Tool)\n2. **Run the capture tool** while launching the PC version of Last War\n3. The tool captures three authentication files: `handshake.bin`, `auth.bin`, `login.bin`\n4. **Upload credentials** via `POST /auth/credentials/upload` with your API key\n5. **Get your session key** via `GET /auth/sessions`\n\nOnce you have a session key, pass it as the `session_key` query parameter on supported endpoints.\n\n**Note:** Session keys are tied to your API key. Each API key can have multiple sessions\n(e.g., for different game accounts or servers).\n\n## Queue System (Shared Service)\n\nRequests **without** a session key use a shared queue system. The API maintains a pool of\nshared game connections, and your request is processed in order.\n\nQueue endpoints are available if you prefer explicit control over request lifecycle:\n\n- `POST /queue/submit` - Submit a request to the queue\n- `GET /queue/status/{request_id}` - Poll request status\n- `GET /queue/stream/{request_id}` - Stream real-time updates (SSE)\n- `GET /queue/{request_id}` - Get completed result\n- `GET /queue/stats` - View queue statistics\n\nFor most use cases, simply omit the `session_key` parameter and the API will handle\nqueuing automatically.\n\n## Rate Limits\n\nAPI keys have hourly and burst rate limits. Check response headers for current usage.\n    ","version":"1.0.0"},"paths":{"/alliance/{alliance_id}/members":{"get":{"tags":["Alliance"],"summary":"Get Alliance Members","description":"Get members of an alliance.\n\n**Note**: Position data (x, y) is only returned for your own alliance.\nOther alliances will show pointId=0 and x/y as null.\n\nThe alliance_id is a 32-character hex string.\n\nIf session_key is provided, uses that session's credentials directly.","operationId":"get_alliance_members_alliance__alliance_id__members_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"alliance_id","in":"path","required":true,"schema":{"type":"string","title":"Alliance Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","description":"Sort field","enum":["power","name","rank"],"default":"power","title":"Sort By"},"description":"Sort field"},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort descending","default":true,"title":"Descending"},"description":"Sort descending"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllianceMembersResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rankings/{server_id}/alliances":{"get":{"tags":["Rankings"],"summary":"Get Alliance Rankings Endpoint","description":"Get alliance power rankings for a server.\n\nReturns alliances sorted by total power descending.\n\nIf session_key is provided, uses that session's credentials directly.\nOtherwise falls back to the connection pool.","operationId":"get_alliance_rankings_endpoint_rankings__server_id__alliances_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"integer","title":"Server Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max results to return","default":50,"title":"Limit"},"description":"Max results to return"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AllianceRankingResponse"},"title":"Response Get Alliance Rankings Endpoint Rankings  Server Id  Alliances Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kingdom/{server_id}/positions":{"get":{"tags":["Kingdom"],"summary":"Get Kingdom Positions Endpoint","description":"Get kingdom government positions for a server.\n\nReturns the 7 kingdom positions (King, Queen, Prime Minister, etc.)\nwith the players currently holding each position.\n\nIf session_key is provided, uses that session's credentials directly.","operationId":"get_kingdom_positions_endpoint_kingdom__server_id__positions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"integer","title":"Server Id"}},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KingdomPositionResponse"},"title":"Response Get Kingdom Positions Endpoint Kingdom  Server Id  Positions Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/detect/players":{"get":{"tags":["Radar"],"summary":"Get Detected Players","description":"Get players visible on the radar/world map.\n\nThis uses the game's detection feature to find nearby players\nand returns their coordinates. Unlike alliance members, this can\nshow players from ANY alliance.\n\n**Note**: Results depend on the logged-in player's current position\nand radar range in the game.\n\nIf session_key is provided, uses that session's credentials directly.","operationId":"get_detected_players_detect_players_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/block":{"get":{"tags":["World Map"],"summary":"Get World Block","description":"Query a world map region to find ALL player bases.\n\nThis is the key endpoint for finding ANY player's coordinates!\nUnlike al.rank (own alliance only) or detect (radar range limited),\nthis directly queries map tiles and returns all bases in that area.\n\n**Usage**:\n- Pick an x,y coordinate and server_id\n- The query returns all bases in a ~20x20 tile area around that point\n- Scan the map by querying different x,y positions\n\n**Coordinate System**:\n- Map is roughly 1000x1000 tiles\n- pointId encodes position as: y * 1000 + x (x max is 999)\n\nIf session_key is provided, uses that session's credentials directly.","operationId":"get_world_block_world_block_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"x","in":"query","required":true,"schema":{"type":"integer","minimum":0,"description":"Map X coordinate","title":"X"},"description":"Map X coordinate"},{"name":"y","in":"query","required":true,"schema":{"type":"integer","minimum":0,"description":"Map Y coordinate","title":"Y"},"description":"Map Y coordinate"},{"name":"server_id","in":"query","required":true,"schema":{"type":"integer","description":"Server ID","title":"Server Id"},"description":"Server ID"},{"name":"block_size","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":50,"minimum":5},{"type":"null"}],"description":"Block size (auto-detected if not specified)","title":"Block Size"},"description":"Block size (auto-detected if not specified)"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapBlockResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/scan":{"get":{"tags":["World Map"],"summary":"Scan World Region","description":"Scan a region of the world map for ALL player bases.\n\nUses **pipelined queries** for fast scanning.\n\n**Map coordinates**: 0-1000 for both X and Y.\n\n**Example**: To scan a region:\n```\n/world/scan?x_start=400&y_start=400&x_end=500&y_end=500&server_id=1349\n```\n\n**Performance**: Uses pipelining - sends all queries rapidly over one connection.\nA 100x100 region with step=20 = 36 queries completes in ~5-10 seconds.\n\n**Zone-based blockSize**: Automatically uses optimal blockSize for each region:\n- Far South (y <= 100): blockSize=20\n- Central (100 < y <= 600): blockSize=10\n- North (y > 600): blockSize=11","operationId":"scan_world_region_world_scan_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"x_start","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Starting X coordinate","default":0,"title":"X Start"},"description":"Starting X coordinate"},{"name":"y_start","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Starting Y coordinate","default":0,"title":"Y Start"},"description":"Starting Y coordinate"},{"name":"x_end","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Ending X coordinate","default":100,"title":"X End"},"description":"Ending X coordinate"},{"name":"y_end","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Ending Y coordinate","default":100,"title":"Y End"},"description":"Ending Y coordinate"},{"name":"server_id","in":"query","required":true,"schema":{"type":"integer","description":"Server ID","title":"Server Id"},"description":"Server ID"},{"name":"step","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":10,"description":"Grid step size","default":20,"title":"Step"},"description":"Grid step size"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapScanResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/find-player":{"get":{"tags":["World Map"],"summary":"Find Player On Map","description":"Search the map for a specific player by name.\n\n**Map coordinates**: 0-1000 for both X and Y.\nDefault scans the entire map (0-1000, 0-1000).\n\n**Tip**: If you know approximately where the player is, narrow\nthe search region for faster results.\n\nIf `session_key` is provided, uses that account's credentials directly\n(faster, bypasses queue). Otherwise, the request goes through the shared\nqueue and uses a fresh connection — this may take longer if the queue is busy.","operationId":"find_player_on_map_world_find_player_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Player name to search for (case-insensitive)","title":"Name"},"description":"Player name to search for (case-insensitive)"},{"name":"server_id","in":"query","required":true,"schema":{"type":"integer","description":"Server ID","title":"Server Id"},"description":"Server ID"},{"name":"x_start","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Search region start X","default":0,"title":"X Start"},"description":"Search region start X"},{"name":"y_start","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Search region start Y","default":0,"title":"Y Start"},"description":"Search region start Y"},{"name":"x_end","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Search region end X","default":1000,"title":"X End"},"description":"Search region end X"},{"name":"y_end","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Search region end Y","default":1000,"title":"Y End"},"description":"Search region end Y"},{"name":"step","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":20,"description":"Grid step size (20 recommended for full coverage, larger may miss players)","default":20,"title":"Step"},"description":"Grid step size (20 recommended for full coverage, larger may miss players)"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials directly (bypasses queue)","title":"Session Key"},"description":"Session key to use specific credentials directly (bypasses queue)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerSearchResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/share-coordinates":{"post":{"tags":["Chat"],"summary":"Share Coordinates","description":"Send a coordinate share message to another player.\n\nSends a clickable coordinate location to the target player via private chat.\nThe recipient will see the coordinates as a shareable map location they can\nclick to view on their map.\n\n**Capitol Building**: Default coordinates (499, 497) are the capitol building,\nwhich is at the same location on every server.\n\n**Use Cases**:\n- Share your alliance's rally point\n- Share enemy base locations\n- Share resource tile locations\n\n**Requirements**:\n- Your UID: Find this in your in-game profile settings\n- Target UID: The 16-digit UID of the player you want to message\n\nIf session_key is provided, uses that session's credentials directly.\n\n**Example**:\n```json\n{\n    \"target_uid\": \"1109037525001351\",\n    \"server_id\": 1364,\n    \"x\": 499,\n    \"y\": 497,\n    \"msg\": \"Rally here!\"\n}\n```","operationId":"share_coordinates_chat_share_coordinates_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"server_host","in":"query","required":false,"schema":{"type":"string","description":"Game server IP","default":"172.65.210.24","title":"Server Host"},"description":"Game server IP"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoordinateShareRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoordinateShareResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/share-coordinates-auto":{"post":{"tags":["Chat"],"summary":"Share Coordinates Auto","description":"Send a coordinate share with automatic owner lookup.\n\nThis is the **recommended endpoint** for sharing coordinates. It automatically:\n1. Queries the world map to find who owns the location at (x, y)\n2. Extracts the owner name and HQ level\n3. Sends the coordinate share with the correct attachment data\n\n**Capitol Building**: Default coordinates (499, 497) are the capitol building.\n\nIf session_key is provided, uses that session's credentials directly.\n\n**Example**:\n```json\n{\n    \"target_uid\": \"1109037525001351\",\n    \"server_id\": 1364,\n    \"x\": 499,\n    \"y\": 497\n}\n```","operationId":"share_coordinates_auto_chat_share_coordinates_auto_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"server_host","in":"query","required":false,"schema":{"type":"string","description":"Game server IP","default":"172.65.210.24","title":"Server Host"},"description":"Game server IP"},{"name":"session_key","in":"query","required":false,"schema":{"type":"string","description":"Session key to use specific credentials","title":"Session Key"},"description":"Session key to use specific credentials"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleCoordinateShareRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoordinateShareResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pool/stats":{"get":{"tags":["System"],"summary":"Get Pool Stats","description":"Get connection pool statistics.\n\nShows the health and status of all connections in the pool.\nUseful for monitoring load distribution and connection health.","operationId":"get_pool_stats_pool_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolStatsResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/queue/status/{request_id}":{"get":{"tags":["Queue"],"summary":"Queue Status","description":"Get current status of a queued request.\n\nUse this for polling or to check status after reconnecting.\nFor real-time updates, use /queue/stream/{request_id} instead.","operationId":"queue_status_queue_status__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queue/stream/{request_id}":{"get":{"tags":["Queue"],"summary":"Queue Stream","description":"Server-Sent Events stream for real-time queue updates.\n\nEvents:\n- status: Initial status when connecting\n- position: Queue position changed\n- processing: Request is now being processed\n- completed: Request completed successfully (includes result)\n- failed: Request failed (includes error)\n- cancelled: Request was cancelled\n\nUse this endpoint with EventSource in the browser.","operationId":"queue_stream_queue_stream__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queue/{request_id}":{"delete":{"tags":["Queue"],"summary":"Queue Cancel","description":"Cancel a queued request.\n\nOnly works for requests that are still queued (not processing).\nCancelled requests are not charged tokens.","operationId":"queue_cancel_queue__request_id__delete","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queue/stats":{"get":{"tags":["Queue"],"summary":"Queue Stats","description":"Get current queue statistics.","operationId":"queue_stats_queue_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/email/request-code":{"post":{"tags":["Auth"],"summary":"Request Email Code","description":"Request a verification code be sent to the email address.","operationId":"request_email_code_auth_email_request_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/verify":{"post":{"tags":["Auth"],"summary":"Verify Email Code","description":"Verify code and create session.","operationId":"verify_email_code_auth_email_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/validate":{"get":{"tags":["Auth"],"summary":"Validate Api Key","description":"Validate an API key without deducting tokens.\n\nReturns basic user info if the key is valid.\nUseful for the capture tool to verify credentials before starting capture.","operationId":"validate_api_key_auth_validate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/auth/sessions":{"get":{"tags":["Auth"],"summary":"Get User Sessions","description":"Get game sessions for the authenticated user.\n\nReturns a list of active game sessions with their session keys,\nwhich can be used to make API requests.","operationId":"get_user_sessions_auth_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/auth/credentials/upload":{"post":{"tags":["Auth"],"summary":"Upload Credentials With Apikey","description":"Upload game credentials captured from the PC game client.\n\nThis endpoint is designed for use with the lastwar-capture tool, which\ncaptures the authentication packets from the PC version of Last War.\n\n## Usage with lastwar-capture tool\n\n1. Run the capture tool while launching the game\n2. The tool will capture three files: handshake.bin, auth.bin, login.bin\n3. Upload all three files to this endpoint\n\n## Required files\n\n- **handshake.bin**: Initial e405/e406 connection packet\n- **auth.bin**: Authentication response packet\n- **login.bin**: Login completion packet\n\nAll three files are required. The server will validate the credentials\nby connecting to the game server before storing them.\n\nReturns:\n    Status, validation result, and player info from the game server","operationId":"upload_credentials_with_apikey_auth_credentials_upload_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"server_ip","in":"query","required":false,"schema":{"type":"string","description":"Game server IP from capture","title":"Server Ip"},"description":"Game server IP from capture"},{"name":"server_port","in":"query","required":false,"schema":{"type":"integer","description":"Game server port from capture","title":"Server Port"},"description":"Game server port from capture"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_credentials_with_apikey_auth_credentials_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/actions/claim-stamina":{"post":{"tags":["Actions"],"summary":"Claim Stamina","description":"Claim daily free stamina.\n\nRequires a session_key. Checks stamina status first, then claims if available.","operationId":"claim_stamina_actions_claim_stamina_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaminaClaimResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/actions/collect-visitors":{"post":{"tags":["Actions"],"summary":"Collect Visitors","description":"Collect all wall/gate visitors.\n\nRequires a session_key. Collects existing visitors first, then spawns\nand collects new ones until no more appear.","operationId":"collect_visitors_actions_collect_visitors_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorCollectResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/actions/collect-idle-rewards":{"post":{"tags":["Actions"],"summary":"Collect Idle Rewards","description":"Collect PvE idle rewards (truck resources).\n\nRequires a session_key. Previews available rewards, then claims them.","operationId":"collect_idle_rewards_actions_collect_idle_rewards_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdleRewardResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/actions/dispatch-trade-truck":{"post":{"tags":["Actions"],"summary":"Dispatch Trade Truck","description":"Roll for a trade truck quality and dispatch it.\n\nRequires a session_key. Lists trucks, rolls dice until target quality,\nsaves formation, dispatches.\n\n**Quality levels**: N, R, SR, SSR, UR (default target: UR)","operationId":"dispatch_trade_truck_actions_dispatch_trade_truck_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeDispatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeDispatchResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mail/system":{"get":{"tags":["Mail"],"summary":"Get System Mails","description":"Get system mail list.\n\nRequires a session_key - uses a fresh connection with that session's credentials.\nReturns system messages including server president mail,\nbattle reports, and game notifications.","operationId":"get_system_mails_mail_system_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"How many days back to fetch mails","default":30,"title":"Days"},"description":"How many days back to fetch mails"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemMailResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/rankings/daily":{"get":{"tags":["VS"],"summary":"Get Vs Daily Rankings","description":"Get VS player rankings for a specific day.\n\nRequires a session_key. Returns individual player scores for the given day.","operationId":"get_vs_daily_rankings_vs_rankings_daily_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"},{"name":"day","in":"query","required":false,"schema":{"type":"integer","maximum":6,"minimum":1,"description":"Day of the VS week (1-6)","default":1,"title":"Day"},"description":"Day of the VS week (1-6)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSRankingsResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/rankings/season":{"get":{"tags":["VS"],"summary":"Get Vs Season Rankings","description":"Get VS overall/season player rankings.\n\nRequires a session_key. Returns cumulative player scores for the entire VS season.","operationId":"get_vs_season_rankings_vs_rankings_season_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSRankingsResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/matchups":{"get":{"tags":["VS"],"summary":"Get Vs Matchups","description":"Get weekly VS matchup results.\n\nRequires a session_key. Returns alliance matchups with win/loss/score data.","operationId":"get_vs_matchups_vs_matchups_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"},{"name":"week","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Week number","default":1,"title":"Week"},"description":"Week number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSMatchupsResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/schedule":{"get":{"tags":["VS"],"summary":"Get Vs Schedule","description":"Get daily VS event schedule and MVPs.\n\nRequires a session_key. Returns the 6-day event schedule.","operationId":"get_vs_schedule_vs_schedule_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSScheduleResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/season":{"get":{"tags":["VS"],"summary":"Get Vs Season Info","description":"Get current VS season info.\n\nRequires a session_key. Returns tier, position, group, and previous season.","operationId":"get_vs_season_info_vs_season_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSSeasonResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vs/group":{"get":{"tags":["VS"],"summary":"Get Vs Group","description":"Get VS group standings.\n\nRequires a session_key. Returns the 16-alliance group with positions.","operationId":"get_vs_group_vs_group_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VSGroupResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/warzone/current":{"get":{"tags":["Warzone"],"summary":"Get Warzone Current","description":"Get current warzone round info.\n\nRequires a session_key. Returns scores for both servers in the current round.","operationId":"get_warzone_current_warzone_current_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarzoneResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/warzone/all-rounds":{"get":{"tags":["Warzone"],"summary":"Get Warzone All Rounds","description":"Get all warzone rounds history and server rankings.\n\nRequires a session_key. Returns complete round history with server rank points.","operationId":"get_warzone_all_rounds_warzone_all_rounds_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_key","in":"query","required":true,"schema":{"type":"string","description":"Session key (required)","title":"Session Key"},"description":"Session key (required)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarzoneResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AllianceMembersResponse":{"properties":{"alliance_id":{"type":"string","title":"Alliance Id"},"member_count":{"type":"integer","title":"Member Count"},"members_with_positions":{"type":"integer","title":"Members With Positions"},"total_power":{"type":"integer","title":"Total Power"},"total_power_formatted":{"type":"string","title":"Total Power Formatted"},"members":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Members"}},"type":"object","required":["alliance_id","member_count","members_with_positions","total_power","total_power_formatted","members"],"title":"AllianceMembersResponse","description":"Alliance members response."},"AllianceRankingResponse":{"properties":{"rank":{"type":"integer","title":"Rank","description":"Position in rankings"},"id":{"type":"string","title":"Id","description":"Alliance 32-char hex ID"},"abbr":{"type":"string","title":"Abbr","description":"Alliance tag"},"name":{"type":"string","title":"Name","description":"Full alliance name"},"power":{"type":"integer","title":"Power","description":"Total alliance power"},"power_formatted":{"type":"string","title":"Power Formatted","description":"Power with suffix"},"server_id":{"type":"integer","title":"Server Id","description":"Home server ID"},"member_count":{"type":"integer","title":"Member Count","description":"Current member count"},"max_member_count":{"type":"integer","title":"Max Member Count","description":"Max member capacity"},"leader":{"type":"string","title":"Leader","description":"Leader name"},"leader_uid":{"type":"string","title":"Leader Uid","description":"Leader UID"},"country":{"type":"string","title":"Country","description":"Alliance country code"},"icon":{"type":"string","title":"Icon","description":"Alliance icon ID"},"army_kill":{"type":"integer","title":"Army Kill","description":"Total army kills"},"army_kill_formatted":{"type":"string","title":"Army Kill Formatted","description":"Army kills with suffix"}},"type":"object","required":["rank","id","abbr","name","power","power_formatted","server_id","member_count","max_member_count","leader","leader_uid","country","icon","army_kill","army_kill_formatted"],"title":"AllianceRankingResponse","description":"Alliance ranking entry."},"Body_upload_credentials_with_apikey_auth_credentials_upload_post":{"properties":{"handshake":{"type":"string","contentMediaType":"application/octet-stream","title":"Handshake","description":"handshake.bin - initial connection packet"},"auth_packet":{"type":"string","contentMediaType":"application/octet-stream","title":"Auth Packet","description":"auth.bin - authentication packet"},"login":{"type":"string","contentMediaType":"application/octet-stream","title":"Login","description":"login.bin - login completion packet"}},"type":"object","required":["handshake","auth_packet","login"],"title":"Body_upload_credentials_with_apikey_auth_credentials_upload_post"},"ConnectionStatsResponse":{"properties":{"state":{"type":"string","title":"State"},"queue_size":{"type":"integer","title":"Queue Size"},"requests_completed":{"type":"integer","title":"Requests Completed"},"requests_failed":{"type":"integer","title":"Requests Failed"},"avg_response_time_ms":{"type":"number","title":"Avg Response Time Ms"},"reconnect_count":{"type":"integer","title":"Reconnect Count"}},"type":"object","required":["state","queue_size","requests_completed","requests_failed","avg_response_time_ms","reconnect_count"],"title":"ConnectionStatsResponse","description":"Statistics for a single connection."},"CoordinateShareRequest":{"properties":{"target_uid":{"type":"string","maxLength":16,"minLength":16,"title":"Target Uid","description":"Target player's UID (16-digit string)"},"server_id":{"type":"integer","title":"Server Id","description":"Server ID where coordinates are located"},"x":{"type":"integer","title":"X","description":"X coordinate","default":499},"y":{"type":"integer","title":"Y","description":"Y coordinate","default":497},"msg":{"type":"string","title":"Msg","description":"Message text (optional)","default":"?"},"owner_name":{"type":"string","title":"Owner Name","description":"EXACT name of owner at coordinates (from world.get.block)"},"level":{"type":"integer","title":"Level","description":"Object level (e.g., 7)","default":7},"oname_key":{"type":"string","title":"Oname Key","description":"Localization key (e.g., 'season_s3_cityname_lv7')","default":"season_s3_cityname_lv7"},"oname":{"type":"integer","title":"Oname","description":"Localization string ID (e.g., 311026)","default":311026}},"type":"object","required":["target_uid","server_id","owner_name"],"title":"CoordinateShareRequest","description":"Request body for coordinate sharing.\n\nIMPORTANT: The server validates that the attachment matches the actual\nlocation data. You must provide the exact owner_name that owns the base\nat the given coordinates, along with the correct localization keys.\n\nTo find this info, first query /world/block to get the location data.\nThe sender UID is automatically determined from the authenticated session."},"CoordinateShareResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the message was sent"},"target_uid":{"type":"string","title":"Target Uid","description":"Target player UID"},"server_id":{"type":"integer","title":"Server Id","description":"Server ID of shared coordinates"},"x":{"type":"integer","title":"X","description":"X coordinate shared"},"y":{"type":"integer","title":"Y","description":"Y coordinate shared"},"message":{"type":"string","title":"Message","description":"Status message"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name","description":"Owner name at coordinates (from lookup)"},"hq_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hq Level","description":"HQ level at coordinates (from lookup)"}},"type":"object","required":["success","target_uid","server_id","x","y","message"],"title":"CoordinateShareResponse","description":"Response from coordinate share."},"DetectResponse":{"properties":{"player_count":{"type":"integer","title":"Player Count","description":"Number of players detected"},"players":{"items":{"$ref":"#/components/schemas/DetectedPlayerResponse"},"type":"array","title":"Players","description":"List of detected players"}},"type":"object","required":["player_count","players"],"title":"DetectResponse","description":"Radar detection response."},"DetectedPlayerResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Player display name"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid","description":"Player unique ID"},"power":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Power","description":"Player power"},"power_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Power Formatted","description":"Power with suffix (M/B)"},"point_id":{"type":"integer","title":"Point Id","description":"Encoded position (y*1000+x)"},"x":{"type":"integer","title":"X","description":"X coordinate"},"y":{"type":"integer","title":"Y","description":"Y coordinate"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id","description":"Home server"}},"type":"object","required":["name","uid","power","power_formatted","point_id","x","y","server_id"],"title":"DetectedPlayerResponse","description":"Player detected on the radar/world map."},"EmailAuthRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email address for verification"}},"type":"object","required":["email"],"title":"EmailAuthRequest"},"EmailVerifyRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email address"},"code":{"type":"string","title":"Code","description":"6-digit verification code"}},"type":"object","required":["email","code"],"title":"EmailVerifyRequest"},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["error"],"title":"ErrorResponse","description":"Error response."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IdleRewardResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether claim succeeded"},"message":{"type":"string","title":"Message","description":"Status message"},"preview_size":{"type":"integer","title":"Preview Size","description":"Preview response size","default":0},"claim_size":{"type":"integer","title":"Claim Size","description":"Claim response size","default":0}},"type":"object","required":["success","message"],"title":"IdleRewardResponse","description":"Response from claiming PvE idle rewards."},"KingdomPositionResponse":{"properties":{"position_id":{"type":"string","title":"Position Id","description":"Position ID (10001=King, 10002=Queen, etc.)"},"position_name":{"type":"string","title":"Position Name","description":"Human-readable position name"},"player_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player Name","description":"Name of player holding position"},"player_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Player Uid","description":"UID of player holding position"},"alliance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Name","description":"Player's alliance name"},"alliance_abbr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Abbr","description":"Player's alliance tag"},"appoint_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Appoint Time","description":"Timestamp when appointed"},"gender":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gender","description":"Required gender (0=any)"}},"type":"object","required":["position_id","position_name","player_name","player_uid","alliance_name","alliance_abbr","appoint_time","gender"],"title":"KingdomPositionResponse","description":"Kingdom government position."},"MapBaseResponse":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Player name"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid","description":"Player UID (16 digits)"},"alliance_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Tag","description":"Alliance tag (e.g., D2WN)"},"alliance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Id","description":"Alliance ID (32 hex chars)"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Country code (e.g., US, AR)"},"hq_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hq Level","description":"Headquarters level (1-30+)"},"shielded":{"type":"boolean","title":"Shielded","description":"True if base has active shield (F18 != max uint64)","default":false},"point_id":{"type":"integer","title":"Point Id","description":"Encoded position (y*1000+x)"},"x":{"type":"integer","title":"X","description":"X coordinate"},"y":{"type":"integer","title":"Y","description":"Y coordinate"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id","description":"Current server (from field 102)"}},"type":"object","required":["point_id","x","y"],"title":"MapBaseResponse","description":"Base/player found on the world map (from triggers.points protobuf)."},"MapBlockResponse":{"properties":{"query_x":{"type":"integer","title":"Query X","description":"Queried X coordinate"},"query_y":{"type":"integer","title":"Query Y","description":"Queried Y coordinate"},"base_count":{"type":"integer","title":"Base Count","description":"Number of bases found (from serverPointArr)"},"bases":{"items":{"$ref":"#/components/schemas/MapBaseResponse"},"type":"array","title":"Bases","description":"List of bases in the area"},"zombie_count":{"type":"integer","title":"Zombie Count","description":"Number of active zombie hunts (from marchInfos)","default":0},"zombies":{"items":{"$ref":"#/components/schemas/ZombieHuntResponse"},"type":"array","title":"Zombies","description":"Active zombie hunts"}},"type":"object","required":["query_x","query_y","base_count","bases"],"title":"MapBlockResponse","description":"World map block query response."},"MapScanResponse":{"properties":{"region":{"type":"string","title":"Region","description":"Scanned region description"},"blocks_scanned":{"type":"integer","title":"Blocks Scanned","description":"Number of blocks queried"},"base_count":{"type":"integer","title":"Base Count","description":"Total bases found"},"bases":{"items":{"$ref":"#/components/schemas/MapBaseResponse"},"type":"array","title":"Bases","description":"All bases found"}},"type":"object","required":["region","blocks_scanned","base_count","bases"],"title":"MapScanResponse","description":"World map scan response."},"MemberResponse":{"properties":{"uid":{"type":"string","title":"Uid","description":"Player unique ID"},"name":{"type":"string","title":"Name","description":"Player display name"},"hq_level":{"type":"integer","title":"Hq Level","description":"HQ level (1-30+)"},"power":{"type":"integer","title":"Power","description":"Player power"},"power_formatted":{"type":"string","title":"Power Formatted","description":"Power with suffix (M/B)"},"server_id":{"type":"integer","title":"Server Id","description":"Home server"},"current_server_id":{"type":"integer","title":"Current Server Id","description":"Current server"},"point_id":{"type":"integer","title":"Point Id","description":"Encoded position (y*1000+x)"},"x":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X","description":"X coordinate (null if not visible)"},"y":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Y","description":"Y coordinate (null if not visible)"},"rank":{"type":"integer","title":"Rank","description":"Alliance rank (1=R1 Leader)"},"online":{"type":"boolean","title":"Online","description":"Currently online"},"join_time":{"type":"integer","title":"Join Time","description":"Unix timestamp when joined alliance"},"army_kill":{"type":"integer","title":"Army Kill","description":"Troops killed"},"career_type":{"type":"integer","title":"Career Type","description":"Career/class type"},"career_level":{"type":"integer","title":"Career Level","description":"Career level"},"offline_time":{"type":"integer","title":"Offline Time","description":"Last offline timestamp"}},"type":"object","required":["uid","name","hq_level","power","power_formatted","server_id","current_server_id","point_id","x","y","rank","online","join_time","army_kill","career_type","career_level","offline_time"],"title":"MemberResponse","description":"Alliance member data."},"PlayerSearchResponse":{"properties":{"found":{"type":"boolean","title":"Found","description":"Whether the player was found"},"search_name":{"type":"string","title":"Search Name","description":"Name searched for"},"blocks_scanned":{"type":"integer","title":"Blocks Scanned","description":"Number of blocks queried"},"player":{"anyOf":[{"$ref":"#/components/schemas/MapBaseResponse"},{"type":"null"}],"description":"Player info if found"}},"type":"object","required":["found","search_name","blocks_scanned","player"],"title":"PlayerSearchResponse","description":"Player search result."},"PoolStatsResponse":{"properties":{"total_connections":{"type":"integer","title":"Total Connections"},"ready_connections":{"type":"integer","title":"Ready Connections"},"connections":{"additionalProperties":{"$ref":"#/components/schemas/ConnectionStatsResponse"},"type":"object","title":"Connections"}},"type":"object","required":["total_connections","ready_connections","connections"],"title":"PoolStatsResponse","description":"Connection pool statistics."},"QueueStatusResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"endpoint":{"type":"string","title":"Endpoint"},"status":{"type":"string","title":"Status"},"position":{"type":"integer","title":"Position"},"total_queue_size":{"type":"integer","title":"Total Queue Size"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"token_cost":{"type":"integer","title":"Token Cost"},"queued_at":{"type":"number","title":"Queued At"},"completed_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["request_id","endpoint","status","position","total_queue_size","token_cost","queued_at"],"title":"QueueStatusResponse","description":"Response from queue status check."},"RewardItem":{"properties":{"type":{"type":"integer","title":"Type","description":"Reward type code"},"id":{"type":"string","title":"Id","description":"Item ID"},"num":{"type":"string","title":"Num","description":"Quantity"}},"type":"object","required":["type","id","num"],"title":"RewardItem","description":"A single reward item from a reward mail."},"SimpleCoordinateShareRequest":{"properties":{"target_uid":{"type":"string","maxLength":16,"minLength":16,"title":"Target Uid","description":"Target player's UID (16-digit string)"},"server_id":{"type":"integer","title":"Server Id","description":"Server ID where coordinates are located"},"x":{"type":"integer","title":"X","description":"X coordinate","default":499},"y":{"type":"integer","title":"Y","description":"Y coordinate","default":497},"msg":{"type":"string","title":"Msg","description":"Message text (optional)","default":"?"}},"type":"object","required":["target_uid","server_id"],"title":"SimpleCoordinateShareRequest","description":"Simplified request for coordinate sharing with auto-lookup.\n\nThis endpoint automatically looks up the owner info at the given coordinates\nbefore sending the share, so you don't need to know who owns the location.\nThe sender UID is automatically determined from the authenticated session."},"StaminaClaimResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the claim succeeded"},"message":{"type":"string","title":"Message","description":"Status message"},"response_size":{"type":"integer","title":"Response Size","description":"Raw response size in bytes","default":0}},"type":"object","required":["success","message"],"title":"StaminaClaimResponse","description":"Response from claiming daily stamina."},"SystemMailEntry":{"properties":{"uid":{"type":"string","title":"Uid","description":"Mail UUID (32-char hex)"},"type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Type","description":"Mail type code"},"type_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Name","description":"Human-readable mail type"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Mail title/subject text"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Mail body text"},"battle_report":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Battle Report","description":"Base64 battle report data (for battle report mails)"},"rewards":{"anyOf":[{"items":{"$ref":"#/components/schemas/RewardItem"},"type":"array"},{"type":"null"}],"title":"Rewards","description":"Reward items (for reward mails)"},"from_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From User","description":"Sender UID"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name","description":"Sender display name"},"to_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To User","description":"Recipient UID"},"send_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Send Time","description":"Send timestamp (ms)"},"create_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Create Time","description":"Create timestamp (ms)"},"expire_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expire Time","description":"Expire timestamp (ms)"},"reward_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reward Status","description":"0=unclaimed, 1=claimed"},"status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status","description":"0=unread, 1=read"},"save_flag":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Save Flag","description":"Save flag"},"custom":{"anyOf":[{},{"type":"null"}],"title":"Custom","description":"Custom metadata"}},"type":"object","required":["uid"],"title":"SystemMailEntry","description":"A single system mail entry with cleaned-up fields."},"SystemMailResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"mails":{"items":{"$ref":"#/components/schemas/SystemMailEntry"},"type":"array","title":"Mails","description":"Parsed mail entries"},"mail_count":{"type":"integer","title":"Mail Count","description":"Number of mails returned","default":0},"more":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"More","description":"Whether more mails are available"},"last_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Uid","description":"UID of last mail for pagination"},"response_size":{"type":"integer","title":"Response Size","description":"Raw response size in bytes"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"SystemMailResponse","description":"Response from system mail query."},"TradeDispatchRequest":{"properties":{"hero_uuids":{"items":{"type":"integer"},"type":"array","maxItems":4,"minItems":1,"title":"Hero Uuids","description":"List of hero UUIDs to dispatch (up to 4)"},"target_quality":{"type":"string","title":"Target Quality","description":"Target quality to roll for (N, R, SR, SSR, UR)","default":"UR"},"max_rolls":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Max Rolls","description":"Maximum dice rolls before giving up","default":50},"squad_no":{"type":"integer","title":"Squad No","description":"Squad number","default":2},"chip_equip_group":{"type":"integer","title":"Chip Equip Group","description":"Chip equipment group","default":1}},"type":"object","required":["hero_uuids"],"title":"TradeDispatchRequest","description":"Request body for trade truck dispatch."},"TradeDispatchResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether dispatch succeeded"},"station_uuid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Station Uuid","description":"Train station UUID used"},"rolls":{"type":"integer","title":"Rolls","description":"Number of dice rolls performed","default":0},"achieved_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Achieved Quality","description":"Quality achieved (N/R/SR/SSR/UR)"},"target_quality":{"type":"string","title":"Target Quality","description":"Target quality requested"},"message":{"type":"string","title":"Message","description":"Status message"}},"type":"object","required":["success","target_quality","message"],"title":"TradeDispatchResponse","description":"Response from trade truck dispatch."},"VSAllianceMatchup":{"properties":{"alliance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"abbr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Abbr"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id"},"wins":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wins","description":"Day wins"},"win_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Win Score","description":"Win points"},"total_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Score","description":"Total VS score"}},"type":"object","title":"VSAllianceMatchup","description":"One alliance in a VS matchup."},"VSDaySchedule":{"properties":{"day":{"type":"integer","title":"Day"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id","description":"Event config ID"},"description_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Id","description":"Description config ID"},"score_multiplier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score Multiplier"},"is_win":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Win","description":"1=won, None=not played"},"mvp":{"anyOf":[{"$ref":"#/components/schemas/VSMVPInfo"},{"type":"null"}]}},"type":"object","required":["day"],"title":"VSDaySchedule","description":"A single day's VS event schedule."},"VSDuelSeason":{"properties":{"rank_type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank Type","description":"Tier (1=Gold, 2=Silver, 3=Bronze)"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position","description":"Position within group"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","description":"Group identifier"},"round_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Round Result","description":"Round results string"}},"type":"object","title":"VSDuelSeason","description":"Current and previous VS season info."},"VSGroupEntry":{"properties":{"position":{"type":"integer","title":"Position"},"alliance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"abbr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Abbr"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id"},"rank_type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank Type"},"round_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Round Result"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"}},"type":"object","required":["position"],"title":"VSGroupEntry","description":"An alliance in the VS group standings."},"VSGroupResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"standings":{"items":{"$ref":"#/components/schemas/VSGroupEntry"},"type":"array","title":"Standings"},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"VSGroupResponse","description":"Response from VS group standings query."},"VSMVPInfo":{"properties":{"uid":{"type":"string","title":"Uid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"alliance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Name"},"alliance_abbr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Abbr"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id"}},"type":"object","required":["uid"],"title":"VSMVPInfo","description":"MVP player for a VS day."},"VSMatchup":{"properties":{"alliance_1":{"$ref":"#/components/schemas/VSAllianceMatchup"},"alliance_2":{"$ref":"#/components/schemas/VSAllianceMatchup"},"decided":{"type":"boolean","title":"Decided","description":"Whether result is final","default":false}},"type":"object","required":["alliance_1","alliance_2"],"title":"VSMatchup","description":"A VS matchup between two alliances."},"VSMatchupsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"matchups":{"items":{"$ref":"#/components/schemas/VSMatchup"},"type":"array","title":"Matchups"},"week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Week"},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"VSMatchupsResponse","description":"Response from weekly matchups query."},"VSPlayerRanking":{"properties":{"rank":{"type":"integer","title":"Rank","description":"Rank position"},"uid":{"type":"string","title":"Uid","description":"Player UID"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Player name"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score","description":"VS score"},"alliance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Name","description":"Alliance name"},"alliance_abbr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Abbr","description":"Alliance abbreviation"},"server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Server Id","description":"Server ID"},"alliance_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alliance Id","description":"Alliance UUID"}},"type":"object","required":["rank","uid"],"title":"VSPlayerRanking","description":"A player's VS ranking entry."},"VSRankingsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"rankings":{"items":{"$ref":"#/components/schemas/VSPlayerRanking"},"type":"array","title":"Rankings"},"player_count":{"type":"integer","title":"Player Count","description":"Number of ranked players","default":0},"day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day","description":"Day number (1-6) for daily rankings"},"rank_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rank Type","description":"'daily' or 'season'"},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"VSRankingsResponse","description":"Response from VS rankings query."},"VSScheduleResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"schedule":{"items":{"$ref":"#/components/schemas/VSDaySchedule"},"type":"array","title":"Schedule"},"start_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Time","description":"Week start timestamp (ms)"},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"VSScheduleResponse","description":"Response from weekly schedule query."},"VSSeasonResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"current":{"anyOf":[{"$ref":"#/components/schemas/VSDuelSeason"},{"type":"null"}]},"previous":{"anyOf":[{"$ref":"#/components/schemas/VSDuelSeason"},{"type":"null"}]},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"VSSeasonResponse","description":"Response from VS season info query."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VisitorCollectResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether collection succeeded"},"total_collected":{"type":"integer","title":"Total Collected","description":"Number of visitors collected"},"message":{"type":"string","title":"Message","description":"Status message"}},"type":"object","required":["success","total_collected","message"],"title":"VisitorCollectResponse","description":"Response from collecting all wall visitors."},"WarzoneResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"current_round":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Round"},"rounds":{"items":{"$ref":"#/components/schemas/WarzoneRound"},"type":"array","title":"Rounds"},"server_rankings":{"additionalProperties":{"type":"integer"},"type":"object","title":"Server Rankings","description":"Server ID -> rank points"},"response_size":{"type":"integer","title":"Response Size"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","response_size","message"],"title":"WarzoneResponse","description":"Response from cross-throne/warzone query."},"WarzoneRound":{"properties":{"round":{"type":"integer","title":"Round"},"server_id":{"type":"integer","title":"Server Id"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"vs_server_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vs Server Id"},"win":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Win","description":"1=won, -1=lost, 0=undecided"},"start_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End Time"}},"type":"object","required":["round","server_id"],"title":"WarzoneRound","description":"A single warzone round entry."},"ZombieHuntResponse":{"properties":{"monster_id":{"type":"integer","title":"Monster Id","description":"Zombie/monster type ID"},"monster_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monster Level","description":"Estimated level from ID"},"point_id":{"type":"integer","title":"Point Id","description":"Zombie location (y*1000+x)"},"x":{"type":"integer","title":"X","description":"X coordinate"},"y":{"type":"integer","title":"Y","description":"Y coordinate"},"march_type":{"type":"integer","title":"March Type","description":"March type (2=zombie hunt)"},"status":{"type":"integer","title":"Status","description":"Status (1=active)"}},"type":"object","required":["monster_id","point_id","x","y","march_type","status"],"title":"ZombieHuntResponse","description":"Active zombie hunt on the world map (from marchInfos)."}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}