# IRPCSensitivityLabels.GetSensitivityLabels

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Sensitivity labels](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSensitivityLabels/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSensitivityLabels/GetSensitivityLabels/

Badges: `Vault API / standard` `read` `session` `idempotent`

Gets the sensitivity labels of one file, or an empty list when no labels are available.

- **Service:** [Sensitivity labels](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSensitivityLabels/index.md) `MFiles.IRPCSensitivityLabels`
- **gRPC method:** `/MFiles.IRPCSensitivityLabels/GetSensitivityLabels`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-sensitivity-labels`
- **Request:** [`GetSensitivityLabelsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSensitivityLabels/GetSensitivityLabels/index.md#request)
- **Response:** [`GetSensitivityLabelsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSensitivityLabels/GetSensitivityLabels/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires a vault session. No special vault rights are needed, and the server does not look up
  the object that the file belongs to.
- The server reads only `file.master_storage_file_ref` and `file.extension`. Pass a
  [File](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) as returned with an object version.
- `label_info.labels` is empty when any of these holds: the feature is not enabled on the
  server, the vault does not store files in SharePoint Embedded, `master_storage_file_ref` is
  empty, the extension is not one that carries labels, or the storage service fails or answers
  with something the server cannot parse.
- Labels are looked up only for Word, Excel and PowerPoint formats (for example `docx`, `xlsx`,
  `pptx` and their older and macro-enabled variants) and `pdf`. The extension is compared
  case-insensitively.

<a id="request"></a>

## Request: GetSensitivityLabelsRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `file` | [`File`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.File/index.md) | The file to query. Only `master_storage_file_ref` and `extension` are read. |
| `file.file_ver` | [`FileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVer/index.md) | The file and its version. Pass it unchanged in an `ObjFileVer` to download the file. |
| `file.file_ver.file_id` | [`FileID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileID/index.md) | The file. |
| `file.file_ver.type` | [`FileVerType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileVerType/index.md) | `FILE_VER_TYPE_SPECIFIC` for a file version number. Values: `FILE_VER_TYPE_UNINITIALIZED` (0), `FILE_VER_TYPE_LATEST` (1), `FILE_VER_TYPE_ANY` (2), `FILE_VER_TYPE_SPECIFIC` (3). |
| `file.file_ver.internal_version` | `int32` | The file version number. |
| `file.file_ver.external_repository_version` | `string` | Used only for files in external repositories. Leave empty. |
| `file.file_ver.external_repository_sort_key` | `int64` | Used only for files in external repositories. Leave 0. |
| `file.title` | `string` | The file name without the extension. |
| `file.extension` | `string` | The file name extension without the dot, for example "pdf". |
| `file.size` | `int64` | The size of the file in bytes. Exact when `size_precision` is `FILE_SIZE_PRECISION_EXACT`. |
| `file.size_precision` | [`FileSizePrecision`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileSizePrecision/index.md) | How exact `size` is. Do not rely on `size` if it is `FILE_SIZE_PRECISION_UNKNOWN`. Values: `FILE_SIZE_PRECISION_EXACT` (0), `FILE_SIZE_PRECISION_ESTIMATE` (1), `FILE_SIZE_PRECISION_UNKNOWN` (2). |
| `file.created_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was originally created. |
| `file.accessed_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last accessed (e.g. read). |
| `file.written_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last written to. |
| `file.changed_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The time in UTC the file was last written to or its attributes were changed. |
| `file.guid` | `string` | GUID of the file. |
| `file.md5_checksum` | `string` | The MD5 checksum of the file as 32 lowercase hexadecimal digits, if available. |
| `file.is_missing` | `bool` | True, if the file is missing. |
| `file.is_content_volatile` | `bool` | True, if the file physical content is volatile. I.e. the physical content can change without the version number change, as long as the logical content is same. The file content is guaranteed to stay physically consistent within single download session only. |
| `file.flags` | [`OBJECTFILEFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OBJECTFILEFLAGS/index.md) | Object file flags. |
| `file.flags.all` | `bool` | Specifies all flags set; Including any future flags. |
| `file.flags.can_be_edited_externally` | `bool` | Next available value. |
| `file.master_storage_file_ref` | `string` | An optional File reference (GUID) to external Master Storage API. Only used with Master Storage, otherwise empty. |

<a id="response"></a>

## Response: GetSensitivityLabelsResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `label_info` | [`FileSensitivityLabelInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileSensitivityLabelInfo/index.md) | The labels of the file. An empty `labels` list means that no label information is available, not that the file is known to be unlabeled. |
| `label_info.labels[]` | repeated [`FileSensitivityLabel`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileSensitivityLabel/index.md) | Labels attached to the file. |
| `label_info.labels[].label_id` | `string` | Stable identifier of the label. May be null. |
| `label_info.labels[].label_name` | `string` | Human-readable display name. May be null. |
| `label_info.labels[].tooltip` | `string` | Hover tooltip text. May be null. |
| `label_info.labels[].color` | `string` | Color hint (e.g. "#FF0000"). May be null. |
| `label_info.labels[].has_protection` | `bool` | TRUE if the label applies encryption/rights-protection. Defaults to FALSE when absent. |
