> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-docs-mcp-bridge-private-server.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Search users based on filters specified in the request body.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/search/users
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/search/users:
    post:
      tags:
        - User
      summary: Search
      description: Search users based on filters specified in the request body.
      operationId: c1.api.user.v1.UserSearch.Search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/c1.api.user.v1.SearchUsersRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/c1.api.user.v1.SearchUsersResponse'
          description: Successful response
      x-codeSamples:
        - lang: go
          label: Search
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.UserSearch.Search(ctx, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.SearchUsersResponse != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: >-
            import { ConductoroneSDKTypescript } from
            "conductorone-sdk-typescript";


            const conductoroneSDKTypescript = new ConductoroneSDKTypescript({
              security: {
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
                oauth: "<YOUR_OAUTH_HERE>",
              },
            });


            async function run() {
              const result = await conductoroneSDKTypescript.userSearch.search();

              for await (const page of result) {
                console.log(page);
              }
            }


            run();
components:
  schemas:
    c1.api.user.v1.SearchUsersRequest:
      description: Search for users based on some filters.
      properties:
        delegateStatus:
          description: Filter for users based on their delegate status.
          enum:
            - DELEGATE_STATUS_UNSPECIFIED
            - DELEGATE_STATUS_HAS_DELEGATE
            - DELEGATE_STATUS_NO_DELEGATE
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        delegatedUserIds:
          description: >-
            Filter for users that have any of the delegated user IDs on this
            list.
          items:
            type: string
          type:
            - array
            - 'null'
        departments:
          description: Search for users that have any of the departments on this list.
          items:
            type: string
          type:
            - array
            - 'null'
        email:
          description: Search for users based on their email (exact match).
          type:
            - string
            - 'null'
        excludeIds:
          description: An array of users IDs to exclude from the results.
          items:
            type: string
          type:
            - array
            - 'null'
        excludeOrigins:
          description: Filter to exclude users with these origins.
          items:
            enum:
              - USER_ORIGIN_UNSPECIFIED
              - USER_ORIGIN_DIRECTORY
              - USER_ORIGIN_LOCAL
              - USER_ORIGIN_SYSTEM
            type: string
            x-speakeasy-unknown-values: allow
          type:
            - array
            - 'null'
        excludeTypes:
          description: An array of types to exclude from the results.
          items:
            enum:
              - USER_TYPE_UNSPECIFIED
              - USER_TYPE_SYSTEM
              - USER_TYPE_HUMAN
              - USER_TYPE_SERVICE
              - USER_TYPE_AGENT
            type: string
            x-speakeasy-unknown-values: allow
          type:
            - array
            - 'null'
        expandMask:
          oneOf:
            - $ref: '#/components/schemas/c1.api.user.v1.UserExpandMask'
            - type: 'null'
        ids:
          description: Deprecated. Use refs array instead.
          items:
            type: string
          type:
            - array
            - 'null'
        isDelegate:
          description: Filter for users who are delegates of at least one other user.
          type:
            - boolean
            - 'null'
        jobTitles:
          description: Search for users that have any of the job titles on this list.
          items:
            type: string
          type:
            - array
            - 'null'
        managerIds:
          description: Search for users that have any of the manager IDs on this list.
          items:
            type: string
          type:
            - array
            - 'null'
        origins:
          description: Filter to include only users with these origins.
          items:
            enum:
              - USER_ORIGIN_UNSPECIFIED
              - USER_ORIGIN_DIRECTORY
              - USER_ORIGIN_LOCAL
              - USER_ORIGIN_SYSTEM
            type: string
            x-speakeasy-unknown-values: allow
          type:
            - array
            - 'null'
        pageSize:
          description: >-
            The pageSize where 0 <= pageSize <= 100. Values < 10 will be set to
            10. A value of 0 returns the default page size (currently 25)
          format: int32
          type:
            - integer
            - 'null'
        pageToken:
          description: The pageToken field.
          type:
            - string
            - 'null'
        query:
          description: Query the apps with a fuzzy search on display name and emails.
          type:
            - string
            - 'null'
        refs:
          description: An array of user refs to restrict the return values to by ID.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserRef'
          type:
            - array
            - 'null'
        roleIds:
          description: Search for users that have any of the role IDs on this list.
          items:
            type: string
          type:
            - array
            - 'null'
        userStatuses:
          description: >-
            Search for users that have any of the statuses on this list. This
            can only be ENABLED, DISABLED, and DELETED
          items:
            enum:
              - UNKNOWN
              - ENABLED
              - DISABLED
              - DELETED
            type: string
            x-speakeasy-unknown-values: allow
          type:
            - array
            - 'null'
      title: Search Users Request
      type: object
      x-speakeasy-name-override: SearchUsersRequest
    c1.api.user.v1.SearchUsersResponse:
      description: The SearchUsersResponse message.
      properties:
        expanded:
          description: List of related objects
          items:
            additionalProperties: true
            description: >-
              Contains an arbitrary serialized message along with a @type that
              describes the type of the serialized message.
            properties:
              '@type':
                description: The type of the serialized message.
                type: string
            type: object
          type:
            - array
            - 'null'
        list:
          description: >-
            The list of results containing up to X results, where X is the page
            size defined in the request
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserView'
          type:
            - array
            - 'null'
        nextPageToken:
          description: >-
            The nextPageToken is shown for the next page if the number of
            results is larger than the max page size. The server returns one
            page of results and the nextPageToken until all results are
            retreived. To retrieve the next page, use the same request and
            append a pageToken field with the value of nextPageToken shown on
            the previous page.
          type:
            - string
            - 'null'
      title: Search Users Response
      type: object
      x-speakeasy-name-override: SearchUsersResponse
    c1.api.user.v1.UserExpandMask:
      description: >-
        The user expand mask is used to indicate which related objects should be
        expanded in the response.
         The supported paths are 'role_ids', 'manager_ids', 'delegated_user_id', 'directory_ids', and '*'.
      properties:
        paths:
          description: An array of paths to be expanded in the response.
          items:
            type: string
          type:
            - array
            - 'null'
      title: User Expand Mask
      type: object
      x-speakeasy-name-override: UserExpandMask
    c1.api.user.v1.UserRef:
      description: A reference to a user.
      properties:
        id:
          description: The id of the user.
          type:
            - string
            - 'null'
      title: User Ref
      type: object
      x-speakeasy-name-override: UserRef
    c1.api.user.v1.UserView:
      description: >-
        The UserView object provides a user response object, as well as
        JSONPATHs to related objects provided by expanders.
      properties:
        delegatedUserPath:
          description: >-
            JSONPATH expression indicating the location of the user objects of
            delegates of the current user in the expanded array.
          readOnly: true
          type:
            - string
            - 'null'
        directoriesPath:
          description: >-
            JSONPATH expression indicating the location of directory objects in
            the expanded array.
          readOnly: true
          type:
            - string
            - 'null'
        managersPath:
          description: >-
            JSONPATH expression indicating the location of the user objects that
            managed the current user in the expanded array.
          readOnly: true
          type:
            - string
            - 'null'
        rolesPath:
          description: >-
            JSONPATH expression indicating the location of the roles of the
            current user in the expanded array.
          readOnly: true
          type:
            - string
            - 'null'
        user:
          oneOf:
            - $ref: '#/components/schemas/c1.api.user.v1.User'
            - type: 'null'
      title: User View
      type: object
      x-speakeasy-name-override: UserView
    c1.api.user.v1.User:
      description: >-
        The User object provides all of the details for an user, as well as some
        configuration.
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type:
            - string
            - 'null'
        delegatedUserId:
          description: >-
            The id of the user to whom tasks will be automatically reassigned
            to.
          type:
            - string
            - 'null'
        deletedAt:
          format: date-time
          readOnly: true
          type:
            - string
            - 'null'
        department:
          description: The department which the user belongs to in the organization.
          readOnly: true
          type:
            - string
            - 'null'
        departmentSources:
          description: >-
            A list of objects mapped based on department attribute mappings
            configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        directoryIds:
          description: A list of unique ids that represent different directories.
          items:
            type: string
          readOnly: true
          type:
            - array
            - 'null'
        directoryStatus:
          description: The status of the user in the directory.
          enum:
            - UNKNOWN
            - ENABLED
            - DISABLED
            - DELETED
          readOnly: true
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        directoryStatusSources:
          description: >-
            A list of objects mapped based on directoryStatus attribute mappings
            configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        displayName:
          description: The display name of the user.
          readOnly: true
          type:
            - string
            - 'null'
        email:
          description: This is the user's email.
          readOnly: true
          type:
            - string
            - 'null'
        emailSources:
          description: A list of source data for the email attribute.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        emails:
          description: This is a list of all of the user's emails from app users.
          items:
            type: string
          readOnly: true
          type:
            - array
            - 'null'
        employeeIdSources:
          description: A list of source data for the employee IDs attribute.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        employeeIds:
          description: This is a list of all of the user's employee IDs from app users.
          items:
            type: string
          readOnly: true
          type:
            - array
            - 'null'
        employmentStatus:
          description: The users employment status.
          readOnly: true
          type:
            - string
            - 'null'
        employmentStatusSources:
          description: >-
            A list of objects mapped based on employmentStatus attribute
            mappings configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        employmentType:
          description: The employment type of the user.
          readOnly: true
          type:
            - string
            - 'null'
        employmentTypeSources:
          description: >-
            A list of objects mapped based on employmentType attribute mappings
            configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        id:
          description: A unique identifier of the user.
          readOnly: true
          type:
            - string
            - 'null'
        jobTitle:
          description: The job title of the user.
          readOnly: true
          type:
            - string
            - 'null'
        jobTitleSources:
          description: >-
            A list of objects mapped based on jobTitle attribute mappings
            configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        managerIds:
          description: A list of ids of the user's managers.
          items:
            type: string
          readOnly: true
          type:
            - array
            - 'null'
        managerSources:
          description: >-
            A list of objects mapped based on managerId attribute mappings
            configured in the system.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        origin:
          description: The origin of the user, describing who owns the user's lifecycle.
          enum:
            - USER_ORIGIN_UNSPECIFIED
            - USER_ORIGIN_DIRECTORY
            - USER_ORIGIN_LOCAL
            - USER_ORIGIN_SYSTEM
          readOnly: true
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        profile:
          additionalProperties: true
          readOnly: true
          type:
            - object
            - 'null'
        roleIds:
          description: >-
            A list of unique identifiers that maps to ConductorOne's user roles
            let you assign users permissions tailored to the work they do in the
            software.
          items:
            type: string
          type:
            - array
            - 'null'
        status:
          description: The status of the user in the system.
          enum:
            - UNKNOWN
            - ENABLED
            - DISABLED
            - DELETED
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        type:
          description: The type of the user.
          enum:
            - USER_TYPE_UNSPECIFIED
            - USER_TYPE_SYSTEM
            - USER_TYPE_HUMAN
            - USER_TYPE_SERVICE
            - USER_TYPE_AGENT
          readOnly: true
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        updatedAt:
          format: date-time
          readOnly: true
          type:
            - string
            - 'null'
        username:
          description: >-
            This is the user's primary username. Typically sourced from the
            primary directory.
          readOnly: true
          type:
            - string
            - 'null'
        usernameSources:
          description: A list of source data for the usernames attribute.
          items:
            $ref: '#/components/schemas/c1.api.user.v1.UserAttributeMappingSource'
          readOnly: true
          type:
            - array
            - 'null'
        usernames:
          description: This is a list of all of the user's usernames from app users.
          items:
            type: string
          readOnly: true
          type:
            - array
            - 'null'
      title: User
      type: object
      x-speakeasy-name-override: User
    c1.api.user.v1.UserAttributeMappingSource:
      description: The UserAttributeMappingSource message.
      properties:
        appId:
          description: The appId field.
          type:
            - string
            - 'null'
        appUserId:
          description: The appUserId field.
          type:
            - string
            - 'null'
        appUserProfileAttributeKey:
          description: The appUserProfileAttributeKey field.
          type:
            - string
            - 'null'
        userAttributeMappingId:
          description: The userAttributeMappingId field.
          type:
            - string
            - 'null'
        value:
          description: The value field.
          type:
            - string
            - 'null'
      title: User Attribute Mapping Source
      type: object
      x-speakeasy-name-override: UserAttributeMappingSource
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````