Skip to content
Go to Micro

Read a view bundle

client.views.get(stringviewID, ViewGetParams { teamId, viewObjectType, cursor, 3 more } params, RequestOptionsoptions?): 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}.

ParametersExpand Collapse
viewID: string
formatuuid
params: ViewGetParams { teamId, viewObjectType, cursor, 3 more }
teamId?: string

Path param

formatuuid
viewObjectType: "action" | "deal" | "document" | 3 more

Path param

One of the following:
"action"
"deal"
"document"
"event"
"identity"
"organization"
cursor?: string

Query param: Forwarded to the records sub-resource when include=records.

include?: string

Query param: 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?: number

Query param: Forwarded to the records sub-resource when include=records.

minimum0
maximum50
page?: number

Query param: Forwarded to the records sub-resource when include=records.

minimum1
ReturnsExpand Collapse
ViewGetResponse = ViewBundle { name, view_type, id, 18 more } | ViewBundleWithRecords { records, view }

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.

One of the following:
ViewBundle { name, view_type, id, 18 more }

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: string
view_type: string
id?: string
formatuuid
aggregation_prop_def_id?: string | null
formatuuid
aggregation_type?: string | null
column_layout?: Record<string, unknown> | null
combinator?: "AND" | "OR"
One of the following:
"AND"
"OR"
created_at?: string
filter?: Array<Record<string, unknown>>

Each entry is { slug: { comparator: value } }

group_by?: string | null

Property slug to group by

group_hidden_option_ids?: Array<unknown> | unknown | null
One of the following:
Array<unknown>
unknown
group_hide_empty?: boolean | null
group_sort?: string | null
icon?: string | null
list_id?: string | null
formatuuid
select?: Array<string>

Property slugs (dot-paths permitted for refs)

sort?: Array<Record<string, unknown>>

Each entry is { slug: ‘asc’ | ‘desc’ }

sort_order?: number | null
team_id?: string | null
formatuuid
updated_at?: string | null
user_id?: string | null
ViewBundleWithRecords { records, view }

Returned by GET /views/{viewId}?include=records. Same records shape as the standalone list-view-records endpoint.

records: Records { data, has_more, next_cursor }
data: Array<Record<string, unknown>>
has_more: boolean
next_cursor?: string | null
view: View { name, view_type, id, 18 more }

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: string
view_type: string
id?: string
formatuuid
aggregation_prop_def_id?: string | null
formatuuid
aggregation_type?: string | null
column_layout?: Record<string, unknown> | null
combinator?: "AND" | "OR"
One of the following:
"AND"
"OR"
created_at?: string
filter?: Array<Record<string, unknown>>

Each entry is { slug: { comparator: value } }

group_by?: string | null

Property slug to group by

group_hidden_option_ids?: Array<unknown> | unknown | null
One of the following:
Array<unknown>
unknown
group_hide_empty?: boolean | null
group_sort?: string | null
icon?: string | null
list_id?: string | null
formatuuid
select?: Array<string>

Property slugs (dot-paths permitted for refs)

sort?: Array<Record<string, unknown>>

Each entry is { slug: ‘asc’ | ‘desc’ }

sort_order?: number | null
team_id?: string | null
formatuuid
updated_at?: string | null
user_id?: string | null

Read a view bundle

import Micro from '@micro-so/sdk';

const client = new Micro({
  teamID: 'My Team ID',
  apiKey: process.env['MICRO_API_KEY'], // This is the default and can be omitted
});

const view = await client.views.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  viewObjectType: 'action',
});

console.log(view);
{
  "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"
}