CreateDomain

Update time: 2026-08-14 16:47:39

Applicable Products

Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast

API Description

Create a domain.

  • API URL: https://api.atomile.com/api/domain
  • Method: POST
  • Limit Description: · The accelerated domain name must have been filed. · Accelerated domain names must not contain the following information: sales of drugs and controlled tools, including illegal speech and information. · Video-accelerated domain names must have audiovisual licenses; blog forums or community-based accelerated domain names must have BBS special approval qualifications. · Interface requests and return results only accept xml format.

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Body Params

NameDescription
*versionString
Version number, current version 1.0.0
*domain-nameString
Domain to be integrated into CDN. Supports wildcard domains, starting with a symbol '.', such as: .example.com, wildcard domains also include multi-level 'a.b.example.com'. If example.com is registered, then the domain xx.example.com does not need to be registered.
service-typeString
Service type of the acceleration domain (only one service type can be submitted at a time): web/web-https: Web acceleration/Web acceleration-https wsa/wsa-https: Whole site acceleration/Whole site acceleration-https vodstream/vod-https: VOD acceleration/VOD acceleration-https download/dl-https: Download acceleration/Download acceleration-https livestream/live-https/cloudv-live: Live streaming acceleration v6sa/osv6: IPv6 security acceleration solution/IPv6 integrated solution Note: 1. The https in service-type does not mean that https is enabled immediately, for example, the https in web-https does not mean that https access is supported immediately, it can only be supported after the certificate is uploaded, remember!
contract-idString
The id of contract, such as 40015677
item-idString
The id of product, such as 10
service-areasString
Acceleration area of the acceleration domain. If there is a need to limit resource coverage by area, the acceleration area needs to be specified. If no acceleration area is specified, we will provide acceleration services with optimal resource coverage according to the customer's opened service area. Multiple areas are separated by semicolons, and the supported areas are as follows: cn (China Mainland), am (America), emea (Europe, Middle East, Africa), apac (Asia Pacific)
commentString
Remarks, maximum limit of 1000 characters
config-form-idInteger
Configuration form template. In specific usage scenarios, if you want the newly added acceleration domain to refer to certain specified configurations, you can specify the configuration form template. Please consult the corresponding customer representative for specific usage.
referenced-domain-nameString
Create an acceleration domain by referring to the configuration of a specified domain. Note: 1. If the referenced domain uses a certificate, the new domain must also be within the authorized range of the corresponding certificate. 2. If the referenced domain is not registered, the new domain may affect resource usage and service quality if it is registered. 3. If the referenced domain is registered, the new domain may be reselected if it is not registered and the resources do not meet policy requirements. 4. It is not allowed to create a new domain by referring to a traffic-free domain.
cname-labelString
Shared first-level label. If multiple acceleration domains need to share a first-level domain, this parameter can be used. That is, a group of domains with the same cname-label share a first-level cname. Note: 1. Domains with the same cname-label share a first-level cname and have completely consistent DNS coverage. 2. Constraints on sharing a first-level: consistent acceleration type (service-type), consistent certificate id (certificate-id, if there is a certificate), consistent acceleration area (service-areas) 3. Multiple http domains can share a first-level, multiple sni https domains can share a first-level 4. When a single domain uses cname-label, the domain can be canceled; when multiple domains share a first-level, these domains cannot be canceled 5. It is supported to modify the cname by modifying the cname-label.
cname-with-customized-prefixString
First-level cname prefix, true means using the domain name as the cname prefix, otherwise, a 14-character random string (numbers + letters) is used as the cname prefix. Note: When the prefix is a wildcard domain, wsall is added as a prefix. For example, .baidu.com.wscloudcdn.com will generate wsall.baidu.com.wscloudcdn.com
origin-configObject
Origin strategy settings (used for non-live domains), used to set the source station information and origin strategy of the acceleration domain.
origin-ipsString
Origin address, can be IP or domain name. 1. IPs are separated by semicolons, multiple are supported. 2. Only one domain name can be entered. IP and domain name cannot be entered at the same time. 3. The maximum length cannot exceed 500 characters. 4. The number of source IPs cannot exceed 15.
default-origin-host-headerString
Origin HOST, used to change the HOST field in the origin HTTP request header. The supported format is: domain name, each segment (dot-separated) length is less than or equal to 62, and the total length of the domain name is less than or equal to 128.
origin-portString
Origin port, Value cannot be zero
live-configObject
Live domain configuration, used to set the push and pull stream of the rtmp live acceleration domain (application required) Note: The relevant parameter configuration under this node, in addition to opening API call permissions, also needs to contact the exclusive customer service to apply for the corresponding API customer template
stream-typeString
Live stream type, optional values are pull and push, pull means pulling stream; push means pushing stream.
origin-push-hostString
Supporting push stream domain name, used to set the push stream domain name corresponding to the rtmp live pull stream domain name. When stream-type is pull, at least one of the source station IP and supporting push stream domain name must not be empty; when stream-type is push, it is not necessary to pass in.
origin-ipsString
Source station IP, when stream-type is pull, at least one of the source station IP and supporting push stream domain name must not be empty. 1. If it is a push-pull stream match, fill in 127.0.0.1, and the system defaults to 127.0.0.1 if not passed 2. If it is a direct origin pull stream, fill in the source station IP of the origin pull stream
accelerate-no-chinaString
Indicates whether the domain is purely accelerated overseas. The default value is 'false'. true: indicates that the customer's domain is purely accelerated overseas. false: indicates that the customer's domain is accelerated in China.
header-of-clientipString
Response header for passing client IP, optional values are Cdn-Src-Ip, X-Forwarded-For, ori_X-Forwarded-For 1) Cdn-Src-Ip: The origin header name is Cdn-Src-Ip, and the IP that establishes a connection with the node is obtained as the client IP and passed back to the origin. 2) X-Forwarded-For: The origin header name is X-Forwarded-For, and the client IP value carried is the connection IP obtained by Cdn-Src-Ip. 3) ori_X-Forwarded-For: When the client requests the CDN node, it will carry the X-Forwarded-For, and the CDN will transparently transmit this header and value back to the origin.
upstream-hostString
Live pull stream domain name, direct origin verification configuration. Can be IP or domain name. Only one of IP and domain name is supported. Multiple input parameters are not supported.
publish-pointsList
Set the publish point of the live push-pull stream domain name Note: 1. The pull stream and the corresponding push stream domain name must configure the same publish point; 2. If you do not want to modify the publish point, do not pass in this node and the following input parameters; 3. The publish point is updated in an overlay manner, and each modification requires submitting all publish points, not just the parts that need to be modified.
uriString
Publish point, supports multiple, if not passed, the system defaults to generate a publish point uri as '/'
sslObject
SSL certificate settings, used to set the SSL certificate configuration of the acceleration domain. To upload a certificate, please use the interface: [Add Certificate V2]; to modify the certificate, please use the interface: [Modify Certificate V2]
use-sslString
Use certificate, optional values are true and false, true means using certificate, false means not using certificate
use-for-sniString
Use SNI certificate, optional values are true and false, true means using SNI certificate, false means using shared certificate (not supported yet)
ssl-certificate-idInteger
Certificate ID, the certificate ID returned by the system after the certificate is successfully added, ssl-certificate-id can only be passed when use-ssl is true.
back-to-origin-rewrite-ruleObject
Modify the origin protocol and port; if you want to return to the origin according to the original request, you can clear this object, example "back-to-origin-rewrite-rule":{}
protocolString
Rewritten origin protocol, optional values: http, https
portString
Rewritten origin port, if protocol is http, the default is 80, if protocol is https, the default is 443
cache-behaviorsList
Cache time configuration
file-typeString
File type
custom-file-typeString
Custom file type
cache-ttlString
Cache time
cache-unitString
Cache time unit, optional values: s, m, h, d
cps-linkString
Cps Link
resource-group-idString
Resource group id, a numeric string, for example, '19672066263443386'.
auto-add-certificateString
Auto add certificate when value is 1.
header-modify-rulesList
Http header settings note: 1. indicating that you need to set the http header, this field is required
header-nameString
Http header name, add or modify the http header, only one is allowed; delete the http header to allow multiple entries, separated by a semicolon ';'. Note: The operation of the special http header is limited, and the http header and operation type of the operation are allowed. This item is required and cannot be empty When the action is add: indicates that the header-name header is added. When the action is set: modify the header-name header When the action is delete: delete the header-name header
except-directoryString
Exception directory.
custom-patternString
Matching conditions: specify common types, optional values are all or homepage. 1. all: all files 2. homepage: home page
allow-regexpString
Http header regular match, optional value: true / false. True: indicates that the value of the header-name is handled as a regular match. False: indicates that the value of the header-name is processed according to the actual parameters, and no regular match is made. Do not pass the default is false
path-patternString
The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as:
except-path-patternString
Exception url matching pattern, support regular. Example:
directoryString
Directory
header-value-oldString
The original value corresponding to the HTTP header field
specify-urlString
Matching Condition: Specify URL. The input parameter does not support the URI format starting with http(s)://
priorityString
Indicates the priority of execution order for multiple sets of configurations. A higher number indicates higher priority. If no parameters are passed, the default value is 10 and cannot be cleared.
request-methodString
The matching request method, the optional values are: GET, POST, PUT, HEAD, DELETE, OPTIONS, separate by semicolons.
except-request-headerString
Exception request header.
header-directionString
The control direction of the http header, the optional value is cache2visitor/cache2origin/visitor2cache/origin2cache, single-select. Cache2origin refers to the source direction---corresponding to the configuration item return source request; Cache2visitor refers to the direction of the client back - the corresponding configuration item returns to the client response; Visitor2cache refers to receiving client requests Origin2cache refers to the receiving source response
request-headerString
Match request header, header values support regular, header and header values separated by Spaces, e.g. : Range bytes=[0-9]{9,}
except-file-typeString
Exception file type.
overrideString
HTTP Header Override Option, Values: true/false/.Empty string true: If the specified header already exists, the original header will be overwritten. If the header does not exist, a new header will be added. false: If the specified header already exists, the original header remains unchanged. If the header does not exist, a new header will be added. Empty string: indicating to clear the configuration Note: This override operation only applies to the cache2origin and cache2visitor directions.
custom-file-typeString
Matching condition: Custom file type, separate by semicolon.
file-typeString
Matching conditions: file type, please separate by semicolon, optional values: gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf m3u8 xml f4m bootstarp ts.
actionString
The control type of the http header supports the addition and deletion of the http header value. The optional value is add|set|delete, which is single-selected. Corresponding to the header-name and header-value parameters. 1. Add: add a header 2. Set: modify the header value 3. Delete: delete the header Note: priority is delete > set > add
except-request-methodString
Exception request method.
header-valueString
The value corresponding to the HTTP header field, for example: mytest.example.com Note: 1. When the action is add or set, the input parameter must be passed a value 2. When the action is delete, the input parameter is not passed Support to get the value of specified variable by keyword, such as client IP, including: Key words: meaning #timestamp: current time, timestamp as 1559124945 #request-host: host in the request header #request-url: request url, which contains the full path of the protocol domain name, etc., such as http://aaa.aa.com/a.html #request-uri: request uri, relative path format, such as /index.html #origin- IP: return source IP #cache-ip: edge node IP #server-ip: external service IP #client-ip: client IP, or visitor IP #response-header{XXX} : get the value in the response header, such as #response-header{etag}, get the etag value in response-header #header{XXX} : to get the value in the HTTP header of the request, such as #header{user-agent}, is to get the user-agent value in the header #cookie{XXX} : get the value in the cookie, such as #cookie{account}, is to get the value of the account set in the cookie
rewrite-rule-settingsList
redirection function note: 1. Define a set of internal redirected content. If there is internal redirected content, this field is required.
operators-areaString
Region
exceptional-uaString
Exceptional UA
custom-patternString
Matching conditions: specify common types, optional values are all or homepage 1. all: all files 2. homepage: home page
path-patternString
The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as:
exceptional-operators-areaString
Exceptional region
exceptional-requestString
Exceptional Request Method
priorityString
Indicates the priority execution order of multiple sets of redirected content by the customer. The higher the number, the higher the priority. When adding a new configuration item, the default is 10
custom-file-typeString
Matching condition: Custom file type, please separate them by semicolon.
except-path-patternString
Exceptional url matching mode, except for certain URLs: such as abc.jpg, no content redirection Customer reference: ^https?://[^/]+/.*\.m3u8
before-valueString
Configuration item: old url Indicates the protocol mode before rewriting (that is, the object that needs to be rewritten), such as: ^https://([^/]+/.*)
directoryString
directory
request-headerString
Matching condition: Request header
file-typeString
gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf m3u8 xml f4m bootstarp ts
exception-request-headerString
Matching condition: Exception request header
uaString
UA
request-wayString
Request Method
ignore-letter-caseString
Ignore case, the optional value is true or false, true means to ignore case; false means not to ignore case; When adding a new configuration item, the default is not true. If the client passes a null value: such as , the configuration is cleared.
after-valueString
Configuration item: new url Indicates the protocol method after rewriting, such as: http://$1
origin-rules-rewritesList
Return path rewrite configuration 1. When you need to set the rewrite configuration of the backsource path, this must be filled in
path-pattern-httpString
The protocol of URL matching mode, which is used with path-pattern, is supported by adding parameters: default is empty, blank is default is to support HTTP and HTTPS protocol before URL matching mode path is needed at the same time; Http: URL matches pattern path with HTTP protocol Https: URL matches pattern path with HTTPS protocol Ignore: URL matching mode path without protocol
path-patternString
The URL matching mode supports regularization. If all matches are made, the input can be configured as:.*
priorityString
Represents the priority execution order of the customer's multi-group redirected content. The bigger the number, the higher the priority.
except-path-patternString
Exceptional URL matching pattern in the same format as path pattern
origin-infoString
Back-source information, you can enter IP or domain name. That is, customer source IP or domain name
except-path-pattern-httpString
Exceptional URL matching mode protocol, which is used in conjunction with except-path-pattern; participation support: default is empty, blank is default is required to support both HTTP and HTTPS protocol before URL matching mode path; Http: URL matches pattern path with HTTP protocol. Https: URL matches pattern path with HTTPS protocol. Ignore: URL matching mode path without protocol.
origin-hostString
Back source host,that support to enter domain names; Example: The backsource host of domain name A configures domain name B. When the A domain name requests the source, the requested URL uses the B domain name instead of the A domain name.
after-rewrited-uriString
The rewritten uri, the request URI configured before-rewrited-uri, is retrieved with the rewritten uri. Rewrite the source path. Support regular configuration
before-rewrited-uriString
Pre-rewrite uri. That is, the original request URI for user access. Support regular configuration
ignore-letter-caseString
Ignore case or not: the allowable values are true and false, and the default is Ignore
http-code-cache-rulesList
Status Code Caching Rule Configuration, parent node 1. When you need to set status code caching rules, this must be filled in.
cache-ttlString
Define the caching time of the specified status code in units s, 0 to indicate no caching
http-codesList
Configure HTTP status code, parent node
http2-settingObject
Http2.0 settings, used to enable or disable http2.0, parent node.
enable-http2String
Enable http2.0. The optional values are true and false. If it is empty, the default value is false. True means http2.0 is on; false means http2.0 is off.
back-to-origin-protocolString
Back-to-origin protocol, the optional value is http1.1: Use the HTTP1.1 protocol version to back to source. if not filled, use it as default. follow-request: Same as client request protocol http2.0: Use the HTTP2.0 protocol. version to back to source.
websocket-switchObject
Open or close websocket function, parent node, you can set to clear this configuration. Scope of application: wsa, web pages
is-open-websocketString
Whether to turn on the websocket function, the allowable values are true and false, default false
change-serversList
Change servers configuration, parent tag 1. This must be filled when the hotlinking configuration of streaming media needs to be set
target-serverString
If it is a universal domain name, set it to a universal domain name, for example,.56.com.

