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
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 field | Type | Required | Description |
|---|---|---|---|
email | String! | ✓ | User email |
password | String! | ✓ | Password containing 6-16 supported characters |
terms | Boolean! | ✓ | Project terms acceptance |
login | String | - | Game-account login when created during registration |
prefix | String | - | Three-character login prefix when enabled |
serverId | Int | - | Server used to create the game account |
utm | JSON | - | UTM tags |
promoGame | JSON | - | 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": {
"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"
}
}
}
Related types
Registration code confirmation
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 field | Type | Required | Description |
|---|---|---|---|
email | String! | ✓ | Email used to start registration |
code | String! | ✓ | 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": {
"code": "123456"
}
}
Response
200 OK
{
"data": {
"confirmRegistrationCode": {
"user": {
"id": "1001",
"emailConfirmed": true
},
"message": "Registration confirmed"
}
}
}