Overview
Menu

CreateZone

1. API Description

Domain name for API request: teo.tencentcloudapi.com.

This API is used to create a site. After you create the site, you can connect it to EdgeOne via the CNAME or NS (see Quick Start), or connect it without a domain name (see Quick Access to L4 Proxy Service).

If there are already EdgeOne plans under the current account, it is recommended to pass in the PlanId to bind the site with the plan directly. If PlanId is not passed in, the created site is not activated. You need to call BindZoneToPlan to bind the site with a plan. To purchase a plan, please go to the EdgeOne console.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: CreateZone.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
TypeNoStringSite access types. Options include:
  • partial: (Default) Access through a CNAME record
  • full: Access through a name server
  • noDomainAccess: Access without using a domain name
  • ZoneNameNoStringSite name. For sites connected via CNAME/NS, pass in the secondary domain name (example.com). Leave it blank if the site is connected without a domain name.
    AreaNoStringThe acceleration area of the L7 domain name when Type is partial or full. When Type is noDomainAccess, please leave it blank.
  • global: Global AZs
  • mainland: AZs in the Chinese mainland
  • overseas: (Default) AZs outside the Chinese mainland
  • PlanIdNoStringID of the plan to which you want to bind the site. If you don't have an EdgeOne plan, purchase one in the EdgeOne console.
    AliasZoneNameNoStringThe site alias. It allows up to 20 characters, including [0-9], [a-z], [A-Z] and [-_]. For details, see Glossary. If you don't want to use it, just leave it blank.
    Tags.NNoArray of TagTags of the site. To create tags, go to the Tag Console.

    3. Output Parameters

    Parameter NameTypeDescription
    ZoneIdStringSite ID.
    OwnershipVerificationOwnershipVerificationSite ownership verification information. After the site is created, you need to complete the ownership verification before the site can serve normally.

    If Type=partial, add TXT records to your DNS provider or add files to the root DNS server, and then call VerifyOwnership to complete verification. For more information, see Ownership Verification.

    If Type = full, switch the DNS server as instructed by Modifying DNS Server. Then call VerifyOwnership to check the result.

    If Type = noDomainAccess, leave it blank. No action is required.
    Note: This field may return·null, indicating that no valid values can be obtained.
    RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating a site with the NS access mode

    u200cConnect the site example.com to EdgeOne via the NS. Set the service area to Chinese mainland, and bind it with the plan edgeone-37q0w6qali10. The information of DNS provider is returned. You need to go to the domain name registrar to modify the configuration. For more information, see Modifying DNS Server.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "full",
        "ZoneName": "example.com",
        "Area": "mainland",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "OwnershipVerification": {
                "DnsVerification": null,
                "FileVerification": null,
                "NsVerification": {
                    "NameServers": [
                        "ns1.teodns.com",
                        "ns2.teodns.com"
                    ]
                }
            },
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    Example2 Creating a site without specifying the domain name

    Create a site without specifying the domain name, and bind it with the plan edgeone-37q0w6qali10. The site ID is returned. For information, see Quick access to L4 proxy service.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "noDomainAccess",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    Example3 Creating a site with the CNAME access mode

    Connect the site example.com to EdgeOne via the CNAME. Set the service area to Global, and bind it with the plan edgeone-37q0w6qali10. This API returns the site ID and site ownership verification information. To verify your ownership of a site, see Ownership Verification.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "partial",
        "ZoneName": "example.com",
        "Area": "global",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "OwnershipVerification": {
                "DnsVerification": {
                    "Subdomain": "edgeonereclaim",
                    "RecordType": "TXT",
                    "RecordValue": "reclaim-a24aba2420cf4ce8b7bff7c8be6d337f"
                },
                "FileVerification": {
                    "Path": "/.well-known/teo-verification/vd4ewuqa9n.txt",
                    "Content": "88v24mnnljwbhaohrpfx80f63duhdnjx"
                },
                "NsVerification": null
            },
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error CodeDescription
    DryRunOperationDryRun operation, which means the DryRun parameter is passed in yet the request will still be successful.
    InvalidParameter.InvalidOriginIpThe origin cannot be a private IP or loopback address.
    InvalidParameter.LengthExceedsLimitMaximum parameter length exceeded.
    InvalidParameter.PlanNotFoundThe plan doesn’t exist.
    InvalidParameter.ZoneHasBeenBoundThe site is already bound.
    InvalidParameterValueInvalid parameter value.
    InvalidParameterValue.AccessBlacklistThe domain name for this zone has been banned.
    InvalidParameterValue.InvalidTagValueThe tag value contains invalid characters.
    InvalidParameterValue.TopLevelDomainNotSupportThe current domain suffix is not supported for access. Please contact us if you need to use it.
    InvalidParameterValue.ZoneNameInvalidThe zone name format is incorrect. Please input a correctly formed domain name.
    InvalidParameterValue.ZoneNameNotSupportPunyCodePunycode access is not supported at present.
    InvalidParameterValue.ZoneNameNotSupportSubDomainThe zone does not support subdomain access. Please use second-level domains for zone access.
    InvalidParameterValue.ZoneSameAsNameThe site alias already exists.
    LimitExceeded.ZoneBindPlanReached the upper limit of sites of the plan
    OperationDeniedOperation denied.
    OperationDenied.DomainIsBlockedUnable to use the domain name when it’s blocked.
    OperationDenied.RecordIsForbiddenThe DNS record cannot be added.
    ResourceInUseThe resource is occupied.
    ResourceInUse.AliasDomainResources occupied by the alias domain names under this account.
    ResourceInUse.CnameResources occupied by this account via CNAME.
    ResourceInUse.DnsDNS resources occupied.
    ResourceInUse.GenericHostResources occupied by the wildcard domain name.
    ResourceInUse.HostResources occupied by the subdomain names under this account.
    ResourceInUse.NSResources occupied by this account via NS.
    ResourceInUse.OthersThe resource has been connected to EdgeOne by another user.
    ResourceInUse.OthersAliasDomainResources occupied by the alias domain names under other accounts.
    ResourceInUse.OthersCnameResources occupied by other accounts via CNAME.
    ResourceInUse.OthersHostResources occupied by the subdomain names under other accounts.
    ResourceInUse.OthersNSResources occupied by other accounts via NS.
    ResourceInUse.SelfAndOthersCnameResources occupied by this account and others via CNAME.
    ResourceNotFoundThe resource doesn’t exist.
    UnauthorizedOperation.CamUnauthorizedCAM is not authorized.
    UnauthorizedOperation.NoPermissionThe sub-account is not authorized for the operation. Please get permissions first.
    UnauthorizedOperation.UnknownAn unknown error occurred in the backend server.