Overview

Start by reviewing the following guide to understand the core principles of making API requests in GearN. This approach applies universally to all APIs in the system.

HTTP

POST /api/:postType/:requestType/:role/:operationCode

ParameterTypeRequiredDescription
postTypestring in rJson | rMsgPacktrueSpecifies whether the request is sent via JSON (t) or MsgPack (r). See PostType
requestTypestringtrueIndicates which entity is making the request: MasterPlayer, GamePlayer, Character, Group... See RequestType
rolestring in admin | server | clienttrueSpecifies the sender's role: 1 (Admin), 2 (Server), 3 (Client). Some APIs require higher privileges. See RequestRole
operationCodestringtrueThe operation identifier to execute (e.g., authenticate, addFriend, createInventory...) See OperationCode
Request Headers
NameTypeRequiredDescription
Auth-TokenstringA 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-KeystringA secure key used to verify that the request originates from a trusted source, per secret key map with a PermissionRule to GearN server known permission of the who send the request
Game-IdstringThe unique identifier of the game this request is targeting. GearN uses GameId to isolate data between different games. The request will only affect the game that matches the specified gameId
Content-Typestringtrue

Specifies the format of the request body. Accepted values:

  • application/json if sending JSON.
  • application/msgpack: if sending binary MsgPack (for more efficient size and parsing)
