> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/networking/cdn/certificate/deletecertificate.md).

# DeleteCertificate

## 1. API Description

This API is used to delete a certificate.

{% hint style="info" %}
Note

* Deleting certificates that are currently in use is not allowed.
  {% endhint %}

## 2. Request Parameters

The following list includes the request parameters required by the API:

| Parameter Name | Required | Type   | Description    |
| -------------- | -------- | ------ | -------------- |
| certificateId  | Yes      | String | Certificate ID |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                              |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| requestId      | String | Unique request ID. Returned with every request. This request's requestId is needed when troubleshooting. |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Delete a certificate**

```json
POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-ZC-Action: DeleteCertificate
<Common Request Params>

Request:
{
   "certificateId": "f0864***66c6fa",
}

Response:
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
}
```

{% endtab %}
{% endtabs %}

## 5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                       | Description                                               |
| ---------------- | -------------------------------- | --------------------------------------------------------- |
| 400              | CERTIFICATE\_IS\_USING           | The certificate is currently in use and cannot be deleted |
| 404              | INVALID\_CERTIFICATE\_NOT\_FOUND | The specified certificate was not found                   |
