# Add secret version in project

`POST /v1/projects/{project}/secrets/{secret}/versions`, operation `secrets.AddSecretVersionInProject`

Adds a version to a secret, which becomes its latest. A shared secret's versions are its source's to add.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `secret` | path | Yes | `string` | The secret's ID. |

## Request body

Content-Type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | `SecretPayload` | Yes | The version's value. |
| `payload.data` | `string` | Yes | The value, base64-encoded: at least 1 byte, at most 64 KiB. |

## Responses

### 201

Created

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createTime` | `string (date-time)` | Yes | When the version was added. |
| `destroyTime` | `string (date-time)` | No | When the version was destroyed, if it was. |
| `name` | `string` | Yes | Resource name, …/secrets/{secret_id}/versions/{version}, numbered from 1. A shared secret names its source's versions under itself. |
| `state` | `string` | Yes | Whether the version can be read: DISABLED until it is enabled again, and DESTROYED for good. Values: `ENABLED`, `DISABLED`, `DESTROYED`. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.