Link Guest Account to Google
horizon_link_googleConverts a signed-in guest player into a Google account while preserving the same user ID, so the current session continues after Google OAuth account linking is chosen.
Instructions
Converts a signed-in guest player into a Google account while keeping the same user ID. Use when: a guest player completes Google OAuth and explicitly chooses to link the account. Not for: new players (use horizon_signup_google), existing google accounts (use horizon_signin_google) and accounts that are not guests. Requires: a signed-in guest player: the userId and current accessToken from horizon_signup_anonymous or horizon_signin_anonymous. Side effects: exchanges the single-use Google code once and turns the guest into a GOOGLE account with the same userId. The current session keeps working and the guest anonymous token is deleted on the server. Returns: 200 with userId, email, googleId, isAnonymous: false, isVerified and authStatus: AUTHENTICATED. Use horizon_signin_google on other devices. Errors: 409 when the Google account already belongs to another account or the account is not a guest: do not retry, ask the player. 401 for an invalid session: sign in again. 400 for invalid input. 404 or 403 for other failures. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"userId": "<userId>",
"sessionToken": "<sessionToken>",
"googleAuthorizationCode": "<googleAuthorizationCode>",
"googleRedirectUri": "<googleRedirectUri>"
},
"name": "horizon_link_google"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | Player user ID (UUID) from the result of horizon_signup_* or horizon_signin_* | |
| sessionToken | Yes | Player accessToken from signup, signin or refresh-session, passed as sessionToken (max 256 characters) | |
| googleRedirectUri | Yes | Exact redirect URI used to obtain the Google authorization code; empty string for configured native flows (max 500 characters) | |
| preferredLanguage | No | Optional language code for the account, such as en or de (max 10 characters) | |
| googleAuthorizationCode | Yes | Fresh single-use Google authorization code obtained by the player's OAuth consent flow (max 2000 characters) |