# IRPCVault.GetMetadataStructure

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) > [Vault information](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/index.md)

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

Badges: `Vault API / core` `read` `session or assertion` `idempotent` `returns metadata structure version`

Gets the vault's real object types (not value lists), with icons, in one call.

- **Service:** [Vault information](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/index.md) `MFiles.IRPCVault`
- **gRPC method:** `/MFiles.IRPCVault/GetMetadataStructure`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-metadata-structure`
- **Request:** [`GetMetadataStructureRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructure/index.md#request)
- **Response:** [`GetMetadataStructureResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructure/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** read
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** yes
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

Set `object_type_and_value_list_request.include_real_object_types` to true; with false, or with
no request part set, the lists come back empty. Value lists are not returned by this method; use
the object types and value lists services for those. The administrative request part requires the
right to see the full metadata structure and fails with `E_MFILES_ACCESS_DENIED` otherwise.

<a id="request"></a>

## Request: GetMetadataStructureRequest

A structure that specifies the request type for the GetMetadataStructure method.

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `object_type_and_value_list_request` | [`ObjectTypeAndValueListStructureRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeAndValueListStructureRequest/index.md) | Requests the specified object types and value lists from the server when set. |
| `object_type_and_value_list_request.include_real_object_types` | `bool` | Requests real object types from the vault. |
| `object_type_and_value_list_admin_request` | [`ObjectTypeAndValueListAdminStructureRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeAndValueListAdminStructureRequest/index.md) | Requests the specified administrative object types and value lists from the server when set. |
| `object_type_and_value_list_admin_request.include_real_object_types` | `bool` | Requests real administrative object types from the vault. |

<a id="response"></a>

## Response: GetMetadataStructureResponse

A structure that specifies the response type for the GetzMetadataStructure method.

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `object_type_and_value_list_response` | [`ObjectTypeAndValueListStructureResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeAndValueListStructureResponse/index.md) | Receives the object types and value lists if they were requested. |
| `object_type_and_value_list_response.object_types_and_value_lists[]` | repeated [`ValueList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueList/index.md) | The object type and value list entries. |
| `object_type_and_value_list_response.object_types_and_value_lists[].id` | `int32` | The ID of the object type or value list. Object types and value lists share one ID space; property definition IDs and item IDs are separate spaces. |
| `object_type_and_value_list_response.object_types_and_value_lists[].name_singular` | `string` | The singular name, for example "Customer". Empty if the caller is not allowed to see the list. |
| `object_type_and_value_list_response.object_types_and_value_lists[].name_plural` | `string` | The plural name, for example "Customers". Empty if the caller is not allowed to see the list. |
| `object_type_and_value_list_response.object_types_and_value_lists[].icon` | `bytes` | The icon in .ICO format. Filled only by GetObjectTypes and GetObjectType, and only for real object types; empty in GetValueLists and GetValueList. |
| `object_type_and_value_list_response.object_types_and_value_lists[].is_real_object_type` | `bool` | True for an object type, whose items are objects (documents, customers); false for a plain value list (Country, Classes, Users). |
| `object_type_and_value_list_response.object_types_and_value_lists[].is_hierarchical` | `bool` | True if items can have a parent item in the same list (`ValueListItem.has_parent`). |
| `object_type_and_value_list_response.object_types_and_value_lists[].has_owner` | `bool` | True if every item belongs to an item of another list, the owner list (`owner_object_type`). For example, contact persons are owned by customers. |
| `object_type_and_value_list_response.object_types_and_value_lists[].owner_object_type` | `int32` | With `has_owner`, the ID of the owner list or object type. |
| `object_type_and_value_list_response.object_types_and_value_lists[].owner_property_def` | `int32` | Owner property def. Subobjects of objects of this object type have this property in their meta data for describing owner relationships. |
| `object_type_and_value_list_response.object_types_and_value_lists[].options` | [`OBJTYPEFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OBJTYPEFLAGS/index.md) | Flags of the list, for example `can_add_items` and `is_external`. See [OBJTYPEFLAGS](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OBJTYPEFLAGS/index.md). |
| `object_type_and_value_list_response.object_types_and_value_lists[].default_property_def` | `int32` | The ID of the lookup property definition that refers to items of this list by default, for example 1079 (Customer) for the Customer object type. |
| `object_type_and_value_list_response.object_types_and_value_lists[].read_only_properties_during_insert[]` | repeated `int32` | The propertydef IDs of those properties that cannot be entered during the creation of a new object because they are not included in the INSERT INTO statement. |
| `object_type_and_value_list_response.object_types_and_value_lists[].read_only_properties_during_update[]` | repeated `int32` | The propertydef IDs of those properties that cannot be entered during the editing of an existing object because they are not included in the UPDATE statement. |
| `object_type_and_value_list_response.object_types_and_value_lists[].targets_for_browsing[]` | repeated [`ObjectTypeTargetForBrowsing`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeTargetForBrowsing/index.md) | Object type targets for browsing. |
| `object_type_and_value_list_response.object_types_and_value_lists[].acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Specifies the ACL that defines the visibility and other permission settings of this object type. Also specifies who can add new items to this object type. |
| `object_type_and_value_list_response.object_types_and_value_lists[].object_type_permissions` | [`ObjectTypePermissionsForClient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypePermissionsForClient/index.md) | What the caller may do with the list: see it (`can_user_see`) and add items or objects (`can_user_add_new_items`). Filled by the read calls of IRPCObjectTypes and IRPCValueLists. |
| `object_type_and_value_list_response.object_types_and_value_lists[].default_acl_for_objects` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Default ACL for new items/objects of this type. If unset, the global default is used (vlitems: read access to all internal users; real objects: full control for all internal users). |
| `object_type_and_value_list_response.object_types_and_value_lists[].vl_sorting_type_reserved` | [`VLSortingType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.VLSortingType/index.md) | The sorting type of value list items. NOTE: This value is not currently used but is reserved for future use. Currently, sorting order is specified on the property definition level only. Values: `VLSORTING_TYPE_BY_DISPLAY_NAME` (0), `VLSORTING_TYPE_BY_EXTERNAL_ID` (1). |
| `object_type_and_value_list_response.object_types_and_value_lists[].sort_ascending_reserved` | `bool` | True to sort in ascending order, false to sort in descending order. NOTE: This value is not currently used but is reserved for future use. Currently, sorting order is specified on the property definition level only. |
| `object_type_and_value_list_response.object_types_and_value_lists[].guid` | `string` | The GUID of the object type or value list, with braces. Resolve it to the vault's ID with [GetMetadataStructureItemIdByGUID](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdByGUID/index.md). |
| `object_type_and_value_list_response.object_types_and_value_lists[].preferred_title_property_def_id` | `int32` | Property definition ID of the title property for the user's preferred language. |
| `object_type_and_value_list_response.object_types_and_value_lists[].search_characteristics` | [`ObjectTypeSearchCharacteristics`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeSearchCharacteristics/index.md) | If set, specifies search characteristics of the object type. |
| `object_type_and_value_list_response.object_types_and_value_lists[].indexing_definition` | [`ObjectTypeIndexingDefinition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeIndexingDefinition/index.md) | If set, defines the indexed value lists and properties of the object type. Used for searching from Master Storage. |
| `object_type_and_value_list_response.object_types_and_value_lists[].view_id` | `int32` | The ID of the object type specific view. |
| `object_type_and_value_list_admin_response` | [`ObjectTypeAndValueListAdminStructureResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeAndValueListAdminStructureResponse/index.md) | Receives the administrative object types and value lists if they were requested. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[]` | repeated [`ValueListAdmin`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListAdmin/index.md) | The object type and value list entries. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].object_type` | [`ValueList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueList/index.md) | Basic data. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_connection_string` | `string` | OLE DB connection string to the external database that contains the objects (and their properties) of this object type. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_select_all_statement` | `string` | SQL statement that retrieves the objects from an external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_select_one_statement` | `string` | SQL statement that retrieves a specific object from an external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_insert_statement` | `string` | SQL statement that inserts a new object to an external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_select_latest_id_statement` | `string` | SQL statement that retrieves the ID of the just inserted record in the external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_update_statement` | `string` | SQL statement that updates an existing object in an external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_delete_statement` | `string` | SQL statement that deletes an object in an external database. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].database_column_mappings[]` | repeated [`ObjectTypeColumnMapping`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeColumnMapping/index.md) | Column mappings. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].automatic_acl_for_objects` | [`AutomaticPermissions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AutomaticPermissions/index.md) | The default automatic permissions for items and objects. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].tags[]` | repeated [`NamedValueNamespace`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValueNamespace/index.md) | Names value namespaces related to the object type. |
| `object_type_and_value_list_admin_response.object_types_and_value_lists[].version_number` | `uint32` | Object type version number, used for OT modification conflicts tracking. |

<a id="related"></a>

## Related methods

- [GetMetadataStructureItemIdByGUID](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdByGUID/index.md): Finds the vault-specific ID of a metadata structure item (object type, property definition, class, workflow, ...) from its GUID.
- [GetMetadataStructureItemIdByAlias](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdByAlias/index.md): Finds the vault-specific ID of a metadata structure item from one of its aliases.
- [GetMetadataStructureItemIdsByAliases](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdsByAliases/index.md): Gets all unambiguous alias-to-ID mappings of one kind of metadata structure item, or of all kinds, as JSON.
- [GetMetadataStructureItemIdsByAliases_Compressed](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdsByAliases_Compressed/index.md): Gets alias-to-ID mappings of several kinds of metadata structure item as JSON, with the option to exclude kinds.
- [GetMetadataStructureItemIdsFromMDCardConfiguration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureItemIdsFromMDCardConfiguration/index.md): Gets metadata structure item IDs and related aliases or GUIDs which are used in Metadata card configuration value. Created for HttpServer.
- [GetMetadataStructureVersion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetMetadataStructureVersion/index.md): Gets the version numbers of the vault's metadata structure and of its property definitions.
