---
title: Create Zone
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

[Zones](https://developers.cloudflare.com/api/typescript/resources/zones)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Create Zone

client.zones.create(ZoneCreateParams { account, name, type } body, RequestOptionsoptions?): [Zone](https://developers.cloudflare.com/api/typescript/resources/zones#%28resource%29%20zones%20%3E%20%28model%29%20zone%20%3E%20%28schema%29) { id, account, activated\_on, 20 more } 

POST/zones

Creates a new zone (domain) in your Cloudflare account.

The zone is created in a pending state and must be activated by updating your domain’s nameservers to point to Cloudflare, or by completing the verification process for partial (CNAME) setups.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### Accepted Permissions (at least one required)

`Zone Zone Edit` `Zone DNS Edit`

##### ParametersExpand Collapse 

body: ZoneCreateParams { account, name, type } 

account: [Account](https://developers.cloudflare.com/api/typescript/resources/zones/methods/create#%28resource%29%20zones%20%3E%20%28method%29%20create%20%3E%20%28params%29%20default%20%3E%20%28param%29%20account%20%3E%20%28schema%29)

id?: string

Identifier

maxLength32

name: string

The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment (“label”) not exceeding 63 characters.

maxLength253

type?: [Type](https://developers.cloudflare.com/api/typescript/resources/zones#%28resource%29%20zones%20%3E%20%28model%29%20type%20%3E%20%28schema%29)

A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.

One of the following:

"full"

"partial"

"secondary"

"internal"

##### ReturnsExpand Collapse 

Zone { id, account, activated\_on, 20 more } 

id: string

Identifier

maxLength32

account: Account { id, name } 

The account the zone belongs to.

id?: string

Identifier

maxLength32

name?: string

The name of the account.

activated\_on: string | null

The last time proof of ownership was detected and the zone was made active.

formatdate-time

created\_on: string

When the zone was created.

formatdate-time

development\_mode: number

The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.

meta: Meta { cdn\_only, custom\_certificate\_quota, dns\_only, 4 more } 

Metadata about the zone.

cdn\_only?: boolean

The zone is only configured for CDN.

custom\_certificate\_quota?: number

Number of Custom Certificates the zone can have.

dns\_only?: boolean

The zone is only configured for DNS.

foundation\_dns?: boolean

The zone is setup with Foundation DNS.

page\_rule\_quota?: number

Number of Page Rules a zone can have.

phishing\_detected?: boolean

The zone has been flagged for phishing.

step?: number

modified\_on: string

When the zone was last modified.

formatdate-time

name: string

The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment (“label”) not exceeding 63 characters.

maxLength253

name\_servers: Array<string\>

The name servers Cloudflare assigns to a zone.

original\_dnshost: string | null

DNS host at the time of switching to Cloudflare.

maxLength50

original\_name\_servers: Array<string\> | null

Original name servers before moving to Cloudflare.

original\_registrar: string | null

Registrar for the domain at the time of switching to Cloudflare.

owner: Owner { id, name, type } 

The owner of the zone.

id?: string

Identifier

maxLength32

name?: string

Name of the owner.

type?: string

The type of owner.

Deprecatedplan: Plan { id, can\_subscribe, currency, 7 more } 

Please use the `/zones/{zone_id}/subscription` API to update a zone’s plan. Changing this value will create/cancel associated subscriptions. To view available plans for this zone, see [Zone Plans](https://developers.cloudflare.com/api/resources/zones/subresources/plans/).

A Zones subscription information.

id?: string

Identifier

maxLength32

can\_subscribe?: boolean

States if the subscription can be activated.

currency?: string

The denomination of the customer.

externally\_managed?: boolean

If this Zone is managed by another company.

frequency?: string

How often the customer is billed.

is\_subscribed?: boolean

States if the subscription active.

legacy\_discount?: boolean

If the legacy discount applies to this Zone.

legacy\_id?: string

The legacy name of the plan.

name?: string

Name of the owner.

price?: number

How much the customer is paying.

cname\_suffix?: string

Allows the customer to use a custom apex. _Tenants Only Configuration_.

paused?: boolean

Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.

Deprecatedpermissions?: Array<string\>

This has been replaced by Account memberships.

Legacy permissions based on legacy user membership information.

status?: "initializing" | "pending" | "active" | "moved"

The zone status on Cloudflare.

One of the following:

"initializing"

"pending"

"active"

"moved"

tenant?: Tenant { id, name } 

The root organizational unit that this zone belongs to (such as a tenant or organization).

id?: string

Identifier

maxLength32

name?: string

The name of the Tenant account.

tenant\_unit?: TenantUnit { id } 

The immediate parent organizational unit that this zone belongs to (such as under a tenant or sub-organization).

id?: string

Identifier

maxLength32

type?: [Type](https://developers.cloudflare.com/api/typescript/resources/zones#%28resource%29%20zones%20%3E%20%28model%29%20type%20%3E%20%28schema%29)

A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.

One of the following:

"full"

"partial"

"secondary"

"internal"

vanity\_name\_servers?: Array<string\>

An array of domains used for custom name servers. This is only available for Business and Enterprise plans.

verification\_key?: string

Verification key for partial zone setup.

### Create Zone

TypeScript

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const zone = await client.zones.create({
  account: {},
  name: 'example.com',
});

console.log(zone.id);
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "account": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Account Name"
    },
    "activated_on": "2014-01-02T00:01:00.12345Z",
    "created_on": "2014-01-01T05:20:00.12345Z",
    "development_mode": 7200,
    "meta": {
      "cdn_only": true,
      "custom_certificate_quota": 1,
      "dns_only": true,
      "foundation_dns": true,
      "page_rule_quota": 100,
      "phishing_detected": false,
      "step": 2
    },
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "name": "example.com",
    "name_servers": [
      "bob.ns.cloudflare.com",
      "lola.ns.cloudflare.com"
    ],
    "original_dnshost": "NameCheap",
    "original_name_servers": [
      "ns1.originaldnshost.com",
      "ns2.originaldnshost.com"
    ],
    "original_registrar": "GoDaddy",
    "owner": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Org",
      "type": "organization"
    },
    "plan": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "can_subscribe": false,
      "currency": "USD",
      "externally_managed": false,
      "frequency": "monthly",
      "is_subscribed": false,
      "legacy_discount": false,
      "legacy_id": "free",
      "name": "Example Org",
      "price": 10.99
    },
    "cname_suffix": "cdn.cloudflare.com",
    "paused": true,
    "permissions": [
      "#worker:read"
    ],
    "status": "active",
    "tenant": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Account Name"
    },
    "tenant_unit": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353"
    },
    "type": "full",
    "vanity_name_servers": [
      "ns1.example.com",
      "ns2.example.com"
    ],
    "verification_key": "284344499-1084221259"
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "account": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Account Name"
    },
    "activated_on": "2014-01-02T00:01:00.12345Z",
    "created_on": "2014-01-01T05:20:00.12345Z",
    "development_mode": 7200,
    "meta": {
      "cdn_only": true,
      "custom_certificate_quota": 1,
      "dns_only": true,
      "foundation_dns": true,
      "page_rule_quota": 100,
      "phishing_detected": false,
      "step": 2
    },
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "name": "example.com",
    "name_servers": [
      "bob.ns.cloudflare.com",
      "lola.ns.cloudflare.com"
    ],
    "original_dnshost": "NameCheap",
    "original_name_servers": [
      "ns1.originaldnshost.com",
      "ns2.originaldnshost.com"
    ],
    "original_registrar": "GoDaddy",
    "owner": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Org",
      "type": "organization"
    },
    "plan": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "can_subscribe": false,
      "currency": "USD",
      "externally_managed": false,
      "frequency": "monthly",
      "is_subscribed": false,
      "legacy_discount": false,
      "legacy_id": "free",
      "name": "Example Org",
      "price": 10.99
    },
    "cname_suffix": "cdn.cloudflare.com",
    "paused": true,
    "permissions": [
      "#worker:read"
    ],
    "status": "active",
    "tenant": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "Example Account Name"
    },
    "tenant_unit": {
      "id": "023e105f4ecef8ad9ca31a8372d0c353"
    },
    "type": "full",
    "vanity_name_servers": [
      "ns1.example.com",
      "ns2.example.com"
    ],
    "verification_key": "284344499-1084221259"
  }
}
```