All Products
Search
Document Center

CDN:AddCdnDomain

Last Updated:Aug 21, 2025

You can call the AddCdnDomain operation to add an accelerated domain name.

Operation description

  • Before you add a domain name, you must activate Alibaba Cloud CDN. For more information, see Activate Alibaba Cloud CDN.

  • The accelerated domain name must have a valid ICP filing.

  • You can add only one accelerated domain name at a time. Each account can have a maximum of 50 domain names.

  • If the content on your origin server is not stored on Alibaba Cloud, the content must be reviewed. The review is completed before the next business day.

  • The throttling limit for each user is 30 calls per second.

Usage notes

  • After you add a domain name by calling this operation, it takes 3 to 5 minutes for the domain name to take effect. Do not configure the domain name during this period. Wait until the domain status is online before you perform other configurations.

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

cdn:AddCdnDomain

create

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

CdnType

string

Yes

The business type of the accelerated domain name. Valid values:

  • web: images and small files.

  • download: large file downloads.

  • video: video-on-demand.

web

DomainName

string

Yes

The accelerated domain name that you want to add to Alibaba Cloud CDN.

Wildcard domain names are supported. A wildcard domain name must start with a period (.), such as .example.com.

.example.com

ResourceGroupId

string

No

The ID of the resource group.

If you do not specify this parameter, the system uses the ID of the default resource group.

rg-acfmyuji4b6r4**

Sources

string

Yes

The list of origin addresses.

[ { "content": "192.0.2.0", "type": "ipaddr", "priority": "20", "port": 80, "weight": "15" } ]

CheckUrl

string

No

The health check URL.

www.example.com/test.html

Scope

string

No

The acceleration region. Valid values:

  • domestic (default): the Chinese mainland only.

  • overseas: global (excluding the Chinese mainland).

  • global: global.

domestic

TopLevelDomain

string

No

The top-level domain.

example.com

Tag

array<object>

No

A list of tags. You can specify up to 20 tags.

object

No

Key

string

No

The tag key.

env

Value

string

No

The tag value.

value

The following table describes the fields of the Sources parameter.

Parameter

Type

Required

Description

type

String

Yes

The type of the origin server. Valid values:
ipaddr: an IP address.
domain: a domain name.
oss: an OSS bucket.
fc_domain: a Function Compute domain name.










content

String

Yes

The address of the origin server. You can specify an IP address or a domain name.

port

Integer

No

The port number.
You can specify port 443 or 80, or a custom port. Default value: 80. Port 443 supports HTTPS origin fetch.

priority

String

No

The priority of the origin server.
Valid values: 20 and 30. Default value: 20. A value of 20 indicates the primary origin server, and a value of 30 indicates the secondary origin server.

weight

String

No

The weight of the origin server for origin fetch. Valid values are 0 to 100. Default value: 10.

Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The request ID.

15C66C7B-671A-4297-9187-2C4477247A74

Examples

Success response

JSON format

