# Update

Launch stage: GA

`POST /api/2.0/secrets/put`

Inserts a secret under the provided scope with the given name. If a secret already
 exists with the same name, this command overwrites the existing secret's value.
 The server encrypts the secret using the secret scope's encryption settings before
 storing it. You must have ``WRITE`` or ``MANAGE`` permission on the secret scope.

 The secret key must consist of alphanumeric characters, dashes, underscores,
 and periods, and cannot exceed 128 characters. The maximum allowed secret
 value size is 128 KB. The maximum number of secrets in a given scope is
 1000.

 Example request:

 .. code::

    {
        "scope": "my-databricks-scope",
        "key": "my-string-key",
        "string_value": "foobar"
    }

 The input fields "string_value" or "bytes_value"
 specify the type of the secret, which will determine the value returned when
 the secret value is requested. Exactly one must be specified.

 Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists.
 Throws ``RESOURCE_LIMIT_EXCEEDED`` if maximum number of secrets in scope is exceeded.
 Throws ``INVALID_PARAMETER_VALUE`` if the request parameters are invalid.
 Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call.
 Throws ``MALFORMED_REQUEST`` if request is incorrectly formatted or conflicting.
 Throws ``BAD_REQUEST`` if request is made against Azure KeyVault backed scope.

API scopes: secrets

## Request body

- `scope` (string, optional)
  The name of the scope to which the secret will be associated with.
- `key` (string, optional)
  A unique name to identify the secret.
- `string_value` (string, required)
  If specified, note that the value will be stored in UTF-8 (MB4) form.
- `bytes_value` (string, required)
  If specified, value will be stored as bytes.

## Response

```json
{}
```

