This article explains how to update an existing custom domain certificate that is not managed by Okta using the Okta Application Programming Interface (API). This is applicable when a user needs to replace a certificate, private key, and certificate chain for a custom domain.
- Custom Domain
- Transport Layer Security (TLS) Certificate
- Okta Management API
- Okta Identity Engine (OIE)
- Okta Classic Engine
Optional: Integrate Postman with Okta to perform API actions by following the steps outlined in the How to Integrate Postman with Okta documentation.
To update a certificate for a non-Okta-managed custom domain, follow these steps:
- Prepare the new PEM-encoded public certificate, private key, and certificate chain.
- Ensure the RSA key size is 2048, 3072, or 4096 bits.
- Identify the
domainIdfor the custom domain by performing aGETrequest to the/api/v1/domainsendpoint. - Update the certificate by sending a
PUTrequest to the following endpoint:PUT /api/v1/domains/<domainId>/certificate. - Include the following parameters in the request body, ensuring the certificates and keys include the
-----BEGIN...-----and-----END...-----delimiters:
[code] { "certificate": "<PEM-encoded-certificate>", "privateKey": "<PEM-encoded-private-key>", "certificateChain": "<PEM-encoded-certificate-chain>" } [code].
- Verify the update by checking the
publicCertificateobject in the API response to confirm the new expiration date and fingerprint.
NOTE: If the certificateSourceType was previously OKTA_MANAGED, performing this operation changes the source type to MANUAL, and Okta no longer automatically renews the certificate.
