Skip to content
Start here

List SAML certificate sets

client.ZeroTrust.Access.SAMLCertificates.List(ctx, params) (*V4PagePaginationArray[AccessSAMLCertificateListResponse], error)
GET/accounts/{account_id}/access/saml_certificates

Returns a paginated list of the organization’s SAML encryption certificate sets. Each certificate set includes the current and (if present) previous certificates.

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
params AccessSAMLCertificateListParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
ID param.Field[string]Optional

Query param: Filter by SAML certificate set UID. Accepts a comma-separated list of UIDs.

Page param.Field[int64]Optional

Query param: Page number of paginated results.

minimum1
PerPage param.Field[int64]Optional

Query param: Maximum number of results per page.

maximum100
minimum1
ReturnsExpand Collapse
type AccessSAMLCertificateListResponse struct{…}
CreatedAt Time

When the certificate set was created

formatdate-time
UID string

Unique identifier for the certificate set

UpdatedAt Time

When the certificate set was last updated

formatdate-time
CurrentCertificate AccessSAMLCertificateListResponseCurrentCertificateOptional

The current active certificate

IsCurrent bool

Indicates whether the certificate can be used for IdP configuration.

NotAfter Time

Certificate expiration date

formatdate-time
PublicCertificate string

The public certificate in PEM format

UID string

Unique identifier for the certificate

PreviousCertificate unknownOptional

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

List SAML certificate sets

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.ZeroTrust.Access.SAMLCertificates.List(context.TODO(), zero_trust.AccessSAMLCertificateListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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": {}
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
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": {}
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}