id,
the template’s templateKey and scope, and a set of values for each field in
the template.
Metadata scopes can be either
global for templates available to
all enterprises, enterprise for templates available to the current
enterprise, or the enterprise_:id for templates belonging to an enterprise
whose ID is the :id value in the scope name.Apply metadata to a file
To apply an instance of a metadata template to a file, call thePOST /files/:file_id/metadata/:scope/:templateKey API endpoint
with the file’s file_id, the template’s scope and templateKey, and an
optional set of values for each field in the template.
To get the
scope and templateKey for a template, either
list all metadata templates, or
list all instances on an file.Apply metadata to a folder
To apply an instance of a metadata template to a folder, call thePOST /folders/:folder_id/metadata/:scope/:templateKey API endpoint
with the folder’s folder_id, the template’s scope and templateKey, and an
optional set of values for each field in the template.
To get the
scope and templateKey for a template, either
list all metadata templates, or
list all instances on an folder.Request body
The body of the request can contain a value for each field in the template. To inspect what fields are present on a template, inspect a metadata metadata template. For example, let’s assume the following template.name and category. The name
field is a regular text field, and the category is an enum.
The request body to assign this template to a file or folder can include a value
for any of the fields on the template. It is possible for the body to have no
values for no fields.
In this case, a valid example would be the following request body.
One exception is a
global scoped template with the key properties that can
be used to assign any data to a template. Using this template, any set of
key/value pairs can be assigned to a template.