---
title: Delete zone environment
---

[Skip to content](#_top)

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

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

[Environments](https://developers.cloudflare.com/api/typescript/resources/zones/subresources/environments)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Delete zone environment

client.zones.environments.delete(stringenvironmentID, EnvironmentDeleteParams {zone\_id } params, RequestOptionsoptions?): [EnvironmentDeleteResponse](<https://developers.cloudflare.com/api/typescript/resources/zones#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)>) {environments }

DELETE/zones/{zone\_id}/environments/{environment\_id}

Deletes a zone environment by reference identifier.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

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

`Zone Versioning Write`

##### ParametersExpand Collapse

environmentID: string

[Link to this property](<#(resource)%20zones.environments%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20environment_id%20%3E%20(schema)>)

<details>

<summary>

params: EnvironmentDeleteParams {zone\_id }

</summary>

zone\_id: string

Identifier of the zone.

<a href="#(resource)%20zones.environments%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zones.environments%20%3E%20(method)%20delete%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

EnvironmentDeleteResponse {environments }

</summary>

<details>

<summary>

environments: Array&lt;Environment&gt;

</summary>

expression: string

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20expression">Link to this property</a>

locked\_on\_deployment: boolean| null

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20locked_on_deployment">Link to this property</a>

name: string

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

position: <a href="https://developers.cloudflare.com/api/typescript/resources/rules#(resource)%20rules.lists.items%20%3E%20(model)%20list_cursor%20%3E%20(schema)">ListCursor</a> {after, before }

</summary>

after?: string

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20position%20%2B%20(resource)%20rules.lists.items%20%3E%20(model)%20list_cursor%20%3E%20(schema)%20%3E%20(property)%20after">Link to this property</a>

before?: string

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20position%20%2B%20(resource)%20rules.lists.items%20%3E%20(model)%20list_cursor%20%3E%20(schema)%20%3E%20(property)%20before">Link to this property</a>

</details>

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20position">Link to this property</a>

ref: string

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20ref">Link to this property</a>

version: number| null

formatint64

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20version">Link to this property</a>

http\_application\_id?: string| null

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments%20%3E%20(items)%20%3E%20(property)%20http_application_id">Link to this property</a>

</details>

<a href="#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)%20%3E%20(property)%20environments">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zones.environments%20%3E%20(model)%20environment_delete_response%20%3E%20(schema)>)

### Delete zone environment

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

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

const environment = await client.zones.environments.delete('environment_id', {
  zone_id: 'zone_id',
});

console.log(environment.environments);
```

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"
      }
    }
  ],
  "result": {
    "environments": [
      {
        "expression": "expression",
        "locked_on_deployment": true,
        "name": "name",
        "position": {
          "after": "yyy",
          "before": "xxx"
        },
        "ref": "ref",
        "version": 0,
        "http_application_id": "http_application_id"
      }
    ]
  },
  "success": true
}
```

##### 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"
      }
    }
  ],
  "result": {
    "environments": [
      {
        "expression": "expression",
        "locked_on_deployment": true,
        "name": "name",
        "position": {
          "after": "yyy",
          "before": "xxx"
        },
        "ref": "ref",
        "version": 0,
        "http_application_id": "http_application_id"
      }
    ]
  },
  "success": true
}
```