> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snackbase.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List users

> List users with optional filters (superadmin only).

Returns a paginated list of users across all accounts.
Supports filtering by account, role, status, and email search.



## OpenAPI

````yaml get /api/v1/users
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/users:
    get:
      tags:
        - users
        - Users
      summary: List users
      description: |-
        List users with optional filters (superadmin only).

        Returns a paginated list of users across all accounts.
        Supports filtering by account, role, status, and email search.
      operationId: list_users_api_v1_users_get
      parameters:
        - name: account_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by account ID
            title: Account Id
          description: Filter by account ID
        - name: role_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Filter by role ID
            title: Role Id
          description: Filter by role ID
        - name: is_active
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by active status
            title: Is Active
          description: Filter by active status
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search by email
            title: Search
          description: Search by email
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of records to skip
            default: 0
            title: Skip
          description: Number of records to skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of records to return
            default: 30
            title: Limit
          description: Maximum number of records to return
        - name: sort
          in: query
          required: false
          schema:
            type: string
            description: Sort field with +/- prefix
            default: '-created_at'
            title: Sort
          description: Sort field with +/- prefix
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserListResponse:
      properties:
        total:
          type: integer
          minimum: 0
          title: Total
          description: Total number of users
        items:
          items:
            $ref: '#/components/schemas/UserListItem'
          type: array
          title: Items
          description: List of users
      type: object
      required:
        - total
        - items
      title: UserListResponse
      description: |-
        Response schema for listing users with pagination.

        Attributes:
            total: Total number of users matching the filter.
            items: List of users for the current page.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserListItem:
      properties:
        id:
          type: string
          title: Id
          description: User ID
        email:
          type: string
          title: Email
          description: User's email address
        account_id:
          type: string
          title: Account Id
          description: Account ID (UUID)
        account_code:
          type: string
          title: Account Code
          description: Human-readable account code in XX#### format (e.g., AB1234)
        account_name:
          type: string
          title: Account Name
          description: Account display name
        role_id:
          type: integer
          title: Role Id
          description: Role ID
        role_name:
          type: string
          title: Role Name
          description: Role name
        is_active:
          type: boolean
          title: Is Active
          description: Whether the user can log in
        auth_provider:
          type: string
          title: Auth Provider
          description: Authentication provider type ('password', 'oauth', 'saml')
        auth_provider_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth Provider Name
          description: Specific provider name (e.g., 'google', 'github')
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External provider's user ID
        external_email:
          anyOf:
            - type: string
            - type: 'null'
          title: External Email
          description: Email from external provider
        profile_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Profile Data
          description: Additional profile data from external provider
        email_verified:
          type: boolean
          title: Email Verified
          description: Whether the user's email is verified
        email_verified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Email Verified At
          description: When the email was verified
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the user was created
        last_login:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Login
          description: Last successful login
      type: object
      required:
        - id
        - email
        - account_id
        - account_code
        - account_name
        - role_id
        - role_name
        - is_active
        - auth_provider
        - email_verified
        - created_at
      title: UserListItem
      description: |-
        List item schema for a user.

        Used in paginated list responses.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````