> 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/vpn-gateway/api-how-tos.md).

# API How-Tos

IONOS CLOUD VPN Gateway: API how-to guides for managing IPSec and WireGuard gateways programmatically

## API Privileges

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Set API Privileges</strong></mark></td><td>Learn how to set user privileges for VPN Gateway using the API.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/set-user-privileges-api.md">Set User Privileges via the API</a></td></tr></tbody></table>

## WireGuard Gateways

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Retrieve all WireGuard Gateways</strong></mark></td><td>Endpoint to retrieve all WireGuard VPN Gateways using pagination and optional filters.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-all-wireguard-gateways.md">Retrieve all Wireguard Gateways</a></td></tr><tr><td><mark style="color:blue;"><strong>Create WireGuard Gateway</strong></mark></td><td>Creates a new WireGuard VPN Gateway. The full configuration needs to be provided.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/create-wireguard-gateway.md">Create Wireguard Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Retrieve WireGuard Gateway</strong></mark></td><td>Retrieves details of a specific WireGuard VPN Gateway.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-wireguard-gateway.md">Retrieve Wireguard Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Update WireGuard Gateway</strong></mark></td><td>Ensures that a WireGuard VPN Gateway with the provided ID is created or modified.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/ensure-wireguard-gateway.md">Ensure Wireguard Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Delete WireGuard Gateway</strong></mark></td><td>Deletes the specified WireGuard Gateway.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/delete-wireguard-gateway.md">Delete Wireguard Gateway</a></td></tr></tbody></table>

## WireGuard Peers

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Retrieve all WireGuard Peers</strong></mark></td><td>Endpoint to retrieve all WireGuard Peers associated with a VPN Gateway using pagination and optional filters.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-all-wireguard-peers.md">Retrieve all Wireguard Peers</a></td></tr><tr><td><mark style="color:blue;"><strong>Create WireGuard Peer</strong></mark></td><td>Creates a new WireGuard Peer. The full configuration needs to be provided.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/create-wireguard-peer.md">Create Wireguard Peer</a></td></tr><tr><td><mark style="color:blue;"><strong>Retrieve WireGuard Peer</strong></mark></td><td>Retrieves details of a specific WireGuard Peer.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-wireguard-peer.md">Retrieve Wireguard Peer</a></td></tr><tr><td><mark style="color:blue;"><strong>Update WireGuard Peer</strong></mark></td><td>Ensures that a WireGuard Peer with the provided ID is created or modified.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/ensure-wireguard-peer.md">Ensure Wireguard Peer</a></td></tr><tr><td><mark style="color:blue;"><strong>Delete WireGuard Peer</strong></mark></td><td>Deletes the specified WireGuard Peer.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/delete-wireguard-peer.md">Delete Wireguard Peer</a></td></tr></tbody></table>

## IPSec Gateways

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Retrieve all IPSec Gateways</strong></mark></td><td>Endpoint to retrieve all IPSec VPN Gateways using pagination and optional filters.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-all-ipsec-gateways.md">Retrieve all IPSec Gateways</a></td></tr><tr><td><mark style="color:blue;"><strong>Create IPSec Gateway</strong></mark></td><td>Creates a new IPSec VPN Gateway. The full configuration needs to be provided.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/create-ipsec-gateways.md">Create IPSec Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Retrieve IPSec Gateway</strong></mark></td><td>Retrieves details of a specific IPSec VPN Gateway.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-ipsec-gateway.md">Retrieve IPSec Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Update IPSec Gateway</strong></mark></td><td>Ensures that an IPSec VPN Gateway with the provided ID is created or modified.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/ensure-ipsec-gateways.md">Ensure IPSec Gateway</a></td></tr><tr><td><mark style="color:blue;"><strong>Delete IPSec Gateway</strong></mark></td><td>Deletes the specified IPSec Gateway.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/delete-ipsec-gateways.md">Delete IPSec Gateway</a></td></tr></tbody></table>

## IPSec Tunnels

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Retrieve all IPSec Tunnels</strong></mark></td><td>Endpoint to retrieve all IPSec VPN Tunnels associated with an IPSec VPN Gateway using pagination and optional filters.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-all-ipsec-tunnels.md">Retrieve all IPSec Tunnels</a></td></tr><tr><td><mark style="color:blue;"><strong>Create IPSec Tunnel</strong></mark></td><td>Creates a new IPSec VPN Tunnel associated with an IPSec VPN Gateway. The full configuration needs to be provided.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/create-ipsec-tunnel.md">Create IPSec Tunnel</a></td></tr><tr><td><mark style="color:blue;"><strong>Retrieve IPSec Tunnel</strong></mark></td><td>Retrieves details of a specific IPSec VPN Tunnel.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/retrieve-ipsec-tunnel.md">Retrieve IPSec Tunnel</a></td></tr><tr><td><mark style="color:blue;"><strong>Update IPSec Tunnel</strong></mark></td><td>Ensures that an IPSec VPN Tunnel with the provided ID is created or modified.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/ensure-ipsec-tunnel.md">Ensure IPSec Tunnel</a></td></tr><tr><td><mark style="color:blue;"><strong>Delete IPSec Tunnel</strong></mark></td><td>Deletes the specified IPSec Tunnel.</td><td><a href="/cloud/network-services/vpn-gateway/api-how-tos/delete-ipsec-tunnel.md">Delete IPSec Tunnel</a></td></tr></tbody></table>

## Endpoints

A regional endpoint is necessary to interact with the VPN Gateway REST API endpoints. For more information, see the [<mark style="color:blue;">API specification file</mark>](https://docs.ionos.com/cloud/api-reference/network-services/vpn-gateway).

{% hint style="info" %}
**Note:** To prevent any failed requests, make sure to use the regional endpoint that corresponds to the location of the VDC where your VPN Gateway has been established.
{% endhint %}

<code class="expression">space.vars.ionos\_cloud</code> supports the following endpoints for various locations:

* Berlin, Germany: `https://vpn.de-txl.ionos.com`
* Frankfurt, Germany: `https://vpn.de-fra.ionos.com`
* Logroño, Spain: `https://vpn.es-vit.ionos.com`
* London, Great Britain: `https://vpn.gb-lhr.ionos.com`
* Newark, United States: `https://vpn.us-ewr.ionos.com`
* Las Vegas, United States: `https://vpn.us-las.ionos.com`
* Lenexa, United States: `https://vpn.us-mci.ionos.com`
* Paris, France: `https://vpn.fr-par.ionos.com`


---

# 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/vpn-gateway/api-how-tos.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.
