Sample - Box Platform API
GET/metadata_templates/{scope}/{template_key}/schema

Get metadata template by name

Retrieves a metadata template by its scope and templateKey values.

To find the scope and templateKey for a template, list all templates for an enterprise or globally, or list all templates applied to a file or folder.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
scopestringrequired
The scope of the metadata template.
Allowed:globalenterprise
template_keystringrequired
The name of the metadata template.

4 status codes
200Returns the metadata template matching the `scope` and `template` name.
idstringrequired
The ID of the metadata template.
typestringrequired
The value will always be `metadata_template`.
Allowed:metadata_template
scopestringoptional
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.
templateKeystringoptional
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.
displayNamestringoptional
The display name of the template. This can be seen in the Box web app and mobile apps.
hiddenbooleanoptional
Defines if this template is visible in the Box web app UI, or if it is purely intended for usage through the API.
fieldsarray<object>optional
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.
copyInstanceOnItemCopybooleanoptional
Whether or not to include the metadata when a file or folder is copied.
400Returned if any of the request parameters are not valid. * `bad_request`: Often returned when the scope of the template is not recognised. Please make sure to use either `enterprise` or `global` as the `scope` value.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
404Returned when a template with the given `scope` and `template_key` can not be found.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
defaultAn unexpected client error.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

A 400 is returned: Returned if any of the request parameters are not valid.

  • bad_request: Often returned when the scope of the template is not recognised. Please make sure to use either enterprise or global as the scope value. A 404 is returned: Returned when a template with the given scope and template_key can not be found. Any other status is an error: An unexpected client error.