# Public Cloud › Network › Site-to-Site VPN › IKE policies API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/

OpenAPI v1: https://api.eu.ovhcloud.com/v1/__schemas/developer-hub-navigation/public-cloud/network/site-to-site-vpn/ike-policies.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/network/site-to-site-vpn/ike-policies.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/vpn/ikePolicy` — List IKE policies
- `GET /publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}` — Get an IKE policy
- `POST /publicCloud/project/{projectId}/vpn/ikePolicy` — Create an IKE policy
- `DELETE /publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}` — Delete an IKE policy
- `PUT /publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}` — Update an IKE policy

## List IKE policies

`GET /v2/publicCloud/project/{projectId}/vpn/ikePolicy`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/#getAllVpnIkePolicies

**Status:** Alpha version  
**IAM actions:** `publicCloudProject:apiovh:vpn/ikePolicy/get`

Returns the IKE policies of the project, in every region.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.vpn.IkePolicy[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the current target specification. Send it back in the update payload to detect concurrent changes. |
| `createdAt` | string (date-time) | read-only | Date and time the IKE policy was created |
| `currentState` | publicCloud.vpn.IkePolicyCurrentState | read-only | Observed state of the IKE policy. Null while the IKE policy is being created. |
| `currentState.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | read-only | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `currentState.description` | string | read-only | Free-form description of the IKE policy. Null when none was given. |
| `currentState.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | read-only | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `currentState.lifetime` | integer | read-only | Lifetime of the IKE security association in seconds |
| `currentState.location` | publicCloud.vpn.Location | read-only | Region of the IKE policy |
| `currentState.location.region` | string | yes | Region code, such as GRA11 |
| `currentState.name` | string | read-only | Name of the IKE policy |
| `currentState.pfs` | publicCloud.vpn.PfsGroupEnum | read-only | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the IKE policy |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the IKE policy |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness of the IKE policy: whether its observed state has converged to its target specification — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | read-only | Last target specification requested for the IKE policy |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `updatedAt` | string (date-time) | read-only | Date and time the IKE policy was last updated |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "authAlgorithm": "SHA256",
      "description": "string",
      "encryptionAlgorithm": "AES_128",
      "lifetime": 0,
      "location": {
        "region": "string"
      },
      "name": "string",
      "pfs": "GROUP14"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "authAlgorithm": "SHA256",
      "description": "string",
      "encryptionAlgorithm": "AES_128",
      "lifetime": 0,
      "location": {
        "region": "string"
      },
      "name": "string",
      "pfs": "GROUP14"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/ikePolicy" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/vpn/ikePolicy")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/vpn/ikePolicy");

print_r($result);
?>
```

## Get an IKE policy

`GET /v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/#getVpnIkePolicy

**Status:** Alpha version  
**IAM actions:** `publicCloudProject:apiovh:vpn/ikePolicy/get`

Returns the IKE policy and its observed state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ikePolicyId` | path | string (uuid) | yes | Ike policy ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.vpn.IkePolicy | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the current target specification. Send it back in the update payload to detect concurrent changes. |
| `createdAt` | string (date-time) | read-only | Date and time the IKE policy was created |
| `currentState` | publicCloud.vpn.IkePolicyCurrentState | read-only | Observed state of the IKE policy. Null while the IKE policy is being created. |
| `currentState.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | read-only | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `currentState.description` | string | read-only | Free-form description of the IKE policy. Null when none was given. |
| `currentState.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | read-only | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `currentState.lifetime` | integer | read-only | Lifetime of the IKE security association in seconds |
| `currentState.location` | publicCloud.vpn.Location | read-only | Region of the IKE policy |
| `currentState.location.region` | string | yes | Region code, such as GRA11 |
| `currentState.name` | string | read-only | Name of the IKE policy |
| `currentState.pfs` | publicCloud.vpn.PfsGroupEnum | read-only | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the IKE policy |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the IKE policy |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness of the IKE policy: whether its observed state has converged to its target specification — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | read-only | Last target specification requested for the IKE policy |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `updatedAt` | string (date-time) | read-only | Date and time the IKE policy was last updated |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}");

print_r($result);
?>
```

## Create an IKE policy

`POST /v2/publicCloud/project/{projectId}/vpn/ikePolicy`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/#createVpnIkePolicy

