Skip to content
Primary navigation

Deactivate certificates for organization

admin.organization.certificates.deactivate(**kwargs) -> Page<CertificateDeactivateResponse { id, active, certificate_details, 3 more } >
POST/organization/certificates/deactivate

Deactivate certificates at the organization level.

You can atomically and idempotently deactivate up to 10 certificates at a time.

ParametersExpand Collapse
certificate_ids: Array[String]
ReturnsExpand Collapse
class CertificateDeactivateResponse { id, active, certificate_details, 3 more }

Represents an individual certificate configured at the organization level.

id: String

The identifier, which can be referenced in API endpoints

active: bool

Whether the certificate is currently active at the organization level.

certificate_details: CertificateDetails{ expires_at, valid_at}
expires_at: Integer

The Unix timestamp (in seconds) of when the certificate expires.

formatunixtime
valid_at: Integer

The Unix timestamp (in seconds) of when the certificate becomes valid.

formatunixtime
created_at: Integer

The Unix timestamp (in seconds) of when the certificate was uploaded.

formatunixtime
name: String

The name of the certificate.

object: :"organization.certificate"

The object type, which is always organization.certificate.

Deactivate certificates for organization

require "openai"

openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

page = openai.admin.organization.certificates.deactivate(certificate_ids: ["cert_abc"])

puts(page)
{
  "object": "organization.certificate.deactivation",
  "data": [
    {
      "object": "organization.certificate",
      "id": "cert_abc",
      "name": "My Example Certificate",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
    {
      "object": "organization.certificate",
      "id": "cert_def",
      "name": "My Example Certificate 2",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
  ],
}
Returns Examples
{
  "object": "organization.certificate.deactivation",
  "data": [
    {
      "object": "organization.certificate",
      "id": "cert_abc",
      "name": "My Example Certificate",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
    {
      "object": "organization.certificate",
      "id": "cert_def",
      "name": "My Example Certificate 2",
      "active": false,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
  ],
}