# Delete IPSec Tunnel

Deletes the specified IPSecTunnel.

To delete a IPSec Tunnel, perform a `DELETE` request with the `gatewayId` of the IPSecGateway and `tunnelId` of the IPSec Tunnel.

## Endpoint

Use a [<mark style="color:blue;">region-specific</mark>](/cloud/network-services/vpn-gateway/api-how-tos.md#endpoints) endpoint to delete IPSec Tunnel: `https://vpn.{region}.ionos.com/ipsecgateways/{gatewayid}/tunnels/{tunnelId}`.

## Request

{% hint style="info" %}
**Note:** The following request contains a sample `gatewayId` and `tunnelId`. Replace them with the `gatewayId` and `tunnelId` value, whose information you want to delete.

```bash
curl --location \
--request DELETE 'https://vpn.de-fra.ionos.com/ipsecgateways/66a114c7-2ddd-5119-9ddf-5a789f5a5a44/tunnels/c28b2d3e-7b15-53ca-ae88-6ae9378d6efe' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO'
```

{% endhint %}

{% tabs %}
{% tab title="Path Parameters" %}
You can update the `gatewayId` and `tunnelId` values to delete a specific IPSec Tunnel for a given gateway:

| Path Parameter | Type   | Description                        | Example                                |
| -------------- | ------ | ---------------------------------- | -------------------------------------- |
| **gatewayId**  | string | The ID (UUID) of the IPSecGateway. | `66a114c7-2ddd-5119-9ddf-5a789f5a5a44` |
| **tunnelId**   | string | The ID (UUID) of the IPSecTunnel.  | `c28b2d3e-7b15-53ca-ae88-6ae9378d6efe` |
| {% endtab %}   |        |                                    |                                        |

{% tab title="Request Header Parameters" %}
To make authenticated requests to the API, the following fields are mandatory in the request header:

| Header Parameter | Required | Type   | Description                                                                       |
| ---------------- | -------- | ------ | --------------------------------------------------------------------------------- |
| `Authorization`  | yes      | string | The Bearer token to enable requests to authenticate using a JSON Web Token (JWT). |
| {% endtab %}     |          |        |                                                                                   |
| {% endtabs %}    |          |        |                                                                                   |

## Response

**202 Successful operation**

{% hint style="success" %}
**Result:** The IPSec Tunnel with the specified `gatewayId` and `tunnelId` is successfully deleted.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.ionos.com/cloud/network-services/vpn-gateway/api-how-tos/delete-ipsec-tunnel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
