# Object types (IRPCObjectTypes)

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

An interface for reading object types.

This interface provides read-only access to object types.

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

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

## Overview

Reads the object types of the vault: the kinds of objects users create, such as Document (0),
Customer or Project. Use it to resolve object type IDs to names, find the property definition
that refers to objects of a type, and check whether the user can create objects of a type.

| Job | Call |
| --- | --- |
| List all object types (with icons) | [GetObjectTypes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/GetObjectTypes/index.md) |
| Read one object type or value list by ID | [GetObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/GetObjectType/index.md) |
| Object types *and* plain value lists, without icons | [GetValueLists](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/GetValueLists/index.md) |
| Ask the server to re-read an external object type now | [RefreshExternalObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/RefreshExternalObjectType/index.md) |

**ID spaces.** An object type is a value list whose items are objects, so object types and value
lists share one ID space and both are described by [ValueList](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueList/index.md)
(`is_real_object_type` tells them apart). Property definition IDs
([IRPCPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/index.md)) are a separate space, and so are the item
IDs inside each list: a class ID, for example, is an item ID in value list 1 (Classes). Built-in
object types keep their IDs in every vault (0 Document, 9 Document collection, 10 Assignment);
the IDs of custom object types differ between vaults, so resolve them by alias or GUID with
[GetMetadataStructureItemIdByAlias](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdByAlias/index.md)
instead of hard-coding them.

The read calls are cacheable: keep the result until the metadata structure version that the server returns
in the `mfiles-metadata-version-bin` trailer changes. See
[Vault and metadata structure](https://developer.m-files.com/APIs/gRPC-API/concepts/vault-and-metadata-structure/index.md)
and
[Metadata structure version and caching](https://developer.m-files.com/APIs/gRPC-API/concepts/metadata-structure-version-and-caching/index.md).

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

## Highlighted methods

| Method | Summary | Facts |
|---|---|---|
| [GetObjectTypes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/GetObjectTypes/index.md) | Gets all object types (real object types only, not plain value lists), with their icons. | `read` `session or assertion` `idempotent` `returns metadata structure version` |
| [GetObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/GetObjectType/index.md) | Gets one object type or value list by ID, with its icon. | `write` `session or assertion` `returns metadata structure version` |

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

## Other methods

| Method | Summary | Facts |
|---|---|---|
| [RefreshExternalObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/RefreshExternalObjectType/index.md) | Refreshes the items of an external object type or value list from its external database now. | `write` `session or assertion` `idempotent` `returns metadata structure version` |
