Search a user using atlas Search, that allows for relevance scoring, which is a ranking system that orders search results by relevance to the query.

This helps ensure that the most relevant data is returned first, just like how search engines prioritize results based on relevance. So here you can search by a 'user_text' and get the 10 best matches for that search criteria

GET /users/search/{userText}

Operation id: UserService_SearchUserByTextSearch

Description

Permission Level: Read

Tags: UserService

Parameters

Path parameters

NameTypeRequiredDescription
userTextstringYestext for the user to search on this fields: firstName, lastName, email, userId. Required: true

Query parameters

NameTypeRequiredDescription
pageSizeinteger (int32)NoThe amount of data returned in a single response. Default: 10, Required: false
pageTokenstringNoMongoDB Field, describes the encoded page token for page traversal, Required: false
partialSearchbooleanNopartial contains search on firstName, and lastName if entered in user_test, Default: false, Required: false
resourceTypestringNothe common ResourceType that all users have access to, Required: false note using this filter will decrease performance of the endpoint
roleFilterstringNoThis filter will only return users who have roles that meet a certain criteria - ALL_ROLES: All Roles - USER_ONLY: User Roles only - ADMIN_ONLY: Admin Roles only
scopestringNoscope of the user to fetch, Required: false
sortFieldarrayNoList of sort fields, valid values: userId, firstName, lastName, email, lastUpdated, licenses or creationTime Default: userId, Required: false
sortTypestringNoSort Type for the results, Default: ASC, Required: false
tenantIdstringNotenant of the user, Required: false

Security

  • Authorization (apiKey)
    • Bearer token

Responses

200 — A successful response.

Content type: application/json

default — An unexpected error response.

Content type: application/json

Response models

200 — A successful response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
usersarrayNo
nextPageTokenstringNo
{
  "type": "object",
  "properties": {
    "users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "description": "The user's roles. Includes nested roles. Flat list. Read only.",
            "items": {
              "type": "object"
            }
          },
          "workspaces": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "location": {
            "type": "string"
          },
          "enabledScopes": {
            "type": "object",
            "description": "Scopes and status (enable, disable) for a user. Scope is optional. Typically applications will always pass their scope, but it is optional for admin purposes."
          },
          "primarySite": {
            "type": "string"
          },
          "selectedDepartments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "middleName": {
            "type": "string"
          },
          "platformId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "creationTime": {
            "type": "string",
            "format": "date-time"
          },
          "siteMapping": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    "nextPageToken": {
      "type": "string"
    }
  }
}

default — An unexpected error response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
codeinteger (int32)No
messagestringNo
detailsarrayNo
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          }
        }
      }
    }
  }
}