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

# List Users By Role (Paginated)

> Returns a paginated list of users filtered by role.



## OpenAPI

````yaml /openapi.yaml get /api/v1/auth/users/role/{role}
openapi: 3.1.0
info:
  title: EmaalCoin API
  description: >
    EmaalCoin API reference. These APIs power cryptocurrency exchange between
    USDT and Fiat trading.


    - **On-Ramp**: Buy USDT with fiat (KES) via mobile money (STK Push for
    Kenya)

    - **Off-Ramp**: Sell USDT for KES with mobile money payout (Kenya)

    - **Ethereum, TRON, and Solana**: Multi-chain wallet support

    - **Merchant Offers**: Create and manage trading offers

    - **OTC Flows**: Bank and mobile money deposits/withdrawals for merchants

    - **Pricing engine**: FX quotes and fee profiles for quote-backed orders and
    transfers

    - **P2P/B2B transfers**: Internal and external stablecoin sends (USDT/USDC)
    with optional pricing snapshots

    - **Stablecoin swaps**: Treasury-backed two-leg USDT ↔ USDC conversion with
    BitGo confirmation, inventory reservation, and automatic refunds

    - **Multisig**: Collaborative and platform-managed multisig flows for
    high-value B2B
  version: 1.1.0
servers:
  - url: https://crypto.westminister.tech
    description: Production API (requires DNS for this hostname).
  - url: http://13.42.110.185:8080
    description: >-
      UAT on EC2 (direct). Use this base when building proof PDF URLs if the
      production hostname does not resolve.
security: []
tags:
  - name: Pricing
    description: >-
      Commercial pricing profiles and FX rate quotes (admin). Used with orders
      and transfers for auditable snapshots.
  - name: Transfers
    description: >-
      P2P and B2B stablecoin transfers (USDT/USDC). Optional fiat-equivalent
      pricing fields. B2B multisig behavior depends on wallet registration
      (synchronous completion vs proposal flow).
  - name: Stablecoin Swaps
    description: >-
      Treasury-backed USDT ↔ USDC conversions for BitGo provider-managed wallets
      on `tron`, `ethereum`, or `solana`. Collection confirms before treasury
      payout starts. Completion requires both legs and dual-asset balance
      synchronization.
  - name: Multisig
    description: >-
      Multisig wallet registration and TRON proposal/confirm flows
      (vendor/admin).
  - name: Escrow Wallets
    description: Escrow pool wallet metadata for off-ramp and operations.
  - name: Users
    description: >-
      User-related operations (registration, lookup, updates, counts, status
      changes)
  - name: Wallets-Users
    description: User wallet operations (create, manage, query balances)
  - name: Offers
    description: Offer operations (create, read, list, counts)
  - name: Orders
    description: Order operations (create, update, list, counts, stats)
  - name: Payment
    description: Payment initiation operations
  - name: Merchants
    description: >
      Merchant (vendor) onboarding and hierarchy operations.

      USE **GET /API/V1/AUTH/MERCHANTS** WITH **PAGE_ID** AND **PAGE_SIZE** TO
      PAGE MASTER VENDORS.

      USE **GET /API/V1/AUTH/MERCHANTS/{MERCHANT_ID}** FOR ONE MASTER VENDOR,
      **MERCHANT_WALLETS**, AND ALL **SUBVENDOR** ROWS WITH **WALLETS** (FULL
      TREE).
  - name: OTC Deposits
    description: >
      OTC fiat-to-crypto deposits (bank or mobile money). Rows live in
      **`otc_deposits`**. Merchants create drafts or one-shot deposits.
      **admin**, **otc_officer**, or **treasury** list all deposits.

      B2B bank flow uses draft, quote, submit, proof, assign, claim, settlement,
      and audit. **`credited_to_address`** is the merchant on-chain wallet
      treasury credits (resolved from the default wallet for
      **`requested_network`** on the master merchant ledger user or any
      **sub-vendor** under that merchant).

      **`GET /api/v1/auth/otc/deposits`** backfills missing
      **`credited_to_address`**/**`to_wallet_id`** when a wallet can be
      resolved. One-shot **`POST /api/v1/auth/otc/deposits`** persists the
      payout address when **`requested_network`** is sent.

      Bank proof PDFs upload via `POST .../proof` and are viewed at **`GET
      /otc-deposits-proof/{deposit_id}/{file}.pdf`** (relative
      **`proof_url`**/**`file_url`** plus API base URL).

      Merchants may edit tab-1 draft fields with **`PATCH
      /api/v1/auth/otc/deposits/{id}/draft`** while **`status`** is **`draft`**.
  - name: OTC Withdrawals
    description: >-
      OTC crypto-to-fiat withdrawals (bank or mobile money). Merchants create.
      Admin approves and executes.
  - name: OTC Config
    description: OTC display config (bank details, mobile money paybill) for merchant UI
  - name: Fiat Currencies
    description: >
      Shared platform **fiat_currencies** catalog. **GET
      /api/v1/auth/fiat-currencies** lists active rows for UI pickers. **GET
      /api/v1/auth/fiat-currencies/admin** lists all rows including inactive
      (admin). Admin manages rows with **GET
      /api/v1/auth/fiat-currencies/{id}**, **POST
      /api/v1/auth/fiat-currencies**, **PATCH
      /api/v1/auth/fiat-currencies/{id}**, and **DELETE
      /api/v1/auth/fiat-currencies/{id}**. Use for OTC, pricing, orders,
      remittance, and backoffice — not under **`/otc/...`**. Prefer **PATCH**
      with **`is_active: false`** over delete when a currency is referenced.
  - name: Countries
    description: >-
      Shared platform **countries** catalog. Public **GET /api/v1/countries**
      lists active rows for pickers. Auth **GET /api/v1/auth/countries** returns
      the same active catalog. Admin manages rows with **GET
      /api/v1/auth/countries/admin**, **GET /api/v1/auth/countries/{id}**,
      **POST /api/v1/auth/countries**, **PATCH /api/v1/auth/countries/{id}**,
      and **DELETE /api/v1/auth/countries/{id}**.
  - name: Files
    description: Authenticated file uploads for OTC receipts and proof artifacts.
