Overview

Link a custom identifier to the player's account.

Client

Require permission rules masterPlayer.linkCustomId.selfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/client/linkCustomId

Request Headers
NameRequiredDescription
Auth-TokentrueA token used to authenticate the user. It is issued after successful login from the client type authenticate (e.g., loginByAccount, loginWithCustomId, etc.) or when an admin logs in via the GearN Dashboard. This token identifies the request sender and determines their access level.
Secret-KeytrueThe SecretKey in SecretInfo with role must is Player.
Game-IdOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typetrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringThe unique identifier of the player. (10 characters)
customIdstringtrueA unique custom identifier used to link or authenticate the player. (6 - 64 characters)
forceLinkbooleanForceLink parameter. (Default: false)
Server

Require permission rules masterPlayer.linkCustomId.serverSelfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/server/linkCustomId

Request Headers
NameRequiredDescription
Secret-KeytrueThe SecretKey in SecretInfo with role must is Server.
Game-IdOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typetrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringtrueThe unique identifier of the player. (10 characters)
customIdstringtrueA unique custom identifier used to link or authenticate the player. (6 - 64 characters)
forceLinkbooleanForceLink parameter. (Default: false)
Admin

Require permission rules masterPlayer.linkCustomId.adminSelfEnable. See PermissionRules

HTTP

POST /api/rJson/masterPlayer/admin/linkCustomId

Request Headers
NameRequiredDescription
Secret-KeytrueThe SecretKey in SecretInfo with role must is Admin.
Game-IdOptional if the gameId in the SecretInfo use in headers Secret-Key has assign a valid value, if not, let unique identifier of the game this request is targeting.
Content-Typetrueapplication/json
Request Body
CodeTypeRequiredDescription
userIdstringtrueThe unique identifier of the player. (10 characters)
customIdstringtrueA unique custom identifier used to link or authenticate the player. (6 - 64 characters)
forceLinkbooleanForceLink parameter. (Default: false)
Response Body

200 Ok

CodeTypeRequiredDescription
returnCodeReturnCodetrueAdditional metadata that can be attached to any request. Especially useful when working with advanced features such as EventCallbackScript. See ReturnCode
debugMessagestringA developer-oriented message that provides additional context useful for debugging and internal logging. This field is not intended for end-users and may include stack traces, validation failures, or internal error diagnostics.
invalidRequestParametersInvalidMember[]Just had data when the returnCode is InvalidRequestParameters.A list of members that failed validation or could not be processed during the request. Each entry typically includes identifying information and an error reason. This is useful for partial success scenarios where some members are accepted and others are rejected. See InvalidMember
parametersResponseDataJust had data when the returnCode is Ok. A dynamic set of key-value pairs included in the response to provide additional context or metadata. These parameters may vary depending on the operation and typically contain optional fields such as timestamps, identifiers, or computed values relevant to the result. See ResponseData
ReturnCode
NameCodeDescription
SecretInvalid-10Secret token is invalid (removed, expired or does not contains).
MaxSizeRequestReject-9Request rejected due to exceeding maximum allowed size.
MaxRequestReject-8Request rejected because the number of requests has exceeded the allowed limit per user or IP or exceeds the total number of pending requests the server is waiting to process..
MaxCCUReject-7Connection rejected due to exceeding the allowed CCU (Concurrent Users).
OperationNotAuthorized-6You are not authorized to perform this operation. Possibly due to missing or invalid token, or insufficient permissions.
InvalidRequestParameters-5Request parameters are invalid or missing.
OperationInvalid-4The requested operation is invalid or not supported.
InternalServerError-3Internal server error. Could be due to an unhandled exception or logic failure.
OperationNotAllow-2This operation is not allowed in the current context.
OperationTimeout-1The operation timed out. No response received within the expected time.
UnknownError0An unknown error occurred. The cause could not be determined.
Ok1Success. The operation completed successfully and returned a valid result.
ResponseData
CodeTypeRequiredDescription
errorCodeErrorCodeA string that represents the status of the operation. It indicates whether the request was successful or failed due to a specific error condition. See ErrorCode
infoResponseParametersInfoResponseParameterstrueInfoResponseParameters used in MasterPlayerResponseData. See InfoResponseParameters
InfoResponseParameters

Parameter object used to control behavior or filters in API calls.

CodeTypeRequiredDescription
externalExternalItemIndicates whether the player is external to the current environment. See ExternalItem
segmentsstring[]Timestamp when the event occurred.
customDatasGenericModels.DataItem[]Custom key-value data defined by the game or system. See GenericModels.DataItem
displayNamestringThe public-facing name of the player.
avatarGenericModels.AvatarItemURL or identifier of the player's avatar image. See GenericModels.AvatarItem
tsCreatenumberTimestamp when the event occurred.
tagsGenericModels.TagItem[]Tag label used to group or filter the player. See GenericModels.TagItem
playerBanGenericModels.BanItemInformation about whether the player is currently banned. See GenericModels.BanItem
playerDatasGenericModels.DataItem[]Key-value metadata stored in the player's profile. See GenericModels.DataItem
playerCurrenciesGenericModels.CurrencyItem[]List of all virtual currencies and their balances. See GenericModels.CurrencyItem
playerStatisticsGenericModels.StatisticsItem[]Name or value of the player's statistic. See GenericModels.StatisticsItem
tsLastLoginnumberTimestamp when the event occurred.
ipAddressCreatestringIP address from which the player first registered.
countryCodestringCountry associated with the player's IP or settings.
emailstringThe email address associated with the player's account.
pushNotificationsPushNotificationItem[]PushNotifications used in InfoResponseParameters. See PushNotificationItem
ExternalItem

