# IRPCViews.AddNewView

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

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

Creates a new private or common view.

- **Service:** [Views](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/index.md) `MFiles.IRPCViews`
- **gRPC method:** `/MFiles.IRPCViews/AddNewView`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-new-view`
- **Request:** [`AddNewViewRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/AddNewView/index.md#request)
- **Response:** [`AddNewViewResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViews/AddNewView/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

- **Private view** (`is_common` false): requires the vault right `manage_private_views`. The
  server replaces the ACL you send with one that gives all internal users read access; only the
  owner sees the view anyway.
- **Common view** (`is_common` true): requires `manage_common_views` and an explicit `acl`
  without named ACL references; an empty ACL fails with "The parameter is incorrect. (Zero
  length ACL.)".
- The server assigns `id` and `guid`; the values you send are ignored. The response has the
  stored view.
- Names must be unique, ignoring case, among the common views and the user's own views at the
  same level; a duplicate fails with "Another view with the same name already exists.".
- To place the view inside another view, set `location`. A common view needs a common parent,
  and a private view's parent must be a common view or one of the user's own views. Views cannot
  be added under the built-in views 13 (Built-in) and 23 (All object types).
- Indexed views (`options.indexed`) need `materialize_views`, cannot be private and cannot be
  filter-only views.
- Vault event handlers for views run. Anonymous sessions get "Access denied.".

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

## Request: AddNewViewRequest

> 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 |
|---|---|---|
| `utf8szview` | [`View`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.View/index.md) | The new view. Set at least `name`, `type`, `is_common`, `is_visible` and `content_definition`; for a common view also `acl`. `id` and `guid` are ignored. |
| `utf8szview.id` | `int32` | The ID of the view. |
| `utf8szview.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). |
| `utf8szview.name` | `string` | The name of the view. |
| `utf8szview.is_common` | `bool` | Tells if the view is admin-defined (common) or user-defined. |
| `utf8szview.is_visible` | `bool` | Tells if the view is visible. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.location.customizes_property_folder` | `bool` | True if the view is overlapping with a property folder. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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). |
| `utf8szview.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. |
| `utf8szview.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Permissions. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.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. |
| `utf8szview.flags_obsolete` | `uint32` | Bit flags that provide additional information on the view. |
| `utf8szview.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. |
| `utf8szview.options.all` | `bool` | Specifies all flags set; Including any future flags. |
| `utf8szview.options.indexed` | `bool` | Materialized/indexed view. |
| `utf8szview.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. |
| `utf8szview.options.sort_across_all_pages_disabled` | `bool` | Sorting search results is disabled. |
| `utf8szview.guid` | `string` | GUID for the view. |
| `utf8szview.view_visualization` | [`ViewVisualization`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ViewVisualization/index.md) | View visualization information. |
| `utf8szview.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="response"></a>

## Response: AddNewViewResponse

> 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 |
|---|---|---|
| `new_view` | [`View`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.View/index.md) | The view as stored, with its new ID and GUID. |
| `new_view.id` | `int32` | The ID of the view. |
| `new_view.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). |
| `new_view.name` | `string` | The name of the view. |
| `new_view.is_common` | `bool` | Tells if the view is admin-defined (common) or user-defined. |
| `new_view.is_visible` | `bool` | Tells if the view is visible. |
| `new_view.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. |
| `new_view.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. |
| `new_view.location.customizes_property_folder` | `bool` | True if the view is overlapping with a property folder. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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). |
| `new_view.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. |
| `new_view.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | Permissions. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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. |
| `new_view.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. |
| `new_view.flags_obsolete` | `uint32` | Bit flags that provide additional information on the view. |
| `new_view.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. |
| `new_view.options.all` | `bool` | Specifies all flags set; Including any future flags. |
| `new_view.options.indexed` | `bool` | Materialized/indexed view. |
| `new_view.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. |
| `new_view.options.sort_across_all_pages_disabled` | `bool` | Sorting search results is disabled. |
| `new_view.guid` | `string` | GUID for the view. |
| `new_view.view_visualization` | [`ViewVisualization`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ViewVisualization/index.md) | View visualization information. |
| `new_view.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. |
