All Products
Search
Document Center

Edge Security Acceleration:SetCertificate

Last Updated:Nov 07, 2025

Configures whether to enable certificates and update certificate information for a website.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
esa:SetCertificatenone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SiteIdlongYes

The website ID, which can be obtained by calling the ListSites operation.

1234567890123
NamestringNo

The certificate name.

yourCertName
CasIdlongNo

The certificate ID on Certificate Management Service.

30000478
TypestringYes

The certificate type. Valid values:

  • cas: a certificate purchased by using Certificate Management Service.
  • upload: a custom certificate that you upload.
cas
CertificatestringNo

The certificate content.

-----BEGIN CERTIFICATE-----
PrivateKeystringNo

The private key of the certificate.

-----BEGIN PRIVATE KEY-----
RegionstringNo

The region.

cn-hangzhou
IdstringNo

The certificate ID on ESA.

30001303

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

A666D44F-19D6-490E-97CF-1A64AB962C57
Idstring

The certificate ID.

babaffe176ae44e2ad16d3e309b9e506

Examples

Sample success responses

JSONformat

{
  "RequestId": "A666D44F-19D6-490E-97CF-1A64AB962C57",
  "Id": "babaffe176ae44e2ad16d3e309b9e506"
}

Error codes

HTTP status codeError codeError messageDescription
400Certificate.StatusErrorThe status of the certificate is invalid.The specified certificate status is invalid.
400Certificate.DuplicatedThe certificate name already exists.The certificate is duplicated.
400InvalidParameterThe specified parameter is invalid.The specified parameter is invalid.
400InvalidCertificate.NotFoundThe specified certificate does not match the website. Check the validity of the certificate and try again.The specified certificate does not match the website. Check the validity of the certificate and try again.
400InvalidSSLPubThe specified Certificate is invalid.The value specified for the Certificate parameter is invalid.
400InvalidSSLPriThe specified PrivateKey is invalid.The value specified for the PrivateKey parameter is invalid.
400CasId.MissingParameterThe CasId parameter is required.The CasId parameter is missing.
400PrivateKey.MissingParameterThe PrivateKey parameter is required.Missing PrivateKey parameter.
400Certificate.MissingParameterThe Certificate parameter is required.Missing Certificate parameter.
400InvalidParameter.SiteIdFailed to query the website based on the SiteID you specified. Check parameter SiteId and try again.Failed to query the website based on the SiteID you specified. Check parameter SiteId and try again.
400InternalExceptionFailed to call the service. Try again later or contact technical support.Failed to call the service. Try again later or contact technical support.
400UpdateFreeCertificate.NotSupportThe free certificate does not support the update operation.The free certificate does not support the update operation.
400CertificateDomainNotMatchSiteThe domain name in the specified certificate does not match the site.The domain name in the certificate does not match the current site.
400CertificateNotMatchPrivateKeyThe specified certificate does not match the private key.The specified certificate and private key do not match.
400CertQuotaCheckFailedThe custom certificate quota verification failed. The number of uploaded certificates exceeds the upper limit allowed for the plan.The custom certificate quota verification failed. The number of uploaded certificates exceeds the upper limit allowed for the plan.
404Certificate.NotFoundThe specified certificate does not exist.The specified certificate does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-02-13The Error code has changed. The request parameters of the API has changedView Change Details
2025-01-09The Error code has changed. The response structure of the API has changedView Change Details
2024-12-12The Error code has changedView Change Details
2024-10-15The Error code has changedView Change Details
2024-10-03The Error code has changedView Change Details
2024-09-18The Error code has changedView Change Details
2024-09-06The Error code has changedView Change Details