Skip to content
Go to Micro

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)

ParametersExpand Collapse
team_id: Optional[str]
formatuuid
view_object_type: Literal["action", "deal", "document", 3 more]
One of the following:
"action"
"deal"
"document"
"event"
"identity"
"organization"
name: str
view_type: str
id: Optional[str]
formatuuid
aggregation_prop_def_id: Optional[str]
formatuuid
aggregation_type: Optional[str]
column_layout: Optional[Dict[str, object]]
combinator: Optional[Literal["AND", "OR"]]
One of the following:
"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]]
One of the following:
Iterable[object]
object
group_hide_empty: Optional[bool]
group_sort: Optional[str]
icon: Optional[str]
list_id: Optional[str]
formatuuid
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]
formatuuid
updated_at: Optional[str]
user_id: Optional[str]
idempotency_key: Optional[str]
minLength1
maxLength255
ReturnsExpand Collapse
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]
formatuuid
aggregation_prop_def_id: Optional[str]
formatuuid
aggregation_type: Optional[str]
column_layout: Optional[Dict[str, object]]
combinator: Optional[Literal["AND", "OR"]]
One of the following:
"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]]
One of the following:
List[object]
object
group_hide_empty: Optional[bool]
group_sort: Optional[str]
icon: Optional[str]
list_id: Optional[str]
formatuuid
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]
formatuuid
updated_at: Optional[str]
user_id: Optional[str]

Create a view bundle (view + select/filter/sort)

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)
{
  "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"
}
Returns Examples
{
  "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"
}