# IRPCPropertyDefsAdmin.RemovePropertyDef

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/RemovePropertyDef/

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

Deletes a property definition and its values from all objects, or only counts the values that
would be removed.

- **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/RemovePropertyDef`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/remove-property-def`
- **Request:** [`RemovePropertyDefRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/RemovePropertyDef/index.md#request)
- **Response:** [`RemovePropertyDefResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/RemovePropertyDef/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:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

- With `check_effects_only` false: **deletes all values of the property from the vault**, and the
  views and similar elements that use it. Use `copy_to_another_property_def` to move the values
  to another property definition first. This cannot be undone.
- With `check_effects_only` true: changes nothing and returns the counts in `null_values` and
  `non_null_values`. Otherwise both counts are 0.
- Requires `change_metadata_structure` and `license_allows_modifications`.
- Built-in property definitions cannot be removed. A property definition used by classes fails
  with an error that names the classes, unless `delete_from_classes_if_necessary` is true.
- Increments `property_defs_version` and the metadata structure version.

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

## Request: RemovePropertyDefRequest

> 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 |
|---|---|---|
| `property_def` | `int32` | The ID of the PropertyDef to remove. |
| `copy_to_another_property_def` | `bool` | True to move the values to `target_property_def` before deleting. |
| `target_property_def` | `int32` | The property definition that receives the values. Used only when `copy_to_another_property_def` is true. |
| `append` | `bool` | True to add the moved values to the target's existing values, false to overwrite them. |
| `delete_from_classes_if_necessary` | `bool` | True to remove the property definition from the classes that use it; false to fail if any class uses it. |
| `check_effects_only` | `bool` | True if the server should only check the effects of these changes to existing documents and not apply the changes yet. |

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

## Response: RemovePropertyDefResponse

> 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 |
|---|---|---|
| `null_values` | `uint32` | With `check_effects_only`, the number of empty values that would be removed. |
| `non_null_values` | `uint32` | With `check_effects_only`, the number of non-empty values that would be removed. |
