# Manage & Operate › Key and Secret Manager › Secrets API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 11 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/manage-operate/key-and-secret-manager/secrets/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/key-and-secret-manager/secrets.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/key-and-secret-manager/secrets.json?format=openapi3

## Operations

- `GET /okms/resource/{okmsId}/secret` — List secrets
- `POST /okms/resource/{okmsId}/secret` — Create a secret
- `GET /okms/resource/{okmsId}/secret/{path}` — Get a secret
- `PUT /okms/resource/{okmsId}/secret/{path}` — Update a secret
- `DELETE /okms/resource/{okmsId}/secret/{path}` — Delete a secret
- `GET /okms/resource/{okmsId}/secret/{path}/version` — List secret versions
- `POST /okms/resource/{okmsId}/secret/{path}/version` — Create a secret version
- `GET /okms/resource/{okmsId}/secret/{path}/version/{version}` — Get a secret version
- `PUT /okms/resource/{okmsId}/secret/{path}/version/{version}` — Update the state of a secret version
- `GET /okms/resource/{okmsId}/secretConfig` — Get the secret configuration
- `PUT /okms/resource/{okmsId}/secretConfig` — Update the secret configuration

## List secrets

`GET /v2/okms/resource/{okmsId}/secret`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#get-okms-resource-okmsid-secret

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/get`

Lists secret paths with metadata (versions, CAS settings). The content of secret versions is not accessible through this API.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `iamTags` | query | object |  | Filter resources on IAM tags |
| `okmsId` | path | string (uuid) | yes | Okms ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.GetResponseWithIAM[] | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `metadata` | okms.secret.Metadata | read-only | Secret metadata |
| `metadata.casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.createdAt` | string (date-time) | read-only | Time of creation of the secret |
| `metadata.currentVersion` | integer | read-only | The secret version |
| `metadata.customMetadata` | object | read-only | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer | read-only | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `metadata.oldestVersion` | integer | read-only | The secret oldest version |
| `metadata.updatedAt` | string (date-time) | read-only | Time of the last update of the secret |
| `path` | string | read-only | Unique identifier of the secret |
| `version` | okms.secret.Version | read-only | Data of the secret version |
| `version.createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `version.data` | any | read-only | Secret version data |
| `version.deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `version.id` | integer | read-only | Secret version |
| `version.state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
[
  {
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
        "key": "string"
      },
      "urn": "string"
    },
    "metadata": {
      "casRequired": true,
      "createdAt": "2024-01-01T12:00:00Z",
      "currentVersion": 0,
      "customMetadata": {
        "key": "string"
      },
      "deactivateVersionAfter": "string",
      "maxVersions": 0,
      "oldestVersion": 0,
      "updatedAt": "2024-01-01T12:00:00Z"
    },
    "path": "string",
    "version": {
      "createdAt": "2024-01-01T12:00:00Z",
      "data": "This is a content of any type !",
      "deactivatedAt": "2024-01-01T12:00:00Z",
      "id": 0,
      "state": "ACTIVE"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secret")

# 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/okms/resource/{okmsId}/secret");

print_r($result);
?>
```

## Create a secret

`POST /v2/okms/resource/{okmsId}/secret`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#post-okms-resource-okmsid-secret

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/create`

Creates a secret at the given path and stores the first version.
Path and engine defaults (CAS, max versions) apply from the service secret config unless overridden in the body.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `okmsId` | path | string (uuid) | yes | Okms ID |

### Request body (required)

Type: `okms.secret.Creation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata` | okms.secret.MetadataRequest |  | Secret metadata |
| `metadata.casRequired` | boolean |  | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.customMetadata` | object |  | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string |  | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer |  | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `path` | string | yes | Secret path |
| `version` | okms.secret.version.Creation | yes | Data of the secret version |
| `version.data` | any | yes | Secret version data in key value json format |

```json
{
  "metadata": {
    "casRequired": true,
    "customMetadata": {
      "key": "string"
    },
    "deactivateVersionAfter": "string",
    "maxVersions": 0
  },
  "path": "string",
  "version": {
    "data": "This is a content of any type !"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.PostResponse | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata` | okms.secret.Metadata | read-only | Secret metadata |
| `metadata.casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.createdAt` | string (date-time) | read-only | Time of creation of the secret |
| `metadata.currentVersion` | integer | read-only | The secret version |
| `metadata.customMetadata` | object | read-only | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer | read-only | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `metadata.oldestVersion` | integer | read-only | The secret oldest version |
| `metadata.updatedAt` | string (date-time) | read-only | Time of the last update of the secret |
| `path` | string | read-only | Secret identifier |

```json
{
  "metadata": {
    "casRequired": true,
    "createdAt": "2024-01-01T12:00:00Z",
    "currentVersion": 0,
    "customMetadata": {
      "key": "string"
    },
    "deactivateVersionAfter": "string",
    "maxVersions": 0,
    "oldestVersion": 0,
    "updatedAt": "2024-01-01T12:00:00Z"
  },
  "path": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret" \
  -H "accept: application/json" \
  -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: okms.secret.Creation
result = client.post("/v2/okms/resource/{okmsId}/secret",
	metadata = None, # Secret metadata (type: okms.secret.MetadataRequest, nullable)
	path = None, # Secret path (type: string)
	version = None, # Data of the secret version (type: okms.secret.version.Creation)
)

# 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: okms.secret.Creation
$result = $ovh->post("/v2/okms/resource/{okmsId}/secret", array(
	metadata => null, // Secret metadata (type: okms.secret.MetadataRequest, nullable)
	path => null, // Secret path (type: string)
	version => null, // Data of the secret version (type: okms.secret.version.Creation)
));

print_r($result);
?>
```

## Get a secret

`GET /v2/okms/resource/{okmsId}/secret/{path}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#get-okms-resource-okmsid-secret-path

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/get`, `okms:apiovh:secret/version/getData`

Returns a secret's metadata. By default the latest version is selected. Pass `version` to target another one.

Set `includeData=true` to also return that version's data (requires the matching IAM action).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `includeData` | query | boolean |  | Secret data |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |
| `version` | query | integer |  | Secret version. When omitted, the latest version will be returned. |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.GetResponseWithIAM | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `metadata` | okms.secret.Metadata | read-only | Secret metadata |
| `metadata.casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.createdAt` | string (date-time) | read-only | Time of creation of the secret |
| `metadata.currentVersion` | integer | read-only | The secret version |
| `metadata.customMetadata` | object | read-only | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer | read-only | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `metadata.oldestVersion` | integer | read-only | The secret oldest version |
| `metadata.updatedAt` | string (date-time) | read-only | Time of the last update of the secret |
| `path` | string | read-only | Unique identifier of the secret |
| `version` | okms.secret.Version | read-only | Data of the secret version |
| `version.createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `version.data` | any | read-only | Secret version data |
| `version.deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `version.id` | integer | read-only | Secret version |
| `version.state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
{
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "metadata": {
    "casRequired": true,
    "createdAt": "2024-01-01T12:00:00Z",
    "currentVersion": 0,
    "customMetadata": {
      "key": "string"
    },
    "deactivateVersionAfter": "string",
    "maxVersions": 0,
    "oldestVersion": 0,
    "updatedAt": "2024-01-01T12:00:00Z"
  },
  "path": "string",
  "version": {
    "createdAt": "2024-01-01T12:00:00Z",
    "data": "This is a content of any type !",
    "deactivatedAt": "2024-01-01T12:00:00Z",
    "id": 0,
    "state": "ACTIVE"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secret/{path}")

# 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/okms/resource/{okmsId}/secret/{path}");

print_r($result);
?>
```

## Update a secret

`PUT /v2/okms/resource/{okmsId}/secret/{path}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#put-okms-resource-okmsid-secret-path

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/edit`, `okms:apiovh:secret/version/create`, `okms:apiovh:secret/updateMetadata`

Updates the secret: include `version.data` to add a new version, and/or `metadata` to change this secret's engine settings.
When `cas` is set, it must equal the current version for the write to succeed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `cas` | query | integer |  | Current secret version number. When the `cas` (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,`cas` must be set to the current version of the secret. |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |

### Request body (required)

Type: `okms.secret.UpdateRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata` | okms.secret.MetadataRequest |  | Secret metadata |
| `metadata.casRequired` | boolean |  | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.customMetadata` | object |  | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string |  | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer |  | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `version` | okms.secret.version.Creation |  | Secret version |
| `version.data` | any | yes | Secret version data in key value json format |

```json
{
  "metadata": {
    "casRequired": true,
    "customMetadata": {
      "key": "string"
    },
    "deactivateVersionAfter": "string",
    "maxVersions": 0
  },
  "version": {
    "data": "This is a content of any type !"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.PostResponse | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata` | okms.secret.Metadata | read-only | Secret metadata |
| `metadata.casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update. If set to false, OKMS domain configuration is applied. |
| `metadata.createdAt` | string (date-time) | read-only | Time of creation of the secret |
| `metadata.currentVersion` | integer | read-only | The secret version |
| `metadata.customMetadata` | object | read-only | Your own name-value pairs stored alongside the secret to describe or classify it. They are held separately from the secret value. |
| `metadata.deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, OKMS domain configuration is applied. |
| `metadata.maxVersions` | integer | read-only | The number of versions to keep. If 0, OKMS domain configuration is applied. |
| `metadata.oldestVersion` | integer | read-only | The secret oldest version |
| `metadata.updatedAt` | string (date-time) | read-only | Time of the last update of the secret |
| `path` | string | read-only | Secret identifier |

```json
{
  "metadata": {
    "casRequired": true,
    "createdAt": "2024-01-01T12:00:00Z",
    "currentVersion": 0,
    "customMetadata": {
      "key": "string"
    },
    "deactivateVersionAfter": "string",
    "maxVersions": 0,
    "oldestVersion": 0,
    "updatedAt": "2024-01-01T12:00:00Z"
  },
  "path": "string"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}" \
  -H "accept: application/json" \
  -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: okms.secret.UpdateRequest
result = client.put("/v2/okms/resource/{okmsId}/secret/{path}",
	metadata = None, # Secret metadata (type: okms.secret.MetadataRequest, nullable)
	version = None, # Secret version (type: okms.secret.version.Creation, nullable)
)

# 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: okms.secret.UpdateRequest
$result = $ovh->put("/v2/okms/resource/{okmsId}/secret/{path}", array(
	metadata => null, // Secret metadata (type: okms.secret.MetadataRequest, nullable)
	version => null, // Secret version (type: okms.secret.version.Creation, nullable)
));

print_r($result);
?>
```

## Delete a secret

`DELETE /v2/okms/resource/{okmsId}/secret/{path}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#delete-okms-resource-okmsid-secret-path

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/delete`

Deletes the secret and all its versions.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secret/{path}")

# 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/okms/resource/{okmsId}/secret/{path}");

print_r($result);
?>
```

## List secret versions

`GET /v2/okms/resource/{okmsId}/secret/{path}/version`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#get-okms-resource-okmsid-secret-path-version

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/get`

Lists version numbers and states for the secret. Version data is not returned by this API.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.Version[] | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `data` | any | read-only | Secret version data |
| `deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `id` | integer | read-only | Secret version |
| `state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "data": "This is a content of any type !",
    "deactivatedAt": "2024-01-01T12:00:00Z",
    "id": 0,
    "state": "ACTIVE"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}/version" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secret/{path}/version")

# 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/okms/resource/{okmsId}/secret/{path}/version");

print_r($result);
?>
```

## Create a secret version

`POST /v2/okms/resource/{okmsId}/secret/{path}/version`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#post-okms-resource-okmsid-secret-path-version

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/version/create`

Appends a new version of the secret data. Optional `cas` must match the current version or the write is rejected.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `cas` | query | integer |  | Current secret version number. When the `cas` (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,`cas` must be set to the current version of the secret. |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |

### Request body (required)

Type: `okms.secret.version.Creation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | any | yes | Secret version data in key value json format |

```json
{
  "data": "This is a content of any type !"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.Version | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `data` | any | read-only | Secret version data |
| `deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `id` | integer | read-only | Secret version |
| `state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "data": "This is a content of any type !",
  "deactivatedAt": "2024-01-01T12:00:00Z",
  "id": 0,
  "state": "ACTIVE"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}/version" \
  -H "accept: application/json" \
  -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: okms.secret.version.Creation
result = client.post("/v2/okms/resource/{okmsId}/secret/{path}/version",
	data = None, # Secret version data in key value json format (type: any)
)

# 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: okms.secret.version.Creation
$result = $ovh->post("/v2/okms/resource/{okmsId}/secret/{path}/version", array(
	data => null, // Secret version data in key value json format (type: any)
));

print_r($result);
?>
```

## Get a secret version

`GET /v2/okms/resource/{okmsId}/secret/{path}/version/{version}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#get-okms-resource-okmsid-secret-path-version-version

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/get`, `okms:apiovh:secret/version/getData`

Returns one version's metadata. Set `includeData=true` to also return the version data.

Reading the data requires a specific IAM right.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `includeData` | query | boolean |  | Secret version data |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |
| `version` | path | integer | yes | Version |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.Version | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `data` | any | read-only | Secret version data |
| `deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `id` | integer | read-only | Secret version |
| `state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "data": "This is a content of any type !",
  "deactivatedAt": "2024-01-01T12:00:00Z",
  "id": 0,
  "state": "ACTIVE"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}/version/{version}" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secret/{path}/version/{version}")

# 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/okms/resource/{okmsId}/secret/{path}/version/{version}");

print_r($result);
?>
```

## Update the state of a secret version

`PUT /v2/okms/resource/{okmsId}/secret/{path}/version/{version}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#put-okms-resource-okmsid-secret-path-version-version

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secret/version/edit`, `okms:apiovh:secret/version/delete`, `okms:apiovh:secret/version/activate`, `okms:apiovh:secret/version/deactivate`

Changes the version state: activate, deactivate, or delete.

To modify the secret data, create a new version.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `okmsId` | path | string (uuid) | yes | Okms ID |
| `path` | path | string | yes | Path |
| `version` | path | integer | yes | Version |

### Request body (required)

Type: `okms.secret.version.UpdateRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `state` | okms.SecretStateEnum | yes | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
{
  "state": "ACTIVE"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secret.version.UpdateResponse | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Time of creation of the secret version |
| `deactivatedAt` | string (date-time) | read-only | Time of deactivation of the secret version |
| `id` | integer | read-only | Secret version |
| `state` | okms.SecretStateEnum | read-only | State of the secret version — one of `ACTIVE`, `DEACTIVATED`, `DELETED` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "deactivatedAt": "2024-01-01T12:00:00Z",
  "id": 0,
  "state": "ACTIVE"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secret/{path}/version/{version}" \
  -H "accept: application/json" \
  -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: okms.secret.version.UpdateRequest
result = client.put("/v2/okms/resource/{okmsId}/secret/{path}/version/{version}",
	state = None, # State of the secret version (type: okms.SecretStateEnum)
)

# 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: okms.secret.version.UpdateRequest
$result = $ovh->put("/v2/okms/resource/{okmsId}/secret/{path}/version/{version}", array(
	state => null, // State of the secret version (type: okms.SecretStateEnum)
));

print_r($result);
?>
```

## Get the secret configuration

`GET /v2/okms/resource/{okmsId}/secretConfig`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#get-okms-resource-okmsid-secretconfig

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secretConfig/get`

Returns the service-level defaults applied to new secrets: `casRequired`, `maxVersions` and `deactivateVersionAfter`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `okmsId` | path | string (uuid) | yes | Okms ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secretConfig.Response | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update |
| `deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, default configuration (unlimited) is applied. |
| `maxVersions` | integer | read-only | The number of versions to keep. If 0, default configuration (10) is applied. |

```json
{
  "casRequired": true,
  "deactivateVersionAfter": "string",
  "maxVersions": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secretConfig" \
  -H "accept: application/json" \
  -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/okms/resource/{okmsId}/secretConfig")

# 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/okms/resource/{okmsId}/secretConfig");

print_r($result);
?>
```

## Update the secret configuration

`PUT /v2/okms/resource/{okmsId}/secretConfig`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/key-and-secret-manager/secrets/#put-okms-resource-okmsid-secretconfig

**Status:** Stable production version  
**IAM actions:** `okms:apiovh:secretConfig/update`

Updates the service-level defaults applied to new secrets.
Existing secrets keep the metadata they were created with.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `okmsId` | path | string (uuid) | yes | Okms ID |

### Request body (required)

Type: `okms.secretConfig.UpdateRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `casRequired` | boolean |  | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update |
| `deactivateVersionAfter` | string |  | Time duration before a version is deactivated. If 0s, default configuration (unlimited) is applied. |
| `maxVersions` | integer |  | The number of versions to keep. If 0, default configuration (10) is applied. |

```json
{
  "casRequired": true,
  "deactivateVersionAfter": "string",
  "maxVersions": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | okms.secretConfig.Response | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `casRequired` | boolean | read-only | If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update |
| `deactivateVersionAfter` | string | read-only | Time duration before a version is deactivated. If 0s, default configuration (unlimited) is applied. |
| `maxVersions` | integer | read-only | The number of versions to keep. If 0, default configuration (10) is applied. |

```json
{
  "casRequired": true,
  "deactivateVersionAfter": "string",
  "maxVersions": 0
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/okms/resource/{okmsId}/secretConfig" \
  -H "accept: application/json" \
  -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: okms.secretConfig.UpdateRequest
result = client.put("/v2/okms/resource/{okmsId}/secretConfig",
	casRequired = None, # If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update (type: boolean, nullable)
	deactivateVersionAfter = None, # Time duration before a version is deactivated. If 0s, default configuration (unlimited) is applied. (type: string, nullable)
	maxVersions = None, # The number of versions to keep. If 0, default configuration (10) is applied. (type: integer, nullable)
)

# 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: okms.secretConfig.UpdateRequest
$result = $ovh->put("/v2/okms/resource/{okmsId}/secretConfig", array(
	casRequired => null, // If set to true, the `Cas` (Check And Set) parameter will be required and verified for each secret update (type: boolean, nullable)
	deactivateVersionAfter => null, // Time duration before a version is deactivated. If 0s, default configuration (unlimited) is applied. (type: string, nullable)
	maxVersions => null, // The number of versions to keep. If 0, default configuration (10) is applied. (type: integer, nullable)
));

print_r($result);
?>
```
