Skip to main content

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 message
  • extensions.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:

  1. User Profile Management

    • currentUser: Query current user details
    • editUserDetail: Update user profile information
    • getBetByToken: Get a bet token for the current user
  2. Verification Processes

    • requestUserLookup: Request email or phone verification
    • verifyUserLookup: Verify email or phone using a code
    • is2faVerify: Check if 2FA is enabled for the current user
  3. KYC (Know Your Customer)

    • requestKycIdvUrl: Request KYC identity verification URL
    • completeKycIdv: Complete KYC identity verification
    • uploadKycPoa: Upload proof of address documents
    • checkKycIdv: Check KYC verification status
  4. Session Management

    • myActiveSessions: List active sessions
    • streamChatToken: Get token for Stream Chat API
  5. Chat Functionality

    • allChannels: Get public chat channels
    • allUserChats: Get user's chat channels with pagination
    • createChatWithOtherUsers: Create chat with other users

Details for each operation are provided in the following sections.