> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to create versions of secrets in MysteryBox

Each secret can have multiple versions. Versions are useful when you need to change credentials or update a secret payload without modifying existing references, such as configurations, scripts or services that point to the specific secret.

For more information, see [Overview of the MysteryBox service](../overview).

## Prerequisites

Make sure you are in a [group](/iam/authorization/groups/index) that has at least the `editor` role within your tenant; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

<Warning>
  Creating a secret or a version of a secret does not automatically grant you access to view payloads in that secret or version. The `editor` role is enough to create a secret or a version, but viewing payloads requires the `mysterybox.payload-viewer` role, which is a sub-role of `admin` but not `editor`.
</Warning>

## How to create a version

<Tabs>
  <Tab title="Web console">
    1. In the [web console](https://console.nebius.com), go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/mysterybox.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=428f0f38232b7eea96e9d8d993c78cd4" width="16" height="16" data-path="_assets/sidebar/mysterybox.svg" /> **Mysterybox**.

    2. Locate the required secret and then click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> → **Create version**.

    3. (Optional) On the page that opens, add a version description. For example, "New database password."

    4. Update **Key** and **Value**. These fields display the key-value pair created in the original version. You can reuse an existing key and value, or you can update them.

       If you update **Value**, select a data type for it:

       * **Text**: Specify a plain string. Commonly used for passwords, tokens and API keys.
       * **File**: Upload a binary file. Convenient for certificates, private keys and configuration files.

    5. (Optional) To store multiple key-value pairs in a single version, click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1" width="16" height="16" data-path="_assets/plus.svg" /> **Add pair**. Then, specify additional key–value pairs.

    6. If you want this version to become primary (it will be returned by default when the secret is referenced), keep the **Make this version primary** option enabled.

    7. Click **Create version**.
  </Tab>

  <Tab title="CLI">
    1. List all secrets:

       ```bash theme={null}
       nebius mysterybox secret list
       ```

       In the output, copy the ID of the required secret.

    2. Create a new version for the secret.

       * Ubuntu:
         ```bash theme={null}
         nebius mysterybox secret-version create \
           --parent-id <secret_ID> \
           --description "<description>" \
           --payload "[
             {\"key\": \"<key_name>\", \"string_value\": \"<value>\"},
             {\"key\": \"<key_name>\", \"binary_value\": \"$(base64 -w 0 <path/to/file>)\"},
             ...
           ]"
         ```

       * macOS:

         ```bash theme={null}
         nebius mysterybox secret-version create \
           --parent-id <secret_ID> \
           --description "<description>" \
           --payload "[
             {\"key\": \"<key_name>\", \"string_value\": \"<value>\"},
             {\"key\": \"<key_name>\", \"binary_value\": \"$(base64 -i <path/to/file>)\"},
             ...
           ]"
         ```

       In the command, specify the following values:

       * `parent-id`: ID that you copied earlier.
       * `description` (optional): Version description.
       * `key`: Name of the key.
       * `string_value`: For each key with a string value, a sensitive secret value.
       * `path/to/file`: For each key with a binary value, a local path to the file whose contents you want to store as binary data in the secret.

    <Tip>
      You can [make a new version primary](./make-version-primary) if you want to get its payload by default. When you create a version by using the CLI, it does not become primary automatically.
    </Tip>
  </Tab>
</Tabs>

After the version is created, you can pin requests to it.