Response parameter(s)

Response Header

NameDescription
x-cnc-request-idString
Uniquely labeled id for querying each requested task (for all interfaces)
LocationString
A URL used to access the domain name information, where the domain-id is a unique identifier for the domain name.
cnameString
CNAME for Acceleration

Body Params

NameDescription
cnameString
The name of the service domain automatically generated by the My company, for example: xxxx.cdn30.com
codeString
The error code, when HTTPStatus is not 202, indicates the type of error the current request is calling.
messageString
Response information, when success is successful

Error code

Error code(code)Description(message)HTTP statusSemantic
InternalErrorInternal error such as server exception, data acquisition failure, etc.500Internal error such as server exception, data acquisition failure, etc.
DomainAlreadyExistsThe added domain name already exists.409The added domain name already exists.
ICPNotFoundThe domain name you provided does not have a record number.400The domain name you provided does not have a record number.
InvalidOriginNo certificate id is passed when using the certificate400No certificate id is passed when using the certificate
CustomizedCnameErrorCustomer sharing a level 1 error409Customer sharing a level 1 error
ConfigFormNotExistsConfiguration does not exist400Configuration does not exist
NoSuchConfigTempletThe configuration template does not exist.404The configuration template does not exist.
NO_AVAILABLE_CONFIGCan't find a suitable ticket based on the type of acceleration400Can't find a suitable ticket based on the type of acceleration
PARSE_PARAM_ERRORInput parameter parsing error400Input parameter parsing error
SERVICE_TYPE_NOT_MATCH_TEMPLET_IDThe acceleration type does not match the acceleration type of the template id400The acceleration type does not match the acceleration type of the template id
MAIN_DOMAIN_NAME_EXISTPrimary domain already exists400Primary domain already exists
MalformedXMLThe xml supplied is incorrect or not in order400The xml supplied is incorrect or not in order
ConfigErrorThere is no associated push flow in the name of non-direct back-to-origin pull basin400There is no associated push flow in the name of non-direct back-to-origin pull basin
DomainExistsCdnAreaErrorInbound service zone error409Inbound service zone error
CnameErrorCommon level belongs to multiple configuration single templates400Common level belongs to multiple configuration single templates
NULL_DOMAIN_NAMEDomain name is null.400Domain name is null.
DOMAIN_NOT_IN_SSL_DNS_DOMAINDomain name is not allowed in certificate400Domain name is not allowed in certificate
NOT_HTTPS_IN_SERVICEFORMSNo matching https service list400No matching https service list
STAGING_SUIT_ERRORCan not find a set meal400Can not find a set meal
SERVICE_TYPE_NOT_USE_SNI_SSLDomain name configuration cannot use sni certificates400Domain name configuration cannot use sni certificates
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICEThe service list is https-type, but there is no certificate-configured related secondary service for the suite400The service list is https-type, but there is no certificate-configured related secondary service for the suite
ERROR_CONFIG_PARAMConfiguration Item Error400Configuration Item Error
NOT_ALLOW_SRC_IP_AS_ACCELERATE_DOMAINThe back-to-origin domain of this domain is also another accelerated domain, which may lead to abnormal access to the accelerated domain .400The back-to-origin domain of this domain is also another accelerated domain, which may lead to abnormal access to the accelerated domain .
NOT_ALLOW_ACCELERATE_DOMAIN_AS_SRC_IPThis accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain.\n\n400This accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain.\n\n
REFERENCE_FREE_FLOW_DOMAINCan not add domain. The reference domain is free flow domain. Please contact technical support for help.400Can not add domain. The reference domain is free flow domain. Please contact technical support for help.
ERROR_CONFIG_PARAMConfiguration Item Error400Configuration Item Error
ERROR_CONFIG_PARAMConfiguration Item Error400Configuration Item Error
ConfigErrorAccelerate type error, please contact technical support.400Accelerate type error, please contact technical support.
NO_AVAILABLE_SUITCan't find a suitable suit based on the type of acceleration400Can't find a suitable suit based on the type of acceleration

Example

JSON(SERVICE-TYPE)
JSON(CONTRACT)
XML
XML3
XML-LIVE-PUSH
XML-LIVE-PULL
JSON(SERVICE-TYPE)
Request example
Copy Copy success
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/api/domain" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '{
    "version":"1.0.0",
    "domain-name":"test12.eaxmple1.com",
    "comment":"",
    "service-type":"web",
    "origin-config":{
        "origin-ips":"127.0.0.1",
        "default-origin-host-header":""
    },
    "referenced-domain-name":"aaa.linlytest.com",
    "ssl":{
         "use-ssl":"true",
         "ssl-certificate-id":"certificate ID"
    }
}'
Response example
Copy Copy success
HTTP/1.1 202 Accepted
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
Location:https://{@apiDomain}/api/domain/1234567
cname: 7nt6mrh7sdkslj.cdn30.com
{"message":"success"}