Skip to content
Primary navigation

Delete certificate

admin.organization.certificates.delete(strcertificate_id) -> CertificateDeleteResponse
DELETE/organization/certificates/{certificate_id}

Delete a certificate from the organization.

The certificate must be inactive for the organization and all projects.

ParametersExpand Collapse
certificate_id: str
ReturnsExpand Collapse
class CertificateDeleteResponse:
id: str

The ID of the certificate that was deleted.

object: Literal["certificate.deleted"]

The object type, must be certificate.deleted.

Delete certificate

import os
from openai import OpenAI

client = OpenAI(
    admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"),  # This is the default and can be omitted
)
certificate = client.admin.organization.certificates.delete(
    "certificate_id",
)
print(certificate.id)
{
  "object": "certificate.deleted",
  "id": "cert_abc"
}
Returns Examples
{
  "object": "certificate.deleted",
  "id": "cert_abc"
}