Skip to main content

User Profile Operations

This section covers GraphQL operations related to user profile management.

Queries​

Current User​

Retrieves the profile information for the currently authenticated user.

query CurrentUser {
currentUser {
id
username
firstName
lastName
fullName
profilePhoto
coverPhoto
biography
hidden
preferredFiatCurrency
preferredLang
createdAt
emailVerifiedAt
phoneVerifiedAt
email
chatRole
contactSms
contactEmail
contactApp
mfaInfo {
enabled
type
enabledAt
}
kycInfo {
kycIdvStatus
kycPoaStatus
verifiedAt
poaVerifiedAt
}
}
}

Response:

{
"data": {
"currentUser": {
"id": "user-id",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe",
"profilePhoto": "https://example.com/profile.jpg",
"coverPhoto": "https://example.com/cover.jpg",
"biography": "Software developer",
"hidden": false,
"preferredFiatCurrency": "USD",
"preferredLang": "EN",
"createdAt": "2023-01-01T00:00:00Z",
"emailVerifiedAt": "2023-01-02T00:00:00Z",
"phoneVerifiedAt": "2023-01-02T00:00:00Z",
"email": "john@example.com",
"chatRole": "USER",
"contactSms": true,
"contactEmail": true,
"contactApp": true
"mfaInfo": {
"enabled": true,
"type": "AUTHENTICATOR",
"enabledAt": "2023-01-03T00:00:00Z"
},
"kycInfo": {
"kycIdvStatus": "VERIFIED",
"kycPoaStatus": "VERIFIED",
"verifiedAt": "2023-01-04T00:00:00Z",
"poaVerifiedAt": "2023-01-04T00:00:00Z"
}
}
}
}

Get Bet By Token​

Retrieves a bet token for the current user.

query GetBetByToken {
getBetByToken {
token
}
}

Response:

{
"data": {
"getBetByToken": {
"token": "bet-token-string"
}
}
}

Mutations​

Edit User Details​

Updates the profile information for the currently authenticated user.

mutation EditUserDetail($input: EditUserInput!) {
editUserDetail(input: $input) {
id
username
firstName
lastName
middleName
fullName
avatarUrl
hidden
preferredFiatCurrency
languageCode
countryCode
stateCode
onBoardingCompleted
contactSms
contactEmail
contactApp
}
}

Input Parameters:

{
"input": {
"username": "newusername",
"firstName": "John",
"lastName": "Doe",
"middleName": "Robert",
"avatarFilename": "profile.jpg",
"onBoardingCompleted": true,
"languageCode": "EN",
"countryCode": "US",
"stateCode": "CA",
"hidden": false,
"preferredFiatCurrency": "EUR",
"contactSms": false,
"contactEmail": false,
"contactApp": true
}
}

Response:

{
"data": {
"editUserDetail": {
"id": "user-id",
"username": "newusername",
"firstName": "John",
"lastName": "Doe",
"middleName": "Robert",
"fullName": "John Robert Doe",
"avatarUrl": "https://storage-url.com/user-id/profile.jpg",
"hidden": false,
"preferredFiatCurrency": "EUR",
"languageCode": "EN",
"countryCode": "US",
"stateCode": "CA",
"onBoardingCompleted": true,
"contactSms": false,
"contactEmail": false,
"contactApp": true
}
}
}

All fields in the input are optional, allowing partial updates to the user profile. Note that avatarFilename is transformed into avatarUrl in the response after the file is processed.

Field Descriptions​

EditUserInput​

FieldTypeDescription
firstNameStringUser's first name (2-20 characters)
lastNameStringUser's last name (2-20 characters)
middleNameStringUser's middle name (2-20 characters)
avatarFilenameStringAvatar filename (passing null will remove avatar)
onBoardingCompletedBooleanWhether onboarding process is completed
languageCodeLangUser's preferred language code (e.g., EN, FR, ES)
countryCodeCountryCodeUser's country code (e.g., US, CA)
stateCodeStringState code (required for US country code)
hiddenBooleanWhether user's bet history and statistics should be hidden
preferredFiatCurrencyFiatCurrencyUser's preferred currency (e.g., USD, EUR)
usernameStringUser's unique username (2-20 characters)
contactEmailbooleanWhether the user consents to email contact.
contactSmsbooleanWhether the user consents to SMS contact.
contactAppbooleanWhether the user consents to Push notifications.