Skip to main content

AppTokenResponse

A short-lived, app-scoped gameplay token (portal). Confined to a single app: usable only against that app's Application API + Buddy realtime surface (plus read-only me and same-app refreshAppToken). It CANNOT perform management operations and CANNOT mint tokens for other apps, so a game stack that receives it never gets the player's full identity session.

type AppTokenResponse {
token: String!
gameTokenId: String!
appId: String!
userId: BigInt!
expiresAt: String!
applicationApiUrl: String
gameApiUrl: String @deprecated
applicationApiWsUrl: String
gameApiWsUrl: String @deprecated
discoveryUrl: String
launchUrl: String
authorizedServer: ServerStatus
runtimeGate: AppRuntimeGate
playerPass: String
}

Fields​

AppTokenResponse.token ● String! non-null scalar​

Opaque app-scoped gameplay token. Send to the target app's Application API as Authorization: Bearer <token> (and in the realtime connectionParams). Do NOT send it to the Management API for anything other than me/refreshAppToken.

AppTokenResponse.gameTokenId ● String! non-null scalar​

Identifier of the underlying game_token row, as a String.

AppTokenResponse.appId ● String! non-null scalar​

The app this token is confined to, as a String.

AppTokenResponse.userId ● BigInt! non-null scalar​

The user the token signs in (BigInt as a decimal string): the id me returns as userId. A game server that signs a player in with mintManagedPlayerToken reads the player here and needs no me call. Every field that answers an app token carries it: mintAppToken, refreshAppToken, mintManagedPlayerToken, exchangeManagedPlayerAssertion, exchangePortalCode and signInWithMinecraft.

AppTokenResponse.expiresAt ● String! non-null scalar​

ISO-8601 UTC expiry. Call refreshAppToken (same app) before this. A different app needs its own token: a hosted sign-in for that app, or mintAppToken with the session.

AppTokenResponse.applicationApiUrl ● String scalar​

Base HTTPS URL of the Application API that serves this app — its OWN datacenter's endpoint when a placement exists, because that is where the app's shards are. Null if the app has no dedicated/shared Application API route yet. Use this for gameplay; use discoveryUrl to recover if it stops answering.

AppTokenResponse.gameApiUrl ● String deprecated scalar​

DEPRECATED

Use applicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027.

Base HTTPS URL of the Application API that serves this app — its OWN datacenter's endpoint when a placement exists, because that is where the app's shards are. Null if the app has no dedicated/shared Application API route yet. Use this for gameplay; use discoveryUrl to recover if it stops answering.

AppTokenResponse.applicationApiWsUrl ● String scalar​

WebSocket URL of the Application API that serves this app (wss://), for realtime subscriptions.

AppTokenResponse.gameApiWsUrl ● String deprecated scalar​

DEPRECATED

Use applicationApiWsUrl: the Game API is now the Application API. Removed on January 1, 2027.

WebSocket URL of the Application API that serves this app (wss://), for realtime subscriptions.

AppTokenResponse.discoveryUrl ● String scalar​

Stable entry origin, resolving to every datacenter, that always reaches SOME healthy instance. Use it to re-discover endpoints when applicationApiUrl stops answering: a token-holding client cannot re-mint, because that needs the identity session it does not have. Never a per-datacenter or per-instance address.

AppTokenResponse.launchUrl ● String scalar​

Browser launch URL for this app (where the player's browser plays it), if configured.

AppTokenResponse.authorizedServer ● ServerStatus object​

Set only by refreshAppToken when the caller passed currentServer: the Buddy the NEW token was just authorized on, which is the node the client is already connected to. When present, keep the existing UDP session and start signing datagrams with the new token; there is no need to call serverWithLeastClients. Null when the caller passed nothing, or when that node can no longer serve this app (gone, draining, Full, or not local to the app) -- then call serverWithLeastClients for a fresh placement, exactly as before.

AppTokenResponse.runtimeGate ● AppRuntimeGate object​

The app's runtime gate when the token was minted. A token is issued for a paused app too, so a client can read status and reason and tell the player the world is paused; realtime sends and hub calls are refused until status is ACTIVE again. Null only when the gate could not be read.

AppTokenResponse.playerPass ● String scalar​

A player pass for the user and app of this token: a signed statement from Crowded Kingdoms that this player is signed in to this app. It expires when the token does, and each refresh answers a new one. Your game server shows it on its hub connection, and an app that requires a pass (setExecCallAsPolicy) then accepts the hub calls the server makes for the player. A pass signs nobody in and opens no connection. Keep it on your servers. Null when hubs are not set up on this tier.

Returned By​

exchangeManagedPlayerAssertion mutation ● exchangePortalCode mutation ● mintAppToken mutation ● mintManagedPlayerToken mutation ● refreshAppToken mutation ● signInWithMinecraft mutation