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

# Search for users

> This endpoint lets you search for users using filters



## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml get /user/search
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /user/search:
    get:
      tags:
        - Users
      summary: Search for users
      description: This endpoint lets you search for users using filters
      operationId: searchUser
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
          description: >-
            Filter by user email. Value must be a valid email address.
            Case-insensitive exact match.
          required: false
        - $ref: '#/components/parameters/query_filter_by_org_id'
        - in: query
          name: query
          schema:
            type: string
          description: >-
            Fuzzy search across the full name and email of users.
            Case-insensitive.
        - in: query
          name: status
          schema:
            $ref: '#/components/schemas/UserStatus'
            description: Filter users by status
        - in: query
          name: disabled
          schema:
            type: boolean
          description: >-
            If `true`, return only disabled users. If `false`, return only
            active users.
        - in: query
          name: has_assigned_businesses
          schema:
            type: boolean
          required: false
          description: >
            Filter users based on whether they have at least one assigned
            business (`true`) or no assigned businesses (`false`).
        - in: query
          name: has_not_permission
          schema:
            type: string
          required: false
          description: >
            Filter users who do *not* have the specified permission.


            For available permissions and their names, use [GET
            /api/v2/permissions](/api-reference/custom-roles/get-permissions) to
            retrieve the full list of available permissions for your
            organization.
        - in: query
          name: has_permission
          schema:
            type: string
          required: false
          description: >
            Filter users who have the specified permission.


            For available permissions and their names, use [GET
            /api/v2/permissions](/api-reference/custom-roles/get-permissions) to
            retrieve the full list of available permissions for your
            organization.
        - in: query
          name: last_name
          schema:
            type: string
          required: false
          description: Filter users by last name (exact substring match, case-sensitive).
        - in: query
          name: role
          schema:
            $ref: '#/components/schemas/Role'
            description: >
              Filter users by role. Accepts a single value or a comma-separated
              list.
          required: false
        - $ref: '#/components/parameters/query_display_business_ids'
        - in: query
          name: business_id
          schema:
            type: string
            description: >
              Filter by users having access to the business with the provided
              id.
            example: 5409c35a97bbc544d8e26737u
        - $ref: '#/components/parameters/query_page'
        - $ref: '#/components/parameters/query_per_page_1_100'
        - in: query
          name: order_by
          schema:
            type: string
            enum:
              - email
              - first_name
              - group_id
              - id
              - last_activity_date
              - last_name
              - org_id
              - role
              - status
              - '-email'
              - '-first_name'
              - '-group_id'
              - '-id'
              - '-last_activity_date'
              - '-last_name'
              - '-org_id'
              - '-role'
              - '-status'
            default: id
          required: false
          description: >
            Order result by given attribute.

            Reverse order can as well be obtained by using a `-` (minus sign)
            before the attribute name, e.g. `order_by=-name`
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ListResult'
                  - type: object
                    properties:
                      users:
                        type: array
                        description: List of users
                        items:
                          $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
