# IRPCVaultsAdmin.EncryptFileData

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md)

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

Badges: `Administration API / specialized` `admin` `session`

Encrypts the existing files of a vault with the vault's latest encryption key.

- **Service:** [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md) `MFiles.IRPCVaultsAdmin`
- **gRPC method:** `/MFiles.IRPCVaultsAdmin/EncryptFileData`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/encrypt-file-data`
- **Request:** [`EncryptFileDataRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/EncryptFileData/index.md#request)
- **Response:** [`EncryptFileDataResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/EncryptFileData/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

- **Starts a background job and returns before it completes**; follow it with `task_id` (see the
  service overview).
- Requires the system administrator server role (server right `manage_vaults`).

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

## Request: EncryptFileDataRequest

> 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 |
|---|---|---|
| `encryptfiledatajob` | [`EncryptFileDataJob`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.EncryptFileDataJob/index.md) | The job. Set `vault_guid` to the GUID of the vault. |
| `encryptfiledatajob.vault_guid` | `string` | The GUID of the vault. |

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

## Response: EncryptFileDataResponse

> 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 |
|---|---|---|
| `task_id` | `int32` | The ID of the server-level scheduled job that encrypts the files. Pass it to [GetScheduledJobRunInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/GetScheduledJobRunInfo/index.md). |
