Box Developer Documentation
Latest version

Update classification

put
https://api.box.com/2.0
/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema

Updates the labels and descriptions of one or more classifications available to the enterprise.

This API can also be called by including the enterprise ID in the URL explicitly, for example /metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema.

Request

bearer [ACCESS_TOKEN]
application/json-patch+json

Request Body

object arrayin bodyrequired

An array that contains one or more classifications to update.

objectin body

The details of the updated classification.

stringin bodyrequired
"Very Sensitive"

A new label for the classification, as it will be shown in the web and mobile interfaces.

objectin body

A static configuration for the classification.

Additional details for the classification.

stringin bodyrequired
"Sensitive"

The original label of the classification to change.

stringin bodyrequired
"Box__Security__Classification__Key"

Defines classifications available in the enterprise.

Value is always Box__Security__Classification__Key

stringin bodyrequired
"editEnumOption"

The type of change to perform on the classification object.

Value is always editEnumOption

Response

Returns the updated securityClassification metadata template, which contains a Box__Security__Classification__Key field that lists all the classifications available to this enterprise.

application/jsonClient error

Returned if any of the request parameters are not valid.

application/jsonClient error

Returned when a template name is not correct. Please make sure the URL for the request is correct.

application/jsonClient error

An unexpected client error.

put
Update classification
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X PUT "https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json-patch+json" \
     -d '[{
       "op": "editEnumOption",
       "fieldKey": "Box__Security__Classification__Key",
       "enumOptionKey": "Sensitive",
       "data": {
         "key": "Very Sensitive",
         "staticConfig": {
           "classification": {
            "classificationDefinition": "Sensitive information that must not be shared.",
            "colorID": 4
           }
         }
       }
     }]'
TypeScript Gen
await client.classifications.updateClassification([
  new UpdateClassificationRequestBody({
    enumOptionKey: classification.key,
    data: {
      key: updatedClassificationName,
      staticConfig: {
        classification: {
          colorId: 2,
          classificationDefinition: updatedClassificationDescription,
        } satisfies UpdateClassificationRequestBodyDataStaticConfigClassificationField,
      } satisfies UpdateClassificationRequestBodyDataStaticConfigField,
    } satisfies UpdateClassificationRequestBodyDataField,
  }),
]);
Python Gen
client.classifications.update_classification(
    [
        UpdateClassificationRequestBody(
            enum_option_key=classification.key,
            data=UpdateClassificationRequestBodyDataField(
                key=updated_classification_name,
                static_config=UpdateClassificationRequestBodyDataStaticConfigField(
                    classification=UpdateClassificationRequestBodyDataStaticConfigClassificationField(
                        color_id=2,
                        classification_definition=updated_classification_description,
                    )
                ),
            ),
        )
    ]
)
.NET Gen
await client.Classifications.UpdateClassificationAsync(requestBody: Array.AsReadOnly(new [] {new UpdateClassificationRequestBody(enumOptionKey: classification.Key, data: new UpdateClassificationRequestBodyDataField(key: updatedClassificationName) { StaticConfig = new UpdateClassificationRequestBodyDataStaticConfigField() { Classification = new UpdateClassificationRequestBodyDataStaticConfigClassificationField() { ColorId = 2, ClassificationDefinition = updatedClassificationDescription } } })}));
Swift Gen (Beta)
try await client.classifications.updateClassification(requestBody: [UpdateClassificationRequestBody(enumOptionKey: classification.key, data: UpdateClassificationRequestBodyDataField(key: updatedClassificationName, staticConfig: UpdateClassificationRequestBodyDataStaticConfigField(classification: UpdateClassificationRequestBodyDataStaticConfigClassificationField(colorId: Int64(2), classificationDefinition: updatedClassificationDescription))))])
Java
List<MetadataTemplate.FieldOperation> updates = new ArrayList<MetadataTemplate.FieldOperation>();

String update = "{\n  op: \"editEnumOption\",\n  fieldKey: \"Box__Security__Classification__Key\",\n  enumOptionKey: \"Sensitive\",\n  data: {\n    key: \"Very Sensitive\"\n }\n}";

updates.add(new MetadataTemplate.FieldOperation(addCategoryFieldJSON));

MetadataTemplate.updateMetadataTemplate(api, Metadata.ENTERPRISE_METADATA_SCOPE, Metadata.CLASSIFICATION_TEMPLATE_KEY, updates);
Python
template = client.metadata_template('enterprise', 'securityClassification-6VMVochwUWo')
new_updates = template.start_update()
new_updates.edit_enum_option('Box__Security__Classification__Key', 'Sensitive', 'Very Sensitive')
updated_template = template.update_info(updates=new_updates)
.NET
var update = new BoxMetadataTemplateUpdate
{
    Op = MetadataTemplateUpdateOp.editEnumOption,
    FieldKey = "Box_Security_Classification_Key",
    EnumOptionKey = "Sensitive",
    Data = new
    {
        key = "Very Sensitive"
    }
};

var template = await client.MetadataManager
    .UpdateMetadataTemplate(new List<BoxMetadataTemplateUpdate>() { update }, "enterprise", "securityClassification-6VMVochwUWo");
Node
var operations = [{
  op: "editEnumOption",
  fieldKey: "Box__Security__Classification__Key",
  enumOptionKey: "Sensitive",
  data: {
    key: "Very Sensitive",
    classification: {
      classificationDefinition: "Sensitive information that must not be shared.",
      colorID: 4
    }
 }
}];
client.metadata.updateTemplate('enterprise', 'securityClassification-6VMVochwUWo', operations)
	.then(template => {
		// the updated classification template
	});

Response Example

{
  "id": "58063d82-4128-7b43-bba9-92f706befcdf",
  "type": "metadata_template",
  "copyInstanceOnItemCopy": true,
  "displayName": "Classification",
  "fields": [
    {
      "displayName": "Classification",
      "hidden": false,
      "id": "822227e0-47a5-921b-88a8-494760b2e6d2",
      "key": "Box__Security__Classification__Key",
      "options": [
        {
          "id": "46aea176-3483-4431-856c-6b5b13d1cc50",
          "key": "Sensitive",
          "staticConfig": {
            "classification": {
              "classificationDefinition": "Sensitive information",
              "colorID": 4
            }
          }
        }
      ],
      "type": "enum"
    }
  ],
  "hidden": false,
  "scope": "enterprise_123456",
  "templateKey": "securityClassification-6VMVochwUWo"
}