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

# List users

> Lists users: an organization's members with `org_id`; with `realm_id`, people you could
invite to the realm (not yet members), searched with `query`; without either, every user
(site administrators, paged and sortable) or just you.

Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`). Results are limited to what that user can see. Site admin: all; org admin: members; else self.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-users.yaml post /v1/users/get
openapi: 3.0.3
info:
  title: 'CliqHub API: Users'
  version: 1.0.0
  description: >-
    User profiles. Which users you see depends on who you are: site
    administrators see

    everyone, organization admins see their members, everyone else sees
    themselves. Account

    administration (create, suspend, delete, passwords) is done by site
    administrators in the

    console.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Users
    description: >-
      User profiles. Which users you see depends on who you are: site
      administrators see

      everyone, organization admins see their members, everyone else sees
      themselves. Account

      administration (create, suspend, delete, passwords) is done by site
      administrators in the

      console.
paths:
  /v1/users/get:
    post:
      tags:
        - Users
      summary: List users
      description: >-
        Lists users: an organization's members with `org_id`; with `realm_id`,
        people you could

        invite to the realm (not yet members), searched with `query`; without
        either, every user

        (site administrators, paged and sortable) or just you.


        Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`).
        Results are limited to what that user can see. Site admin: all; org
        admin: members; else self.
      operationId: POST_v1_users_get
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                org_id:
                  type: string
                  format: uuid
                  description: The organization whose members to list.
                realm_id:
                  type: string
                  minLength: 1
                  description: >-
                    List people who are not yet members of this realm (for
                    inviting them).
                query:
                  type: string
                  description: Matches part of the username or email.
                search:
                  type: string
                  description: Older name for `query`.
                role:
                  type: string
                  enum:
                    - user
                    - admin
                  description: 'Site administrators: only `user` or `admin` accounts.'
                suspended:
                  type: boolean
                  description: >-
                    Site administrators: only suspended (`true`) or active
                    (`false`) accounts.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: Page size (at most 100).
                offset:
                  type: integer
                  minimum: 0
                  description: Rows to skip, for paging.
                sort_by:
                  type: string
                  enum:
                    - username
                    - role
                    - created_at
                    - suspended_at
                  description: Site-admin hub list only (400 with org_id / realm_id).
                sort_dir:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: >-
                    Sort direction with sort_by (default asc); ties are broken
                    by id ascending
                include_deleted:
                  type: boolean
                  description: 'Site administrators: also list deleted accounts.'
            examples:
              org:
                value:
                  org_id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
              invite:
                summary: People to invite to a realm
                value:
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                  query: jdo
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                  data:
                    type: object
                    properties:
                      users:
                        type: array
                        items:
                          $ref: '#/components/schemas/UserData'
                      total:
                        type: integer
                      limit:
                        type: integer
                      offset:
                        type: integer
              example:
                ok: true
                data:
                  users:
                    - id: 2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e
                      username: jdoe
                      display_name: Jane Doe
                      email: jdoe@acme.example
                      role: user
                      suspended_at: null
                      suspended_reason: null
                      created_at: '2026-10-07T10:00:00Z'
                  total: 1
                  limit: 20
                  offset: 0
        '400':
          description: >-
            `invalid_params`: `sort_by` was sent with `org_id` or `realm_id`
            (sorting applies to the site-admin list only).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: >-
                      sort_by applies to the site-admin hub list only (not with
                      org_id / realm_id)
                    code: invalid_params
        '401':
          description: >-
            `unauthorized`: No `Authorization` header, or the token is
            malformed, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                unauthorized:
                  summary: unauthorized
                  value:
                    ok: false
                    error:
                      code: unauthorized
                      message: Authentication required
        '403':
          description: '`forbidden`: A daemon token was used; this route needs a user token.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    ok: false
                    error:
                      code: forbidden
                      message: You do not have access to do this
        '422':
          description: >-
            `invalid_params`: The body fails the request schema: a required
            field is missing or a value has the wrong type or format. The
            message lists every issue as `field: problem`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: 'org_id: Required'
                    code: invalid_params
        '500':
          description: >-
            `internal_error`: An unexpected server fault. Retry later; if it
            persists, report it with the time of the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                internal_error:
                  summary: internal_error
                  value:
                    ok: false
                    error: Internal server error
                    code: internal_error
      security:
        - BearerAuth: []
components:
  schemas:
    UserData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: User UUID
        username:
          type: string
          description: Unique username / handle
        display_name:
          type: string
          description: Human-readable display name
        email:
          type: string
          description: Primary email address
        role:
          type: string
          enum:
            - user
            - admin
          description: Site-level role
        suspended_at:
          type: string
          nullable: true
          description: ISO timestamp when account was suspended; null if active
        suspended_reason:
          type: string
          description: Admin note on suspension; empty string when not suspended
        created_at:
          type: string
          description: ISO timestamp of account creation
        preferences:
          type: object
          additionalProperties: true
          description: User-controlled preference bag
      required:
        - id
        - username
        - display_name
        - email
        - role
        - suspended_at
        - suspended_reason
        - created_at
        - preferences
    HubErr:
      type: object
      required:
        - ok
        - error
      description: >-
        Every failure. Route-policy denials (401/403/404, and 400 when neither
        realm_id nor org_id was sent) answer `error` as `{ code, message }`;
        errors raised by the endpoint answer `error` as the message with the
        code beside it in `code`. Every error has a code. See
        [Errors](/hub-api/errors).
      properties:
        ok:
          type: boolean
          description: Always false on error
        error:
          description: The message, or `{ code, message }` for an access denial.
          oneOf:
            - type: string
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                message:
                  type: string
        code:
          type: string
          description: Stable error code of an endpoint error.
        details:
          type: object
          additionalProperties: true
          description: Structured detail, when there is some.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cliq_tok_* | cliq_dt_*
      description: >-
        User PAT (`cliq_tok_…`, including session-scoped) or realm token
        (`cliq_dt_…`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.