## Edit Zone `zones.edit(ZoneEditParams**kwargs) -> Zone` **patch** `/zones/{zone_id}` Edits a zone. Only one zone property can be changed at a time. ### Parameters - `zone_id: str` Identifier - `paused: Optional[bool]` Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits. - `type: Optional[Literal["full", "partial", "secondary", "internal"]]` A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. This parameter is only available to Enterprise customers or if it has been explicitly enabled on a zone. - `"full"` - `"partial"` - `"secondary"` - `"internal"` - `vanity_name_servers: Optional[SequenceNotStr[str]]` An array of domains used for custom name servers. This is only available for Business and Enterprise plans. ### Returns - `class Zone: …` - `id: str` Identifier - `account: Account` The account the zone belongs to. - `id: Optional[str]` Identifier - `name: Optional[str]` The name of the account. - `activated_on: Optional[datetime]` The last time proof of ownership was detected and the zone was made active. - `created_on: datetime` When the zone was created. - `development_mode: float` 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` Metadata about the zone. - `cdn_only: Optional[bool]` The zone is only configured for CDN. - `custom_certificate_quota: Optional[int]` Number of Custom Certificates the zone can have. - `dns_only: Optional[bool]` The zone is only configured for DNS. - `foundation_dns: Optional[bool]` The zone is setup with Foundation DNS. - `page_rule_quota: Optional[int]` Number of Page Rules a zone can have. - `phishing_detected: Optional[bool]` The zone has been flagged for phishing. - `step: Optional[int]` - `modified_on: datetime` When the zone was last modified. - `name: str` 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. - `name_servers: List[str]` The name servers Cloudflare assigns to a zone. - `original_dnshost: Optional[str]` DNS host at the time of switching to Cloudflare. - `original_name_servers: Optional[List[str]]` Original name servers before moving to Cloudflare. - `original_registrar: Optional[str]` Registrar for the domain at the time of switching to Cloudflare. - `owner: Owner` The owner of the zone. - `id: Optional[str]` Identifier - `name: Optional[str]` Name of the owner. - `type: Optional[str]` The type of owner. - `plan: Plan` A Zones subscription information. - `id: Optional[str]` Identifier - `can_subscribe: Optional[bool]` States if the subscription can be activated. - `currency: Optional[str]` The denomination of the customer. - `externally_managed: Optional[bool]` If this Zone is managed by another company. - `frequency: Optional[str]` How often the customer is billed. - `is_subscribed: Optional[bool]` States if the subscription active. - `legacy_discount: Optional[bool]` If the legacy discount applies to this Zone. - `legacy_id: Optional[str]` The legacy name of the plan. - `name: Optional[str]` Name of the owner. - `price: Optional[float]` How much the customer is paying. - `cname_suffix: Optional[str]` Allows the customer to use a custom apex. *Tenants Only Configuration*. - `paused: Optional[bool]` Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits. - `permissions: Optional[List[str]]` Legacy permissions based on legacy user membership information. - `status: Optional[Literal["initializing", "pending", "active", "moved"]]` The zone status on Cloudflare. - `"initializing"` - `"pending"` - `"active"` - `"moved"` - `tenant: Optional[Tenant]` The root organizational unit that this zone belongs to (such as a tenant or organization). - `id: Optional[str]` Identifier - `name: Optional[str]` The name of the Tenant account. - `tenant_unit: Optional[TenantUnit]` The immediate parent organizational unit that this zone belongs to (such as under a tenant or sub-organization). - `id: Optional[str]` Identifier - `type: Optional[Type]` A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. - `"full"` - `"partial"` - `"secondary"` - `"internal"` - `vanity_name_servers: Optional[List[str]]` An array of domains used for custom name servers. This is only available for Business and Enterprise plans. - `verification_key: Optional[str]` Verification key for partial zone setup. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) zone = client.zones.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(zone.id) ``` #### Response ```json { "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" } } ```