---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.4
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/upsert-object-type-secret.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/upsert-object-type-secret.md
sourcePath: en/core/yql/reference/syntax/upsert-object-type-secret.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# UPSERT OBJECT (TYPE SECRET)

{% note warning %}

The syntax for managing secrets will change in future YDB releases.

{% endnote %}

To change the contents of a [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md), use the following statement:

```yql
UPSERT OBJECT `secret_name` (TYPE SECRET) WITH value = `secret_value`;
```

Where:

* `secret_name` — Name of the secret.
* `secret_value` — Secret payload.

## Example

The following statement sets the secret named `MySecretName` to `MySecretData`:

```yql
UPSERT OBJECT `MySecretName` (TYPE SECRET) WITH value = `MySecretData`;
```
