Rotate SAML certificate
Rotates the SAML encryption certificates within the specified certificate set. This generates a new certificate and moves the current certificate to the previous slot. If a previous certificate exists, it will be deactivated and removed.
This endpoint ensures zero-downtime rotation by maintaining both current and previous certificates during the transition period, allowing IdPs time to update their configurations. Automated rotation happens 30 days before a current certificate’s expiration.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Rotate SAML certificate
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/saml_certificates/$SAML_CERT_SET_ID/rotate \
-X POST \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{
"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": {}
}
}