{"openapi":"3.1.0","info":{"title":"LaunchMC Guard Server Autologin","version":"1.1.0","description":"Optional offline account login over verified Guard TLS. First authenticate the player in your own system, then request explicit consent in Minecraft. Keep the Guard operator token private. Requests must originate from your backend. Never authenticate from a nickname or connectionId alone. Account settings in LaunchMC provide revocation."},"servers":[{"url":"https://api.launchmc.pl"}],"security":[{"guardOperator":[]}],"components":{"securitySchemes":{"guardOperator":{"type":"http","scheme":"bearer","description":"Existing registered Guard TLS server credential (43-character base64url)."}}},"paths":{"/v1/server/auth/links":{"post":{"operationId":"requestServerLogin","summary":"Request in-game consent after your own successful login","description":"accountId is your immutable local account ID. Obtain connectionId from fresh GuardResult.authConnectionId(). Send returned requestId using LMA1 plugin message operation 40 on launchmc:api or LaunchMC|API: big-endian magic 0x4c4d4131, byte 40, int32 correlation, uint16 36, ASCII UUID. The game retrieves verified terms and shows a native consent window. durationSeconds is required: 60..315360000 or null for indefinite access. The 3-minute deadline is only for answering; the requested duration starts on approval. Identical requests are idempotent; changing duration requires a new connection. Plugin-message acknowledgements cannot authenticate or grant consent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","pattern":"^[a-f0-9]{32}$"},"accountId":{"type":"string","pattern":"^[A-Za-z0-9_.:@-]{1,128}$"},"durationSeconds":{"anyOf":[{"type":"integer","minimum":60,"maximum":315360000},{"type":"null"}]}},"required":["connectionId","accountId","durationSeconds"]}}}},"responses":{"201":{"description":"Consent requested","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"requestId":{"type":"string","format":"uuid"},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["pending","approved","denied"]}},"required":["requestId","expiresAt","status"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid operator credential","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Guard TLS, account session or consent unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict or ticket already consumed","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/server/auth/links/requests/{id}":{"get":{"operationId":"getServerLoginConsent","summary":"Poll consent status for your server","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Consent status; save approved linkId for revocation","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"requestId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","approved","denied","expired"]},"linkId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["requestId","status","linkId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid operator credential","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Guard TLS, account session or consent unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict or ticket already consumed","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/server/auth/links/{id}":{"delete":{"operationId":"revokeServerLogin","summary":"Revoke your server account link","description":"Call after account deletion, password reset or ownership change in your system. Existing authenticated game sessions remain your responsibility.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Revoked (idempotent)","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ok":{"const":true}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid operator credential","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Guard TLS, account session or consent unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict or ticket already consumed","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/server/auth/attempts":{"post":{"operationId":"createServerLoginAttempt","summary":"Request a one-time ticket for the current Guard TLS connection","description":"Valid for 30 seconds. Reissuing replaces any unconsumed ticket. A consumed connection cannot obtain another ticket.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["connectionId"]}}}},"responses":{"201":{"description":"Ticket issued; never log or send to the game client","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"attemptId":{"type":"string","format":"uuid"},"ticket":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"connectionId":{"type":"string","pattern":"^[a-f0-9]{32}$"},"expiresAt":{"type":"string","format":"date-time"}},"required":["attemptId","ticket","connectionId","expiresAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid operator credential","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Guard TLS, account session or consent unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict or ticket already consumed","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/server/auth/attempts/{id}/consume":{"post":{"operationId":"consumeServerLoginAttempt","summary":"Atomically consume a ticket and authenticate its current connection","description":"On success, check your bans/2FA/access policy and that the same player connection still has fresh Guard TLS before completing login. Lost responses must fall back to ordinary login. Never log the response.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","pattern":"^[a-f0-9]{32}$"},"ticket":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"}},"required":["connectionId","ticket"]}}}},"responses":{"200":{"description":"Authenticated for this connection only","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"authenticated":{"const":true},"serverId":{"type":"string"},"connectionId":{"type":"string","pattern":"^[a-f0-9]{32}$"},"playerUuid":{"type":"string","pattern":"^[a-f0-9]{32}$"},"playerName":{"type":"string"},"accountId":{"type":"string"},"linkId":{"type":"string","format":"uuid"}},"required":["authenticated","serverId","connectionId","playerUuid","playerName","accountId","linkId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid operator credential","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Guard TLS, account session or consent unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict or ticket already consumed","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}