> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/network-services/nat-gateway/api-howtos/delete-nat-gateway-rule.md).

# Delete a NAT Gateway Rule

IONOS CLOUD NAT Gateway: delete a NAT gateway rule using the API

Permanently remove a specific rule from a NAT gateway using the `DELETE` request.

{% hint style="warning" %}
**Warning:**

* The operation is irreversible; you cannot undo the deletion once it begins.
* Deleting a NAT gateway rule immediately blocks all traffic relying on that rule. Configure alternative routing before you proceed with the deletion.
  {% endhint %}

## Endpoint

`https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}`

## Request

```bash
curl --location \
--request DELETE 'https://api.ionos.com/cloudapi/v6/datacenters/1e072e52-2255-492f-8a89-8e306d48634b/natgateways/6b1b2b2c-3c3d-4e4f-5f5f-6f6f7f7f8f8f/rules/9a9a9a9a-8b8b-7c7c-6d6d-5e5e4f4f3f3f' \
--header 'Authorization: Bearer $IONOS_TOKEN'
```

{% tabs %}
{% tab title="Request Header Parameters" %}
Include the following mandatory fields in the request header to authenticate your requests:

| **Header Parameters** | **Required** | **Type** | **Description**                                                             |
| --------------------- | ------------ | -------- | --------------------------------------------------------------------------- |
| `Authorization`       | yes          | string   | Use a Bearer token to authenticate requests through a JSON Web Token (JWT). |
| {% endtab %}          |              |          |                                                                             |
| {% endtabs %}         |              |          |                                                                             |

## Response

A **202 Accepted** response indicates that the NAT gateway rule is successfully deleted. The resource maintains a `DESTROYING` status until the deletion is complete. Once the process finishes, the rule is removed from the NAT gateway, and the gateway blocks all traffic matching the rule's criteria.

{% hint style="info" %}
**Note:** NAT gateway rule deletion is performed asynchronously. For core Cloud API endpoints, the response includes a `Location` header with a URL to poll the request status.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/network-services/nat-gateway/api-howtos/delete-nat-gateway-rule.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
