# Views ## Create a view bundle (view + select/filter/sort) `views.create(Literal["action", "deal", "document", 3 more]view_object_type, ViewCreateParams**kwargs) -> ViewCreateResponse` **post** `/v2/prism/{teamId}/{viewObjectType}/views` Create a view bundle (view + select/filter/sort) ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[Iterable[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[Iterable[object], object, null]]` - `Iterable[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[Sequence[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[Iterable[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` - `idempotency_key: Optional[str]` ### Returns - `class ViewCreateResponse: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) view = client.views.create( view_object_type="action", name="name", view_type="view_type", ) print(view.id) ``` #### Response ```json { "name": "name", "view_type": "view_type", "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_type": "aggregation_type", "column_layout": { "foo": "bar" }, "combinator": "AND", "created_at": "created_at", "filter": [ { "foo": "bar" } ], "group_by": "group_by", "group_hidden_option_ids": [ {} ], "group_hide_empty": true, "group_sort": "group_sort", "icon": "icon", "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "select": [ "string" ], "sort": [ { "foo": "bar" } ], "sort_order": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "updated_at", "user_id": "user_id" } ``` ## Read a view bundle `views.get(strview_id, ViewGetParams**kwargs) -> ViewGetResponse` **get** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}` Returns the view bundle. Pass `?include=records` to also fetch a page of records selected by the view in the same call; the response is then wrapped as `{view, records}`. ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `cursor: Optional[str]` Forwarded to the records sub-resource when `include=records`. - `include: Optional[str]` Comma-separated list of optional sub-resources to inline. Currently the only recognized value is `records` — when present, the response is `{view, records}` rather than the bare view bundle. - `limit: Optional[int]` Forwarded to the records sub-resource when `include=records`. - `page: Optional[int]` Forwarded to the records sub-resource when `include=records`. ### Returns - `ViewGetResponse` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `class ViewBundle: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` - `class ViewBundleWithRecords: …` Returned by `GET /views/{viewId}?include=records`. Same `records` shape as the standalone list-view-records endpoint. - `records: ViewBundleWithRecordsRecords` - `data: List[Dict[str, object]]` - `has_more: bool` - `next_cursor: Optional[str]` - `view: ViewBundleWithRecordsView` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) view = client.views.get( view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", ) print(view) ``` #### Response ```json { "name": "name", "view_type": "view_type", "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_type": "aggregation_type", "column_layout": { "foo": "bar" }, "combinator": "AND", "created_at": "created_at", "filter": [ { "foo": "bar" } ], "group_by": "group_by", "group_hidden_option_ids": [ {} ], "group_hide_empty": true, "group_sort": "group_sort", "icon": "icon", "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "select": [ "string" ], "sort": [ { "foo": "bar" } ], "sort_order": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "updated_at", "user_id": "user_id" } ``` ## Update a view bundle (select/filter/sort arrays are replaced wholesale when supplied) `views.update(strview_id, ViewUpdateParams**kwargs) -> ViewUpdateResponse` **patch** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}` Update a view bundle (select/filter/sort arrays are replaced wholesale when supplied) ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `filter: Optional[Iterable[Dict[str, object]]]` - `group_by: Optional[str]` - `group_hidden_option_ids: Optional[Union[Iterable[object], object, null]]` - `Iterable[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `name: Optional[str]` - `select: Optional[Sequence[str]]` - `sort: Optional[Iterable[Dict[str, object]]]` - `sort_order: Optional[int]` - `team_id: Optional[str]` - `user_id: Optional[str]` - `view_type: Optional[str]` - `idempotency_key: Optional[str]` ### Returns - `class ViewUpdateResponse: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) view = client.views.update( view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", ) print(view.id) ``` #### Response ```json { "name": "name", "view_type": "view_type", "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_type": "aggregation_type", "column_layout": { "foo": "bar" }, "combinator": "AND", "created_at": "created_at", "filter": [ { "foo": "bar" } ], "group_by": "group_by", "group_hidden_option_ids": [ {} ], "group_hide_empty": true, "group_sort": "group_sort", "icon": "icon", "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "select": [ "string" ], "sort": [ { "foo": "bar" } ], "sort_order": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "updated_at", "user_id": "user_id" } ``` ## Delete a view bundle `views.delete(strview_id, ViewDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}` Delete a view bundle ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.views.delete( view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", ) ``` ## Domain Types ### View Create Response - `class ViewCreateResponse: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` ### View Get Response - `ViewGetResponse` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `class ViewBundle: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` - `class ViewBundleWithRecords: …` Returned by `GET /views/{viewId}?include=records`. Same `records` shape as the standalone list-view-records endpoint. - `records: ViewBundleWithRecordsRecords` - `data: List[Dict[str, object]]` - `has_more: bool` - `next_cursor: Optional[str]` - `view: ViewBundleWithRecordsView` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` ### View Update Response - `class ViewUpdateResponse: …` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: str` - `view_type: str` - `id: Optional[str]` - `aggregation_prop_def_id: Optional[str]` - `aggregation_type: Optional[str]` - `column_layout: Optional[Dict[str, object]]` - `combinator: Optional[Literal["AND", "OR"]]` - `"AND"` - `"OR"` - `created_at: Optional[str]` - `filter: Optional[List[Dict[str, object]]]` Each entry is { slug: { comparator: value } } - `group_by: Optional[str]` Property slug to group by - `group_hidden_option_ids: Optional[Union[List[object], object, null]]` - `List[object]` - `object` - `group_hide_empty: Optional[bool]` - `group_sort: Optional[str]` - `icon: Optional[str]` - `list_id: Optional[str]` - `select: Optional[List[str]]` Property slugs (dot-paths permitted for refs) - `sort: Optional[List[Dict[str, object]]]` Each entry is { slug: 'asc' | 'desc' } - `sort_order: Optional[int]` - `team_id: Optional[str]` - `updated_at: Optional[str]` - `user_id: Optional[str]` # Records ## List records selected by a view (filters and sorts applied; pinned record_order overlaid first) `views.records.list(strview_id, RecordListParams**kwargs) -> RecordListResponse` **get** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records` List records selected by a view (filters and sorts applied; pinned record_order overlaid first) ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor. - `limit: Optional[int]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. ### Returns - `class RecordListResponse: …` - `data: List[Dict[str, object]]` - `has_more: bool` True if more records exist beyond this page. - `next_cursor: Optional[str]` Opaque cursor for the next page; null when `has_more` is false. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) records = client.views.records.list( view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", ) print(records.data) ``` #### Response ```json { "data": [ { "foo": "bar" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Bulk reorder pinned records `views.records.reorder(strview_id, RecordReorderParams**kwargs)` **patch** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records` Bulk reorder pinned records ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `object_ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.views.records.reorder( view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", object_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) ``` ## Pin a record to the view (append to record_order) `views.records.pin(strobject_id, RecordPinParams**kwargs)` **post** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}` Pin a record to the view (append to record_order) ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `object_id: str` - `idempotency_key: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.views.records.pin( object_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Unpin a record from the view `views.records.unpin(strobject_id, RecordUnpinParams**kwargs)` **delete** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}` Unpin a record from the view ### Parameters - `team_id: Optional[str]` - `view_object_type: Literal["action", "deal", "document", 3 more]` - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `view_id: str` - `object_id: str` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.views.records.unpin( object_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", view_object_type="action", view_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Domain Types ### Record List Response - `class RecordListResponse: …` - `data: List[Dict[str, object]]` - `has_more: bool` True if more records exist beyond this page. - `next_cursor: Optional[str]` Opaque cursor for the next page; null when `has_more` is false.