# IRPCPropertyDefsAdmin.ModifyObjectClass

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

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

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Saves a changed class and, optionally, its property associations.

- **Service:** [Property definition and class administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/index.md) `MFiles.IRPCPropertyDefsAdmin`
- **gRPC method:** `/MFiles.IRPCPropertyDefsAdmin/ModifyObjectClass`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/modify-object-class`
- **Request:** [`ModifyObjectClassRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/ModifyObjectClass/index.md#request)
- **Response:** [`ModifyObjectClassResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/ModifyObjectClass/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

- Requires `change_metadata_structure` and `license_allows_modifications`, and read access to the
  class.
- Adding or removing properties of existing objects runs as background tasks, returned in
  `async_task_ids`; follow them with
  [GetAsyncTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTask/index.md).
- The same name-property permission rule as in
  [AddObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddObjectClass/index.md) applies.
- Increments the metadata structure version.

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

## Request: ModifyObjectClassRequest

> 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 |
|---|---|---|
| `doc_class` | [`DocClass`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DocClass/index.md) | The complete new class; `value_list_item.item_info.obj_id.item_id.internal_id` identifies it. |
| `doc_class.value_list_item` | [`ValueListItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListItem/index.md) | Value list item representing this document class. |
| `doc_class.value_list_item.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. |
| `doc_class.value_list_item.has_parent` | `bool` | True if the item has a parent item in the same (hierarchical) list. |
| `doc_class.value_list_item.has_owner` | `bool` | True if the item belongs to an item of the owner list (`ValueList.owner_object_type`). |
| `doc_class.value_list_item.parent_id` | `int32` | With `has_parent`, the item ID of the parent item; otherwise ignored. |
| `doc_class.value_list_item.owner_id` | `int32` | With `has_owner`, the item ID of the owner item in the owner list. |
| `doc_class.value_list_item.owner_name` | `string` | The name of the owner item. |
| `doc_class.value_list_item.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. |
| `doc_class.value_list_item.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. |
| `doc_class.workflow` | `int32` | The default workflow of the document class, or zero if there is no default workflow. |
| `doc_class.object_type` | `int32` | The object type with which this class is used. |
| `doc_class.is_predefined` | `bool` | True if this is a predefined class (cannot be deleted, editing is restricted). |
| `doc_class.force_workflow` | `bool` | True if the use of the workflow with this class is enforced. |
| `doc_class.name_property_def` | `int32` | The ID of the property definition that represents the name of the document or other object. Typically PROPERTYDEF_TITLE (0). |
| `doc_class.object_type_specific_properties` | [`ObjectTypeSpecificClassContentUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeSpecificClassContentUnion/index.md) | Additional object type specific class content. |
| `doc_class.object_type_specific_properties.assignment` | [`AssignmentClassInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AssignmentClassInfo/index.md) (oneof data) | Assignment-specific class settings. |
| `doc_class.signature_settings_for_new_objects` | [`ElectronicSignatureSettings`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ElectronicSignatureSettings/index.md) | The electronic signature settings for creating an electronic signature for new objects. Reserved for future improvements. |
| `doc_class.signature_settings_for_new_objects.is_required` | `bool` | True if this transition requires an electronic signature. |
| `doc_class.signature_settings_for_new_objects.prompt_mode` | [`ElectronicSignaturePromptMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ElectronicSignaturePromptMode/index.md) | Option 1: static reason/meaning. Values: `ELECTRONIC_SIGNATURE_PROMPT_MODE_FIXED` (0), `ELECTRONIC_SIGNATURE_PROMPT_MODE_SELECTABLE` (1). |
| `doc_class.signature_settings_for_new_objects.fixed_prompt_details` | [`ElectronicSignaturePromptInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ElectronicSignaturePromptInfo/index.md) | Option 2: Pre-defined reason |
| `doc_class.signature_settings_for_new_objects.selectable_prompt_details[]` | repeated [`ElectronicSignaturePromptInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ElectronicSignaturePromptInfo/index.md) | Option 3: Metadata-based reason/meaning. |
| `doc_class.signature_settings_for_new_objects.user_selectable_reason_meaning_items_property_def` | `int32` | A property definition that represents items in value list. Used if the prompt mode is eesrmpmPromptModeMetadataBasedUserSelectable. |
| `doc_class.signature_settings_for_new_objects.user_selectable_reason_property_def` | `int32` | A property definition that indicates the reason property. PROPERTYDEF_UNINITIALIZED if no reason is specified. Used if the prompt mode is eesrmpmPromptModeMetadataBasedUserSelectable. |
| `doc_class.signature_settings_for_new_objects.user_selectable_meaning_property_def` | `int32` | A property definition that indicates the meaning property. PROPERTYDEF_UNINITIALIZED if no meaning is specified. Used if the prompt mode is eesrmpmPromptModeMetadataBasedUserSelectable. |
| `doc_class.signature_settings_for_new_objects.add_metadata_reference_to_reason_meaning_item` | `bool` | Common prompt details. |
| `doc_class.signature_settings_for_new_objects.prompt_free_form_text` | `bool` | True if a free-form text is prompted with the signature. |
| `doc_class.signature_settings_for_new_objects.free_form_text_property_def` | `int32` | Signature details. boolean bFillReasonPropertyText;  //!< Optional? boolean bFillMeaningPropertyText;  //!< Optional? |
| `doc_class.signature_settings_for_new_objects.manifestation_additional_info` | `string` | Additional information for the manifestation text for the signature. This is not shown to the user when signing. |
| `doc_class.signature_settings_for_new_objects.create_separate_signature_object` | `bool` | True if the electronic signature shall be stored as a separate signature object. False to store as an embedded signature in a multi-line text property. |
| `doc_class.signature_settings_for_new_objects.manifestation_property_def` | `int32` | Property definition to be used for storing the signature manifestation on the object. Ignored if bCreateSeparateSignatureObject is true. |
| `doc_class.signature_settings_for_new_objects.signature_identifier` | `string` | Signature identifier. Required if bCreateSeparateSignatureObject is true. |
| `doc_class.aliases` | `string` | Semicolon-separated list of semantic aliases. |
| `automatic_permissions_forced_active` | `bool` | True to make changed automatic permissions active on the objects of the class, false to add them inactive. |
| `modify_associations` | `bool` | True to replace the class's property associations with `property_defs`. |
| `property_defs[]` | repeated [`AssociatedPropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AssociatedPropertyDef/index.md) | The new property associations. Ignored when `modify_associations` is false. |
| `property_defs[].property_def` | `int32` | The ID of the property definition. |
| `property_defs[].is_required` | `bool` | True if objects of the class must have a value for this property. |

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

## Response: ModifyObjectClassResponse

> 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 |
|---|---|---|
| `task_idchange_objects` | `int64` | The ID of the last background task that adds or removes properties of existing objects, or -1 if there is none. It is also in `async_task_ids`. |
| `async_task_ids[]` | repeated [`AsyncTaskID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AsyncTaskID/index.md) | All background tasks started by the change. |
| `async_task_ids[].id` | `int64` | Task ID. |
| `async_task_ids[].type` | `string` | Task type name. |
| `async_task_ids[].definition` | `string` | The display string of the task definition. |

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

## Related methods

- [IRPCBackgroundOperationsAdmin.GetAsyncTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTask/index.md): Gets one asynchronous task by ID.
- [AddObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddObjectClass/index.md): Creates a class with its property associations.
