# Object type administration (IRPCObjectTypesAdmin)

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

Administers object types and value lists: reads their full definitions, adds, modifies, converts
and removes them, and manages value list items with administrator rights.

Use this interface to add, remove and modify object types and their
contents. This interface is intended to be used with administrative
value list operations as well. Value lists are just seen as simple object
types.

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

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

## Overview

This is the administrator's side of [IRPCObjectTypes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/index.md) and
[IRPCValueLists](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/index.md). M-Files Admin and administrative tools call it;
ordinary applications read the structure with the Vault API instead.

| | Vault API (read side) | This service |
| --- | --- | --- |
| Data | [ValueList](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueList/index.md): names, flags, the caller's permissions | [ValueListAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListAdmin/index.md): the same plus external database connection, column mappings, automatic permissions, aliases |
| Rights | none | `read_all_metadata_structure` to read, `change_metadata_structure` to write |
| Calls | [GetObjectTypes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypes/GetObjectTypes/index.md), [GetValueLists](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/GetValueLists/index.md) | [GetObjectTypeDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetObjectTypeDefs/index.md), [GetValueListDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetValueListDefs/index.md) |

- **Session and rights.** Every method requires a vault session. Reads need the vault right
  `read_all_metadata_structure`; writes need `change_metadata_structure` and
  `license_allows_modifications`. The vault role full control grants them. A normal user gets
  "Access denied." (gRPC status `UNKNOWN`, error codes 0x800407E4 and 0x800400A9).
  Connecting an object type to an external database also needs the server right `run_code`
  (see [ModifyObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ModifyObjectType/index.md)).
- **Read the definitions**:
  [GetObjectTypeDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetObjectTypeDefs/index.md),
  [GetValueListDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetValueListDefs/index.md),
  [GetObjectTypeDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetObjectTypeDef/index.md).
- **Change the definitions**:
  [AddObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/AddObjectType/index.md),
  [ModifyObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ModifyObjectType/index.md),
  [ConvertValueListToObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ConvertValueListToObjectType/index.md),
  [RemoveObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RemoveObjectType/index.md). Read the current
  definition first, change it, and send the whole [ValueListAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListAdmin/index.md)
  back.
- **External object types** (items read from an external database or connector):
  [ParseSQLSelectStatement](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement/index.md),
  [RefreshExternalObjectTypeColumnMappings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RefreshExternalObjectTypeColumnMappings/index.md),
  [GetExternalObjectTypePlugins](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetExternalObjectTypePlugins/index.md),
  [GetExternalObjectTypePluginConnectionInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetExternalObjectTypePluginConnectionInfo/index.md).
- **Value list items** (not objects of real object types):
  [AddObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/AddObjectTypeItem/index.md),
  [UpdateObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/UpdateObjectTypeItem/index.md),
  [RemoveObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RemoveObjectTypeItem/index.md),
  [ChangeObjectTypeItemPermissions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemPermissions/index.md),
  [ChangeObjectTypeItemIcon](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemIcon/index.md),
  [ChangeObjectTypeItemAutomaticPermissionsForObjects](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemAutomaticPermissionsForObjects/index.md).
  Users without administrator rights use the `...FromClient` methods of
  [IRPCValueLists](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/index.md) instead. Classes (list 1) and class groups
  (list 2) are not items here: use [IRPCPropertyDefsAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/index.md)
  and [IRPCDocClassGroupsAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/index.md).

**Metadata structure version.** Adding, modifying, converting and removing an object type or value list
increments the vault's metadata structure version by one when the change commits, so clients that cache
the structure reload it (see
[Metadata structure version and caching](https://developer.m-files.com/APIs/gRPC-API/concepts/metadata-structure-version-and-caching/index.md)). These methods do
not send the `mfiles-metadata-version-bin` trailer themselves; read the new value
with [GetMetadataStructureVersion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureVersion/index.md) or from
the trailer of the next call. Changing value list items does not change the metadata structure version,
except permission changes on items of structure lists such as classes. Changes that update the
metadata structure version fail while the vault is being archived or restored.

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

## Methods

| Method | Summary | Facts |
|---|---|---|
| [AddObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/AddObjectType/index.md) | Creates a new object type or value list. | `admin` `session` |
| [AddObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/AddObjectTypeItem/index.md) | Adds an item to a value list as an administrator. | `admin` `session` |
| [AreAutomaticPermissionsUsed](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/AreAutomaticPermissionsUsed/index.md) | Tells whether any item uses automatic permissions, in one object type or value list or in all of them. | `admin` `session` `idempotent` |
| [ChangeObjectTypeItemAutomaticPermissionsForObjects](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemAutomaticPermissionsForObjects/index.md) | Sets or clears the automatic permissions that an item (a value list item or an object) gives to the objects that refer to it. | `admin` `session` `idempotent` |
| [ChangeObjectTypeItemIcon](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemIcon/index.md) | Sets or clears the icon of a value list item. | `admin` `session` `idempotent` |
| [ChangeObjectTypeItemPermissions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ChangeObjectTypeItemPermissions/index.md) | Replaces the permissions (ACL) of a value list item. | `admin` `session` `idempotent` |
| [ConvertValueListToObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ConvertValueListToObjectType/index.md) | Converts a value list, and the lists that own it or that it owns, into real object types. | `admin` `session` |
| [GetExternalObjectTypePluginConnectionInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetExternalObjectTypePluginConnectionInfo/index.md) | Gets the configuration domain and status message of a connector for one object type. | `admin` `session` |
| [GetExternalObjectTypePlugins](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetExternalObjectTypePlugins/index.md) | Lists the installed connectors (vault applications) that can provide the items of external object types. | `admin` `session` |
| [GetObjectTypeDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetObjectTypeDef/index.md) | Gets the full administrative definition of one object type or value list. | `admin` `session` |
| [GetObjectTypeDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetObjectTypeDefs/index.md) | Gets the full administrative definitions of all real object types. | `admin` `session` `idempotent` |
| [GetValueListDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/GetValueListDefs/index.md) | Gets the full administrative definitions of all object types and value lists. | `admin` `session` `idempotent` |
| [ModifyObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ModifyObjectType/index.md) | Saves a changed definition of an object type or value list. | `admin` `session` `idempotent` |
| [ParseSQLSelectStatement](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement/index.md) | Connects to an external database and returns the source table and columns of a SELECT statement, to set up the column mappings of an external object type. | `admin` `session` `idempotent` |
| [RefreshExternalObjectTypeColumnMappings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RefreshExternalObjectTypeColumnMappings/index.md) | Re-reads the columns of an external object type's SELECT statement, merges them with the existing column mappings, and saves the object type. | `admin` `session` |
| [RemoveObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RemoveObjectType/index.md) | Removes an object type or value list together with its items, classes and dependent views. | `admin` `session` |
| [RemoveObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/RemoveObjectTypeItem/index.md) | Deletes an item of a value list as an administrator. | `admin` `session` |
| [UpdateObjectTypeItem](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/UpdateObjectTypeItem/index.md) | Updates an item of a value list (for example its name, parent or owner) as an administrator. | `admin` `session` `idempotent` |
