> Markdown version of https://tuna.am/en/docs/api/secrets-secret-edit/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# Create, update, and delete configuration secrets

post`/v1/secrets/configs/config/secrets`

Changes are applied in a single transaction: if one fails validation, none are applied. The response contains all configuration secrets. Also accepts a configuration service token with `write` access: `Authorization: Bearer <token>`; it can't change other environments. The configuration's trusted networks apply. Requires `editor` access to the environment.

## Request

### Authorization

* **Authorization**stringheaderrequired

  Key in the format `Bearer <API-key>`. Create a key on the [API keys](https://my.tuna.am/api_keys) page.

### Request body

application/json

* **apply_to_environments**string\[]

  Aliases of environments whose root configs get the same changes; only for the root config and only with an API key

  **Example:&#x20;**`["staging","production"]`

  **change_requests** object\[]

  List of changes

  Array \[
* **name**stringrequired

  Secret name: Latin letters, digits and `_`, must not start with a digit, up to 255 characters

  **Example:&#x20;**`DATABASE_URL`

  **note**string

  New note, null — leave unchanged

  **Example:&#x20;**`Connection string for the main database`

  **original_name**string

  Previous name when renaming: the secret `original_name` is renamed to `name`

  **Example:&#x20;**`DB_URL`

  **original_value**string

  Current secret value, used to detect a stale change; not required for secrets with `restricted` visibility

  **Example:&#x20;**`postgresql://user:****@db:5432/old`

  **original_value_type**string

  Current value type of the secret

  **Possible values:** \[`string`, `json`, `boolean`, `integer`, `decimal`, `email`, `url`, `yaml`, `xml`, `date`, `datetime`]

  **Example:&#x20;**`url`

  **original_visibility**string

  Current visibility of the secret

  **Possible values:** \[`masked`, `unmasked`, `restricted`]

  **Example:&#x20;**`masked`

  **should_converge**boolean

  Remove the branch override and fall back to the root config value

  **should_delete**boolean

  Delete the secret. In the root config, for a secret missing from it, hides the secret from the list of missing secrets

  **should_promote**boolean

  Promote the branch override to the root config

  **value**string

  New value, null — leave unchanged. For an existing secret, pass `original_value`, otherwise the change is silently skipped

  **Example:&#x20;**`postgresql://user:****@db:5432/app`

  **value_type**string

  New value type, null — leave unchanged. Requires `original_value_type`, otherwise the change is silently skipped

  **Possible values:** \[`string`, `json`, `boolean`, `integer`, `decimal`, `email`, `url`, `yaml`, `xml`, `date`, `datetime`]

  **Example:&#x20;**`url`

  **visibility**string

  New visibility, null — leave unchanged. Requires `original_visibility`, otherwise the change is silently skipped. `restricted` can only be removed together with a new value

  **Possible values:** \[`masked`, `unmasked`, `restricted`]

  **Example:&#x20;**`masked`

  ]

  **config**stringrequired

  Configuration alias

  **Example:&#x20;**`production/local`

  **project**stringrequired

  Project alias

  **Example:&#x20;**`payments`

### Response

200

application/json

* **property name\*** SecretsSecret

  **can_be_converged**boolean

  The override can be removed to fall back to the root config value

  **can_be_promoted**boolean

  The override can be promoted to the root config

  **created_at**string\<date-time>

  Creation date

  **fingerprint**string

  Value fingerprint for comparison without revealing the value: HMAC-SHA256 with the team key, empty for restricted

  **Example:&#x20;**`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08`

  **id**integer\<int64>

  Identifier

  **Example:&#x20;**`7001`

  **name**string

  Name

  **Example:&#x20;**`DATABASE_URL`

  **note**string

  Note

  **Example:&#x20;**`Connection string for the main database`

  **override**boolean

  The secret is overridden in this branch and not inherited from the root config

  **reminder** object

  **next_at**string

  Next reminder date in `YYYY-MM-DD` format

  **Example:&#x20;**`2026-03-01`

  **note**string

  Note

  **Example:&#x20;**`Check key rotation`

  **repeat_days**integer\<uint64>

  Repeat interval in days

  **Example:&#x20;**`90`

  **updated_at**string\<date-time>

  Update date

  **value**string

  Value; empty for secrets with `restricted` visibility unless the request uses a service token

  **Example:&#x20;**`postgresql://user:****@db:5432/app`

  **value_type**string

  Value type; the value is validated against it on change

  **Possible values:** \[`string`, `json`, `boolean`, `integer`, `decimal`, `email`, `url`, `yaml`, `xml`, `date`, `datetime`]

  **Example:&#x20;**`url`

  **visibility**string

  Visibility: `masked` — the value is hidden in the interface, `unmasked` — shown, `restricted` — the value is not returned to users, only to a service token

  **Possible values:** \[`masked`, `unmasked`, `restricted`]

  **Example:&#x20;**`masked`
