Skip to content
Go to Micro

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

client.views.create("comment" | "action" | "deal" | 5 moreobjectType, ViewCreateParams { teamId, name, view_type, 20 more } params, RequestOptionsoptions?): ViewCreateResponse { name, view_type, id, 18 more }
POST/v2/prism/{teamId}/{objectType}/views

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

ParametersExpand Collapse
objectType: "comment" | "action" | "deal" | 5 more
One of the following:
"comment"
"action"
"deal"
"engagement"
"document"
"event"
"identity"
"organization"
params: ViewCreateParams { teamId, name, view_type, 20 more }
teamId?: string

Path param

formatuuid
name: string

Body param

view_type: string

Body param

id?: string

Body param

formatuuid
aggregation_prop_def_id?: string | null

Body param

formatuuid
aggregation_type?: string | null

Body param

column_layout?: Record<string, unknown> | null

Body param

combinator?: "AND" | "OR"

Body param

One of the following:
"AND"
"OR"
created_at?: string

Body param

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

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

group_by?: string | null

Body param: Property slug to group by

group_hidden_option_ids?: Array<unknown> | unknown | null

Body param

One of the following:
Array<unknown>
unknown
group_hide_empty?: boolean | null

Body param

group_sort?: string | null

Body param

icon?: string | null

Body param

list_id?: string | null

Body param

formatuuid
select?: Array<string>

Body param: Property slugs (dot-paths permitted for refs)

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

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

sort_order?: number | null

Body param

team_id?: string | null

Body param

formatuuid
updated_at?: string | null

Body param

user_id?: string | null

Body param

idempotencyKey?: string

Header param: A unique key (UUID or any opaque string up to 255 chars) for an authenticated POST, PUT, or PATCH request. The server retains the initial claim for 24 hours and replays a completed non-5xx response only when the method, path, and request body all match. Reusing a non-expired key with a different method, path, or body returns 409 idempotency_key_mismatch; reusing it after expiry returns 409 idempotency_key_stale, so use a new key. Replays include the idempotent-replay: true response header.

minLength1
maxLength255
ReturnsExpand Collapse
ViewCreateResponse { 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

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

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.create('comment', { name: 'name', view_type: 'view_type' });

console.log(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"
}