# 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>](https://docs.ionos.com/sections-test/guides/network-services/vpn-gateway/api-how-tos/..#endpoints) endpoint to delete IPSec Tunnel: `https://vpn.{region}.ionos.com/ipsecgateways/{gatewayid}/tunnels/{tunnelId}`.

## Request

**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'
```

{% 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 %}
