> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Certificate

> Deletes a certificate specified by name. The certificate is automatically undeployed from all environments after deletion.

## Endpoint

```
DELETE /apiops/projects/{projectName}/certificates/{certificateName}/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value            | Required |
| ------------- | ---------------- | -------- |
| Authorization | Bearer `{token}` | Yes      |

### Path Parameters

| Parameter       | Type   | Required | Description      |
| --------------- | ------ | -------- | ---------------- |
| projectName     | string | Yes      | Project name     |
| certificateName | string | Yes      | Certificate name |

### Query Parameters

| Parameter       | Type   | Required | Description                                                                                                                                  |
| --------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| jwkDeleteAction | string | No       | Action to take on referenced JWKs: `NULLIFY` (clear references) or `DELETE` (delete JWKs completely). Defaults to `NULLIFY` if not provided. |

### Request Body

None.

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "deploymentResult": {
    "success": true,
    "message": "Undeployment completed successfully",
    "environmentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Undeployed successfully"
      }
    ]
  }
}
```

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Certificate (name: my-certificate) is not found!"
}
```

## cURL Example

### Example 1: Delete Certificate (Default: Clear JWK References)

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Example 2: Delete Certificate and Clear JWK References

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/?jwkDeleteAction=NULLIFY" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Example 3: Delete Certificate and Delete Related JWKs

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/?jwkDeleteAction=DELETE" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Permissions

User must have **`SECRETS` + `MANAGE`** permission in the project. For undeployment operations (when undeploying certificates from environments), user must also have **`SECRETS` + `DEPLOY_UNDEPLOY`** permission.

## Notes and Warnings

* **Permanent Deletion**:
  * Certificate is permanently deleted
  * This action cannot be undone

* **Automatic Undeployment**:
  * Certificate is automatically undeployed from all environments
  * Undeployment results are returned in the response

* **Referenced JWKs**:
  * If `jwkDeleteAction=NULLIFY` or not provided (default), JWK references will be cleared
  * If `jwkDeleteAction=DELETE`, all JWKs created from this certificate will be permanently deleted
  * Default behavior (`NULLIFY`) preserves JWKs but removes their reference to the deleted certificate

## Related Documentation

* [List Certificates](/api-reference/keys-secrets/crud/list-certificates) - List all certificates
* [Create Certificate](/api-reference/keys-secrets/crud/create-certificate) - Create a new certificate
