# License management (IRPCLicenseManagement)

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)

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

Reads and sets the server's license, its usage, and whether licensed features such as OCR or
M-Files Web are available.

Use this interface to set or get license code and serial number.

- **gRPC service:** `MFiles.IRPCLicenseManagement`
- **Book and level:** [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md), specialized
- **Methods:** 6
- **Proto file:** [`mfiles/IRPCLicenseManagement.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCLicenseManagement.proto)

<a id="overview"></a>

## Overview

M-Files Admin uses this service on its license page. Applications mostly need only
[DoesLicenseHaveFeature](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/DoesLicenseHaveFeature/index.md), which any
session can call to find out whether an add-on feature is licensed before offering it.

**Sessions and rights.** A server-level session is enough (log in with `login_data.vault_guid` =
`{00000000-0000-0000-0000-000000000000}`). Reading or changing the license code and reading the
usage require the system administrator server role (server right `manage_licenses` in
[ServerAccess](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerAccess/index.md)); other callers get "Access denied. You do not
have the server-level access rights required by this operation.". On servers that license each
vault separately through M-Files Manage, a vault administrator can also read that vault's
license and usage from a vault session.

- **Feature checks**:
  [DoesLicenseHaveFeature](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/DoesLicenseHaveFeature/index.md)
  (session),
  [DoesLicenseHaveFeatureByVaultDNS](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/DoesLicenseHaveFeatureByVaultDNS/index.md)
  (no session).
- **License code**:
  [GetLicenseCodeAndSerialNumber](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/GetLicenseCodeAndSerialNumber/index.md),
  [SetLicenseCodeAndSerialNumber](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/SetLicenseCodeAndSerialNumber/index.md),
  [RefreshLicenseCode](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/RefreshLicenseCode/index.md).
- **Usage**: [GetLicenseUsage](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/GetLicenseUsage/index.md).

<a id="methods"></a>

## Methods

| Method | Summary | Facts |
|---|---|---|
| [DoesLicenseHaveFeature](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/DoesLicenseHaveFeature/index.md) | Tells which of the requested add-on features (OCR, M-Files Web, AI search and so on) the license allows. | `admin` `session` `idempotent` |
| [DoesLicenseHaveFeatureByVaultDNS](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/DoesLicenseHaveFeatureByVaultDNS/index.md) | Tells whether a feature is licensed for the vault that a host name points to, without a session. | `admin` `no session` `idempotent` |
| [GetLicenseCodeAndSerialNumber](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/GetLicenseCodeAndSerialNumber/index.md) | Gets the server's serial number, license code and evaluation state. | `admin` `session` `idempotent` |
| [GetLicenseUsage](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/GetLicenseUsage/index.md) | Gets how many named, concurrent and read-only user licenses are in use. | `admin` `session` `idempotent` |
| [RefreshLicenseCode](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/RefreshLicenseCode/index.md) | Asks the server to fetch its license again from M-Files Manage. | `admin` `session` `idempotent` |
| [SetLicenseCodeAndSerialNumber](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLicenseManagement/SetLicenseCodeAndSerialNumber/index.md) | Installs a new license for the server. | `admin` `session` `idempotent` |
