# Property definitions and classes (IRPCPropertyDefs)

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.IRPCPropertyDefs/

An interface for retrieving property definitions.

Provides methods for read-only access to PropertyDefs.

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

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

## Overview

Reads property definitions and classes: what metadata objects can have and how it is grouped.

| Job | Call |
| --- | --- |
| All property definitions (names, data types, lookup targets) | [GetPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDefs/index.md) |
| One property definition | [GetPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md) |
| All classes and class groups | [GetObjectClassesAndGroups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClassesAndGroups/index.md) |
| One class, for example to build a metadata card | [GetObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClass/index.md) |

**ID spaces.** Property definition IDs, class IDs, class group IDs and object type IDs are
separate number spaces; the same number means different things in each.

- A property definition ID identifies a property such as 0 (Name or title), 100 (Class) or
  1079 (Customer). Built-in property definitions have the same ID in every vault.
- A class is an item of value list 1 (Classes); its ID is
  `base_info.item_info.obj_id.item_id.internal_id` of [ObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectClass/index.md).
  Class 0 is Document; the default classes of some built-in object types have negative IDs
  (for example -100 Assignment). A class belongs to exactly one object type
  (`ObjectClass.object_type`).
- A class group is an item of value list 2 (Class groups).
- A lookup property points to an object type or value list with `PropertyDef.value_list`.

IDs of custom property definitions and classes differ between vaults: resolve them by alias or
GUID with [GetMetadataStructureItemIdByAlias](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdByAlias/index.md).

How property values are written and read is described in
[Properties and values](https://developer.m-files.com/APIs/gRPC-API/concepts/properties-and-values/index.md).

All four calls are cacheable by the metadata structure version (`mfiles-metadata-version-bin` trailer).
[GetPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDefs/index.md) and
[GetObjectClassesAndGroups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClassesAndGroups/index.md) also take
a `known_version`, so a client that keeps a cache can ask for the data only when it has changed.

<a id="highlighted"></a>

## Highlighted methods

| Method | Summary | Facts |
|---|---|---|
| [GetPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDefs/index.md) | Gets all property definitions that the user is allowed to see. | `read` `session or assertion` `idempotent` `returns metadata structure version` |
| [GetPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md) | Gets one property definition by ID. | `write` `session or assertion` `returns metadata structure version` |
| [GetObjectClassesAndGroups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClassesAndGroups/index.md) | Gets all classes and class groups that the user is allowed to see. | `read` `session or assertion` `idempotent` `returns metadata structure version` |
| [GetObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClass/index.md) | Gets one class by ID, with the property definitions associated with it. | `read` `session or assertion` `idempotent` `returns metadata structure version` |
