---
title: "Searches for certificates confirming given criteria and pagination."
method: POST
path: "/v2/certificate/search"
tags: ["v2/certificate"]
---

# Searches for certificates confirming given criteria and pagination.

`POST /v2/certificate/search`

Insert as many search criteria as needed. A reference about allowed values for criteria could be found below, under SearchCertificateCriteriaRestRequestV2 model. Use -1 for current_page to get total number of certificate for the request criteria.

## Request body

- SearchCertificatesRestRequestV2
  - `pagination` Pagination — Pagination.
    - `page_size` integer — Number of results per page
    - `current_page` integer — Current page number
  - `sort` SearchCertificateSortRestRequest — Use one of allowed values as property and operation. Available propertiesUSERNAME ISSUER_DN SUBJECT_DN EXTERNAL_ACCOUNT_BINDING_ID END_ENTITY_PROFILE CERTIFICATE_PROFILE STATUS TAG TYPE UPDATE_TIME ISSUED_DATE EXPIRE_DATE REVOCATION_DATE Available operationsASC DESC
    - `property` 'USERNAME' | 'ISSUER_DN' | 'SUBJECT_DN' | 'EXTERNAL_ACCOUNT_BINDING_ID' | 'END_ENTITY_PROFILE' | 'CERTIFICATE_PROFILE' | 'STATUS' | 'TAG' | 'TYPE' | 'UPDATE_TIME' | 'ISSUED_DATE' | 'EXPIRE_DATE' | 'REVOCATION_DATE' — Sorted by
    - `operation` 'ASC' | 'DESC' — Sort ascending or descending. 'ASC' for ascending, 'DESC' for descending.
  - `criteria` SearchCertificateCriteriaRestRequest[] — A List of search criteria.
    - `property` 'QUERY, SERIAL_NUMBER, USERNAME, SUBJECT_DN, SUBJECT_ALT_NAME, EXTERNAL_ACCOUNT_BINDING_ID, END_ENTITY_PROFILE, CERTIFICATE_PROFILE, EXTERNAL_ACCOUNT_BINDING_ID, CA, STATUS, ISSUED_DATE, EXPIRE_DATE, REVOCATION_DATE' — A search property
    - `value` string — A search value. This could be sting value, ISO 8601 Date string, an appropriate string name of End Entity Profile or Certificate Profile or CA
    - `operation` 'EQUAL' | 'LIKE' | 'BEGINS_WITH' | 'BEFORE' | 'AFTER' — An operation for property on inserted value. 'EQUAL' for string, 'LIKE' for string value ('QUERY'), 'BEGINS_WITH' for string value (case sensitive trailing wildcard search.), 'BEFORE' or 'AFTER' for date values

## Response `200`

Successful operation

- SearchCertificatesRestResponseV2
  - `certificates` CertificateRestResponseV2[]
    - `fingerprint` string — Certificate fingerprint
    - `c_afingerprint` string — Certificate Authority fingerprint
    - `certificate_profile_id` integer — Certificate Profile Identifier
    - `end_entity_profile_id` integer — End Entity Profile Identifier
    - `expire_date` integer — Date after which certificate should be considered expired
    - `issuer_dn` string — Issuer Distinguished Name
    - `not_before` integer — Date at which certificate became valid
    - `revocation_date` integer — Revocation date
    - `revocation_reason` integer — Revocation reason
    - `serial_number` string — Hex Serial Number
    - `status` integer — Certificate status
    - `subject_alt_name` string — Subject Alternative Name (SAN)
    - `subject_dn` string — Subject Distinguished Name
    - `subject_key_id` string — Subject Key Identifier
    - `tag` string
    - `type` integer
    - `udpate_time` integer — Update time
    - `username` string — Username
    - `base64_cert` string, byte — Base64 encoded certificate
    - `certificate_request` string — Certificate request
    - `crl_partition_index` integer — CRL partition index
    - `invalidity_date` integer — Invalidity date
    - `certificate_profile` string — Certificate Profile Name
    - `end_entity_profile` string — End Entity Profile Name
  - `pagination_summary` PaginationSummary
    - `page_size` integer
    - `current_page` integer
    - `total_certs` integer

## Changes

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

- **2025-03-11** `4045b1bab09f` — 15 breaking, 1 warning, 35 info
  - removed the enum value `CA` of the request property `criteria/items/property`
  - removed the enum value `CERTIFICATE_PROFILE` of the request property `criteria/items/property`
  - removed the enum value `END_ENTITY_PROFILE` of the request property `criteria/items/property`
  - removed the enum value `EXPIRE_DATE` of the request property `criteria/items/property`
  - …47 more
- **2025-03-11** `37878df36b77` — 2 breaking, 11 warning, 38 info
  - removed the enum value `QUERY, SERIAL_NUMBER, USERNAME, SUBJECT_DN, SUBJECT_ALT_NAME, EXTERNAL_ACCOUNT_BINDING_ID, END_ENTITY_PROFILE, CERTIFICATE_PROFILE, EXTERNAL_ACCOUNT_BINDING_ID, CA, STATUS, ISSUED_DATE, EXPIRE_DATE, REVOCATION_DATE` of the request property `criteria/items/property`
  - the `certificates/items/base64_cert` response's property type/format changed from `string`/`byte` to `array`/`` for status `200`
  - added the new `-1.00` enum value to the `certificates/items/revocation_reason` response property for the response status `200`
  - added the new `0.00` enum value to the `certificates/items/revocation_reason` response property for the response status `200`
  - …47 more
- …earlier changes not shown

[Full history](https://skmtc.dev/keyfactor/apis/ejbca-rest-interface/changes/v2/certificate/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)