**Status:** Alpha version  
**IAM actions:** `publicCloudProject:apiovh:vpn/ikePolicy/create`

Creates an IKE policy: a set of IKE (phase 1) algorithms used by the IPsec tunnels that reference it in their targetSpec.ike. Several IPsec tunnels can share one policy, provided their VPN gateways are in the region of the policy. The policy negotiates IKEv2. Creation applies immediately: the response already holds the result.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.vpn.IkePolicyCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | yes | Desired specification of the IKE policy to create |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |

```json
{
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.vpn.IkePolicy | successful operation |
| 400 | object | Error 400 response |
| 403 | object | Error 403 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the current target specification. Send it back in the update payload to detect concurrent changes. |
| `createdAt` | string (date-time) | read-only | Date and time the IKE policy was created |
| `currentState` | publicCloud.vpn.IkePolicyCurrentState | read-only | Observed state of the IKE policy. Null while the IKE policy is being created. |
| `currentState.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | read-only | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `currentState.description` | string | read-only | Free-form description of the IKE policy. Null when none was given. |
| `currentState.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | read-only | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `currentState.lifetime` | integer | read-only | Lifetime of the IKE security association in seconds |
| `currentState.location` | publicCloud.vpn.Location | read-only | Region of the IKE policy |
| `currentState.location.region` | string | yes | Region code, such as GRA11 |
| `currentState.name` | string | read-only | Name of the IKE policy |
| `currentState.pfs` | publicCloud.vpn.PfsGroupEnum | read-only | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the IKE policy |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the IKE policy |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness of the IKE policy: whether its observed state has converged to its target specification — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | read-only | Last target specification requested for the IKE policy |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `updatedAt` | string (date-time) | read-only | Date and time the IKE policy was last updated |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/ikePolicy" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.vpn.IkePolicyCreation
result = client.post("/v2/publicCloud/project/{projectId}/vpn/ikePolicy",
	targetSpec = None, # Desired specification of the IKE policy to create (type: publicCloud.vpn.IkePolicyTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.vpn.IkePolicyCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/vpn/ikePolicy", array(
	targetSpec => null, // Desired specification of the IKE policy to create (type: publicCloud.vpn.IkePolicyTargetSpec)
));

print_r($result);
?>
```

## Delete an IKE policy

`DELETE /v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/#deleteVpnIkePolicy

**Status:** Alpha version  
**IAM actions:** `publicCloudProject:apiovh:vpn/ikePolicy/delete`

Deletes the IKE policy. It is refused while an IPsec tunnel uses it. Deletion applies immediately: the response already holds the result.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ikePolicyId` | path | string (uuid) | yes | Ike policy ID |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.vpn.IkePolicy | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the current target specification. Send it back in the update payload to detect concurrent changes. |
| `createdAt` | string (date-time) | read-only | Date and time the IKE policy was created |
| `currentState` | publicCloud.vpn.IkePolicyCurrentState | read-only | Observed state of the IKE policy. Null while the IKE policy is being created. |
| `currentState.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | read-only | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `currentState.description` | string | read-only | Free-form description of the IKE policy. Null when none was given. |
| `currentState.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | read-only | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `currentState.lifetime` | integer | read-only | Lifetime of the IKE security association in seconds |
| `currentState.location` | publicCloud.vpn.Location | read-only | Region of the IKE policy |
| `currentState.location.region` | string | yes | Region code, such as GRA11 |
| `currentState.name` | string | read-only | Name of the IKE policy |
| `currentState.pfs` | publicCloud.vpn.PfsGroupEnum | read-only | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the IKE policy |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the IKE policy |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness of the IKE policy: whether its observed state has converged to its target specification — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | read-only | Last target specification requested for the IKE policy |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `updatedAt` | string (date-time) | read-only | Date and time the IKE policy was last updated |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}");

print_r($result);
?>
```

## Update an IKE policy

`PUT /v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/site-to-site-vpn/ike-policies/#editVpnIkePolicy

**Status:** Alpha version  
**IAM actions:** `publicCloudProject:apiovh:vpn/ikePolicy/edit`

