Skip to main content
PUT
/
metadata_templates
/
{scope}
/
{template_key}
/
schema
cURL
curl -i -X PUT "https://api.box.com/2.0/metadata_templates/enterprise/blueprintTemplate/schema" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json-patch+json" \
     -d '[
       {
         "op": "editField",
         "fieldKey": "category",
         "data": {
           "displayName": "Customer Group"
         }
       }
     ]'
{
  "id": "58063d82-4128-7b43-bba9-92f706befcdf",
  "type": "metadata_template",
  "scope": "enterprise_123456",
  "templateKey": "productInfo",
  "displayName": "Product Info",
  "hidden": true,
  "fields": [
    {
      "type": "string",
      "key": "category",
      "displayName": "Category",
      "description": "The category",
      "hidden": true,
      "options": [
        {
          "key": "Category 1",
          "id": "45dc2849-a4a7-40a9-a751-4a699a589190"
        }
      ],
      "id": "822227e0-47a5-921b-88a8-494760b2e6d2"
    }
  ],
  "copyInstanceOnItemCopy": true
}
This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.Learn more about Box SDK versioning strategy.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

scope
enum<string>
required

The scope of the metadata template.

Available options:
global,
enterprise
template_key
string
required

The name of the metadata template.

Body

application/json-patch+json
op
enum<string>
required

The type of change to perform on the template. Some of these are hazardous as they will change existing templates.

Available options:
editTemplate,
addField,
reorderFields,
addEnumOption,
reorderEnumOptions,
reorderMultiSelectOptions,
addMultiSelectOption,
editField,
removeField,
editEnumOption,
removeEnumOption,
editMultiSelectOption,
removeMultiSelectOption
Example:

"addEnumOption"

data
object

The data for the operation. This will vary depending on the operation being performed.

Example:
{ "name": "Aaron Levie" }
fieldKey
string

For operations that affect a single field this defines the key of the field that is affected.

Example:

"category"

fieldKeys
string[]

For operations that affect multiple fields this defines the keys of the fields that are affected.

Example:
["category", "name"]
enumOptionKey
string

For operations that affect a single enum option this defines the key of the option that is affected.

Example:

"option1"

enumOptionKeys
string[]

For operations that affect multiple enum options this defines the keys of the options that are affected.

Example:
["option1", "option2", "option3"]
multiSelectOptionKey
string

For operations that affect a single multi select option this defines the key of the option that is affected.

Example:

"option1"

multiSelectOptionKeys
string[]

For operations that affect multiple multi select options this defines the keys of the options that are affected.

Example:
["option1", "option2", "option3"]

Response

Returns the updated metadata template, with the custom template data included.

A template for metadata that can be applied to files and folders.

id
string
required

The ID of the metadata template.

Example:

"58063d82-4128-7b43-bba9-92f706befcdf"

type
enum<string>
required

The value will always be metadata_template.

Available options:
metadata_template
Example:

"metadata_template"

scope
string

The scope of the metadata template can either be global or enterprise_*. The global scope is used for templates that are available to any Box enterprise. The enterprise_* scope represents templates that have been created within a specific enterprise, where * will be the ID of that enterprise.

Example:

"enterprise_123456"

templateKey
string

A unique identifier for the template. This identifier is unique across the scope of the enterprise to which the metadata template is being applied, yet is not necessarily unique across different enterprises.

Maximum string length: 64
Example:

"productInfo"

displayName
string

The display name of the template. This can be seen in the Box web app and mobile apps.

Maximum string length: 4096
Example:

"Product Info"

hidden
boolean

Defines if this template is visible in the Box web app UI, or if it is purely intended for usage through the API.

Example:

true

fields
Metadata Field (Read) · object[]

An ordered list of template fields which are part of the template. Each field can be a regular text field, date field, number field, as well as a single or multi-select list.

copyInstanceOnItemCopy
boolean

Whether or not to include the metadata when a file or folder is copied.

Example:

true