---
title: "Searches and sorts for end entity conforming given criteria."
method: POST
path: "/v2/endentity/search"
tags: ["v2/endentity"]
---

# Searches and sorts for end entity conforming given criteria.

`POST /v2/endentity/search`

Insert as many search criteria as needed and optionally a sorting criteria. A reference about allowed values for criteria could be found below, under SearchEndEntityCriteriaRestRequestV2 model.

## Request body

- SearchEndEntitiesRestRequestV2
  - `max_number_of_results` integer — Maximum number of results
  - `current_page` integer — Current page number
  - `criteria` SearchEndEntityCriteriaRestRequest[] — A List of search criteria.
    - `property` 'QUERY' | 'END_ENTITY_PROFILE' | 'CERTIFICATE_PROFILE' | 'CA' | 'STATUS' | 'MODIFIED_BEFORE' | 'MODIFIED_AFTER' — A search property
    - `value` string — A search value. This could be string value, an appropriate string name of End Entity Profile or Certificate Profile or CA
    - `operation` 'EQUAL' | 'LIKE' — An operation for property on inserted value. 'EQUALS' for string, 'LIKE' for string value ('QUERY')
  - `sort_operation` SearchEndEntitiesSortRestRequest — Use one of allowed values as property and operation. Available propertiesUSERNAME SUBJECT_DN SUBJECT_ALT_NAME END_ENTITY_PROFILE(by databse identifier, not user-given name) CERTIFICATE_PROFILE(by identifier) CA(by identifier) STATUS UPDATE_TIME CREATED_DATE Available operationsASC DESC
    - `property` 'USERNAME' | 'SUBJECT_DN' | 'SUBJECT_ALT_NAME' | 'END_ENTITY_PROFILE' | 'CERTIFICATE_PROFILE' | 'STATUS' | 'UPDATE_TIME' | 'CREATED_TIME' — Sorted by
    - `operation` 'ASC' | 'DESC' — Sort ascending or descending. 'ASC' for ascending, 'DESC' for descending.

## Response `200`

Successful operation

- SearchEndEntitiesRestResponse
  - `end_entities` EndEntityRestResponse[]
    - `username` string — Username
    - `dn` string — Subject Distinguished Name
    - `subject_alt_name` string — Subject Alternative Name (SAN)
    - `email` string — Email
    - `status` 'NEW, FAILED, INITIALIZED, INPROCESS, GENERATED, REVOKED, HISTORICAL, KEYRECOVERY, WAITINGFORADDAPPROVAL' — End Entity status
    - `token` 'USERGENERATED, P12, BCFKS, JKS, PEM' — Token type
    - `extension_data` ExtendedInformationRestResponseComponent[] — Extended Information
      - `name` string — Extended Information property name
      - `value` string — Property value
  - `more_results` boolean

## Changes

> 8 revisions in range; 1 could not be searched.

- **2025-03-11** `4045b1bab09f` — 2 warning, 14 info
  - added the new `NEW, FAILED, INITIALIZED, INPROCESS, GENERATED, REVOKED, HISTORICAL, KEYRECOVERY, WAITINGFORADDAPPROVAL` enum value to the `end_entities/items/status` response property for the response status `200`
  - added the new `USERGENERATED, P12, BCFKS, JKS, PEM` enum value to the `end_entities/items/token` response property for the response status `200`
  - removed the `BCFKS` enum value from the `end_entities/items/token` response property for the response status `200`
  - removed the `FAILED` enum value from the `end_entities/items/status` response property for the response status `200`
  - …12 more
- **2025-03-11** `37878df36b77` — 14 warning, 2 info
  - added the new `BCFKS` enum value to the `end_entities/items/token` response property for the response status `200`
  - added the new `FAILED` enum value to the `end_entities/items/status` response property for the response status `200`
  - added the new `GENERATED` enum value to the `end_entities/items/status` response property for the response status `200`
  - added the new `HISTORICAL` enum value to the `end_entities/items/status` response property for the response status `200`
  - …12 more
- …earlier changes not shown

[Full history](https://skmtc.dev/keyfactor/apis/ejbca-rest-interface/changes/v2/endentity/search/post.md)

---

[API](https://skmtc.dev/keyfactor/apis/ejbca-rest-interface.md) · [All operations](https://skmtc.dev/keyfactor/apis/ejbca-rest-interface/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keyfactor/ejbca-rest-interface/revisions/44f8798658e2/schema)
