## Delete Hostname Client Certificate `client.OriginTLSClientAuth.HostnameCertificates.Delete(ctx, certificateID, body) (*HostnameCertificateDeleteResponse, error)` **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. ### Parameters - `certificateID string` Identifier. - `body HostnameCertificateDeleteParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type HostnameCertificateDeleteResponse struct{…}` - `ID string` Identifier. - `Certificate string` The hostname certificate. - `ExpiresOn Time` The date when the certificate expires. - `Issuer string` The certificate authority that issued the certificate. - `SerialNumber string` The serial number on the uploaded certificate. - `Signature string` The type of hash used for the certificate. - `Status HostnameCertificateDeleteResponseStatus` Status of the certificate or the association. - `const HostnameCertificateDeleteResponseStatusInitializing HostnameCertificateDeleteResponseStatus = "initializing"` - `const HostnameCertificateDeleteResponseStatusPendingDeployment HostnameCertificateDeleteResponseStatus = "pending_deployment"` - `const HostnameCertificateDeleteResponseStatusPendingDeletion HostnameCertificateDeleteResponseStatus = "pending_deletion"` - `const HostnameCertificateDeleteResponseStatusActive HostnameCertificateDeleteResponseStatus = "active"` - `const HostnameCertificateDeleteResponseStatusDeleted HostnameCertificateDeleteResponseStatus = "deleted"` - `const HostnameCertificateDeleteResponseStatusDeploymentTimedOut HostnameCertificateDeleteResponseStatus = "deployment_timed_out"` - `const HostnameCertificateDeleteResponseStatusDeletionTimedOut HostnameCertificateDeleteResponseStatus = "deletion_timed_out"` - `UploadedOn Time` The time when the certificate was uploaded. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/origin_tls_client_auth" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) hostnameCertificate, err := client.OriginTLSClientAuth.HostnameCertificates.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", origin_tls_client_auth.HostnameCertificateDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", hostnameCertificate.ID) } ``` #### Response ```json { "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-----\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" } } ```