Count Documents Satisfying a Query​
Performs a search with a provided query and returns the count of results in the X-Total-Count header.
- application/json
Request Body required
- indices string[]
Possible values: [
accessprofiles
,accountactivities
,entitlements
,events
,identities
,roles
,*
]The names of the Elasticsearch indices in which to search. If none are provided, then all indices will be searched.
- queryType string
Possible values: [
DSL
,SAILPOINT
,TYPEAHEAD
]Default value:
SAILPOINT
The type of query to use. By default, the
SAILPOINT
query type is used, which requires thequery
object to be defined in the request body. To use thequeryDsl
ortypeAheadQuery
objects in the request, you must set the type toDSL
orTYPEAHEAD
accordingly. Additional values may be added in the future without notice. - queryVersion object
Default value:
5.2
The current Elasticserver version.
query object
Query parameters used to construct an Elasticsearch query object.
query stringThe query using the Elasticsearch Query String Query syntax from the Query DSL extended by SailPoint to support Nested queries.
fields string[]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.
timeZone stringThe time zone to be applied to any range query related to dates.
innerHit object
The innerHit query object returns a flattened list of results for the specified nested type.
query string requiredThe search query using the Elasticsearch Query String Query syntax from the Query DSL extended by SailPoint to support Nested queries.
type string requiredThe nested type to use in the inner hits query. The nested type Nested Type refers to a document "nested" within another document. For example, an identity can have nested documents for access, accounts, and apps.
- queryDsl object
The search query using the Elasticsearch Query DSL syntax.
typeAheadQuery object
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."
query string requiredThe type ahead query string used to construct a phrase prefix match query.
field string requiredThe field on which to perform the type ahead search.
nestedType stringThe nested type.
maxExpansions int32Possible values:
>= 1
and<= 1000
Default value:
10
The number of suffixes the last term will be expanded into. Influences the performance of the query and the number results returned. Valid values: 1 to 1000.
- includeNested boolean
Default value:
true
Indicates whether nested objects from returned search results should be included.
queryResultFilter object
Allows the query results to be filtered by specifying a list of fields to include and/or exclude from the result documents.
includes string[]The list of field names to include in the result documents.
excludes string[]The list of field names to exclude from the result documents.
- aggregationType string
Possible values: [
DSL
,SAILPOINT
]Default value:
DSL
Enum representing the currently available query languages for aggregations, which are used to perform calculations or groupings on search results.
Additional values may be added in the future without notice.
- aggregationsVersion object
Default value:
5.2
The current Elasticserver version.
- aggregationsDsl object
The aggregation search query using Elasticsearch Aggregations syntax.
aggregations object
nested object
The nested aggregation object.
name string requiredThe name of the nested aggregate to be included in the result.
type string requiredThe type of the nested object.
metric object
The calculation done on the results of the query
name string requiredThe name of the metric aggregate to be included in the result. If the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.
type stringPossible values: [
COUNT
,UNIQUE_COUNT
,AVG
,SUM
,MEDIAN
,MIN
,MAX
]Default value:
UNIQUE_COUNT
Enum representing the currently supported metric aggregation types. Additional values may be added in the future without notice.
field string requiredThe field the calculation is performed on.
Prefix the field name with '@' to reference a nested object.
filter object
An additional filter to constrain the results of the search query.
name string requiredThe name of the filter aggregate to be included in the result.
type stringPossible values: [
TERM
]Default value:
TERM
Enum representing the currently supported filter aggregation types. Additional values may be added in the future without notice.
field string requiredThe search field to apply the filter to.
Prefix the field name with '@' to reference a nested object.
value string requiredThe value to filter on.
bucket object
The bucket to group the results of the aggregation query by.
name string requiredThe name of the bucket aggregate to be included in the result.
type stringPossible values: [
TERMS
]Default value:
TERMS
Enum representing the currently supported bucket aggregation types. Additional values may be added in the future without notice.
field string requiredThe field to bucket on. Prefix the field name with '@' to reference a nested object.
size int32Maximum number of buckets to include.
minDocCount int32Minimum number of documents a bucket should have.
subAggregation object
Aggregation to be performed on the result of the parent bucket aggregation.
nested object
The nested aggregation object.
name string requiredThe name of the nested aggregate to be included in the result.
type string requiredThe type of the nested object.
metric object
The calculation done on the results of the query
name string requiredThe name of the metric aggregate to be included in the result. If the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.
type stringPossible values: [
COUNT
,UNIQUE_COUNT
,AVG
,SUM
,MEDIAN
,MIN
,MAX
]Default value:
UNIQUE_COUNT
Enum representing the currently supported metric aggregation types. Additional values may be added in the future without notice.
field string requiredThe field the calculation is performed on.
Prefix the field name with '@' to reference a nested object.
filter object
An additional filter to constrain the results of the search query.
name string requiredThe name of the filter aggregate to be included in the result.
type stringPossible values: [
TERM
]Default value:
TERM
Enum representing the currently supported filter aggregation types. Additional values may be added in the future without notice.
field string requiredThe search field to apply the filter to.
Prefix the field name with '@' to reference a nested object.
value string requiredThe value to filter on.
bucket object
The bucket to group the results of the aggregation query by.
name string requiredThe name of the bucket aggregate to be included in the result.
type stringPossible values: [
TERMS
]Default value:
TERMS
Enum representing the currently supported bucket aggregation types. Additional values may be added in the future without notice.
field string requiredThe field to bucket on. Prefix the field name with '@' to reference a nested object.
size int32Maximum number of buckets to include.
minDocCount int32Minimum number of documents a bucket should have.
subAggregation object
Aggregation to be performed on the result of the parent bucket aggregation.
nested object
The nested aggregation object.
name string requiredThe name of the nested aggregate to be included in the result.
type string requiredThe type of the nested object.
metric object
The calculation done on the results of the query
name string requiredThe name of the metric aggregate to be included in the result. If the metric aggregation is omitted, the resulting aggregation will be a count of the documents in the search results.
type stringPossible values: [
COUNT
,UNIQUE_COUNT
,AVG
,SUM
,MEDIAN
,MIN
,MAX
]Default value:
UNIQUE_COUNT
Enum representing the currently supported metric aggregation types. Additional values may be added in the future without notice.
field string requiredThe field the calculation is performed on.
Prefix the field name with '@' to reference a nested object.
filter object
An additional filter to constrain the results of the search query.
name string requiredThe name of the filter aggregate to be included in the result.
type stringPossible values: [
TERM
]Default value:
TERM
Enum representing the currently supported filter aggregation types. Additional values may be added in the future without notice.
field string requiredThe search field to apply the filter to.
Prefix the field name with '@' to reference a nested object.
value string requiredThe value to filter on.
bucket object
The bucket to group the results of the aggregation query by.
name string requiredThe name of the bucket aggregate to be included in the result.
type stringPossible values: [
TERMS
]Default value:
TERMS
Enum representing the currently supported bucket aggregation types. Additional values may be added in the future without notice.
field string requiredThe field to bucket on. Prefix the field name with '@' to reference a nested object.
size int32Maximum number of buckets to include.
minDocCount int32Minimum number of documents a bucket should have.
- sort string[]
The fields to be used to sort the search results. Use + or - to specify the sort direction.
- searchAfter string[]
Used to begin the search window at the values specified. This parameter consists of the last values of the sorted fields in the current record set. This is used to expand the Elasticsearch limit of 10K records by shifting the 10K window to begin at this value. It 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. For example, when searching for identities, if you are sorting by displayName you will also want to include ID, for example ["displayName", "id"]. If 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. The searchAfter value will look like ["John Doe","2c91808375d8e80a0175e1f88a575221"]
filters object
The filters to be applied for each filtered field name.
property name*
object
- 204
- 400
- 401
- 403
- 429
- 500
No content - indicates the request was successful but there is no content to be returned in the response.
Response Headers
X-Total-Count integer
Example: 5The total result count.
Client Error - Returned if the request body is invalid.
- application/json
- Schema
- Example (from schema)
Schema
- detailCode string
Fine-grained error code providing more detail of the error.
- trackingId string
Unique tracking id for the error.
messages object[]
Generic localized reason for error
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
causes object[]
Plain-text descriptive reasons to provide additional detail to the text provided in the messages field
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
{
"detailCode": "400.1 Bad Request Content",
"trackingId": "e7eab60924f64aa284175b9fa3309599",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
],
"causes": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
]
}
Unauthorized - Returned if there is no authorization header, or if the JWT token is expired.
- application/json
- Schema
- Example (from schema)
Schema
- error
A message describing the error
{
"error": "JWT validation failed: JWT is expired"
}
Forbidden - Returned if the user you are running as, doesn't have access to this end-point.
- application/json
- Schema
- Example (from schema)
- 403
Schema
- detailCode string
Fine-grained error code providing more detail of the error.
- trackingId string
Unique tracking id for the error.
messages object[]
Generic localized reason for error
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
causes object[]
Plain-text descriptive reasons to provide additional detail to the text provided in the messages field
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
{
"detailCode": "400.1 Bad Request Content",
"trackingId": "e7eab60924f64aa284175b9fa3309599",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
],
"causes": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
]
}
An example of a 403 response object
{
"detailCode": "403 Forbidden",
"trackingId": "b21b1f7ce4da4d639f2c62a57171b427",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The server understood the request but refuses to authorize it."
}
]
}
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.
- application/json
- Schema
- Example (from schema)
Schema
- message
A message describing the error
{
"message": " Rate Limit Exceeded "
}
Internal Server Error - Returned if there is an unexpected error.
- application/json
- Schema
- Example (from schema)
- 500
Schema
- detailCode string
Fine-grained error code providing more detail of the error.
- trackingId string
Unique tracking id for the error.
messages object[]
Generic localized reason for error
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
causes object[]
Plain-text descriptive reasons to provide additional detail to the text provided in the messages field
locale stringThe locale for the message text, a BCP 47 language tag.
localeOrigin stringPossible values: [
DEFAULT
,REQUEST
]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.
text stringActual text of the error message in the indicated locale.
{
"detailCode": "400.1 Bad Request Content",
"trackingId": "e7eab60924f64aa284175b9fa3309599",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
],
"causes": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "The request was syntactically correct but its content is semantically invalid."
}
]
}
An example of a 500 response object
{
"detailCode": "500.0 Internal Fault",
"trackingId": "b21b1f7ce4da4d639f2c62a57171b427",
"messages": [
{
"locale": "en-US",
"localeOrigin": "DEFAULT",
"text": "An internal fault occurred."
}
]
}