The target specification replaces the previous one as a whole: every algorithm and the lifetime must be sent, and a description left null is removed. Send the checksum of the last GET to reject the update with a checksum mismatch when someone changed the resource in between. Changing the algorithms does not renegotiate the IPsec tunnels already using the policy: each one takes them the next time it is configured, for example on its next update. The update applies immediately: the response already holds the result.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ikePolicyId` | path | string (uuid) | yes | Ike policy ID |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.vpn.IkePolicyUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.vpn.IkePolicyUpdateTargetSpec | yes | Desired specification of the IKE policy. It replaces the previous one as a whole. |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | yes | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | yes | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer | yes | Lifetime of the IKE security association in seconds. At least 60. |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum | yes | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |

```json
{
  "checksum": "string",
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "name": "string",
    "pfs": "GROUP14"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.vpn.IkePolicy | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the current target specification. Send it back in the update payload to detect concurrent changes. |
| `createdAt` | string (date-time) | read-only | Date and time the IKE policy was created |
| `currentState` | publicCloud.vpn.IkePolicyCurrentState | read-only | Observed state of the IKE policy. Null while the IKE policy is being created. |
| `currentState.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum | read-only | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. — one of `SHA256`, `SHA384`, `SHA512` |
| `currentState.description` | string | read-only | Free-form description of the IKE policy. Null when none was given. |
| `currentState.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum | read-only | Encryption algorithm — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `currentState.lifetime` | integer | read-only | Lifetime of the IKE security association in seconds |
| `currentState.location` | publicCloud.vpn.Location | read-only | Region of the IKE policy |
| `currentState.location.region` | string | yes | Region code, such as GRA11 |
| `currentState.name` | string | read-only | Name of the IKE policy |
| `currentState.pfs` | publicCloud.vpn.PfsGroupEnum | read-only | Diffie-Hellman group of the key exchange — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the IKE policy |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the IKE policy |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness of the IKE policy: whether its observed state has converged to its target specification — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.vpn.IkePolicyTargetSpec | read-only | Last target specification requested for the IKE policy |
| `targetSpec.authAlgorithm` | publicCloud.vpn.AuthAlgorithmEnum |  | Integrity algorithm of the IKE negotiation. With an AES_*_GCM encryptionAlgorithm, it is used only as the pseudorandom function. Defaults to SHA256 when null. — one of `SHA256`, `SHA384`, `SHA512` |
| `targetSpec.description` | string |  | Free-form description of the IKE policy. At most 255 characters. |
| `targetSpec.encryptionAlgorithm` | publicCloud.vpn.EncryptionAlgorithmEnum |  | Encryption algorithm. Defaults to AES_256 when null. — one of `AES_128`, `AES_128_GCM`, `AES_192`, `AES_256`, `AES_256_GCM` |
| `targetSpec.lifetime` | integer |  | Lifetime of the IKE security association in seconds. Defaults to 10800 (3 hours) when null. At least 60. |
| `targetSpec.location` | publicCloud.vpn.Location | yes | Region of the IKE policy: only the IPsec tunnels of the VPN gateways of this region can use it. Immutable after creation. |
| `targetSpec.location.region` | string | yes | Region code, such as GRA11 |
| `targetSpec.name` | string | yes | Name of the IKE policy. At most 255 characters. |
| `targetSpec.pfs` | publicCloud.vpn.PfsGroupEnum |  | Diffie-Hellman group of the key exchange. Defaults to GROUP14 when null. — one of `GROUP14`, `GROUP15`, `GROUP16`, `GROUP19`, `GROUP20`, `GROUP21`, `GROUP31` |
| `updatedAt` | string (date-time) | read-only | Date and time the IKE policy was last updated |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "authAlgorithm": "SHA256",
    "description": "string",
    "encryptionAlgorithm": "AES_128",
    "lifetime": 0,
    "location": {
      "region": "string"
    },
    "name": "string",
    "pfs": "GROUP14"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.vpn.IkePolicyUpdate
result = client.put("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired specification of the IKE policy. It replaces the previous one as a whole. (type: publicCloud.vpn.IkePolicyUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.vpn.IkePolicyUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/vpn/ikePolicy/{ikePolicyId}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired specification of the IKE policy. It replaces the previous one as a whole. (type: publicCloud.vpn.IkePolicyUpdateTargetSpec)
));

print_r($result);
?>
```
