v1

latestOpenAPI 3.0.2Apache-2.02026-07-142963051.0 MB
Classifications on files

Add classification to file

Adds a classification to a file by specifying the label of the classification to add.

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

post/files/{file_id}/metadata/enterprise/securityClassification-6VMVochwUWo

Path parameters

file_idstring required

The unique identifier that represents a file.

The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/files/123 the file_id is 123.

Request body

Box__Security__Classification__Keystring

The name of the classification to apply to this file.

To list the available classifications in an enterprise, use the classification API to retrieve the classification template which lists all available classification keys.

Example request

{
  "Box__Security__Classification__Key": "Sensitive"
}

Response

Returns the classification template instance that was applied to the file.

Box__Security__Classification__Keystring

The name of the classification applied to the item.

$parentstring

The identifier of the item that this metadata instance has been attached to. This combines the type and the id of the parent in the form {type}_{id}.

$template'securityClassification-6VMVochwUWo'

The value will always be securityClassification-6VMVochwUWo.

$scopestring

The scope of the enterprise that this classification has been applied for.

This will be in the format enterprise_{enterprise_id}.

$versioninteger

The version of the metadata instance. This version starts at 0 and increases every time a classification is updated.

$typestring

The unique ID of this classification instance. This will be include the name of the classification template and a unique ID.

$typeVersionnumber

The version of the metadata template. This version starts at 0 and increases every time the template is updated. This is mostly for internal use.

$canEditboolean

Whether an end user can change the classification.

Example response

{
  "Box__Security__Classification__Key": "Sensitive",
  "$parent": "folder_59449484661,",
  "$template": "securityClassification-6VMVochwUWo",
  "$scope": "enterprise_27335",
  "$version": 1,
  "$type": "securityClassification-6VMVochwUWo-fd31537a-0f95-4d86-9f2b-5974a29978f8",
  "$typeVersion": 5,
  "$canEdit": true
}