---
id: search-count
sidebar_label: Count Documents Satisfying a Query
hide_title: true
hide_table_of_contents: true
api: {"tags":["Search"],"description":"Performs a search with a provided query and returns the count of results in the X-Total-Count header.","operationId":"searchCount","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"indices":{"description":"The names of the Elasticsearch indices in which to search. If none are provided, then all indices will be searched.","externalDocs":{"description":"Learn more about search indices here.","url":"https://documentation.sailpoint.com/saas/help/search/searchable-fields.html"},"type":"array","items":{"description":"Enum representing the currently supported indices.\nAdditional values may be added in the future without notice.","type":"string","enum":["accessprofiles","accountactivities","entitlements","events","identities","roles","*"],"example":"identities"},"example":["identities"]},"queryType":{"description":"The type of query to use.  By default, the `SAILPOINT` query type is used, which requires the `query` object to be defined in the request body.\nTo use the `queryDsl` or `typeAheadQuery` objects in the request, you must set the type to `DSL` or `TYPEAHEAD` accordingly.\nAdditional values may be added in the future without notice.","type":"string","enum":["DSL","SAILPOINT","TYPEAHEAD"],"default":"SAILPOINT","example":"SAILPOINT"},"queryVersion":{"allOf":[{"description":"The current Elasticserver version.","type":"string","default":"5.2","example":"5.2"},{"type":"string","description":"The version of the query object.\nThis version number will map to the version of Elasticsearch for the query strings and objects being used."}]},"query":{"type":"object","description":"Query parameters used to construct an Elasticsearch query object.","properties":{"query":{"description":"The query using the Elasticsearch [Query String Query](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-query-string-query.html#query-string) syntax from the Query DSL extended by SailPoint to support Nested queries.","type":"string","example":"name:a*"},"fields":{"description":"The fields to which the specified query will be applied.  The available fields are dependent on the indice(s) being searched on.  Please refer to the response schema of this API for a list of available fields.","type":"array","items":{"type":"string"},"example":["name"]},"timeZone":{"description":"The time zone to be applied to any range query related to dates.","type":"string","example":"America/Chicago"},"innerHit":{"description":"The innerHit query object returns a flattened list of results for the specified nested type.","type":"object","required":["query","type"],"properties":{"query":{"description":"The search query using the Elasticsearch [Query String Query](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-query-string-query.html#query-string) syntax from the Query DSL extended by SailPoint to support Nested queries.","type":"string","example":"source.name:\\\"Active Directory\\\""},"type":{"description":"The nested type to use in the inner hits query.  The nested type [Nested Type](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) refers to a document \"nested\" within another document. For example, an identity can have nested documents for access, accounts, and apps.","type":"string","example":"access"}}}}},"queryDsl":{"description":"The search query using the Elasticsearch [Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/query-dsl.html) syntax.","type":"object","example":{"match":{"name":"john.doe"}}},"typeAheadQuery":{"type":"object","description":"Query parameters used to construct an Elasticsearch type ahead query object.  The typeAheadQuery performs a search for top values beginning with the typed values. For example, typing \"Jo\" results in top hits matching \"Jo.\" Typing \"Job\" results in top hits matching \"Job.\" ","required":["query","field"],"properties":{"query":{"description":"The type ahead query string used to construct a phrase prefix match query.","type":"string","example":"Work"},"field":{"description":"The field on which to perform the type ahead search.","type":"string","example":"source.name"},"nestedType":{"description":"The nested type.","type":"string","example":"access"},"maxExpansions":{"description":"The number of suffixes the last term will be expanded into.\nInfluences the performance of the query and the number results returned.\nValid values: 1 to 1000.","type":"integer","format":"int32","minimum":1,"maximum":1000,"default":10,"example":10}}},"includeNested":{"description":"Indicates whether nested objects from returned search results should be included.","type":"boolean","default":true,"example":true},"queryResultFilter":{"type":"object","description":"Allows the query results to be filtered by specifying a list of fields to include and/or exclude from the result documents.","properties":{"includes":{"description":"The list of field names to include in the result documents.","type":"array","items":{"type":"string"},"example":["name","displayName"]},"excludes":{"description":"The list of field names to exclude from the result documents.","type":"array","items":{"type":"string"},"example":["stacktrace"]}}},"aggregationType":{"description":"Enum representing the currently available query languages for aggregations, which are used to perform calculations or groupings on search results.\n\nAdditional values may be added in the future without notice.\n","type":"string","enum":["DSL","SAILPOINT"],"default":"DSL","example":"DSL"},"aggregationsVersion":{"allOf":[{"description":"The current Elasticserver version.","type":"string","default":"5.2","example":"5.2"},{"type":"string","description":"The version of the language being used for aggregation queries.\nThis version number will map to the version of Elasticsearch for the aggregation query object."}]},"aggregationsDsl":{"description":"The aggregation search query using Elasticsearch [Aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations.html) syntax.","type":"object","example":{}},"aggregations":{"description":"The aggregation’s specifications, such as the groupings and calculations to be performed.\n","allOf":[{"type":"object","properties":{"nested":{"type":"object","description":"The nested aggregation object.","required":["name","type"],"properties":{"name":{"description":"The name of the nested aggregate to be included in the result.","type":"string","example":"id"},"type":{"description":"The type of the nested object.","type":"string","example":"access"}}},"metric":{"type":"object","description":"The calculation done on the results of the query","required":["name","field"],"properties":{"name":{"description":"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.","type":"string","example":"Access Name Count"},"type":{"description":"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["COUNT","UNIQUE_COUNT","AVG","SUM","MEDIAN","MIN","MAX"],"default":"UNIQUE_COUNT","example":"COUNT"},"field":{"description":"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"@access.name"}}},"filter":{"type":"object","description":"An additional filter to constrain the results of the search query.","required":["name","field","value"],"properties":{"name":{"description":"The name of the filter aggregate to be included in the result.","type":"string","example":"Entitlements"},"type":{"description":"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERM"],"default":"TERM","example":"TERM"},"field":{"description":"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"access.type"},"value":{"description":"The value to filter on.","type":"string","example":"ENTITLEMENT"}}},"bucket":{"type":"object","description":"The bucket to group the results of the aggregation query by.","required":["name","field"],"properties":{"name":{"description":"The name of the bucket aggregate to be included in the result.","type":"string","example":"Identity Locations"},"type":{"description":"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERMS"],"default":"TERMS","example":"TERMS"},"field":{"description":"The field to bucket on.\nPrefix the field name with '@' to reference a nested object.","type":"string","example":"attributes.city"},"size":{"description":"Maximum number of buckets to include.","type":"integer","format":"int32","example":100},"minDocCount":{"description":"Minimum number of documents a bucket should have.","type":"integer","format":"int32","example":2}}}}},{"type":"object","properties":{"subAggregation":{"description":"Aggregation to be performed on the result of the parent bucket aggregation.","allOf":[{"type":"object","properties":{"nested":{"type":"object","description":"The nested aggregation object.","required":["name","type"],"properties":{"name":{"description":"The name of the nested aggregate to be included in the result.","type":"string","example":"id"},"type":{"description":"The type of the nested object.","type":"string","example":"access"}}},"metric":{"type":"object","description":"The calculation done on the results of the query","required":["name","field"],"properties":{"name":{"description":"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.","type":"string","example":"Access Name Count"},"type":{"description":"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["COUNT","UNIQUE_COUNT","AVG","SUM","MEDIAN","MIN","MAX"],"default":"UNIQUE_COUNT","example":"COUNT"},"field":{"description":"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"@access.name"}}},"filter":{"type":"object","description":"An additional filter to constrain the results of the search query.","required":["name","field","value"],"properties":{"name":{"description":"The name of the filter aggregate to be included in the result.","type":"string","example":"Entitlements"},"type":{"description":"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERM"],"default":"TERM","example":"TERM"},"field":{"description":"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"access.type"},"value":{"description":"The value to filter on.","type":"string","example":"ENTITLEMENT"}}},"bucket":{"type":"object","description":"The bucket to group the results of the aggregation query by.","required":["name","field"],"properties":{"name":{"description":"The name of the bucket aggregate to be included in the result.","type":"string","example":"Identity Locations"},"type":{"description":"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERMS"],"default":"TERMS","example":"TERMS"},"field":{"description":"The field to bucket on.\nPrefix the field name with '@' to reference a nested object.","type":"string","example":"attributes.city"},"size":{"description":"Maximum number of buckets to include.","type":"integer","format":"int32","example":100},"minDocCount":{"description":"Minimum number of documents a bucket should have.","type":"integer","format":"int32","example":2}}}}},{"type":"object","properties":{"subAggregation":{"type":"object","properties":{"nested":{"type":"object","description":"The nested aggregation object.","required":["name","type"],"properties":{"name":{"description":"The name of the nested aggregate to be included in the result.","type":"string","example":"id"},"type":{"description":"The type of the nested object.","type":"string","example":"access"}}},"metric":{"type":"object","description":"The calculation done on the results of the query","required":["name","field"],"properties":{"name":{"description":"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.","type":"string","example":"Access Name Count"},"type":{"description":"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["COUNT","UNIQUE_COUNT","AVG","SUM","MEDIAN","MIN","MAX"],"default":"UNIQUE_COUNT","example":"COUNT"},"field":{"description":"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"@access.name"}}},"filter":{"type":"object","description":"An additional filter to constrain the results of the search query.","required":["name","field","value"],"properties":{"name":{"description":"The name of the filter aggregate to be included in the result.","type":"string","example":"Entitlements"},"type":{"description":"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERM"],"default":"TERM","example":"TERM"},"field":{"description":"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n","type":"string","example":"access.type"},"value":{"description":"The value to filter on.","type":"string","example":"ENTITLEMENT"}}},"bucket":{"type":"object","description":"The bucket to group the results of the aggregation query by.","required":["name","field"],"properties":{"name":{"description":"The name of the bucket aggregate to be included in the result.","type":"string","example":"Identity Locations"},"type":{"description":"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice.","type":"string","enum":["TERMS"],"default":"TERMS","example":"TERMS"},"field":{"description":"The field to bucket on.\nPrefix the field name with '@' to reference a nested object.","type":"string","example":"attributes.city"},"size":{"description":"Maximum number of buckets to include.","type":"integer","format":"int32","example":100},"minDocCount":{"description":"Minimum number of documents a bucket should have.","type":"integer","format":"int32","example":2}}}},"description":"Aggregation to be performed on the result of the parent bucket aggregation."}}}]}}}]},"sort":{"description":"The fields to be used to sort the search results. Use + or - to specify the sort direction.","type":"array","items":{"type":"string","example":["displayName","+id"]}},"searchAfter":{"description":"Used to begin the search window at the values specified.\nThis parameter consists of the last values of the sorted fields in the current record set.\nThis is used to expand the Elasticsearch limit of 10K records by shifting the 10K window to begin at this value.\nIt is recommended that you always include the ID of the object in addition to any other fields on this parameter in order to ensure you don't get duplicate results while paging.\nFor example, when searching for identities, if you are sorting by displayName you will also want to include ID, for example [\"displayName\", \"id\"]. \nIf the last identity ID in the search result is 2c91808375d8e80a0175e1f88a575221 and the last displayName is \"John Doe\", then using that displayName and ID will start a new search after this identity.\nThe searchAfter value will look like [\"John Doe\",\"2c91808375d8e80a0175e1f88a575221\"]","type":"array","items":{"type":"string","example":["John Doe","2c91808375d8e80a0175e1f88a575221"]}},"filters":{"description":"The filters to be applied for each filtered field name.","type":"object","additionalProperties":{"type":"object","properties":{"type":{"description":"Enum representing the currently supported filter types.\nAdditional values may be added in the future without notice.","type":"string","enum":["EXISTS","RANGE","TERMS"],"example":"RANGE"},"range":{"type":"object","description":"The range of values to be filtered.","properties":{"lower":{"description":"The lower bound of the range.","type":"object","required":["value"],"properties":{"value":{"description":"The value of the range's endpoint.","type":"string","example":"1"},"inclusive":{"description":"Indicates if the endpoint is included in the range.","type":"boolean","default":false,"example":false}}},"upper":{"description":"The upper bound of the range.","type":"object","required":["value"],"properties":{"value":{"description":"The value of the range's endpoint.","type":"string","example":"1"},"inclusive":{"description":"Indicates if the endpoint is included in the range.","type":"boolean","default":false,"example":false}}}}},"terms":{"description":"The terms to be filtered.","type":"array","items":{"type":"string","example":"account_count"}},"exclude":{"description":"Indicates if the filter excludes results.","type":"boolean","default":false,"example":false}}},"example":{}}}},"examples":{"query-timeZone":{"summary":"Query with TimeZone","value":{"indices":["identities"],"query":{"query":"created: [2022-05-19T19:26:03.351Z TO now]","timeZone":"America/Los_Angeles"}}}}}},"required":true},"responses":{"204":{"description":"No content - indicates the request was successful but there is no content to be returned in the response.","headers":{"X-Total-Count":{"description":"The total result count.","schema":{"type":"integer"},"example":5}}},"400":{"description":"Client Error - Returned if the request body is invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"detailCode":{"type":"string","description":"Fine-grained error code providing more detail of the error.","example":"400.1 Bad Request Content"},"trackingId":{"type":"string","description":"Unique tracking id for the error.","example":"e7eab60924f64aa284175b9fa3309599"},"messages":{"type":"array","description":"Generic localized reason for error","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}},"causes":{"type":"array","description":"Plain-text descriptive reasons to provide additional detail to the text provided in the messages field","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}}}}}}},"401":{"description":"Unauthorized - Returned if there is no authorization header, or if the JWT token is expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A message describing the error","example":"JWT validation failed: JWT is expired"}}}}}},"403":{"description":"Forbidden - Returned if the user you are running as, doesn't have access to this end-point.","content":{"application/json":{"schema":{"type":"object","properties":{"detailCode":{"type":"string","description":"Fine-grained error code providing more detail of the error.","example":"400.1 Bad Request Content"},"trackingId":{"type":"string","description":"Unique tracking id for the error.","example":"e7eab60924f64aa284175b9fa3309599"},"messages":{"type":"array","description":"Generic localized reason for error","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}},"causes":{"type":"array","description":"Plain-text descriptive reasons to provide additional detail to the text provided in the messages field","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}}}},"examples":{"403":{"summary":"An example of a 403 response object","value":{"detailCode":"403 Forbidden","trackingId":"b21b1f7ce4da4d639f2c62a57171b427","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"The server understood the request but refuses to authorize it."}]}}}}}},"429":{"description":"Too Many Requests - Returned in response to too many requests in a given period of time - rate limited. The Retry-After header in the response includes how long to wait before trying again.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"A message describing the error","example":" Rate Limit Exceeded "}}}}}},"500":{"description":"Internal Server Error - Returned if there is an unexpected error.","content":{"application/json":{"schema":{"type":"object","properties":{"detailCode":{"type":"string","description":"Fine-grained error code providing more detail of the error.","example":"400.1 Bad Request Content"},"trackingId":{"type":"string","description":"Unique tracking id for the error.","example":"e7eab60924f64aa284175b9fa3309599"},"messages":{"type":"array","description":"Generic localized reason for error","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}},"causes":{"type":"array","description":"Plain-text descriptive reasons to provide additional detail to the text provided in the messages field","items":{"type":"object","properties":{"locale":{"type":"string","description":"The locale for the message text, a BCP 47 language tag.","example":"en-US"},"localeOrigin":{"type":"string","enum":["DEFAULT","REQUEST"],"description":"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice.","example":"DEFAULT"},"text":{"type":"string","description":"Actual text of the error message in the indicated locale.","example":"The request was syntactically correct but its content is semantically invalid."}}}}}},"examples":{"500":{"summary":"An example of a 500 response object","value":{"detailCode":"500.0 Internal Fault","trackingId":"b21b1f7ce4da4d639f2c62a57171b427","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"An internal fault occurred."}]}}}}}}},"method":"post","path":"/search/count","servers":[{"url":"https://{tenant}.api.identitynow.com/v3","description":"This is the production API server.","variables":{"tenant":{"default":"sailpoint","description":"This is the name of your tenant, typically your company's name."}}}],"security":[{"oauth2":[]}],"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth2 Bearer token (JWT). See [IdentityNow REST API Authentication](https://developer.sailpoint.com/idn/api/authentication) for more information.\n- Directions for generating a [personal access token](https://developer.sailpoint.com/idn/api/authentication#personal-access-tokens)\n- Directions using [client credentials flow](https://developer.sailpoint.com/idn/api/authentication#client-credentials-grant-flow)\n- Directions for using [authorization code flow](https://developer.sailpoint.com/idn/api/authentication#authorization-code-grant-flow)\n\nWhich authentication method should I choose?  See our [guide](https://developer.sailpoint.com/idn/api/authentication#which-oauth-20-grant-flow-should-i-use)\n\nLearn more about how to find your `tokenUrl` and `authorizationUrl` [in our docs](https://developer.sailpoint.com/idn/api/authentication#find-your-tenants-oauth-details)\n","flows":{"clientCredentials":{"tokenUrl":"https://tenant.api.identitynow.com/oauth/token","scopes":{"sp:scopes:default":"default scope","sp:scopes:all":"access to all scopes"}},"authorizationCode":{"authorizationUrl":"https://tenant.identitynow.com/oauth/authorize","tokenUrl":"https://tenant.api.identitynow.com/oauth/token","scopes":{"sp:scopes:default":"default scope","sp:scopes:all":"access to all scopes"}}}}},"jsonRequestBodyExample":{"indices":["identities"],"queryType":"SAILPOINT","queryVersion":"5.2","query":{"query":"name:a*","fields":["name"],"timeZone":"America/Chicago","innerHit":{"query":"source.name:\\\"Active Directory\\\"","type":"access"}},"queryDsl":{"match":{"name":"john.doe"}},"typeAheadQuery":{"query":"Work","field":"source.name","nestedType":"access","maxExpansions":10},"includeNested":true,"queryResultFilter":{"includes":["name","displayName"],"excludes":["stacktrace"]},"aggregationType":"DSL","aggregationsVersion":"5.2","aggregationsDsl":{},"aggregations":{"nested":{"name":"id","type":"access"},"metric":{"name":"Access Name Count","type":"COUNT","field":"@access.name"},"filter":{"name":"Entitlements","type":"TERM","field":"access.type","value":"ENTITLEMENT"},"bucket":{"name":"Identity Locations","type":"TERMS","field":"attributes.city","size":100,"minDocCount":2},"subAggregation":{"nested":{"name":"id","type":"access"},"metric":{"name":"Access Name Count","type":"COUNT","field":"@access.name"},"filter":{"name":"Entitlements","type":"TERM","field":"access.type","value":"ENTITLEMENT"},"bucket":{"name":"Identity Locations","type":"TERMS","field":"attributes.city","size":100,"minDocCount":2},"subAggregation":{"nested":{"name":"id","type":"access"},"metric":{"name":"Access Name Count","type":"COUNT","field":"@access.name"},"filter":{"name":"Entitlements","type":"TERM","field":"access.type","value":"ENTITLEMENT"},"bucket":{"name":"Identity Locations","type":"TERMS","field":"attributes.city","size":100,"minDocCount":2}}}},"sort":[["displayName","+id"]],"searchAfter":[["John Doe","2c91808375d8e80a0175e1f88a575221"]],"filters":{}},"info":{"title":"IdentityNow V3 API","description":"Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.","termsOfService":"https://developer.sailpoint.com/discuss/tos","contact":{"name":"Developer Relations","url":"https://developer.sailpoint.com/discuss/api-help"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"3.0.0"},"postman":{"name":"Count Documents Satisfying a Query","description":{"content":"Performs a search with a provided query and returns the count of results in the X-Total-Count header.","type":"text/plain"},"url":{"path":["search","count"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}}
sidebar_class_name: "post api-method"
info_path: idn/api/v3/identitynow-v-3-api
custom_edit_url: "https://github.com/sailpoint-oss/developer.sailpoint.com/issues/new?assignees=&labels=&template=bug-report.md&title=%5BBug%5D+Your+Bug+Report+Here Requesting changes to 'Count Documents Satisfying a Query' (search-count)"
---

import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";

## Count Documents Satisfying a Query



Performs a search with a provided query and returns the count of results in the X-Total-Count header.

<MimeTabs><TabItem label={"application/json"} value={"application/json-schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"indices"} required={false} deprecated={undefined} schemaDescription={"The names of the Elasticsearch indices in which to search. If none are provided, then all indices will be searched."} schemaName={"string[]"} qualifierMessage={"**Possible values:** [`accessprofiles`, `accountactivities`, `entitlements`, `events`, `identities`, `roles`, `*`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"queryType"} required={false} deprecated={undefined} schemaDescription={"The type of query to use.  By default, the `SAILPOINT` query type is used, which requires the `query` object to be defined in the request body.\nTo use the `queryDsl` or `typeAheadQuery` objects in the request, you must set the type to `DSL` or `TYPEAHEAD` accordingly.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DSL`, `SAILPOINT`, `TYPEAHEAD`]"} defaultValue={"SAILPOINT"}></SchemaItem><SchemaItem collapsible={false} name={"queryVersion"} required={false} deprecated={undefined} schemaDescription={"The current Elasticserver version."} schemaName={"object"} qualifierMessage={undefined} defaultValue={"5.2"}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>query</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Query parameters used to construct an Elasticsearch query object.

</div><SchemaItem collapsible={false} name={"query"} required={false} deprecated={undefined} schemaDescription={"The query using the Elasticsearch [Query String Query](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-query-string-query.html#query-string) syntax from the Query DSL extended by SailPoint to support Nested queries."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"fields"} required={false} deprecated={undefined} schemaDescription={"The fields to which the specified query will be applied.  The available fields are dependent on the indice(s) being searched on.  Please refer to the response schema of this API for a list of available fields."} schemaName={"string[]"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"timeZone"} required={false} deprecated={undefined} schemaDescription={"The time zone to be applied to any range query related to dates."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>innerHit</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The innerHit query object returns a flattened list of results for the specified nested type.

</div><SchemaItem collapsible={false} name={"query"} required={true} deprecated={undefined} schemaDescription={"The search query using the Elasticsearch [Query String Query](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-query-string-query.html#query-string) syntax from the Query DSL extended by SailPoint to support Nested queries."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} deprecated={undefined} schemaDescription={"The nested type to use in the inner hits query.  The nested type [Nested Type](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) refers to a document \"nested\" within another document. For example, an identity can have nested documents for access, accounts, and apps."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"queryDsl"} required={false} deprecated={undefined} schemaDescription={"The search query using the Elasticsearch [Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/query-dsl.html) syntax."} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>typeAheadQuery</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Query parameters used to construct an Elasticsearch type ahead query object.  The typeAheadQuery performs a search for top values beginning with the typed values. For example, typing "Jo" results in top hits matching "Jo." Typing "Job" results in top hits matching "Job." 

</div><SchemaItem collapsible={false} name={"query"} required={true} deprecated={undefined} schemaDescription={"The type ahead query string used to construct a phrase prefix match query."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field on which to perform the type ahead search."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"nestedType"} required={false} deprecated={undefined} schemaDescription={"The nested type."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"maxExpansions"} required={false} deprecated={undefined} schemaDescription={"The number of suffixes the last term will be expanded into.\nInfluences the performance of the query and the number results returned.\nValid values: 1 to 1000."} schemaName={"int32"} qualifierMessage={"**Possible values:** `>= 1` and `<= 1000`"} defaultValue={10}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"includeNested"} required={false} deprecated={undefined} schemaDescription={"Indicates whether nested objects from returned search results should be included."} schemaName={"boolean"} qualifierMessage={undefined} defaultValue={true}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>queryResultFilter</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Allows the query results to be filtered by specifying a list of fields to include and/or exclude from the result documents.

</div><SchemaItem collapsible={false} name={"includes"} required={false} deprecated={undefined} schemaDescription={"The list of field names to include in the result documents."} schemaName={"string[]"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"excludes"} required={false} deprecated={undefined} schemaDescription={"The list of field names to exclude from the result documents."} schemaName={"string[]"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"aggregationType"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently available query languages for aggregations, which are used to perform calculations or groupings on search results.\n\nAdditional values may be added in the future without notice.\n"} schemaName={"string"} qualifierMessage={"**Possible values:** [`DSL`, `SAILPOINT`]"} defaultValue={"DSL"}></SchemaItem><SchemaItem collapsible={false} name={"aggregationsVersion"} required={false} deprecated={undefined} schemaDescription={"The current Elasticserver version."} schemaName={"object"} qualifierMessage={undefined} defaultValue={"5.2"}></SchemaItem><SchemaItem collapsible={false} name={"aggregationsDsl"} required={false} deprecated={undefined} schemaDescription={"The aggregation search query using Elasticsearch [Aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations.html) syntax."} schemaName={"object"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>aggregations</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>nested</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The nested aggregation object.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the nested aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} deprecated={undefined} schemaDescription={"The type of the nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>metric</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The calculation done on the results of the query

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`COUNT`, `UNIQUE_COUNT`, `AVG`, `SUM`, `MEDIAN`, `MIN`, `MAX`]"} defaultValue={"UNIQUE_COUNT"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>filter</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

An additional filter to constrain the results of the search query.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the filter aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERM`]"} defaultValue={"TERM"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"value"} required={true} deprecated={undefined} schemaDescription={"The value to filter on."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>bucket</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The bucket to group the results of the aggregation query by.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the bucket aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERMS`]"} defaultValue={"TERMS"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field to bucket on.\nPrefix the field name with '@' to reference a nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"size"} required={false} deprecated={undefined} schemaDescription={"Maximum number of buckets to include."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"minDocCount"} required={false} deprecated={undefined} schemaDescription={"Minimum number of documents a bucket should have."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>subAggregation</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Aggregation to be performed on the result of the parent bucket aggregation.

</div><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>nested</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The nested aggregation object.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the nested aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} deprecated={undefined} schemaDescription={"The type of the nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>metric</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The calculation done on the results of the query

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`COUNT`, `UNIQUE_COUNT`, `AVG`, `SUM`, `MEDIAN`, `MIN`, `MAX`]"} defaultValue={"UNIQUE_COUNT"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>filter</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

An additional filter to constrain the results of the search query.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the filter aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERM`]"} defaultValue={"TERM"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"value"} required={true} deprecated={undefined} schemaDescription={"The value to filter on."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>bucket</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The bucket to group the results of the aggregation query by.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the bucket aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERMS`]"} defaultValue={"TERMS"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field to bucket on.\nPrefix the field name with '@' to reference a nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"size"} required={false} deprecated={undefined} schemaDescription={"Maximum number of buckets to include."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"minDocCount"} required={false} deprecated={undefined} schemaDescription={"Minimum number of documents a bucket should have."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>subAggregation</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Aggregation to be performed on the result of the parent bucket aggregation.

</div><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>nested</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The nested aggregation object.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the nested aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} deprecated={undefined} schemaDescription={"The type of the nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>metric</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The calculation done on the results of the query

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the metric aggregate to be included in the result.\nIf the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported metric aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`COUNT`, `UNIQUE_COUNT`, `AVG`, `SUM`, `MEDIAN`, `MIN`, `MAX`]"} defaultValue={"UNIQUE_COUNT"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field the calculation is performed on.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>filter</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

