{"openapi":"3.1.0","info":{"title":"WRKarma API","description":"Global map ratings from connected game servers. Server enrollment uses a derived credential proof; it is not independent Nadeo ownership verification.","version":"1.0.0"},"paths":{"/api/v1/karma/health":{"get":{"summary":"Mania Karma service status","operationId":"karma_health_api_v1_karma_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/karma/maps":{"get":{"summary":"Search public map ratings","operationId":"karma_maps_api_v1_karma_maps_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100,"default":"","title":"Q"}},{"name":"game","in":"query","required":false,"schema":{"enum":["","TMN","TMF"],"type":"string","default":"","title":"Game"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["recent","rating","votes"],"type":"string","default":"recent","title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/karma/maps/{game}/{uid}":{"get":{"summary":"Global and optional server-local map ratings","operationId":"karma_map_api_v1_karma_maps__game___uid__get","parameters":[{"name":"game","in":"path","required":true,"schema":{"enum":["TMN","TMF"],"type":"string","title":"Game"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_-]+$","title":"Uid"}},{"name":"server","in":"query","required":false,"schema":{"type":"string","maxLength":100,"default":"","title":"Server"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/karma/votes":{"post":{"summary":"Set or withdraw a player vote from an authenticated controller","description":"Six nonzero levels; zero withdraws. Controller-provided identity and\nfinish claims are not an independent proof of a real player.","operationId":"karma_vote_api_v1_karma_votes_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KarmaVote"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/karma/player-vote":{"get":{"summary":"Read one player vote using a server session","operationId":"karma_player_vote_api_v1_karma_player_vote_get","parameters":[{"name":"game","in":"query","required":true,"schema":{"enum":["TMN","TMF"],"type":"string","title":"Game"}},{"name":"uid","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_-]+$","title":"Uid"}},{"name":"login","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Login"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/servers/authenticate":{"post":{"summary":"Authenticate Server","operationId":"authenticate_server_api_v1_servers_authenticate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerAuthenticate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"servers":[{"url":"https://karma.wrmania.net"}],"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KarmaMap":{"properties":{"uid":{"type":"string","maxLength":100,"minLength":1,"title":"Uid"},"name":{"type":"string","maxLength":180,"minLength":1,"title":"Name"},"author":{"type":"string","maxLength":100,"minLength":1,"title":"Author"},"environment":{"type":"string","maxLength":50,"minLength":1,"title":"Environment"}},"additionalProperties":false,"type":"object","required":["uid","name","author","environment"],"title":"KarmaMap"},"KarmaPlayer":{"properties":{"login":{"type":"string","maxLength":100,"minLength":1,"title":"Login"}},"additionalProperties":false,"type":"object","required":["login"],"title":"KarmaPlayer"},"KarmaVote":{"properties":{"game":{"type":"string","enum":["TMN","TMF"],"title":"Game"},"map":{"$ref":"#/components/schemas/KarmaMap"},"player":{"$ref":"#/components/schemas/KarmaPlayer"},"vote":{"type":"integer","maximum":3.0,"minimum":-3.0,"title":"Vote"},"operationId":{"type":"string","maxLength":36,"minLength":36,"title":"Operationid"},"castAt":{"type":"integer","maximum":9999999999999.0,"minimum":0.0,"title":"Castat"}},"additionalProperties":false,"type":"object","required":["game","map","player","vote","operationId","castAt"],"title":"KarmaVote"},"ServerAuthenticate":{"properties":{"game":{"type":"string","maxLength":24,"minLength":2,"title":"Game"},"login":{"type":"string","maxLength":100,"minLength":1,"title":"Login"},"credentialProof":{"type":"string","maxLength":64,"minLength":64,"title":"Credentialproof"},"nation":{"type":"string","maxLength":3,"title":"Nation","default":""}},"additionalProperties":false,"type":"object","required":["game","login","credentialProof"],"title":"ServerAuthenticate","description":"Dedimania-style credentials for auto-enrollment (NOT Nadeo verification)."},"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"}}}}