Box Developer Documentation

A beta version of the new Box developer documentation site is launching soon! Updated Developer Guides, modern API Reference, and AI-powered search are on the way to help you build with Box faster. Stay tuned for more updates.

List all metadata templates

List all metadata templates

It's likely your enterprise already has a list of metadata templates that you can use right off-the-shelve without having to create your own.

In general, metadata templates are either available to only your enterprise or to every enterprise using Box. The scope of a template defines if a template is available to everyone (global) or only to your enterprise (enterprise).

Learn more about metadata scopes

Listing templates

A few global templates are available to all customers.

cURL
curl -i -X GET "https://api.box.com/2.0/metadata_templates/global" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.metadataTemplates.getGlobalMetadataTemplates();
Python v10
client.metadata_templates.get_global_metadata_templates()
.NET v10
await client.MetadataTemplates.GetGlobalMetadataTemplatesAsync();
Swift v10
try await client.metadataTemplates.getGlobalMetadataTemplates()
Java v10
client.getMetadataTemplates().getGlobalMetadataTemplates()
.NET v6
await client.MetadataTemplates.GetGlobalMetadataTemplatesAsync();
Node v4
await client.metadataTemplates.getGlobalMetadataTemplates();

Many of these templates are for Box's internal use, yet your application can use and apply these. More useful are templates created by applications and admins within your enterprise to hold data specific to your enterprise's needs.

cURL
curl -i -X GET "https://api.box.com/2.0/metadata_templates/enterprise" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.metadataTemplates.getEnterpriseMetadataTemplates();
Python v10
client.metadata_templates.get_enterprise_metadata_templates()
.NET v10
await client.MetadataTemplates.GetEnterpriseMetadataTemplatesAsync();
Swift v10
try await client.metadataTemplates.getEnterpriseMetadataTemplates()
Java v10
client.getMetadataTemplates().getEnterpriseMetadataTemplates()
.NET v6
await client.MetadataTemplates.GetEnterpriseMetadataTemplatesAsync();
Node v4
await client.metadataTemplates.getEnterpriseMetadataTemplates();

A metadata template

A metadata template describes a set of key/value pairs that can be assigned to a file or folder.

For example, a customerInfo template might hold data about a customer, having a field for the customer name as well as the customer's industry.

{
  "id": "100ac693-a468-4b37-9535-05984b804dc2",
  "type": "metadata_template",
  "templateKey": "customerInfo",
  "scope": "enterprise_12345",
  "displayName": "Customer Info",
  "hidden": false,
  "copyInstanceOnItemCopy": false,
  "fields": [
    {
      "id": "5c6a5906-003b-4654-9deb-472583fc2930",
      "type": "string",
      "key": "name",
      "displayName": "Name",
      "hidden": false
    },
    {
      "id": "cf3eb5b8-52ef-456c-b175-44354a27e289",
      "type": "enum",
      "key": "industry",
      "displayName": "Industry",
      "options": [
        {"key": "Technology"},
        {"key": "Healthcare"},
        {"key": "Legal"}
      ],
      "hidden": false
    }
  ]
}