> Markdown version of https://tuna.am/en/docs/api/secrets-secret-upload/. 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.

# Upload secrets from a file

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

A file up to 1 MiB: a JSON object with flat values or dotenv; the format is detected from the content. Secrets from the file are created or overwritten; other secrets are not affected. File parsing errors are returned with the `InvalidSecretsFile` code. Also accepts a configuration service token with `write` access: `Authorization: Bearer <token>`. 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

* **config**stringrequired

  Configuration alias

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

  **file**stringrequired

  Secrets file contents: a JSON object or dotenv

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

  **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`
