---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/create-object-type-secret.md?version=v26.1
  - https://ydb.tech/docs/ru/yql/reference/syntax/create-object-type-secret.md?version=v26.1
  - href: en/yql/reference/syntax/create-object-type-secret.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/yql/reference/syntax/create-object-type-secret.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# CREATE OBJECT (TYPE SECRET)

<!-- source: en/yql/reference/syntax/_includes/deprecated_secrets_warning.md -->
{% note alert %}

**This command is deprecated** and will be removed in future versions of YDB. The recommended syntax for working with secrets is described in the [Secrets](https://ydb.tech/docs/en/concepts/datamodel/secrets.md?version=v26.1) section.

{% endnote %}
<!-- endsource: en/yql/reference/syntax/_includes/deprecated_secrets_warning.md -->

The following SQL statement creates a [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md?version=v26.1):

```yql
CREATE OBJECT <secret_name> (TYPE SECRET) WITH value = "<secret_value>";
```

Where:

* `secret_name` - the name of the secret.
* `secret_value` - the contents of the secret.

## Example {#examples}

The following statement creates a secret named `MySecretName` with `MySecretData` as a value.

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