# Named value storage (IRPCNamedValueStorage)

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)

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

Reads and writes named values: small key-value settings stored in the vault, grouped by
storage type and namespace.

- **gRPC service:** `MFiles.IRPCNamedValueStorage`
- **Book and level:** [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md), standard
- **Methods:** 3
- **Proto file:** [`mfiles/IRPCNamedValueStorage.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCNamedValueStorage.proto)

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

## Overview

Named value storage keeps configuration and state for applications, vault applications and
M-Files itself. A value is addressed by three things:

1. **Storage type** ([NamedValueType](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.NamedValueType/index.md)): decides who can read and
   write, and whether the value is shared or private to one user.
2. **Namespace**: a string of at most 100 characters, for example `"MyCompany.MyApp"`. Choose
   one that is unique to your application.
3. **Key**: the `key` of a [NamedValue](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValue/index.md), at most 100 characters. The
   value is a [TypedValue](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md), usually `DATATYPE_TEXT` or
   `DATATYPE_MULTILINE_TEXT` holding the setting as text.

Use the same spelling and case for namespaces and keys every time; keys that differ only in
case are stored as separate values.

| Storage type | Who can read | Who can write and remove |
| --- | --- | --- |
| `NAMED_VALUE_TYPE_USER_CONFIGURATION_VALUE` | any user | any user (shared by all users) |
| `NAMED_VALUE_TYPE_USER_SPECIFIC_VALUE` | the user only | the user only (private to each user) |
| `NAMED_VALUE_TYPE_METADATA_CONFIGURATION_VALUE` | any user | vault right `change_metadata_structure` |
| `NAMED_VALUE_TYPE_FOLDER_CONFIGURATION_VALUE` | any user | vault right `manage_common_views` |
| `NAMED_VALUE_TYPE_ADMIN_CONFIGURATION_VALUE` | vault right `read_all_metadata_structure` | vault right `change_metadata_structure` |
| `NAMED_VALUE_TYPE_SYSTEM_CONFIGURATION_VALUE` | system administrators | `change_metadata_structure` and full server rights |
| `NAMED_VALUE_TYPE_REGISTRY_VALUE` | any user | nobody (read-only) |

`NAMED_VALUE_TYPE_PROPERTY_AUTOMATIC_NUMBERING` and `NAMED_VALUE_TYPE_VAULT_SHARED_VARIABLE`
are not accessible through this service ("Access denied."), and
`NAMED_VALUE_TYPE_UNINITIALIZED` fails with "The parameter is incorrect.". Anonymous sessions
cannot set values. Vault rights are in [VaultAccess](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultAccess/index.md).

Some namespaces of the configuration types hold M-Files' own vault configuration, such as vault
settings and metadata card configuration. Writing to them changes how the vault behaves and can
change the metadata structure version. Do not write to namespaces that your application does not own.

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

## Methods

| Method | Summary | Facts |
|---|---|---|
| [GetNamedValues](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCNamedValueStorage/GetNamedValues/index.md) | Gets all named values of one storage type and namespace. | `read` `session` `idempotent` `returns metadata structure version` |
| [RemoveNamedValues](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCNamedValueStorage/RemoveNamedValues/index.md) | Removes named values from one namespace by key. | `write` `session` `returns metadata structure version` |
| [SetNamedValues](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCNamedValueStorage/SetNamedValues/index.md) | Creates or replaces the given named values in one namespace, optionally only if the current values are as expected. | `write` `session` `idempotent` `returns metadata structure version` |
