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.

Set Self Excluded​

Allows users to self-exclude themselves from the platform for a specified period. This is a responsible gambling feature that helps users take a break from the platform.

mutation SetSelfExcluded($input: SetSelfExcludedInput!) {
setSelfExcluded(input: $input)
}

Input Parameters:

{
"input": {
"period": "ONE_WEEK"
}
}

Response:

{
"data": {
"setSelfExcluded": true
}
}

Supported Periods:

ValueDescription
ONE_DAY1 day exclusion
ONE_WEEK1 week exclusion
ONE_MONTH1 month exclusion
SIX_MONTHS6 months exclusion
PERMANENTPermanent exclusion

Important Notes:

  • Self-exclusion is immediate and cannot be reversed during the exclusion period
  • All active sessions are automatically deactivated
  • Users cannot log in during the exclusion period
  • For temporary exclusions, the account will be automatically reactivated after the period ends
  • For permanent exclusions, the account remains excluded indefinitely
  • This action requires the user to have a valid customer ID (badhombreId)

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.