Request Body
CodeTypeRequiredDescription
customTagsGNHashtableAdditional metadata that can be attached to any request. Especially useful when working with advanced features such as EventCallbackScript.
...Other fields vary depending on the type of request. Refer to the specific API documentation for required parameters.
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-10The selected secret key is missing, wrong, or does not match the current route/game context.
MaxSizeRequestReject-9The serialized request payload exceeded the maximum size accepted by the backend.
MaxRequestReject-8The backend rejected the request because the current caller exceeded a request-rate limit.
MaxCCUReject-7The backend rejected the request because the current concurrent-user/session limit was exceeded.
OperationNotAuthorized-6The target operation exists, but the caller is not authorized for the selected role or target resource.
InvalidRequestParameters-5The request shape or one or more request-member values are invalid.
When available, inspect `invalidMembers` for field-level details.
OperationInvalid-4The requested operation code is unknown or is not valid for the selected request type/role.
InternalServerError-3The backend hit an unhandled internal failure before producing a valid business response.
OperationNotAllow-2The operation is known and the secret key is valid, but the permission rules attached
to the current secret key do not allow this operation in the current target context.
This usually maps to missing `selfEnable`, `otherSelfEnable`, `serverSelfEnable`,
or `adminSelfEnable` permission for the resolved request.
OperationTimeout-1The request timed out before a response was received.
This code may be synthesized by the SDK timeout layer as well as returned by the backend.
UnknownError0The request failed, but no more specific low-level return code was mapped.
Ok1The request completed successfully at protocol level and produced a response payload.
Callers must still validate the business `errorCode` in that payload.
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
...Other fields vary depending on the type of request. Refer to the specific API documentation for required parameters.
PostType
NameCodeDescription
JsonrJsonSend Api request via Json.
MsgPackrMsgPackSend Api request via MsgPack.
RequestType
NameCodeDescription
CustomcustomSend Api request for custom operation request when use custom GearN Server.
AuthenticateauthenticateManages all user authentication methods, including login via username/password, device ID, social providers (Google, Facebook, Apple), and token refresh operations. See Authenticate
CharacterPlayercharacterPlayerManages operations related to character-based gameplay. Includes features like inventory, statistics, tags, groups, and data associated with a player’s in-game character. See CharacterPlayer
ContentcontentProvides access to game content metadata such as catalogs, class definitions, localization strings, and versioned data used for content distribution. See Content
GamePlayergamePlayerHandles global player data that is not tied to a specific character. Includes user-level settings, custom data, authentication info, and platform linkage. See GamePlayer
GroupgroupManages player groups or teams. Supports creating, joining, leaving, or modifying group membership and associated group metadata. See Group
InventoryinventoryHandles server-authoritative inventory operations. Includes item creation, usage, consumption, and validation of inventory-related logic. See Inventory
MasterPlayermasterPlayerProvides administrative control over player accounts. Includes actions like resetting data, applying server bans, or inspecting global state of players. See MasterPlayer
StoreInventorystoreInventoryManages virtual store interactions. Includes purchasing, consuming items, currency exchange, and store validation mechanisms. See StoreInventory
DashboarddashboardReserved for administrative dashboard-related actions, configuration, monitoring, or runtime tools used by backend or operator panels. See Dashboard
MultiplayermultiplayerSupports real-time and asynchronous multiplayer functionality. Includes room/session management, matchmaking ticket, match and multiplayer state operations. See Multiplayer
CloudScriptcloudScriptExecutes custom server-side scripts hosted on the cloud. Used to run logic like validation, rule enforcement, or backend automation without client trust. See CloudScript
RequestRole
NameCodeDescription
AdminadminIndicates that the request originates from an administrative interface or privileged tool. These requests typically have elevated permissions and are used for operations such as banning players, modifying backend data, or accessing internal diagnostics.
ServerserverRepresents trusted requests coming from secure backend services or cloud functions. These requests bypass client-side validation and are used for authoritative actions like validating purchases, adjusting stats, or executing server logic.
ClientclientDesignates requests initiated from the player’s device or game client. These requests are subject to authentication, rate limiting, and often restricted in scope to prevent unauthorized access or manipulation.
ErrorCode
NameCodeDescription
Ok1The business operation completed successfully.
AccountNotFound2The requested username/account does not exist.
AccountPasswordWrong3The provided account password is incorrect.
AccountUsernameExists4The requested username already exists and cannot be created again.
VerifyTokenError5The provided token could not be verified or decoded.
VerifyFailed6An external/provider verification step failed.
CharacterPlayerNotFound7The target character player does not exist.
NotEnoughCurrency8The target wallet or owner does not have enough currency to complete the operation.
KeyNotFound9The requested key does not exist in the target data set.
ItemNotFound10The target inventory item does not exist.
CatalogIdNotFound11The referenced catalog id does not exist.
GroupNotFound12The target group does not exist.
OwnerNotFound13The resolved owner entity does not exist.
ClassIdNotFound14The referenced class id does not exist.
MemberNotFound15The target group member or relationship member does not exist.
PlayerNotMember16The player is not currently a member of the target group.
GamePlayerNotFound17The target game player does not exist.
FileNotFound18The requested file metadata or physical file does not exist.
FileNotUpload19The file metadata exists but the file content has not been uploaded yet.
OwnerTypeNotSupport20The requested owner type is not supported by the target operation.
ItemNotStackable21The item cannot be stacked, so amount-based operations are invalid.
GameNotFound22The target game does not exist.
GameExists23The game already exists and cannot be created again with the same identity.
SecretInfoNotFound24The requested secret-info record does not exist.
SecretInfoExists25The secret-info record already exists.
ExternalNotLinked26The requested external identity is not linked to the current account.
ExternalLinkedOtherAccount27The external identity is already linked to a different account.
ExternalLinkedOtherValue28The external provider/value pair conflicts with an existing linked value.
MasterPlayerNotFound29The target master player does not exist.
StoreItemNotFound30The target store item does not exist.
BuyerNotFound31The buyer entity does not exist.
CanNotBuyThisStoreItem32The requested store item cannot be purchased in the current state or by the current buyer.
ExceptionWhenValidateReceipt33An exception occurred while validating a platform receipt.
StoreInvalid34The target store/provider configuration is invalid.
ReceiptInvalid35The provided purchase receipt is invalid.
StoreItemRemoved36The target store item was removed and can no longer be used for purchase flows.
DisplayNameUsed37The requested display name is already in use.
PlayerBan38The target player is currently banned.
MatchmakingTicketNotFound39The target matchmaking ticket does not exist.
MatchmakingTicketAlreadyCompleted40The matchmaking ticket already completed and cannot be joined or modified further.
MatchmakingPlayerNotJoinedTicket41The player is not a member of the referenced matchmaking ticket.
MatchNotFound42The requested match does not exist.
MatchmakingPlayerJoinedOtherTicket43The player already joined a different matchmaking ticket that conflicts with this request.
MatchmakingQueueNotFound44The referenced matchmaking queue does not exist.
TicketSizeError45The requested ticket size violates queue configuration.
ExecuteError46CloudScript execution failed inside the target function.
VersionInvalid47The requested CloudScript version is invalid or unavailable.
EmailInvalid48The provided email address is syntactically or semantically invalid.
StoreItemPurchasedAndNonConsumable49The buyer already owns this non-consumable store item.
StoreItemExists50The store item already exists and cannot be created again with the same identity.
InvalidMember
CodeTypeDescription
codestringThe parameterCode invalid.
invalidMemberTypeInvalidMemberTypeThe invalid member type of this parameterCode. See InvalidMemberType
InvalidMemberType
NameCodeDescription
UnknownError1The backend rejected the member but did not map it to a more specific validation category.
DataRequired2The member is required but missing.
TypeInvalid3The member type does not match the expected runtime type.
StringNull4A required string member is null or empty when null is not allowed.
StringMinLength5A string member is shorter than the configured minimum length.
StringMaxLength6A string member is longer than the configured maximum length.
NumberMinValue7A numeric member is lower than the configured minimum value.
NumberMaxValue8A numeric member is higher than the configured maximum value.
NumberMustInt9A numeric member must be an integer but received a non-integer value.
GNHashtableNull10A required `GNHashtable` member is null.
GNHashtableMinLength11A `GNHashtable` member contains fewer entries than allowed.
GNHashtableMaxLength12A `GNHashtable` member contains more entries than allowed.
GNArrayNull13A required `GNArray` member is null.
GNArrayMinLength14A `GNArray` member contains fewer items than allowed.
GNArrayMaxLength15A `GNArray` member contains more items than allowed.
OperationCode
NameCode
LoginByAdminAccountloginByAdminAccount
ChangePasswordAdminAccountchangePasswordAdminAccount
GetGameListgetGameList
GetMasterGameSettingsgetMasterGameSettings
SetMasterGameSettingssetMasterGameSettings
CreateAdminAccountcreateAdminAccount
RemoveAdminAccountremoveAdminAccount
SetPasswordAdminAccountsetPasswordAdminAccount
SetSecretKeyAdminAccountsetSecretKeyAdminAccount
GetGameInformationgetGameInformation
SetGameInformationsetGameInformation
GetAdminAccountListgetAdminAccountList
CreateGamecreateGame
GetServerLoggetServerLog
GetSecretInfoInformationgetSecretInfoInformation
GetSecretInfoListgetSecretInfoList
CreateSecretInfocreateSecretInfo
SetSecretInfoInformationsetSecretInfoInformation
GetUsernameAdminAccountgetUsernameAdminAccount
GetAnalyticsgetAnalytics
GetEventCallbackCloudScriptgetEventCallbackCloudScript
SetEventCallbackCloudScriptsetEventCallbackCloudScript
ResetStatisticsLeaderboardresetStatisticsLeaderboard
GetBackupStatisticsLeaderboardVersiongetBackupStatisticsLeaderboardVersion
GetServerGameDatagetServerGameData
DeleteInDatabasedeleteInDatabase
LoginByAccountloginByAccount
LoginByAndroidDeviceIdloginByAndroidDeviceId
LoginByAppleloginByApple
LoginByCustomDeviceIdloginByCustomDeviceId
LoginByCustomIdloginByCustomId
LoginByEditorDeviceIdloginByEditorDeviceId
LoginByFacebookloginByFacebook
LoginByGenericServiceloginByGenericService
LoginByGoogleloginByGoogle
LoginByiOSDeviceIdloginByiOSDeviceId
LoginByLinuxDeviceIdloginByLinuxDeviceId
LoginByMacOSDeviceIdloginByMacOSDeviceId
LoginByWindowsDeviceIdloginByWindowsDeviceId
LoginByWindowsPhoneDeviceIdloginByWindowsPhoneDeviceId
RegisterAccountregisterAccount
LinkAccountlinkAccount
LinkAndroidDeviceIdlinkAndroidDeviceId
LinkApplelinkApple
LinkCustomDeviceIdlinkCustomDeviceId
LinkCustomIdlinkCustomId
LinkEditorDeviceIdlinkEditorDeviceId
LinkFacebooklinkFacebook
LinkGenericServicelinkGenericService
LinkGooglelinkGoogle
LinkiOSDeviceIdlinkiOSDeviceId
LinkLinuxDeviceIdlinkLinuxDeviceId
LinkMacOSDeviceIdlinkMacOSDeviceId
LinkWindowsDeviceIdlinkWindowsDeviceId
LinkWindowsPhoneDeviceIdlinkWindowsPhoneDeviceId
UnlinkAccountunlinkAccount
UnlinkAndroidDeviceIdunlinkAndroidDeviceId
UnlinkAppleunlinkApple
UnlinkCustomDeviceIdunlinkCustomDeviceId
UnlinkCustomIdunlinkCustomId
UnlinkEditorDeviceIdunlinkEditorDeviceId
UnlinkFacebookunlinkFacebook
UnlinkGenericServiceunlinkGenericService
UnlinkGoogleunlinkGoogle
UnlinkiOSDeviceIdunlinkiOSDeviceId
UnlinkLinuxDeviceIdunlinkLinuxDeviceId
UnlinkMacOSDeviceIdunlinkMacOSDeviceId
UnlinkWindowsDeviceIdunlinkWindowsDeviceId
UnlinkWindowsPhoneDeviceIdunlinkWindowsPhoneDeviceId
AddSegmentaddSegment
RemoveSegmentremoveSegment
GetSegmentgetSegment
SetTagsetTag
GetTaggetTag
SetDisplayNamesetDisplayName
GetDisplayNamegetDisplayName
GetTsCreategetTsCreate
GetIpAddressCreategetIpAddressCreate
GetTsLastLogingetTsLastLogin
SetPlayerBansetPlayerBan
GetPlayerBangetPlayerBan
SetCountryCodesetCountryCode
GetCountryCodegetCountryCode
ChangeAccountPasswordchangeAccountPassword
ResetAccountPasswordresetAccountPassword
SetAvatarsetAvatar
GetAvatargetAvatar
ChangePlayerCurrencychangePlayerCurrency
GetPlayerCurrencygetPlayerCurrency
ChangePlayerStatisticschangePlayerStatistics
GetPlayerStatisticsgetPlayerStatistics
GetStatisticsLeaderboardgetStatisticsLeaderboard
GetStatisticsLeaderboardAroundPlayergetStatisticsLeaderboardAroundPlayer
SetCustomDatasetCustomData
GetCustomDatagetCustomData
SetPlayerDatasetPlayerData
GetPlayerDatagetPlayerData
GetPlayerInformationgetPlayerInformation
GetPlayersWithApplegetPlayersWithApple
GetPlayersWithFacebookgetPlayersWithFacebook
GetPlayersWithGooglegetPlayersWithGoogle
GetPlayersWithGenericServicegetPlayersWithGenericService
GetPlayersWithSegmentgetPlayersWithSegment
GetPlayersWithTaggetPlayersWithTag
GetExternalgetExternal
GetCatalogIdgetCatalogId
GetOwnerInfogetOwnerInfo
GetOnlineStatusgetOnlineStatus
RemovePlayerItemremovePlayerItem
RemovePlayerCharacterremovePlayerCharacter
AddPlayerFriendaddPlayerFriend
RemovePlayerFriendremovePlayerFriend
GetPlayerInventorygetPlayerInventory
GetPlayerCharactergetPlayerCharacter
GetPlayerFriendgetPlayerFriend
GetPlayerGroupgetPlayerGroup
CreateGroupcreateGroup
JoinGroupjoinGroup
CreatePlayerItemcreatePlayerItem
CreatePlayerCharactercreatePlayerCharacter
GetOwnergetOwner
GetRemoveStatusgetRemoveStatus
ChangeGroupStatisticschangeGroupStatistics
SetGroupDatasetGroupData
GetGroupCurrencygetGroupCurrency
ChangeGroupCurrencychangeGroupCurrency
CreateGroupItemcreateGroupItem
GetStatisticsLeaderboardAroundGroupgetStatisticsLeaderboardAroundGroup
GetGroupsWithTaggetGroupsWithTag
GetGroupsWithSegmentgetGroupsWithSegment
GetGroupStatisticsgetGroupStatistics
GetGroupInventorygetGroupInventory
GetGroupDatagetGroupData
GetGroupInformationgetGroupInformation
GetMembersgetMembers
ChangeItemStatisticschangeItemStatistics
SetItemDatasetItemData
GetItemDatagetItemData
GetStatisticsLeaderboardAroundItemgetStatisticsLeaderboardAroundItem
GetItemsWithTaggetItemsWithTag
GetItemsWithSegmentgetItemsWithSegment
GetItemStatisticsgetItemStatistics
GetItemInformationgetItemInformation
GetAmountgetAmount
GetItemTypegetItemType
UpdateTsLastLoginupdateTsLastLogin
SetRemoveStatussetRemoveStatus
SetAmountsetAmount
RemoveGroupremoveGroup
LeaveGroupleaveGroup
AddMemberaddMember
RemoveMemberremoveMember
GetContentDatagetContentData
SetContentDatasetContentData
GetGroupMessagegetGroupMessage
SendGroupMessagesendGroupMessage
GetPlayersWithDisplayNamegetPlayersWithDisplayName
GetItemsWithDisplayNamegetItemsWithDisplayName
GetGroupsWithDisplayNamegetGroupsWithDisplayName
SetOwnersetOwner
RemoveGroupItemremoveGroupItem
GetClassIdgetClassId
GetStoreItemInformationgetStoreItemInformation
GetStoreItemsWithTaggetStoreItemsWithTag
CreateStoreItemcreateStoreItem
RemoveTagremoveTag
BuyStoreItembuyStoreItem
ValidateAppleAppStoreReceiptvalidateAppleAppStoreReceipt
ValidateGooglePlayStoreReceiptvalidateGooglePlayStoreReceipt
ValidateFacebookStoreReceiptvalidateFacebookStoreReceipt
GetFriendStatisticsLeaderboardAroundPlayergetFriendStatisticsLeaderboardAroundPlayer
GetFriendStatisticsLeaderboardgetFriendStatisticsLeaderboard
SetEmailsetEmail
GetEmailgetEmail
CreateNewFileUploadInfocreateNewFileUploadInfo
GetFileUploadInfogetFileUploadInfo
RequestDownloadFileUploadInforequestDownloadFileUploadInfo
RemoveFileUploadInforemoveFileUploadInfo
GetFileUploadInfoListgetFileUploadInfoList
SetStoreItemInformationsetStoreItemInformation
RefreshAuthTokenrefreshAuthToken
CancelAllMatchmakingTicketcancelAllMatchmakingTicket
CancelMatchmakingTicketcancelMatchmakingTicket
CreateMatchmakingTicketcreateMatchmakingTicket
GetMatchgetMatch
GetMatchmakingTicketgetMatchmakingTicket
GetQueueStatisticsgetQueueStatistics
JoinMatchmakingTicketjoinMatchmakingTicket
ListMatchmakingTicketsForPlayerlistMatchmakingTicketsForPlayer
GetCurrencyLeaderboardgetCurrencyLeaderboard
ExecuteFunctionexecuteFunction
GetFunctionsgetFunctions
AddFunctionaddFunction
EditFunctioneditFunction
GetFunctiongetFunction
LoginByGooglePlayGameServiceloginByGooglePlayGameService
LoginByGameCenterloginByGameCenter
LinkGooglePlayGameServicelinkGooglePlayGameService
LinkGameCenterlinkGameCenter
UnlinkGooglePlayGameServiceunlinkGooglePlayGameService
UnlinkGameCenterunlinkGameCenter
GetPlayersWithGooglePlayGameServicegetPlayersWithGooglePlayGameService
GetPlayersWithGameCentergetPlayersWithGameCenter
GetLastLoginLeaderboardgetLastLoginLeaderboard
GetCreateLeaderboardgetCreateLeaderboard
GetAllMatchmakingTicketgetAllMatchmakingTicket
GetAllMatchgetAllMatch
SendSocketOperationEventsendSocketOperationEvent
GetStatisticsLoggetStatisticsLog
GetCurrencyLoggetCurrencyLog
PresentStoreItempresentStoreItem
GetStoreLoggetStoreLog
SendEmailsendEmail
SendPushNotificationsendPushNotification
AddPushNotificationaddPushNotification
RemovePushNotificationremovePushNotification
GetPushNotificationgetPushNotification
GetStoreUsedgetStoreUsed
RemoveStoreUsedremoveStoreUsed