All Products
Search
Document Center

Edge Security Acceleration:CreateCustomHostname

Last Updated:Sep 18, 2026

Creates a SaaS domain name under a site.

Operation description

  • If the acceleration area is set to the Chinese mainland only or global, the site domain name must have a valid Internet Content Provider (ICP) filing.

  • Each user can invoke this operation up to 100 times per hour.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

esa:CreateCustomHostname

create

*Site

acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Hostname

string

Yes

The SaaS domain name.

custom.site.com

SiteId

integer

Yes

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

1234567890123

RecordId

integer

Yes

The ID of the record to bind. You can obtain this value by calling the ListRecords operation.

1234567890123

SslFlag

string

Yes

Specifies whether to enable SSL. Valid values:

  • on: Enable SSL.

  • off: Disable SSL.

Valid values:

  • off :

    Disable SSL.

  • on :

    Enable SSL.

on

CertType

string

No

The certificate type. This parameter is required when SslFlag is set to on. Valid values:

  • free: free certificate.

  • upload: uploaded certificate.

  • cas: SSL Certificates Service certificate.

Valid values:

  • cas :

    SSL Certificates Service certificate.

  • upload :

    Uploaded certificate.

  • free :

    Free certificate.

free

Certificate

string

No

The certificate content. This parameter is required when CertType is set to upload.

-----BEGIN CERTIFICATE-----

PrivateKey

string

No

The private key of the certificate. This parameter is required when CertType is set to upload.

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

CasId

integer

No

The SSL Certificates Service certificate ID. This parameter is required when CertType is set to cas.

30000478

CasRegion

string

No

The region of the SSL Certificates Service certificate. This parameter is required when CertType is set to cas.

  • For Chinese site accounts, set this parameter to cn-hangzhou.

  • For international site accounts, set this parameter to ap-southeast-1.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

Hostname

string

The SaaS domain name.

custom.site.com

HostnameId

integer

The ID of the SaaS domain name.

1234567890123

RequestId

string

The request ID, which is a unique identifier generated by Alibaba Cloud for this request.

0AEDAF20-4DDF-4165-8750-47FF9C1929C9

Examples

Success response

JSON format

{
  "Hostname": "custom.site.com",
  "HostnameId": 1234567890123,
  "RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is invalid. The specified parameter is invalid.
400 InternalException Failed to call the service. Try again later or contact technical support. Failed to call the service. Try again later or contact technical support.
400 Instance.NotOnline Your plan is unavailable due to an overdue payment. Complete the payment first. Your plan is unavailable due to an overdue payment. Complete the payment first.
400 Site.ServiceBusy This website is being configured. Try again later. This website is being configured. Try again later.
400 CustomHostname.ConflictWithExistingResource The custom hostname conflicts with existing resources, such as sites, records, load balancers, source address pools, custom hostnames and Layer 4 proxy records. The custom hostname conflicts with existing resources, such as sites, records, load balancers, source address pools, custom hostnames and Layer 4 proxy records.
400 CustomHostname.ApplyCertFailed Fail to apply a free cert for custom hostname. Please try again later. Fail to apply a free cert for custom hostname. Please try again later.
400 CustomHostname.SetCertFailed Fail to deploy a cert for custom hostname. Please try again later. Fail to deploy a cert for custom hostname. Please try again later.
400 CustomHostname.CheckQuotaFailed Fail to check quota for custom hostname. Please try again later. Failed to check the custom hostname quota for the site. Try again later.
400 CustomHostname.OfflineForMultiReason Unable to activate the custom hostname because it is offline due to multiple reasons. The custom hostname has been taken offline for multiple reasons and cannot be activated.
400 CustomHostname.WildcardDomainRequireEnterprisePlan Wildcard custom hostnames require an Enterprise plan. Only Enterprise Edition plans support adding wildcard SaaS domain names. Upgrade your plan and try again.
400 CustomHostname.QueryCasCertFailed Fail to query CAS certificate details. Please try again later. Failed to query the China Shield certificate details. Try again later.
400 QuotaExceed.CustomHostname The number of custom hostnames exceeds the plan quota. Contact the sales team to increase your quota. The number of custom hostnames exceeds the plan quota. Contact the sales team to increase your quota.
400 ICPCheckFailed The ICP filing verification service is temporarily unavailable. Please try again later. The filing query service is abnormal. Please try again later.
400 CustomHostname.InvalidICP The specified website does not have an ICP filing or the filing information is invalid. Make sure your website is filed and try again. The specified website does not have an ICP filing or the filing information is invalid. Make sure your website is filed and try again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.