User API Reference
The User API provides functionality for managing user profiles, authentication verifications, KYC processes, and chat capabilities.
Overview​
The User API consists of several GraphQL operations:
- Queries: Retrieve user information, sessions, and chat channels
- Mutations: Update user profiles, verify email/phone, complete KYC processes, and manage chats
Authentication​
All operations except for public queries require authentication. Authentication is handled automatically via HTTP cookies, with the system managing both accessToken and refreshToken.
Error Handling​
API errors are returned in the GraphQL response under the errors
field. Each error contains:
message
: Human-readable error messageextensions.code
: Error code for programmatic handling
Example error response:
{
"errors": [
{
"message": "User not found",
"extensions": {
"code": "USER_NOT_FOUND"
}
}
]
}
Available Operations​
The User API is divided into several categories:
-
User Profile Management
currentUser
: Query current user detailseditUserDetail
: Update user profile informationgetBetByToken
: Get a bet token for the current user
-
Verification Processes
requestUserLookup
: Request email or phone verificationverifyUserLookup
: Verify email or phone using a codeis2faVerify
: Check if 2FA is enabled for the current user
-
KYC (Know Your Customer)
requestKycIdvUrl
: Request KYC identity verification URLcompleteKycIdv
: Complete KYC identity verificationuploadKycPoa
: Upload proof of address documentscheckKycIdv
: Check KYC verification status
-
Session Management
myActiveSessions
: List active sessionsstreamChatToken
: Get token for Stream Chat API
-
Chat Functionality
allChannels
: Get public chat channelsallUserChats
: Get user's chat channels with paginationcreateChatWithOtherUsers
: Create chat with other users
Details for each operation are provided in the following sections.