> 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

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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
