Skip to main content

Registration

Registration creates a master account and verifies a six-digit code when email confirmation is required by project settings or email-risk policy.

Registration by email​

MutationdocumentId: registerEmailauth: public

registerEmail​

Description​

Registers a user by email. The operation can also create a game account on the selected server when that option is enabled by the project.

Input​

Input fieldTypeRequiredDescription
emailString!✓User email
passwordString!✓Password containing 6-16 supported characters
termsBoolean!✓Project terms acceptance
loginString-Game-account login when created during registration
prefixString-Three-character login prefix when enabled
serverIdInt-Server used to create the game account
utmJSON-UTM tags
promoGameJSON-Promo-game attribution data

Result​

Response type - LoginResult. When confirmation is required, user and sessionId are null and message reports that the code was sent. Without confirmation, the operation immediately returns the user and new session.

Errors​

  • VALIDATION - email, password, login, or terms are invalid.
  • EMAIL_EXISTS - the email is already registered in this project.
  • GAME_ACCOUNT_EXISTS - the requested game-account login is unavailable.
  • REGISTRATION_DISABLED - email registration is disabled for the project.

Exchange example​

Request
documentId: registerEmail
{
"documentId": "registerEmail",
"variables": {
"email": "[email protected]",
"password": "password123",
"login": "GameLogin",
"prefix": "abc",
"serverId": 1,
"terms": true,
"utm": {
"source": "site",
"medium": "web",
"campaign": "launch"
},
"promoGame": {}
}
}
Response
200 OK
{
"data": {
"registerEmail": {
"sessionId": null,
"sessionEnd": null,
"user": null,
"twoFactorChallenge": null,
"message": "A confirmation code was sent to your email"
}
}
}

Registration code confirmation​

MutationdocumentId: confirmRegistrationCodeauth: public

confirmRegistrationCode​

Description​

Verifies the code, completes pending registration, and creates a confirmed account. The code is bound to the email, team, and project and can be accepted only once.

Input​

Input fieldTypeRequiredDescription
emailString!✓Email used to start registration
codeString!✓Six-digit confirmation code

Result​

Response type - UserResult.

Errors​

  • VALIDATION - the email or code is missing.
  • INVALID_CODE - the code is invalid or expired.
  • USER_NOT_FOUND - the pending registration cannot be completed.

Exchange example​

Request
documentId: confirmRegistrationCode
{
"documentId": "confirmRegistrationCode",
"variables": {
"email": "[email protected]",
"code": "123456"
}
}
Response
200 OK
{
"data": {
"confirmRegistrationCode": {
"user": {
"id": "1001",
"email": "[email protected]",
"emailConfirmed": true
},
"message": "Registration confirmed"
}
}
}