Documentation for scw secret

October 28, 2025 ยท View on GitHub

This API allows you to manage your Secret Manager services, for storing, accessing and sharing sensitive data such as passwords, API keys and certificates.

Secret management commands

Secrets are logical containers made up of zero or more immutable versions, that contain sensitive data.

Allow a product to use the secret

Allow a product to use the secret.

Usage:

scw secret secret add-owner <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
productOne of: unknown_product, edge_services, s2s_vpnID of the product to add
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Create a secret

Create a secret in a given region specified by the region parameter.

Usage:

scw secret secret create [arg=value ...]

Args:

NameDescription
project-idProject ID to use. If none is passed the default project ID will be used
nameName of the secret
tags.{index}List of the secret's tags
descriptionDescription of the secret
typeOne of: unknown_type, opaque, certificate, key_value, basic_credentials, database_credentials, ssh_keyType of the secret
pathPath of the secret
ephemeral-policy.time-to-liveTime frame, from one second and up to one year, during which the secret's versions are valid.
ephemeral-policy.expires-once-accessedReturns true if the version expires after a single user access.
ephemeral-policy.actionOne of: unknown_action, delete, disableAction to perform when the version of a secret expires
protectedReturns true if secret protection is applied to a given secret
key-idID of the Scaleway Key Manager key
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Create a given secret

scw secret secret create name=foobar description="$(cat <path/to/your/secret>)"

Delete a secret

Delete a given secret specified by the region and secret_id parameters.

Usage:

scw secret secret delete <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Delete a given secret

scw secret secret delete 11111111-1111-1111-1111-111111111111

Get metadata using the secret's ID

Retrieve the metadata of a secret specified by the region and secret_id parameters.

Usage:

scw secret secret get <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

List secrets

Retrieve the list of secrets created within an Organization and/or Project. You must specify either the organization_id or the project_id and the region.

Usage:

scw secret secret list [arg=value ...]

Args:

NameDescription
project-idFilter by Project ID (optional)
order-byOne of: name_asc, name_desc, created_at_asc, created_at_desc, updated_at_asc, updated_at_desc
tags.{index}List of tags to filter on (optional)
nameFilter by secret name (optional)
pathFilter by exact path (optional)
ephemeralFilter by ephemeral / not ephemeral (optional)
typeOne of: unknown_type, opaque, certificate, key_value, basic_credentials, database_credentials, ssh_keyFilter by secret type (optional)
scheduled-for-deletionFilter by whether the secret was scheduled for deletion / not scheduled for deletion. By default, it will display only not scheduled for deletion secrets.
organization-idFilter by Organization ID (optional)
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw, all
Region to target. If none is passed will use default region from the config

Enable secret protection

Enable secret protection for a given secret specified by the secret_id parameter. Enabling secret protection means that your secret can be read and modified, but it cannot be deleted.

Usage:

scw secret secret protect <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret to enable secret protection for
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Enable secret protection

scw secret secret protect 11111111-1111-1111-1111-111111111111

Disable secret protection

Disable secret protection for a given secret specified by the secret_id parameter. Disabling secret protection means that your secret can be read, modified and deleted.

Usage:

scw secret secret unprotect <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret to disable secret protection for
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Disable secret protection

scw secret secret unprotect 11111111-1111-1111-1111-111111111111

Update metadata of a secret

Edit a secret's metadata such as name, tag(s), description and ephemeral policy. The secret to update is specified by the secret_id and region parameters.

Usage:

scw secret secret update <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
nameSecret's updated name (optional)
tags.{index}Secret's updated list of tags (optional)
descriptionDescription of the secret
pathPath of the folder
ephemeral-policy.time-to-liveTime frame, from one second and up to one year, during which the secret's versions are valid.
ephemeral-policy.expires-once-accessedReturns true if the version expires after a single user access.
ephemeral-policy.actionOne of: unknown_action, delete, disableAction to perform when the version of a secret expires
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Secret Version management commands

Versions store the sensitive data contained in your secrets (API keys, passwords, or certificates).

Access a secret's version using the secret's ID

Access sensitive data in a secret's version specified by the region, secret_id and revision parameters.

Usage:

scw secret version access <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
fieldReturn only the JSON field of the given name
rawReturn only the raw payload
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Get a raw json value from a secret version

scw secret version access 11111111-1111-1111-111111111111 revision=1 field=key raw=true

Access a secret's version using the secret's name and path

Access sensitive data in a secret's version specified by the region, secret_name, secret_path and revision parameters.

Usage:

scw secret version access-by-path [arg=value ...]

Args:

NameDescription
secret-pathSecret's path
secret-nameSecret's name
revisionRequiredVersion number
project-idProject ID to use. If none is passed the default project ID will be used
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Create a version

Create a version of a given secret specified by the region and secret_id parameters.

Usage:

scw secret version create <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
dataRequiredContent of the secret version.
descriptionDescription of the version
disable-previousDisable the previous secret version
data-crc32(Optional.) The CRC32 checksum of the data as a base-10 integer
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Create a json secret version

scw secret version create 11111111-1111-1111-111111111111 data={"key":"value"}

Delete a version

Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.

Usage:

scw secret version delete <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Examples:

Delete a given Secret Version

scw secret version delete 11111111-1111-1111-1111-111111111111 revision=1

Disable a version

Make a specific version inaccessible. You must specify the region, secret_id and revision parameters.

Usage:

scw secret version disable <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Enable a version

Make a specific version accessible. You must specify the region, secret_id and revision parameters.

Usage:

scw secret version enable <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

Get metadata of a secret's version using the secret's ID

Retrieve the metadata of a secret's given version specified by the region, secret_id and revision parameters.

Usage:

scw secret version get <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config

List versions of a secret using the secret's ID

Retrieve the list of a given secret's versions specified by the secret_id and region parameters.

Usage:

scw secret version list <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
status.{index}One of: unknown_status, enabled, disabled, deleted, scheduled_for_deletionFilter results by status
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw, all
Region to target. If none is passed will use default region from the config

Update metadata of a version

Edit the metadata of a secret's given version, specified by the region, secret_id and revision parameters.

Usage:

scw secret version update <secret-id ...> [arg=value ...]

Args:

NameDescription
secret-idRequiredID of the secret
revisionRequiredVersion number
descriptionDescription of the version
ephemeral-properties.expires-atThe version's expiration date
ephemeral-properties.expires-once-accessedReturns true if the version expires after a single user access.
ephemeral-properties.actionOne of: unknown_action, delete, disableAction to perform when the version of a secret expires
regionDefault: fr-par
One of: fr-par, nl-ams, pl-waw
Region to target. If none is passed will use default region from the config