Skip to content
Primary navigation

List organization certificates

client.admin.organization.certificates.list(CertificateListParams { after, limit, order } query?, RequestOptionsoptions?): ConversationCursorPage<CertificateListResponse { id, active, certificate_details, 3 more } >
GET/organization/certificates

List uploaded certificates for this organization.

ParametersExpand Collapse
query: CertificateListParams { after, limit, order }
after?: string

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limit?: number

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

order?: "asc" | "desc"

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

One of the following:
"asc"
"desc"
ReturnsExpand Collapse
CertificateListResponse { 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: boolean

Whether the certificate is currently active at the organization level.

certificate_details: CertificateDetails { expires_at, valid_at }
expires_at?: number

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

formatunixtime
valid_at?: number

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

formatunixtime
created_at: number

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

formatunixtime
name: string | null

The name of the certificate.

object: "organization.certificate"

The object type, which is always organization.certificate.

List organization certificates

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const certificateListResponse of client.admin.organization.certificates.list()) {
  console.log(certificateListResponse.id);
}
{
  "object": "list",
  "data": [
    {
      "object": "organization.certificate",
      "id": "cert_abc",
      "name": "My Example Certificate",
      "active": true,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
  ],
  "first_id": "cert_abc",
  "last_id": "cert_abc",
  "has_more": false
}
Returns Examples
{
  "object": "list",
  "data": [
    {
      "object": "organization.certificate",
      "id": "cert_abc",
      "name": "My Example Certificate",
      "active": true,
      "created_at": 1234567,
      "certificate_details": {
        "valid_at": 12345667,
        "expires_at": 12345678
      }
    },
  ],
  "first_id": "cert_abc",
  "last_id": "cert_abc",
  "has_more": false
}