Box Developer Documentation

Delete a metadata template

Delete a metadata template

Deleting a metadata template can be achieved by calling the DELETE /metadata_templates/enterprise/:templateKey/schema API.

cURL
curl -i -X DELETE "https://api.box.com/2.0/metadata_templates/enterprise/blueprintTemplate/schema" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.metadataTemplates.deleteMetadataTemplate(
  'enterprise' as DeleteMetadataTemplateScope,
  template.templateKey!,
);
Python v10
client.metadata_templates.delete_metadata_template(
    DeleteMetadataTemplateScope.ENTERPRISE, template.template_key
)
.NET v10
await client.MetadataTemplates.DeleteMetadataTemplateAsync(scope: DeleteMetadataTemplateScope.Enterprise, templateKey: NullableUtils.Unwrap(template.TemplateKey));
Swift v10
try await client.metadataTemplates.deleteMetadataTemplate(scope: DeleteMetadataTemplateScope.enterprise, templateKey: template.templateKey!)
Java v10
client.getMetadataTemplates().deleteMetadataTemplate(DeleteMetadataTemplateScope.ENTERPRISE, template.getTemplateKey())
Java v4
MetadataTemplate.deleteMetadataTemplate(api, "enterprise", "templateName");
Python v3
client.metadata_template('enterprise', 'employeeRecord').delete()
Node v3
client.metadata.deleteTemplate('enterprise', 'testtemplate', callback);

This API returns a 204 No Content API response with no response body when the template has been successfully deleted. This API also removes all the template instances from any files and folders.

Only templates created within the enterprise scope can be deleted.

Admin permissions required

Deleting metadata templates is restricted to users with admin permission. This means that only admins, or co-admins who have been granted rights to Create and edit metadata templates for your company by the admin can use the web app or the API to manage templates.