Metadata Categories

A MetadataCategory defines a reusable set of Custom Metadata rules that can be assigned to folders via a folder behavior. Each category specifies named metadata keys with optional allowed-value constraints, and a set of default columns to display in the UI.

If a key's allowed_values array is empty, it is treated as a free-form text field. If the array is non-empty, the key is constrained to those values in the Web UI.

List Metadata Categories

Command

files-cli metadata-categories list

Output

Outputs a list of MetadataCategory 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 metadata-categories list

Show Metadata Category

Command

files-cli metadata-categories find

Output

Outputs a MetadataCategory 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
Metadata Category ID.

Example Request

files-cli metadata-categories find \
  --id=1

List Metadata Categories by Path

Command

files-cli metadata-categories list-for

Output

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

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDescription
--path=
string
Required
Path to operate on.

Additional Arguments

Example Request

files-cli metadata-categories list-for \
  --path="path"

Create Metadata Category

Command

files-cli metadata-categories create

Output

Outputs a MetadataCategory 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
--name=
string
Required
Name of the metadata category.
--default-columns=
array(string)
Metadata keys that should appear as columns in the UI by default.

Example Request

files-cli metadata-categories create \
  --name="Approval Workflow"

Update Metadata Category

Command

files-cli metadata-categories update

Output

Outputs a MetadataCategory 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
Metadata Category ID.
--name=
string
Name of the metadata category.
--default-columns=
array(string)
Metadata keys that should appear as columns in the UI by default.

Example Request

files-cli metadata-categories update \
  --id=1 \
  --name="Approval Workflow"

Delete Metadata Category

Command

files-cli metadata-categories 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
Metadata Category ID.

Example Request

files-cli metadata-categories delete \
  --id=1

The MetadataCategory Object

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

AttributeDescription
id
int64
Metadata Category ID
name
string
Name of the metadata category.
definitions
hash(string,array(string))
Map of key names to arrays of allowed values. An empty array means free-form text.
default_columns
array(string)
Metadata keys that should appear as columns in the UI by default.