{
  "RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidDomainName.Malformed Specified DomainName is malformed. The specified DomainName parameter is invalid or wildcard domain names cannot be batch added.
400 MissingParameter The input parameter cdnType that is mandatory for processing this request is not supplied. You must specify the cdnType parameter.
400 InvalidCdnType.Malformed Specified CdnType is malformed. The CdnType parameter is set to an invalid value. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content.
400 InvalidSources.Malformed Specified Sources is malformed. The specified origin address is invalid.
400 InvalidSourceType.Malformed Specified CdnType is malformed. The specified CdnType parameter is invalid.
400 InvalidSource.Priority.Malformed The specified Source Priority is invalid.
400 InvalidTypeAndContent.MissMatch The specified source type does not match the specified source content.
400 InvalidScope.Malformed Specified Scope is malformed. The specified Scope parameter is invalid.
400 SourceIp.Exceed The Certificate you provided is malformed The specified certificate format is invalid.
400 InvalidCertificate The Certificate you provided is malformed The specified certificate format is invalid.
400 InvalidCertificate.TooLong The Certificate you provided is over the max length Certificate and private key length exceeds the limit
400 InnerAddDomainDenied Your account has not bind aoneId, can not add domain. You are not allowed to add domain names because your account is not bound to aoneId.
400 CheckSourceHealthFailed sources ip or source domain check health failed,please input right source. The origin IP address or domain name is invalid. Specify a valid value and try again.
400 ExtensiveAndAllBothExist Extensive domain and the domain begins with all. can not exist at the same time. Wildcard domain names and domain names that start with "all." cannot both exist.
400 CdnTypeNotSupportExtensiveDomain Extensive domain not supported for this cdn type. The specified CdnType parameter is not supported for wildcard domain names. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content.
400 ExtensiveAndSpecificDomainConflict The number of wildcard domain names exceeds the limit.
400 InvalidResourceGroupId.Malformed Specified ResourceGroupId is malformed. Format of parameter ResourceGroupId is incorrect.
400 DomainReserved The root domain of your domain is reserved by another account. Submit a ticket to contact customer support.
400 InvalidDomainNameLevel Domain name suffixed with alicdn.com only support third level. alicdn.com supports up to three domain levels for wildcard domain names.
400 InvalidTopLevelDomain.Malformed Specified TopLevelDomain is malformed. The specified TopLevelDomain parameter is invalid.
400 TopLevelDomain.NotFound TopLevelDomain is not exist. The specified TopLevelDomain parameter does not exist.
400 EntityNotExists.ResourceGroup The resource group does not exist. The specified ResourceGroup parameter does not exist.
400 EntityNotExist.ResourceGroup The resource group does not exist. The specified resource group does not exist.
400 InvalidStatus.ResourceGroup It is not allowed to do this operation because of the current status of resource-group. This operation is not supported while the resource group is in the current state.
400 NotInternationRealIdentity You need to do real name authentication when you use Chinese mainland resources. You have not passed real-name verification. According to the regulations issued by MIIT, you must pass real-name verification if you want to purchase IT services in the Chinese mainland.
400 Abs.CheckUrl.Malformed The CheckUrl you provided is malformed.
400 RecordCheckNotAvailable The ICP filing interface is unavailable. Please try again later.
400 IcpBlack The domain is on the ICP blacklist.
400 IspBlack The domain is on the ISP blacklist.
400 DomainOwnerVerifyFail Owner verification of the root domain failed. The first time a domain name is added to Alibaba Cloud CDN, you must prove the ownership of the domain name. You must add a DNS record or a verification file for the domain name before it can be added to Alibaba Cloud CDN.
400 TopLevelDomain.Mismatch The specified TopLevelDomain does not match webSiteType. The top-level domain name does not match the domain name type.
400 DomainInBlacklist The domain is in the blacklist. The domain name is in the blacklist.
400 InvalidTagKey The specified TagKey is invalid. The parameter TagKey is invalid.
400 InvalidTagValue The specified TagValue is invalid.
400 InvalidTagKey.Repeated The specified TagKey is duplicated.
400 InvalidTag The specified Tag is Invalid.
400 InvalidTagKey.OverLimit The number of Tag can not over limit 20.
400 SourceInBlacklist Source is in the blacklist. The origin server is in the blacklist.
400 ReservedTagKey The tag key is used internally as a reserved field and is not allowed to be used. The tag key is used as an internal reserved field and is not allowed.
400 DomainOverLimit The maximum number of domains is exceeded. The number of domain names exceeds the limit.
400 DomainInRiskList The domain you added may be at risk. If you have any questions, please submit a ticket. The domain name you added may be at risk. If you have any questions, please submit a work order.
400 RegionNoResource Resource allocation failed. Please submit a work order to contact customer service. Resource allocation failed. Please submit a work order to contact customer service.
403 AccountException Account exception. Please open ticket to make an appeal.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.