---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/upsert-object-type-secret.md?version=v26.3
  - https://ydb.tech/docs/ru/yql/reference/syntax/upsert-object-type-secret.md?version=v26.3
  - href: https://ydb.tech/docs/en/yql/reference/syntax/upsert-object-type-secret.md?version=v26.3
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt?revision=3d20fc614f8b1a092ebb766518e1c746cda9c005&version=v26.3
    rel: describedby
sourcePath: en/core/yql/reference/syntax/upsert-object-type-secret.md
---
> **Documentation capabilities:** Search, read sources, and browse this documentation: [agent guide](https://ydb.tech/docs/docs-api/agent/overview?project=ydb-platform--ydb&lang=en&version=v26.3).

> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt?revision=3d20fc614f8b1a092ebb766518e1c746cda9c005&version=v26.3

# 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?version=v26.3), 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`;
```
