Skip to content
Start here

List Client Certificates

GET/zones/{zone_id}/client_certificates

List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
SSL and Certificates WriteSSL and Certificates Read
Path ParametersExpand Collapse
zone_id: string

Identifier.

maxLength32
Query ParametersExpand Collapse
limit: optional number

Limit to the number of records returned.

offset: optional number

Offset the results

page: optional number

Page number of paginated results.

minimum1
per_page: optional number

Number of records per page.

maximum50
minimum5
status: optional "all" or "active" or "pending_reactivation" or 2 more

Client Certitifcate Status to filter results by.

One of the following:
"all"
"active"
"pending_reactivation"
"pending_revocation"
"revoked"
ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

result: optional array of ClientCertificate { id, certificate, certificate_authority, 15 more }
id: optional string

Identifier.

maxLength32
certificate: optional string

The Client Certificate PEM

certificate_authority: optional object { id, name }

Certificate Authority used to issue the Client Certificate

id: optional string
name: optional string
common_name: optional string

Common Name of the Client Certificate

country: optional string

Country, provided by the CSR

csr: optional string

The Certificate Signing Request (CSR). Must be newline-encoded.

expires_on: optional string

Date that the Client Certificate expires

fingerprint_sha256: optional string

Unique identifier of the Client Certificate

issued_on: optional string

Date that the Client Certificate was issued by the Certificate Authority

location: optional string

Location, provided by the CSR

organization: optional string

Organization, provided by the CSR

organizational_unit: optional string

Organizational Unit, provided by the CSR

serial_number: optional string

The serial number on the created Client Certificate.

signature: optional string

The type of hash used for the Client Certificate..

ski: optional string

Subject Key Identifier

state: optional string

State, provided by the CSR

status: optional Status

Client Certificates may be active or revoked, and the pending_reactivation or pending_revocation represent in-progress asynchronous transitions

One of the following:
"active"
"pending_reactivation"
"pending_revocation"
"revoked"
validity_days: optional number

The number of days the Client Certificate will be valid after the issued_on date

result_info: optional object { count, page, per_page, 2 more }
count: optional number

Total number of results for the requested service.

page: optional number

Current page within paginated list of results.

per_page: optional number

Number of results per page of results.

total_count: optional number

Total results available without any search parameters.

total_pages: optional number

The number of total pages in the entire result set.

List Client Certificates

curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/client_certificates \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "certificate": "-----BEGIN CERTIFICATE-----\nMIIDmDCCAoC...dhDDE\n-----END CERTIFICATE-----",
      "certificate_authority": {
        "id": "568b6b74-7b0c-4755-8840-4e3b8c24adeb",
        "name": "Cloudflare Managed CA for account"
      },
      "common_name": "Cloudflare",
      "country": "US",
      "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----",
      "expires_on": "2033-02-20T23:18:00Z",
      "fingerprint_sha256": "256c24690243359fb8cf139a125bd05ebf1d968b71e4caf330718e9f5c8a89ea",
      "issued_on": "2023-02-23T23:18:00Z",
      "location": "Somewhere",
      "organization": "Organization",
      "organizational_unit": "Organizational Unit",
      "serial_number": "3bb94ff144ac567b9f75ad664b6c55f8d5e48182",
      "signature": "SHA256WithRSA",
      "ski": "8e375af1389a069a0f921f8cc8e1eb12d784b949",
      "state": "CA",
      "status": "active",
      "validity_days": 3650
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "certificate": "-----BEGIN CERTIFICATE-----\nMIIDmDCCAoC...dhDDE\n-----END CERTIFICATE-----",
      "certificate_authority": {
        "id": "568b6b74-7b0c-4755-8840-4e3b8c24adeb",
        "name": "Cloudflare Managed CA for account"
      },
      "common_name": "Cloudflare",
      "country": "US",
      "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----",
      "expires_on": "2033-02-20T23:18:00Z",
      "fingerprint_sha256": "256c24690243359fb8cf139a125bd05ebf1d968b71e4caf330718e9f5c8a89ea",
      "issued_on": "2023-02-23T23:18:00Z",
      "location": "Somewhere",
      "organization": "Organization",
      "organizational_unit": "Organizational Unit",
      "serial_number": "3bb94ff144ac567b9f75ad664b6c55f8d5e48182",
      "signature": "SHA256WithRSA",
      "ski": "8e375af1389a069a0f921f8cc8e1eb12d784b949",
      "state": "CA",
      "status": "active",
      "validity_days": 3650
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}