# IRPCPropertyDefs.GetObjectClass

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) > [Property definitions and classes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/index.md)

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

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

Gets one class by ID, with the property definitions associated with it.

- **Service:** [Property definitions and classes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/index.md) `MFiles.IRPCPropertyDefs`
- **gRPC method:** `/MFiles.IRPCPropertyDefs/GetObjectClass`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-object-class`
- **Request:** [`GetObjectClassRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClass/index.md#request)
- **Response:** [`GetObjectClassResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetObjectClass/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

- Requires a vault session. No special vault rights are needed.
- Use it to build a metadata card or to check properties before
  [AddObject](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddObject/index.md): the class gives
  the required and optional properties (`associated_property_defs`), the property used as the
  object's name (`name_property_def`) and the default workflow.
- A class that does not exist, or that the user is not allowed to see, fails with the error
  message "Not found.". A deleted class also fails unless `allow_deleted` is true.
- `associated_property_defs` lists only the property definitions the user can see.
- Cacheable by metadata structure version.

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

## Request: GetObjectClassRequest

> 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 |
|---|---|---|
| `class_id` | `int32` | The ID of the class (an item ID in value list 1, Classes). 0 is the Document class; some built-in classes have negative IDs. |
| `allow_deleted` | `bool` | True to return the class even if it has been deleted. |

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

## Response: GetObjectClassResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page. Fields marked (recursive) refer to a type already on their path.

| Field | Type | Description |
|---|---|---|
| `object_class` | [`ObjectClass`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectClass/index.md) | The class. See [ObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectClass/index.md). |
| `object_class.base_info` | [`ValueListItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListItem/index.md) | The class as an item of value list 1 (Classes). The class ID is `base_info.item_info.obj_id.item_id.internal_id` and its name `base_info.item_info.name`. |
| `object_class.base_info.item_info` | [`ItemInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemInfo/index.md) | The item's identity and name: `obj_id.type` is the value list ID, `obj_id.item_id.internal_id` the item ID (unique within the list only), plus `name`, `guid`, `external_id` and flags. `options.is_deleted` marks a deleted item. |
| `object_class.base_info.has_parent` | `bool` | True if the item has a parent item in the same (hierarchical) list. |
| `object_class.base_info.has_owner` | `bool` | True if the item belongs to an item of the owner list (`ValueList.owner_object_type`). |
| `object_class.base_info.parent_id` | `int32` | With `has_parent`, the item ID of the parent item; otherwise ignored. |
| `object_class.base_info.owner_id` | `int32` | With `has_owner`, the item ID of the owner item in the owner list. |
| `object_class.base_info.owner_name` | `string` | The name of the owner item. |
| `object_class.base_info.automatic_permissions` | [`AutomaticPermissions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AutomaticPermissions/index.md) | If set, specifies the automatic permissions for an object for which the user selects this item. |
| `object_class.base_info.icon` | [`Bytes`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Bytes/index.md) | If set, contains the icon of this item in .ICO format. |
| `object_class.associated_property_defs[]` | repeated [`AssociatedPropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AssociatedPropertyDef/index.md) | The properties of objects of this class, each with `is_required`. Lists only property definitions the caller can see, and includes the built-in properties that every object has (such as 20 Created and 25 Created by). |
| `object_class.associated_property_defs[].property_def` | `int32` | The ID of the property definition. |
| `object_class.associated_property_defs[].is_required` | `bool` | True if objects of the class must have a value for this property. |
| `object_class.default_workflow` | `int32` | The default workflow of the document class, or zero if there is no default workflow. |
| `object_class.object_type` | `int32` | The ID of the object type the class belongs to. |
| `object_class.name_property_def` | `int32` | The property definition whose value is the object's name: 0 (Name or title) unless the class names its objects by another property. |
| `object_class.force_workflow` | `bool` | True if objects of this class must use `default_workflow`. |
| `object_class.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 class. Also specifies who can attach objects to this class. |
| `object_class.acl.checked_out_to_user` | `int32` | Specifies the ID of the user who has extended rights because of the checkout operation performed by her. 0 if such user does not exist. |
| `object_class.acl.is_fully_authoritative` | `bool` | Specifies whether this access control list is set to ignore the secondary permissions that come from the latest checked in version. |
| `object_class.acl.custom_component` | [`AccessControlListComponent`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponent/index.md) | Accesses the custom component of this ACL. |
| `object_class.acl.restrictive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the restrictive automatic components of this ACL. |
| `object_class.acl.secondary_access_control_list` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (recursive) | Secondary ACL used for latest version ACL. Not used for access check if null. |
| `object_class.acl.additive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the additive automatic components of this ACL. |
| `object_class.current_user_permissions` | [`ClassPermissionsForClient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ClassPermissionsForClient/index.md) | If set, specifies the permissions for current user that defines the visibility and other permission settings of this class. |
| `object_class.current_user_permissions.can_user_see` | `bool` | The class is visible for the current user. |
| `object_class.current_user_permissions.can_user_attach_objects` | `bool` | The current user can attach new objects to this class. |
| `object_class.object_type_class_content` | [`ObjectTypeSpecificClassContentUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeSpecificClassContentUnion/index.md) | Settings that only some object types have; set for the assignment classes of object type 10 (Assignment). |
| `object_class.object_type_class_content.assignment` | [`AssignmentClassInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AssignmentClassInfo/index.md) (oneof data) | Assignment-specific class settings. |
| `object_class.is_object_type_default_class` | `bool` | True if this is the default class of its object type. |

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

## Related methods

- [IRPCObjectOperations.AddObject](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/AddObject/index.md): Creates a new object without files.