Represents a single unit of data related to the player.

CodeTypeRequiredDescription
deviceDeviceDevice used in ExternalItem. See Device
accountAccountAccount used in ExternalItem. See Account
customCustomCustom used in ExternalItem. See Custom
appleAppleApple used in ExternalItem. See Apple
googleGoogleGoogle used in ExternalItem. See Google
facebookFacebookFacebook used in ExternalItem. See Facebook
genericServiceGenericService[]GenericService used in ExternalItem. See GenericService
googlePlayGameServiceGooglePlayGameServiceGooglePlayGameService used in ExternalItem. See GooglePlayGameService
gameCenterGameCenterGameCenter used in ExternalItem. See GameCenter
Device

Data structure: Device.

CodeTypeRequiredDescription
customDeviceIdstringCustomDeviceId used in Device.
androidDeviceIdstringAndroidDeviceId used in Device.
iOSDeviceIdstringiOSDeviceId used in Device.
windowsPhoneDeviceIdstringWindowsPhoneDeviceId used in Device.
windowsDeviceIdstringWindowsDeviceId used in Device.
linuxDeviceIdstringLinuxDeviceId used in Device.
macOSDeviceIdstringMacOSDeviceId used in Device.
editorDeviceIdstringEditorDeviceId used in Device.
Account

Data structure: Account.

CodeTypeRequiredDescription
usernamestringUsername used in Account.
Custom

Data structure: Custom.

CodeTypeRequiredDescription
customIdstringCustomId used in Custom.
Apple

Data structure: Apple.

CodeTypeRequiredDescription
appleIdstringtrueAppleId used in Apple.
emailstringtrueThe email address associated with the player's account.
Google

Data structure: Google.

CodeTypeRequiredDescription
googleIdstringtrueGoogleId used in Google.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
Facebook

Data structure: Facebook.

CodeTypeRequiredDescription
facebookIdstringtrueFacebookId used in Facebook.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
GenericService

Data structure: GenericService.

CodeTypeRequiredDescription
serviceNamestringtrueServiceName used in GenericService.
serviceIdstringtrueServiceId used in GenericService.
GooglePlayGameService

Data structure: GooglePlayGameService.

CodeTypeRequiredDescription
playerIdstringtruePlayerId used in GooglePlayGameService.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
GameCenter

Data structure: GameCenter.

CodeTypeRequiredDescription
playerIdstringtruePlayerId used in GameCenter.
displayNamestringtrueThe public-facing name of the player.
emailstringtrueThe email address associated with the player's account.
Generic.DataItem

Represents a structured key-value data pair stored in a player or group profile.

CodeTypeRequiredDescription
keystringtrueKey used in a structured data pair.
valueanytrueValue assigned to the specified key.
Generic.AvatarItem

Represents avatar-related metadata such as image, icon, and background colors.

CodeTypeRequiredDescription
typenumbertrueType field in AvatarItem.
valuestringtrueValue assigned to the specified key.
Generic.TagItem

Represents a tag or category label used for filtering or grouping entities.

CodeTypeRequiredDescription
keystringtrueKey used in a structured data pair.
valuestringtrueValue assigned to the specified key.
Generic.BanItem

Details information about a ban applied to a player or entity.

CodeTypeRequiredDescription
tsExpirenumbertrueTsExpire field in BanItem.
reasonstringtrueText explaining why the ban or action was applied.
Generic.CurrencyItem

Defines a virtual currency identifier and its current amount.

CodeTypeRequiredDescription
keystringtrueKey used in a structured data pair.
valuenumbertrueValue assigned to the specified key.
Generic.StatisticsItem

Represents a named statistic and its numeric value.

CodeTypeRequiredDescription
keystringtrueKey used in a structured data pair.
valuenumbertrueValue assigned to the specified key.
PushNotificationItem

Represents a single unit of data related to the player.

CodeTypeRequiredDescription
tokenstringtrueToken used in PushNotificationItem.
pushIdstringtrueIdentifier for the registered push notification device.
platformTypenumbertruePlatformType used in PushNotificationItem.
ErrorCode
NameCode
Ok1
MasterPlayerNotFound29
ExternalLinkedOtherValue28
ExternalLinkedOtherAccount27
InvalidMember
CodeTypeDescription
codestringThe parameterCode invalid.
invalidMemberTypeInvalidMemberTypeThe invalid member type of this parameterCode. See InvalidMemberType
InvalidMemberType
NameCodeDescription
UnknownError1An unspecified or unexpected error has occurred.
DataRequired2A required data field is missing or not provided.
TypeInvalid3The data type provided does not match the expected type.
StringNull4A string value is null or has not been assigned.
StringMinLength5The string value is shorter than the minimum required length.
StringMaxLength6The string value exceeds the maximum allowed length.
NumberMinValue7The numeric value is less than the minimum allowed value.
NumberMaxValue8The numeric value exceeds the maximum allowed value.
NumberMustInt9The numeric value must be an integer but is not.
GNHashtableNull10The hashtable object is null or not provided.
GNHashtableMinLength11The hashtable contains fewer entries than the minimum required.
GNHashtableMaxLength12The hashtable contains more entries than the maximum allowed.
GNArrayNull13The array object is null or not provided.
GNArrayMinLength14The array contains fewer elements than the minimum required.
GNArrayMaxLength15The array contains more elements than the maximum allowed.