Skip to content
Start here

Get SAML certificate set

client.zeroTrust.access.samlCertificates.get(stringsamlCERTSetId, SAMLCertificateGetParams { account_id } params, RequestOptionsoptions?): SAMLCertificateGetResponse { created_at, uid, updated_at, 2 more }
GET/accounts/{account_id}/access/saml_certificates/{saml_cert_set_id}

Retrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
samlCERTSetId: string

UUID.

maxLength36
params: SAMLCertificateGetParams { account_id }
account_id: string

Identifier.

maxLength32
ReturnsExpand Collapse
SAMLCertificateGetResponse { created_at, uid, updated_at, 2 more }
created_at: string

When the certificate set was created

formatdate-time
uid: string

Unique identifier for the certificate set

updated_at: string

When the certificate set was last updated

formatdate-time
current_certificate?: CurrentCertificate { is_current, not_after, public_certificate, uid }

The current active certificate

is_current: boolean

Indicates whether the certificate can be used for IdP configuration.

not_after: string

Certificate expiration date

formatdate-time
public_certificate: string

The public certificate in PEM format

uid: string

Unique identifier for the certificate

previous_certificate?: unknown

The previous certificate (maintained during rotation period). May be null when no rotation has occurred. Mirrors the structure of saml_certificate.

Get SAML certificate set

import Cloudflare from 'cloudflare';

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

const samlCertificate = await client.zeroTrust.access.samlCertificates.get(
  'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(samlCertificate.uid);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created_at": "2024-03-21T10:30:00Z",
    "uid": "a5bb4b3f-c2d1-4e6a-8f9b-1d3e4f5a6b7c",
    "updated_at": "2024-03-21T10:30:00Z",
    "current_certificate": {
      "is_current": true,
      "not_after": "2027-03-21T12:00:00Z",
      "public_certificate": "-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...\n...certificate content...\n-----END CERTIFICATE-----\n",
      "uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
    },
    "previous_certificate": {}
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created_at": "2024-03-21T10:30:00Z",
    "uid": "a5bb4b3f-c2d1-4e6a-8f9b-1d3e4f5a6b7c",
    "updated_at": "2024-03-21T10:30:00Z",
    "current_certificate": {
      "is_current": true,
      "not_after": "2027-03-21T12:00:00Z",
      "public_certificate": "-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...\n...certificate content...\n-----END CERTIFICATE-----\n",
      "uid": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
    },
    "previous_certificate": {}
  }
}