Rolebase Developers
API Reference

users

Represents user accounts in Rolebase, managed by Hasura Auth. Contains profile information, authentication details, and relationships to organizations and roles.

Fields

FieldTypeDescription
iduuidUnique identifier for the user (auto-generated)
displayNameStringUser’s display name
emailStringUser’s email address (unique, optional)
emailVerifiedBooleanWhether the email has been verified (defaults to false)
phoneNumberStringUser’s phone number (unique, optional)
phoneNumberVerifiedBooleanWhether the phone number has been verified (defaults to false)
avatarUrlStringURL to the user’s avatar image
localeStringUser’s preferred locale
metadataJSONAdditional user metadata (e.g., timezone, preferences)
newEmailStringNew email address pending verification (optional)
isAnonymousBooleanWhether this is an anonymous user (defaults to false)
disabledBooleanWhether the user account is disabled (defaults to false)
lastSeenTimestampWhen the user was last active (optional)
createdAtTimestampWhen the account was created (defaults to current timestamp)
updatedAtTimestampWhen the account was last updated (defaults to current timestamp)

Authentication Fields

FieldTypeDescription
passwordHashStringHashed password for password authentication (never exposed via API)
activeMfaTypeStringActive multi-factor authentication method (optional)
totpSecretStringSecret for time-based one-time password (optional)
otpHashStringOne-time password hash (never exposed via API)
otpHashExpiresAtTimestampWhen the OTP hash expires
otpMethodLastUsedStringLast used OTP method (optional)
ticketStringAuthentication ticket (optional)
ticketExpiresAtTimestampWhen the authentication ticket expires
currentChallengeStringCurrent authentication challenge (optional)

Relationships

Array Relationships

  • apps — User’s connected applications (see user_app)
  • members — Organization memberships
  • roles — User’s assigned roles
  • refreshTokens — Authentication refresh tokens
  • securityKeys — WebAuthn security keys
  • userProviders — Connected authentication providers (OAuth, etc.)

Query Examples

Get User Profile

query GetUserProfile($userId: uuid!) {
  user(id: $userId) {
    id
    displayName
    email
    emailVerified
    avatarUrl
    locale
    metadata
    newEmail
    lastSeen
    members {
      id
      org {
        name
      }
    }
  }
}

Mutation Examples

Update User Profile

mutation UpdateUserProfile {
  updateUser(
    pk_columns: { id: "user-id" }
    _set: {
      displayName: "New Name"
      locale: "en"
      metadata: { timezone: "Europe/Paris" }
    }
  ) {
    id
    displayName
    locale
    metadata
    updatedAt
  }
}

Permissions

Access to user data is strictly controlled:

  • Users can only view and modify their own profile data
  • Sensitive fields (passwordHash, otpHash, etc.) are never exposed via the API
  • Role management is handled through dedicated endpoints
  • Email and phone number changes require verification
  • Account disabling can only be done by administrators

The user entity is managed by Hasura Auth and should not be modified directly. Multi-factor authentication (MFA) can be enabled using various methods, and WebAuthn security keys support passwordless authentication. Connected OAuth providers are managed through the userProviders relationship.