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

ParameterTypeDescription
postTypestring in rJson | rMsgPackSpecifies whether the request is sent via JSON (t) or MsgPack (r). See PostType
requestTypestringIndicates which entity is making the request: MasterPlayer, GamePlayer, Character, Group... See RequestType
rolestring in admin | server | clientSpecifies the sender's role: 1 (Admin), 2 (Server), 3 (Client). Some APIs require higher privileges. See RequestRole
operationCodestringThe operation identifier to execute (e.g., authenticate, addFriend, createInventory...) See OperationCode
Request Headers
NameDescription
Auth-TokenA 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-KeyA 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-IdThe 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-Type

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-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
...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
NameCode
Ok1
AccountNotFound2
AccountPasswordWrong3
AccountUsernameExists4
VerifyTokenError5
VerifyFailed6
CharacterPlayerNotFound7
NotEnoughCurrency8
KeyNotFound9
ItemNotFound10
CatalogIdNotFound11
GroupNotFound12
OwnerNotFound13
ClassIdNotFound14
MemberNotFound15
PlayerNotMember16
GamePlayerNotFound17
FileNotFound18
FileNotUpload19
OwnerTypeNotSupport20
ItemNotStackable21
GameNotFound22
GameIsExists23
SecretInfoNotFound24
SecretInfoIsExists25
ExternalNotLinked26
ExternalLinkedOtherAccount27
ExternalLinkedOtherValue28
MasterPlayerNotFound29
StoreItemNotFound30
BuyerNotFound31
CanNotBuyThisStoreItem32
ExceptionWhenValidateReceipt33
StoreInvalid34
ReceiptInvalid35
StoreItemHadBeenRemove36
DisplayNameHasUse37
PlayerBan38
MatchmakingTicketNotFound39
MatchmakingTicketAlreadyCompleted40
MatchmakingPlayerHasNotJoinedTicket41
MatchNotFound42
MatchmakingPlayerHasJoinedOtherTicket43
MatchmakingQueueNotFound44
TicketSizeError45
ExecuteError46
VersionInvalid47
EmailInvalid48
StoreItemHadPurchaseAndNonConsumable49
StoreItemHadExists50
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.
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
SetTsLastLoginsetTsLastLogin
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