paths:
  /api/v1/auth/users/role/{role}:
    get:
      tags:
        - Users
      summary: List Users By Role (Paginated)
      description: Returns a paginated list of users filtered by role.
      parameters:
        - name: role
          in: path
          required: true
          schema:
            type: string
            enum:
              - customer
              - vendor
              - subvendor
              - user
              - admin
              - treasury
              - otc_officer
          description: Role to filter users by.
        - name: page_id
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
          description: Page number (1-based).
        - name: page_size
          in: query
          required: true
          schema:
            type: integer
            minimum: 5
            maximum: 10
          description: Page size (between 5 and 10).
      responses:
        '200':
          description: List of users with the specified role
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
              examples:
                vendor_list:
                  summary: Vendors
                  value:
                    - id: 383f20af-5960-4374-a5c3-b7566ea8f771
                      email: tigger.germain@gmail.com
                      phone_number: '+254723453286'
                      first_name: Tigger
                      last_name: Germain
                      role: vendor
                      kyc_status: pending
                    - id: 7a4301b0-e04b-4102-a999-b17dada65509
                      email: loice.juma@gmail.com
                      phone_number: '+254723453285'
                      first_name: Loice
                      last_name: Juma
                      role: vendor
                      kyc_status: pending
                    - id: c02c70db-2f9e-4bc8-a665-2836f3e5fd4e
                      email: kosla.imran@gmail.com
                      phone_number: '+254727648191'
                      first_name: Kosla
                      last_name: Imran
                      role: vendor
                      kyc_status: pending
                    - id: 5c81c005-1c52-4e0d-85e2-862ee1cdd4d0
                      email: imran.kosla@gmail.com
                      phone_number: '+254727648190'
                      first_name: Imran
                      last_name: Kosla
                      role: vendor
                      kyc_status: pending
                customer_list:
                  summary: Customers
                  value:
                    - id: b523ed51-a7e0-4c53-8ac2-3c0b7e1c9cd5
                      email: thando.eli@gmail.com
                      phone_number: '+254723453282'
                      first_name: Thando
                      last_name: Eli
                      role: customer
                      kyc_status: pending
                    - id: 8d09359f-325a-4ecf-998d-dbe5eda3a498
                      email: mike.juma@gmail.com
                      phone_number: '+254723453284'
                      first_name: Mike
                      last_name: Juma
                      role: customer
                      kyc_status: pending
                    - id: 2b06d31b-bb17-4392-b639-ae75b97d86e6
                      email: john.oganda@gmail.com
                      phone_number: '+254723453283'
                      first_name: John
                      last_name: Oganda
                      role: customer
                      kyc_status: pending
      security:
        - bearerAuth: []
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: User ID.
        email:
          type: string
          format: email
          description: User email.
        phone_number:
          type: string
          description: Phone in E.164 format.
        first_name:
          type: string
          description: Given name.
        last_name:
          type: string
          description: Family name.
        role:
          type: string
          enum:
            - customer
            - vendor
            - subvendor
            - user
            - admin
          description: >-
            Assigned role. Admin can only be assigned via PUT
            /api/v1/auth/user/id/{id}/role by an existing admin.
        kyc_status:
          type: string
          description: Current KYC status.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PASETO

````