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

Endpoint

GET/metadata_categories

Return Object

MetadataCategory[]

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

curl https://app.files.com/api/rest/v1/metadata_categories.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "Approval Workflow",
    "definitions": {
      "Approval Status": [
        "Under Review",
        "Approved",
        "Rejected"
      ],
      "Reviewer": [

      ]
    },
    "default_columns": [
      "Approval Status"
    ]
  }
]

Show Metadata Category

Endpoint

GET/metadata_categories/{id}

Return Object

MetadataCategory

Authorization Requirement

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

Request Parameters

ParameterDescription
id
int64
Required
Metadata Category ID.

Example Request

curl https://app.files.com/api/rest/v1/metadata_categories/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Approval Workflow",
  "definitions": {
    "Approval Status": [
      "Under Review",
      "Approved",
      "Rejected"
    ],
    "Reviewer": [

    ]
  },
  "default_columns": [
    "Approval Status"
  ]
}

List Metadata Categories by Path

Endpoint

GET/metadata_categories/list_by_path/{path}

Return Object

MetadataCategory[]

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
path
string
Required
Path to operate on.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/metadata_categories/list_by_path/{path} \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "Approval Workflow",
    "definitions": {
      "Approval Status": [
        "Under Review",
        "Approved",
        "Rejected"
      ],
      "Reviewer": [

      ]
    },
    "default_columns": [
      "Approval Status"
    ]
  }
]

Create Metadata Category

Endpoint

POST/metadata_categories

Return Object

MetadataCategory

Authorization Requirement

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

Request Parameters

ParameterDescription
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

curl https://app.files.com/api/rest/v1/metadata_categories.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"Approval Workflow","default_columns":["Approval Status"]}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Approval Workflow",
  "definitions": {
    "Approval Status": [
      "Under Review",
      "Approved",
      "Rejected"
    ],
    "Reviewer": [

    ]
  },
  "default_columns": [
    "Approval Status"
  ]
}

Update Metadata Category

Endpoint

PATCH/metadata_categories/{id}

Return Object

MetadataCategory

Authorization Requirement

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

Request Parameters

ParameterDescription
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

curl https://app.files.com/api/rest/v1/metadata_categories/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"Approval Workflow","default_columns":["Approval Status"]}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Approval Workflow",
  "definitions": {
    "Approval Status": [
      "Under Review",
      "Approved",
      "Rejected"
    ],
    "Reviewer": [

    ]
  },
  "default_columns": [
    "Approval Status"
  ]
}

Delete Metadata Category

Endpoint

DELETE/metadata_categories/{id}

Return Object

No return value.

Authorization Requirement

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

Request Parameters

ParameterDescription
id
int64
Required
Metadata Category ID.

Example Request

curl https://app.files.com/api/rest/v1/metadata_categories/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The MetadataCategory Object

Some of the endpoints 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.

Example MetadataCategory Object

{
  "id": 1,
  "name": "Approval Workflow",
  "definitions": {
    "Approval Status": [
      "Under Review",
      "Approved",
      "Rejected"
    ],
    "Reviewer": [

    ]
  },
  "default_columns": [
    "Approval Status"
  ]
}