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
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
| Flag | Description |
|---|---|
| --id= int64 Required | Metadata Category ID. |
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
| Flag | Description |
|---|---|
| --path= string Required | Path to operate on. |
Additional Arguments
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
| Flag | Description |
|---|---|
| --name= string Required | Name of the metadata category. |
| --default-columns= array(string) | Metadata keys that should appear as columns in the UI by default. |
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
| Flag | Description |
|---|---|
| --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. |
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
| Flag | Description |
|---|---|
| --id= int64 Required | Metadata Category ID. |
The MetadataCategory Object
Some of the commands above return a MetadataCategory object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| 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. |