# IRPCViews.CopyView

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

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

Badges: `Vault API / standard` `write` `session or assertion` `returns metadata structure version`

Copies a private view that another user has shared, with its child views, into the caller's
own views.

- **Service:** [Views](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/index.md) `MFiles.IRPCViews`
- **gRPC method:** `/MFiles.IRPCViews/CopyView`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/copy-view`
- **Request:** [`CopyViewRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/CopyView/index.md#request)
- **Response:** [`CopyViewResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/CopyView/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

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

## Remarks

- The owner must first share the view with
  [EnableShareView](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/index.md). Otherwise the call fails with
  "This view is not shared with you.". The sharing expires after the number of days that
  [EnableShareView](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/index.md) returns (14 by default).
- Common views cannot be copied.
- The copy is a new private view at the top level of the caller's views; its child views are
  copied with it. Vault event handlers for views run.

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

## Request: CopyViewRequest

> 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 |
|---|---|---|
| `view_id` | [`ItemID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemID/index.md) | The ID of the shared view (`internal_id`). |
| `view_id.internal_id` | `int32` | The ID of the object or value list item. |
| `view_id.external_repository_id` | [`ExternalRepositoryID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExternalRepositoryID/index.md) | Used only for objects in external repositories (external connectors). Leave it unset for objects stored in the vault. |
| `view_id.external_repository_id.connection` | `string` | The external repository connection identifier. |
| `view_id.external_repository_id.item` | `string` | External ID within the scope of the connection to external system. |

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

## Response: CopyViewResponse

> 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 |
|---|---|---|
| `putf8szviews[]` | repeated [`View`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.View/index.md) | The new view and its copied child views. |
| `putf8szviews[].id` | `int32` | The ID of the view. |
| `putf8szviews[].type` | [`ViewType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ViewType/index.md) | The type of the view. Values: `VIEW_TYPE_SHOW_OBJECTS` (0), `VIEW_TYPE_FILTER_ONLY` (1). |
| `putf8szviews[].name` | `string` | The name of the view. |
| `putf8szviews[].is_common` | `bool` | Tells if the view is admin-defined (common) or user-defined. |
| `putf8szviews[].is_visible` | `bool` | Tells if the view is visible. |
| `putf8szviews[].location` | [`ViewLocation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ViewLocation/index.md) | The location of the view. Valid only if bHasParent is true. |
| `putf8szviews[].location.parent_folder[]` | repeated [`Folder`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Folder/index.md) | Array of folders describing the parent folder of the view. The first element of the array must be a view folder. Other elements, if any, are property folders. |
| `putf8szviews[].location.customizes_property_folder` | `bool` | True if the view is overlapping with a property folder. |
| `putf8szviews[].location.customized_property_folder` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The overlapped property folder. Ignored if bOverlapping is false. |
| `putf8szviews[].content_definition` | [`SearchDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchDef/index.md) | The search definition that contains the view levels and search conditions of the view. |
| `putf8szviews[].content_definition.filter_conditions[]` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | The conditions that limit the object set of this search. |
| `putf8szviews[].content_definition.grouping_levels[]` | repeated [`GroupingLevel`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.GroupingLevel/index.md) | View levels (the display hierarchy of this search). |
| `putf8szviews[].content_definition.options` | [`SearchFlags`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchFlags/index.md) | Search flags. This affects the resulting object version set and also distinct view level values displayed inside this search. |
| `putf8szviews[].acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Permissions. |
| `putf8szviews[].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. |
| `putf8szviews[].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. |
| `putf8szviews[].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. |
| `putf8szviews[].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. |
| `putf8szviews[].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. |
| `putf8szviews[].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. |
| `putf8szviews[].flags_obsolete` | `uint32` | Bit flags that provide additional information on the view. |
| `putf8szviews[].options` | [`VIEWFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VIEWFLAGS/index.md) | Bit flags that provide additional information on the view. |
| `putf8szviews[].options.all` | `bool` | Specifies all flags set; Including any future flags. |
| `putf8szviews[].options.indexed` | `bool` | Materialized/indexed view. |
| `putf8szviews[].options.incompatible_with_full_text_search` | `bool` | The search conditions of the view definition (excluding the grouping levels) are not compatible with full-text search. |
| `putf8szviews[].options.sort_across_all_pages_disabled` | `bool` | Sorting search results is disabled. |
| `putf8szviews[].guid` | `string` | GUID for the view. |
| `putf8szviews[].view_visualization` | [`ViewVisualization`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ViewVisualization/index.md) | View visualization information. |
| `putf8szviews[].view_visualization.subview_groups[]` | repeated [`SubviewGroup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SubviewGroup/index.md) | The subviews of the view as groups. |

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

## Related methods

- [EnableShareView](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/EnableShareView/index.md): Allows other users to copy the given private views of the caller for a limited time.
