Secrets

A Secret stores named, typed secret material for later use by features that reference the Secret by ID.

Secret values are encrypted at rest and are write-only. API responses include metadata and configured value field names, but never include the stored secret values.

List Secrets

Command

files-cli secrets list

Output

Outputs a list of Secret objects according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

files-cli secrets list

Show Secret

Command

files-cli secrets find

Output

Outputs a Secret object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Secret ID.

Example Request

files-cli secrets find \
  --id=1

Create Secret

Command

files-cli secrets create

Output

Outputs a Secret object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDefaultDescription
--name=
string
Required
Secret name.
--description=
string
Internal description for your reference.
--secret-type=
string
Required
Secret type.
Possible values: basic, token, headers, certificate, key_value
--metadata=
object
Non-secret metadata for the Secret type.
--workspace-id=
int64
0Workspace ID. 0 means the default workspace.

Example Request

files-cli secrets create \
  --name="Production API token" \
  --secret-type="token"

Update Secret

Command

files-cli secrets update

Output

Outputs a Secret object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Secret ID.
--name=
string
Secret name.
--description=
string
Internal description for your reference.
--secret-type=
string
Secret type.
Possible values: basic, token, headers, certificate, key_value
--metadata=
object
Non-secret metadata for the Secret type.

Example Request

files-cli secrets update \
  --id=1 \
  --name="Production API token"

Delete Secret

Command

files-cli secrets delete

Output

No output is returned.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Secret ID.

Example Request

files-cli secrets delete \
  --id=1

The Secret Object

Some of the commands above return a Secret object. The attributes of this object are listed below.

AttributeDescription
id
int64
Secret ID.
workspace_id
int64
Workspace ID. 0 means the default workspace.
name
string
Secret name.
description
string
Internal description for your reference.
secret_type
string
Secret type.
Possible values: basic, token, headers, certificate, key_value
metadata
object
Non-secret metadata for the Secret type.
value_field_names
array(string)
Names of configured secret value fields. Secret values are never returned.
created_at
date-time
Secret create date/time.
updated_at
date-time
Secret update date/time.