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

# Get directory user search count

> Returns total count of directory users matching the same filters as the search endpoint. Use this for pagination totalCount without running the count in the search query.



## OpenAPI

````yaml https://api.wirespeed.co/v1/openapi.json post /v1/directory/count
openapi: 3.0.0
info:
  title: Wirespeed API
  description: The public Wirespeed API. v1 is the first stable contract.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.wirespeed.co
security: []
tags: []
paths:
  /v1/directory/count:
    post:
      tags:
        - Directory
      summary: Get directory user search count
      description: >-
        Returns total count of directory users matching the same filters as the
        search endpoint. Use this for pagination totalCount without running the
        count in the search query.
      operationId: DirectoryController_searchDirectoryUsersCount
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectoryUserSearchDto'
      responses:
        '200':
          description: Total count of directory users matching the search criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectoryUserSearchCountResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
      security:
        - bearer: []
components:
  schemas:
    DirectoryUserSearchDto:
      type: object
      properties:
        size:
          type: number
        page:
          type: number
        filter:
          type: string
          enum:
            - email
            - name
            - username
            - title
            - department
            - role
            - integration_source_id
            - custom_attribute
          description: Field to filter directory users by
        search:
          type: string
        orderBy:
          type: string
        orderDir:
          type: string
          enum:
            - asc
            - desc
        searchAttributeKey:
          type: string
          description: >-
            Custom attribute key to match when filter is custom_attribute. When
            omitted, searches across all attribute keys and values.
        teamId:
          type: string
          description: Filter users by team ID (for service providers)
        groups:
          type: array
          description: Filter users by groups
          items:
            type: string
            enum:
              - VIP
              - ADMIN
              - EXTERNAL
              - TECHNICAL
              - FINANCIAL
              - NHI
        ipId:
          type: string
          description: Filter users associated with specific IP address
        endpointId:
          type: string
          description: Filter users associated with specific endpoint
        endpointPrivateIpId:
          type: string
          description: >-
            Filter users associated with endpoints that have this private IP
            address
        userAgentId:
          type: string
          description: Filter users associated with specific user agent
        showUnmanagedUsers:
          type: boolean
          description: Include unmanaged users in results
        onlyEnabled:
          type: boolean
          description: Only include users that are enabled
        onlyDisabled:
          type: boolean
          description: Only include users that are disabled
        onlyContained:
          type: boolean
          description: Only include users that are contained
        onlyChatOpsOnboardingUsers:
          type: boolean
          description: Only include users that are in the chat ops onboarding group
        smsEnrollmentStatus:
          type: string
          enum:
            - enrolled
            - pending
            - max_attempts
            - opted_out
            - not_invited
          description: Filter users by SMS enrollment status
        integrationIds:
          description: Filter users by integration IDs (sources)
          type: array
          items:
            type: string
            format: uuid
        groupIds:
          description: >-
            Filter users by group IDs (supports multiple). Pass the sentinel
            value "ungrouped" to filter users with no group memberships.
          type: array
          items:
            type: string
        groupFilterOperator:
          type: string
          enum:
            - and
            - or
          description: >-
            Operator for combining multiple group filters. "and" = must be in
            ALL groups, "or" = must be in ANY group. Defaults to "or".
        dedupeCanonicalRoots:
          type: boolean
          description: >-
            When true and asset deduplication is enabled for the team, return
            only canonical representative rows (canonical_id IS NULL)
        onlyCanonicalClustersWithDuplicates:
          type: boolean
          description: >-
            When true together with dedupeCanonicalRoots and asset
            deduplication, return only canonical roots that have at least one
            merged duplicate from another source
        canonicalClusterOfDirectoryUserId:
          type: string
          description: >-
            When set with asset deduplication enabled, return paginated
            directory user rows in this canonical cluster (children only;
            resolves root from root or child id)
    DirectoryUserSearchCountResponse:
      type: object
      properties:
        totalCount:
          type: number
          description: Total number of directory users matching the search criteria
      required:
        - totalCount
    HttpError:
      type: object
      properties:
        message:
          type: string
        statusCode:
          type: number
      required:
        - message
        - statusCode
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````