Skip to content

Create or replace a secret

PUT
/api/v3/organizations/{api_organisation}/applications/{api_application}/environments/{api_environment}/secrets/{api_secret}
curl --request PUT \
--url https://dashboard.quantcdn.io/api/v3/organizations/test-org/applications/test-app/environments/test-env/secrets/DB_PASSWORD \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "value": "example" }'

Sets the secret value. The value is write-only: the response returns the key only. The change takes effect on the next redeploy of the environment. A name that already exists as an environment variable is refused with 409.

api_organisation
required
string

The organisation ID

Example
test-org
api_application
required
string

The application ID

Example
test-app
api_environment
required
string

The environment ID

Example
test-env
api_secret
required
string
/^[A-Za-z_][A-Za-z0-9_.-]*$/

The secret key

Example
DB_PASSWORD
Media typeapplication/json
object
value
required
string format: password
Examplegenerated
{
"value": "example"
}

The secret is set. It takes effect on the next redeploy.

Media typeapplication/json
object
key
required

The secret name

string
warnings

Notices from Quant Cloud about the change. Present only when there is at least one.

Array<string>
Example
{
"key": "DB_PASSWORD"
}

The name already exists as an environment variable

Media typeapplication/json
object
message
required
string
Example
{
"message": "Cannot create/update secret 'DB_PASSWORD' as it already exists as an environment variable."
}

The key or the value is not valid