An additional filter to constrain the results of the search query.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the filter aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported filter aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERM`]"} defaultValue={"TERM"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The search field to apply the filter to.\n\nPrefix the field name with '@' to reference a nested object.\n"} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"value"} required={true} deprecated={undefined} schemaDescription={"The value to filter on."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>bucket</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The bucket to group the results of the aggregation query by.

</div><SchemaItem collapsible={false} name={"name"} required={true} deprecated={undefined} schemaDescription={"The name of the bucket aggregate to be included in the result."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={false} deprecated={undefined} schemaDescription={"Enum representing the currently supported bucket aggregation types.\nAdditional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`TERMS`]"} defaultValue={"TERMS"}></SchemaItem><SchemaItem collapsible={false} name={"field"} required={true} deprecated={undefined} schemaDescription={"The field to bucket on.\nPrefix the field name with '@' to reference a nested object."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"size"} required={false} deprecated={undefined} schemaDescription={"Maximum number of buckets to include."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"minDocCount"} required={false} deprecated={undefined} schemaDescription={"Minimum number of documents a bucket should have."} schemaName={"int32"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"sort"} required={false} deprecated={undefined} schemaDescription={"The fields to be used to sort the search results. Use + or - to specify the sort direction."} schemaName={"string[]"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"searchAfter"} required={false} deprecated={undefined} schemaDescription={"Used to begin the search window at the values specified.\nThis parameter consists of the last values of the sorted fields in the current record set.\nThis is used to expand the Elasticsearch limit of 10K records by shifting the 10K window to begin at this value.\nIt is recommended that you always include the ID of the object in addition to any other fields on this parameter in order to ensure you don't get duplicate results while paging.\nFor example, when searching for identities, if you are sorting by displayName you will also want to include ID, for example [\"displayName\", \"id\"]. \nIf the last identity ID in the search result is 2c91808375d8e80a0175e1f88a575221 and the last displayName is \"John Doe\", then using that displayName and ID will start a new search after this identity.\nThe searchAfter value will look like [\"John Doe\",\"2c91808375d8e80a0175e1f88a575221\"]"} schemaName={"string[]"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>filters</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

The filters to be applied for each filtered field name.

</div><li><div><code>property name*</code><span style={{"opacity":"0.6"}}> object</span></div></li></div></details></SchemaItem></ul></details></TabItem></MimeTabs><div><ApiTabs><TabItem label={"204"} value={"204"}><div>

No content - indicates the request was successful but there is no content to be returned in the response.

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}><li className={"schemaItem"}><summary style={{}}><strong>X-Total-Count</strong><span style={{"opacity":"0.6"}}> integer</span></summary><div><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>Example: 5

The total result count.

</div></div></li></ul></details><div></div></TabItem><TabItem label={"400"} value={"400"}><div>

Client Error - Returned if the request body is invalid.

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"detailCode"} required={false} deprecated={undefined} schemaDescription={"Fine-grained error code providing more detail of the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"trackingId"} required={false} deprecated={undefined} schemaDescription={"Unique tracking id for the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>messages</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Generic localized reason for error

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>causes</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Plain-text descriptive reasons to provide additional detail to the text provided in the messages field

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"detailCode\": \"400.1 Bad Request Content\",\n  \"trackingId\": \"e7eab60924f64aa284175b9fa3309599\",\n  \"messages\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ],\n  \"causes\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>

Unauthorized - Returned if there is no authorization header, or if the JWT token is expired.

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"error"} required={false} deprecated={undefined} schemaDescription={"A message describing the error"} schemaName={""} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"error\": \"JWT validation failed: JWT is expired\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"403"} value={"403"}><div>

Forbidden - Returned if the user you are running as, doesn't have access to this end-point.

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"detailCode"} required={false} deprecated={undefined} schemaDescription={"Fine-grained error code providing more detail of the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"trackingId"} required={false} deprecated={undefined} schemaDescription={"Unique tracking id for the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>messages</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Generic localized reason for error

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>causes</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Plain-text descriptive reasons to provide additional detail to the text provided in the messages field

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"detailCode\": \"400.1 Bad Request Content\",\n  \"trackingId\": \"e7eab60924f64aa284175b9fa3309599\",\n  \"messages\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ],\n  \"causes\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ]\n}"} language={"json"}></ResponseSamples></TabItem><TabItem label={"403"} value={"403"}><p> An example of a 403 response object</p><ResponseSamples responseExample={"{\n  \"detailCode\": \"403 Forbidden\",\n  \"trackingId\": \"b21b1f7ce4da4d639f2c62a57171b427\",\n  \"messages\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The server understood the request but refuses to authorize it.\"\n    }\n  ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"429"} value={"429"}><div>

Too Many Requests - Returned in response to too many requests in a given period of time - rate limited. The Retry-After header in the response includes how long to wait before trying again.

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"message"} required={false} deprecated={undefined} schemaDescription={"A message describing the error"} schemaName={""} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"message\": \" Rate Limit Exceeded \"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal Server Error - Returned if there is an unexpected error.

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"detailCode"} required={false} deprecated={undefined} schemaDescription={"Fine-grained error code providing more detail of the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"trackingId"} required={false} deprecated={undefined} schemaDescription={"Unique tracking id for the error."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>messages</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Generic localized reason for error

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>causes</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Plain-text descriptive reasons to provide additional detail to the text provided in the messages field

</div><SchemaItem collapsible={false} name={"locale"} required={false} deprecated={undefined} schemaDescription={"The locale for the message text, a BCP 47 language tag."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"localeOrigin"} required={false} deprecated={undefined} schemaDescription={"An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice."} schemaName={"string"} qualifierMessage={"**Possible values:** [`DEFAULT`, `REQUEST`]"} defaultValue={undefined}></SchemaItem><SchemaItem collapsible={false} name={"text"} required={false} deprecated={undefined} schemaDescription={"Actual text of the error message in the indicated locale."} schemaName={"string"} qualifierMessage={undefined} defaultValue={undefined}></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"detailCode\": \"400.1 Bad Request Content\",\n  \"trackingId\": \"e7eab60924f64aa284175b9fa3309599\",\n  \"messages\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ],\n  \"causes\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"The request was syntactically correct but its content is semantically invalid.\"\n    }\n  ]\n}"} language={"json"}></ResponseSamples></TabItem><TabItem label={"500"} value={"500"}><p> An example of a 500 response object</p><ResponseSamples responseExample={"{\n  \"detailCode\": \"500.0 Internal Fault\",\n  \"trackingId\": \"b21b1f7ce4da4d639f2c62a57171b427\",\n  \"messages\": [\n    {\n      \"locale\": \"en-US\",\n      \"localeOrigin\": \"DEFAULT\",\n      \"text\": \"An internal fault occurred.\"\n    }\n  ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div>