# Retrieve entities using a search query

Lists all entities that match the criteria. This endpoint supports sorted pagination using the `search-after` property.  For additional information, see the [SearchAfter API (V3) developer documentation](https://doc.sitecore.com/ch/en/developers/cloud-dev/searchafter-api--v3-.html), including information about [supported query operators](https://doc.sitecore.com/ch/en/developers/cloud-dev/supported-searchafter-query-operators.html), [filters and supported operators](https://doc.sitecore.com/ch/en/developers/cloud-dev/searchafter-api--v3-.html#filters), as well as [SearchAfter examples](https://doc.sitecore.com/ch/en/developers/cloud-dev/searchafter-api--v3--examples.html).

Endpoint: POST /api/entities/searchAfter
Version: v3.0
Security: OAuth2.0

## Security:

  - `OAuth2.0` (unknown)
    oauth2

## Header parameters:

  - `X-ApiVersion` (integer, required)

## Request body:

  - `application/json` (unknown)
    Request for executing queries with pagination.

## Request fields (application/json):

  - `filter` (any, required)

  - `filter.type` (string, required)
    Specifies the type of filter to be applied in a query node.
    Enum: "Negating", "Logical", "DefinitionId", "DefinitionName", "RootTaxonomyItem", "PathRoot", "Locked", "LockedBy", "CreatedBy", "ModifiedBy", "FullText", "Identifier", "IdIn", "Selection", "IntProperty", "LongProperty", "DecimalProperty", "BoolProperty", "DateTimeProperty", "DateTimeOffsetProperty", "StringProperty", "Relation", "RelationExists", "Ancestor"

  - `filter.relation` (string, required)
    Gets or sets ancestor relation name.

  - `filter.id` (integer, required)
    Gets or sets ancestor ID.

  - `filter.user_id` (integer, required)
    Gets or sets the user id.

  - `filter.id` (integer, required)
    Gets or sets the definition id.

  - `filter.name` (string, required)
    gets or sets the definition name.

  - `filter.value` (string, required)
    Gets or sets the text value.

  - `filter.identifier` (string, required)
    gets or sets the identifier.

  - `filter.ids` (array, required)
    gets or sets the ids.

  - `filter.user_id` (integer, required)
    gets or sets the user id.

  - `filter.left` (any, required)
    Gets or sets the left operant.

  - `filter.right` (any, required)
    Gets or sets the right operant.

  - `filter.operator` (string, required)
    Enum: "And", "Or"

  - `sorting` (array, required)

  - `sorting.field_type` (string)
    Enum: "Property", "System"

  - `sorting.field` (string, required)

  - `sorting.culture` (string)

  - `sorting.order` (string, required)
    Enum: "Desc", "Asc"

  - `search_after` (array)

  - `take` (integer)

  - `load_configuration` (object)
    Represents the configuration for loading an entity.

  - `load_configuration.culture_option` (object)
    Represents options for loading cultures.

  - `load_configuration.culture_option.load_option` (string)
    An enum of possible load options.
    Enum: "None", "Default", "Custom", "All"

  - `load_configuration.culture_option.cultures` (array)
    Gets or sets a list of culture names that need to be loaded. This is only useful when `Stylelabs.M.Base.Entities.Loading.CultureLoadOption.LoadOption` is `Stylelabs.M.Base.Entities.Loading.LoadOption.Custom`.

  - `load_configuration.property_option` (object)
    Represents options for loading properties.

  - `load_configuration.property_option.properties` (array)
    Gets or sets a list of property names (case insensitive) that need to be loaded.
This is only useful when `Stylelabs.M.Base.Entities.Loading.PropertyLoadOption.LoadOption` is `Stylelabs.M.Base.Entities.Loading.LoadOption.Custom`.

  - `load_configuration.relation_option` (object)
    Represents options for loading relations.

  - `load_configuration.relation_option.relations` (array)
    Gets or sets a list of relations that need to be loaded.
This is only useful when `Stylelabs.M.Base.Entities.Loading.RelationLoadOption.LoadOption` is `Stylelabs.M.Base.Entities.Loading.LoadOption.Custom`.

  - `load_configuration.relation_option.relations.name` (string)
    Name of the relation (case insensitive).

  - `load_configuration.relation_option.relations.role` (string)
    Enum: "Parent", "Child"

  - `load_configuration.relation_option.max_related_items` (integer)
    Gets or sets the maximum number of related items for each relation.

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

  - `last_hit_data` (array)
    The last returned hits, which are used to fetch the next page of results.

  - `items` (array)
    Gets or sets the list of items.

  - `items.id` (integer)
    The ID for the entity, for example, `39752`.

  - `items.identifier` (string)
    The identifier for the entity.

  - `items.cultures` (array)
    The cultures associated with the entity, for example, `en-US`.

  - `items.properties` (object)
    The properties of the entity.

  - `items.relations` (object)
    The relations of the entity.

  - `items.created_by` (object)
    Represents a link to a resource.

  - `items.created_by.href` (string)
    Gets or sets the URI that points to the resource this link refers to.

  - `items.created_by.filename_properties` (array)
    Gets or sets the URI that points to the resource this link refers to.

  - `items.created_by.title` (string)
    Gets or sets the title that describes this link.

  - `items.created_by.templated` (boolean)
    Gets or sets a value indicating whether the contained URI is a template.

  - `items.created_on` (string)
    The date and time when the entity was created.

  - `items.modified_on` (string)
    The date and time when the entity was last modified.

  - `items.locked_on` (string)
    The date and time when the entity was locked.

  - `items.requested_permissions` (object)
    The requested permissions with identification if a certain user has the permissions.

  - `items.is_root_taxonomy_item` (boolean)
    Gets or sets a value indicating whether the entity is a root taxonomy item.

  - `items.is_path_root` (boolean)
    Gets or sets a value indicating whether the entity is a path root.

  - `items.inherits_security` (boolean)
    Gets or sets a value indicating whether the entity inherits security.

  - `items.is_system_owned` (boolean)
    Gets or sets a value indicating whether the entity is system owned.

  - `items.version` (integer)
    The version of the entity.

  - `items.modules` (array)
    The modules associated with the entity.

  - `total_items` (integer)
    Gets or sets the total number of items.

  - `returned_items` (integer)
    Gets or sets the number of returned items.

  - `offset` (integer)
    Gets or sets the offset of the items.

  - `identifier` (string)
    Gets or sets the identifier of the resource.

## Response 400:

  - `400` (unknown)
    Request not valid

## Response 401:

  - `401` (unknown)
    Unauthorized request or invalid access token