components:
  parameters:
    query_filter_by_org_id:
      in: query
      name: org_id
      schema:
        type: integer
      required: false
      description: >
        Filter by organization ID. Only `PROVIDER` users can use this filter. If
        you are not a `PROVIDER`, this will default to the ID of your
        organization.
    query_display_business_ids:
      in: query
      name: display_business_ids
      schema:
        type: boolean
        default: true
      required: false
      description: >
        - If `true`, response includes `business_ids`; a list of businesses the
        user has access to.

        - If `false`, response does *not* include `business_ids`.


        ⚠️ Note: The `business_ids` list is only populated for users with the
        `BUSINESS_MANAGER` role.
    query_page:
      in: query
      name: page
      schema:
        type: integer
        default: 1
      description: |
        Page number.
        Starts at 1. Any value lower than 1 will be considered as 1.
        For the number of items per page, see the `per_page` query parameter.
    query_per_page_1_100:
      in: query
      name: per_page
      schema:
        type: integer
        default: 30
        minimum: 1
        maximum: 100
      description: Number of items to return per page. Currently limited to 100.
  schemas:
    UserStatus:
      description: User status in the application
      type: string
      enum:
        - active
        - invited
      example: active
    Role:
      description: User role in the application
      type: string
      enum:
        - PROVIDER
        - ORG_ADMIN
        - ORG_MANAGER
        - GROUP_MANAGER
        - BUSINESS_MANAGER
        - PUBLISHER
      example: BUSINESS_MANAGER
    ListResult:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/current_page'
        max_page:
          $ref: '#/components/schemas/max_page'
        count:
          $ref: '#/components/schemas/count'
    User:
      description: Partoo App User
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UserId'
        org_id:
          $ref: '#/components/schemas/UserOrgId'
        first_name:
          $ref: '#/components/schemas/UserFirstName'
        last_name:
          $ref: '#/components/schemas/UserLastName'
        email:
          $ref: '#/components/schemas/UserEmail'
        lang:
          $ref: '#/components/schemas/Lang'
        sidebar_pages:
          $ref: '#/components/schemas/SidebarPages'
          deprecated: true
        business_ids:
          description: >
            Populated only for BUSINESS_MANAGER role.


            List of businesses ids the user can access.


            Note: For a reliable way of getting all the businesses the user can
            access, use
            [operation/searchBusinesses](/api-reference/businesses/search-for-businesses).
          type: array
          items:
            $ref: '#/components/schemas/BusinessId'
        accesses:
          $ref: '#/components/schemas/accesses'
        role:
          $ref: '#/components/schemas/Role'
        provider:
          $ref: '#/components/schemas/UserProvider'
        status:
          $ref: '#/components/schemas/UserStatus'
        disabled:
          description: The state of the User account.
          type: boolean
          example: false
        created_at:
          description: Timestamp representing the date the user was created
          type: number
          example: 1615299414
        shadow_user_id:
          description: Used internally at Partoo
          type: string
          example: ''
        custom_role:
          $ref: '#/components/schemas/CustomRoleApiId'
        sso_only:
          $ref: '#/components/schemas/SsoOnly'
    current_page:
      type: integer
      description: Current page number
      example: 1
    max_page:
      type: integer
      description: Last page number
      example: 10
    count:
      type: integer
      description: Number of resources complying with filters
      example: 287
    UserId:
      description: User id
      type: string
      example: 5309c3a237bbc544d8e26737
    UserOrgId:
      description: User organization id
      type: integer
      example: 42
    UserFirstName:
      description: User first name
      type: string
      example: Perceval
    UserLastName:
      description: User last name
      type: string
      example: de Galles
    UserEmail:
      description: User email
      type: string
      format: email
      example: perceval@kaamelott.com
    Lang:
      description: Available language in the application
      type: string
      enum:
        - fr
        - en
        - es
        - it
        - pt-br
        - de
        - ar
        - nl
        - pl
        - cs
        - ca
        - sk
        - pt
        - lv
        - ro
        - bg
        - hu
      example: fr
    SidebarPages:
      type: array
      description: |
        List of features the user can access from the sidebar.
      items:
        allOf:
          - $ref: '#/components/schemas/SidebarPagesFeatureEnum'
        type: string
        description: Sidebar page feature name
    BusinessId:
      description: Business id
      type: string
      example: 5409c35a97bbc544d8e26737
    accesses:
      description: >
        List of (list of Group ID).


        Accesses of the users for the new groups system, only for
        `GROUP_MANAGER` users.


        See [the Groups and Sections
        description](/guides/api/resources/organizations/groups)
      type: array
      items:
        type: array
        items:
          type: integer
      example:
        - - 1
          - 2
        - - 1
          - 3
    UserProvider:
      description: User provider label
      type: string
      example: partoo
    CustomRoleApiId:
      description: >
        Optional API identifier of a custom role to assign to the user. The
        value must match the `api_id` of one of the custom roles available to
        your organization.


        If no custom role is given, users with the role `GROUP_MANAGER` or
        `BUSINESS_MANAGER` will automatically be assigned to the default
        built-in custom role associated with their role.


        For more information about custom roles, see [Managing User Permissions
        with Custom Roles](/guides/api/guides/custom-roles-and-permissions)
      type: string
      example: my_custom_role
    SsoOnly:
      description: >
        Prevent the user from connecting directly from the Partoo connection
        page.


        This field is available for users whose organization has defined an SSO
        configuration.


        This field can be edited by a user with the role `ORG_ADMIN` or
        `PROVIDER`.
      type: boolean
      default: false
    SidebarPagesFeatureEnum:
      enum:
        - bulk_modification
        - diffusion
        - feedback_management
        - messages
        - posts
        - presence_analytics
        - review_analytics
        - review_invite
        - review_management
  responses:
    '400':
      description: Your request is incorrect
      content:
        application/json:
          schema:
            description: |
              Error that occcurs when your request is incorrect
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: object
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````