Box Developer Documentation
 
    Latest version

    Add initial classifications

    post
    https://api.box.com/2.0
    /metadata_templates/schema

    This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

    When an enterprise does not yet have any classifications, this API call initializes the classification template with an initial set of classifications.

    If an enterprise already has a classification, the template will already exist and instead an API call should be made to add additional classifications.

    Request

    bearer [ACCESS_TOKEN]
    application/json

    Request Body

    booleanin bodyoptional
    false

    Determines if classifications are copied along when the file or folder is copied.

    stringin bodyrequired
    "Classification"

    The name of the template as shown in web and mobile interfaces.

    Value is always Classification

    object arrayin bodyrequired

    The classification template requires exactly one field, which holds all the valid classification values.

    stringin bodyrequired
    "enum"

    The type of the field that is always enum.

    Value is always enum

    stringin bodyrequired
    "Classification"

    A display name for the classification.

    Value is always Classification

    booleanin bodyoptional
    false

    Determines if the classification template is hidden or available on web and mobile devices.

    stringin bodyrequired
    "Box__Security__Classification__Key"

    Defines classifications available in the enterprise.

    Value is always Box__Security__Classification__Key

    object arrayin bodyrequired

    The actual list of classifications that are present on this template.

    stringin bodyrequired
    "Sensitive"

    The display name and key this classification. This will be show in the Box UI.

    Additional information about the classification.

    Additional information about the classification.

    booleanin bodyoptional
    false

    Determines if the classification template is hidden or available on web and mobile devices.

    stringin bodyrequired
    "enterprise"

    The scope in which to create the classifications. This should be enterprise or enterprise_{id} where id is the unique ID of the enterprise.

    Value is always enterprise

    stringin bodyrequired
    "securityClassification-6VMVochwUWo"

    Defines the list of metadata templates.

    Value is always securityClassification-6VMVochwUWo

    Response

    Returns a new 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.

    post
    Add initial classifications
    You can now try out some of our APIs live, right here in the documentation.
    Log in

    Request Example

    cURL
    curl -i -X POST "https://api.box.com/2.0/metadata_templates/schema" \
         -H "authorization: Bearer <ACCESS_TOKEN>" \
         -H "content-type: application/json" \
         -d '{
           "templateKey": "securityClassification-6VMVochwUWo",
           "scope": "enterprise",
           "displayName": "Classification",
           "hidden": false,
           "copyInstanceOnItemCopy": true,
           "fields": [
             {
               "type": "enum",
               "key": "Box__Security__Classification__Key",
               "displayName": "Classification",
               "hidden": false,
               "options": [
                 {
                   "key": "Classified",
                   "staticConfig": {
                     "classification": {
                       "colorID": 7,
                       "classificationDefinition": "Top Seret"
                     }
                   }
                 }
               ]
             }
           ]
         }'

    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"
    }