---
title: Revoke Client Certificate
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Client Certificates](https://developers.cloudflare.com/api/go/resources/client_certificates)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Revoke Client Certificate

client.ClientCertificates.Delete(ctx, clientCertificateID, body) (\*[ClientCertificate](<https://developers.cloudflare.com/api/go/resources/client_certificates#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)>), error)

DELETE/zones/{zone\_id}/client\_certificates/{client\_certificate\_id}

Set a API Shield mTLS Client Certificate to pending\_revocation status for processing to revoked status.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`SSL and Certificates Write`

##### ParametersExpand Collapse

clientCertificateID string

Client Certificate Tag

maxLength36

minLength36

[Link to this property](<#(resource)%20client_certificates%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20client_certificate_id%20%3E%20(schema)>)

<details>

<summary>

body ClientCertificateDeleteParams

</summary>

ZoneID param.Field\[string]

Identifier.

maxLength32

<a href="#(resource)%20client_certificates%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20client_certificates%20%3E%20(method)%20delete%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type ClientCertificate struct{…}

</summary>

ID stringOptional

Client Certificate Tag

maxLength36

minLength36

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Certificate stringOptional

The Client Certificate PEM.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20certificate">Link to this property</a>

<details>

<summary>

CertificateAuthority ClientCertificateCertificateAuthorityOptional

Certificate Authority used to issue the Client Certificate.

</summary>

ID stringOptional

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20certificate_authority%20%3E%20(property)%20id">Link to this property</a>

Name stringOptional

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20certificate_authority%20%3E%20(property)%20name">Link to this property</a>

</details>

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20certificate_authority">Link to this property</a>

CommonName stringOptional

Common Name of the Client Certificate.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20common_name">Link to this property</a>

Country stringOptional

Country, provided by the CSR.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20country">Link to this property</a>

Csr stringOptional

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

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20csr">Link to this property</a>

ExpiresOn stringOptional

Date that the Client Certificate expires.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20expires_on">Link to this property</a>

FingerprintSha256 stringOptional

Unique identifier of the Client Certificate.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20fingerprint_sha256">Link to this property</a>

IssuedOn stringOptional

Date that the Client Certificate was issued by the Certificate Authority.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20issued_on">Link to this property</a>

Location stringOptional

Location, provided by the CSR.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20location">Link to this property</a>

Organization stringOptional

Organization, provided by the CSR.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20organization">Link to this property</a>

OrganizationalUnit stringOptional

Organizational Unit, provided by the CSR.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20organizational_unit">Link to this property</a>

SerialNumber stringOptional

The serial number on the created Client Certificate.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20serial_number">Link to this property</a>

Signature stringOptional

The type of hash used for the Client Certificate..

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20signature">Link to this property</a>

Ski stringOptional

Subject Key Identifier.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20ski">Link to this property</a>

State stringOptional

State, provided by the CSR.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20state">Link to this property</a>

<details>

<summary>

Status ClientCertificateStatusOptional

Client Certificates may be active or revoked, and the pending\_reactivation or pending\_revocation represent in-progress asynchronous transitions.

</summary>

One of the following:

const ClientCertificateStatusActive ClientCertificateStatus = "active"

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const ClientCertificateStatusPendingReactivation ClientCertificateStatus = "pending\_reactivation"

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const ClientCertificateStatusPendingRevocation ClientCertificateStatus = "pending\_revocation"

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

const ClientCertificateStatusRevoked ClientCertificateStatus = "revoked"

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

ValidityDays int64Optional

The number of days the Client Certificate will be valid after the issued\_on date.

<a href="#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)%20%3E%20(property)%20validity_days">Link to this property</a>

</details>

[Link to this property](<#(resource)%20client_certificates%20%3E%20(model)%20client_certificate%20%3E%20(schema)>)

### Revoke Client Certificate

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/client_certificates"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  clientCertificate, err := client.ClientCertificates.Delete(
    context.TODO(),
    "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
    client_certificates.ClientCertificateDeleteParams{
      ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", clientCertificate.ID)
}
```

200 example

```
{
  "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": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
    "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
  }
}
```

##### Returns Examples

200 example

```
{
  "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": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
    "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
  }
}
```