---
title: Delete Hostname Client Certificate
---

[Skip to content](#_top)

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

[Origin TLS Client Auth](https://developers.cloudflare.com/api/python/resources/origin_tls_client_auth)

[Hostname Certificates](https://developers.cloudflare.com/api/python/resources/origin_tls_client_auth/subresources/hostname_certificates)

Copy Markdown

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

---

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

# Delete Hostname Client Certificate

origin\_tls\_client\_auth.hostname\_certificates.delete(strcertificate\_id, HostnameCertificateDeleteParams\*\*kwargs) -> [HostnameCertificateDeleteResponse](<https://developers.cloudflare.com/api/python/resources/origin_tls_client_auth#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)>)

DELETE/zones/{zone\_id}/origin\_tls\_client\_auth/hostnames/certificates/{certificate\_id}

Removes a client certificate used for authenticated origin pulls on a specific hostname. Note: Before deleting the certificate, you must first invalidate the hostname for client authentication by sending a PUT request with `enabled` set to null. After invalidating the association, the certificate can be safely deleted.

##### 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

zone\_id: str

Identifier.

maxLength32

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20zone_id%20%3E%20(schema)>)

certificate\_id: str

Certificate identifier tag.

maxLength36

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20certificate_id%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class HostnameCertificateDeleteResponse: …

</summary>

id: Optional\[str]

Certificate identifier tag.

maxLength36

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

certificate: Optional\[str]

The hostname certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20certificate">Link to this property</a>

expires\_on: Optional\[datetime]

The date when the certificate expires.

formatdate-time

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20expires_on">Link to this property</a>

issuer: Optional\[str]

The certificate authority that issued the certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20issuer">Link to this property</a>

serial\_number: Optional\[str]

The serial number on the uploaded certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20serial_number">Link to this property</a>

signature: Optional\[str]

The type of hash used for the certificate.

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20signature">Link to this property</a>

<details>

<summary>

status: Optional\[Literal\["initializing", "pending\_deployment", "pending\_deletion", 4 more]]

Status of the certificate or the association.

</summary>

One of the following:

"initializing"

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

"pending\_deployment"

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

"pending\_deletion"

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

"active"

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

"deleted"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%204">Link to this property</a>

"deployment\_timed\_out"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%205">Link to this property</a>

"deletion\_timed\_out"

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%206">Link to this property</a>

</details>

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

uploaded\_on: Optional\[datetime]

The time when the certificate was uploaded.

formatdate-time

<a href="#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)%20%3E%20(property)%20uploaded_on">Link to this property</a>

</details>

[Link to this property](<#(resource)%20origin_tls_client_auth.hostname_certificates%20%3E%20(model)%20hostname_certificate_delete_response%20%3E%20(schema)>)

### Delete Hostname Client Certificate

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
hostname_certificate = client.origin_tls_client_auth.hostname_certificates.delete(
    certificate_id="2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(hostname_certificate.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": "2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n",
    "expires_on": "2100-01-01T05:20:00Z",
    "issuer": "GlobalSign",
    "serial_number": "6743787633689793699141714808227354901",
    "signature": "SHA256WithRSA",
    "status": "active",
    "uploaded_on": "2019-10-28T18:11:23.37411Z"
  }
}
```

##### 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": "2458ce5a-0c35-4c7f-82c7-8e9487d3ff60",
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA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oRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n",
    "expires_on": "2100-01-01T05:20:00Z",
    "issuer": "GlobalSign",
    "serial_number": "6743787633689793699141714808227354901",
    "signature": "SHA256WithRSA",
    "status": "active",
    "uploaded_on": "2019-10-28T18:11:23.37411Z"
  }
}
```