Skip to content
Go to Micro

List saved views for an owner

client.Views.List(ctx, objectType, params) (*ViewListResponse, error)
GET/v2/prism/{teamId}/{objectType}/views

Returns saved view bundles for the path team. Pass ?list_id= to scope to a list (CRM) instead. Cursor pagination matches other Prism list endpoints.

ParametersExpand Collapse
One of the following:
const ViewListParamsObjectTypeComment ViewListParamsObjectType = "comment"
const ViewListParamsObjectTypeAction ViewListParamsObjectType = "action"
const ViewListParamsObjectTypeDeal ViewListParamsObjectType = "deal"
const ViewListParamsObjectTypeEngagement ViewListParamsObjectType = "engagement"
const ViewListParamsObjectTypeDocument ViewListParamsObjectType = "document"
const ViewListParamsObjectTypeEvent ViewListParamsObjectType = "event"
const ViewListParamsObjectTypeIdentity ViewListParamsObjectType = "identity"
const ViewListParamsObjectTypeOrganization ViewListParamsObjectType = "organization"
params ViewListParams
TeamID param.Field[string]Optional

Path param

formatuuid
Cursor param.Field[string]Optional

Query param: Opaque pagination cursor (from a prior response’s next_cursor); supersedes page/limit when present.

Limit param.Field[int64]Optional

Query param: Maximum items per page (<= 50; defaults to 50).

minimum0
maximum50
ListID param.Field[string]Optional

Query param: List (CRM) id to scope the listing to. When omitted, views owned by the path team are returned.

formatuuid
Page param.Field[int64]Optional

Query param: 1-based page number. Prefer cursor.

minimum1
ReturnsExpand Collapse
type ViewListResponse struct{…}
Data []ViewListResponseData
Name string
ViewType string
ID stringOptional
formatuuid
AggregationPropDefID stringOptional
formatuuid
AggregationType stringOptional
ColumnLayout map[string, unknown]Optional
Combinator ViewListResponseDataCombinatorOptional
One of the following:
const ViewListResponseDataCombinatorAnd ViewListResponseDataCombinator = "AND"
const ViewListResponseDataCombinatorOr ViewListResponseDataCombinator = "OR"
CreatedAt stringOptional
Filter []map[string, unknown]Optional

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

GroupBy stringOptional

Property slug to group by

GroupHiddenOptionIDs []unknownOptional
One of the following:
[]unknown
GroupHideEmpty boolOptional
GroupSort stringOptional
Icon stringOptional
ListID stringOptional
formatuuid
Select []stringOptional

Property slugs (dot-paths permitted for refs)

Sort []map[string, unknown]Optional

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

SortOrder int64Optional
TeamID stringOptional
formatuuid
UpdatedAt stringOptional
UserID stringOptional
HasMore bool

True if more views exist beyond this page.

NextCursor stringOptional

Opaque cursor for the next page; null when has_more is false.

List saved views for an owner

package main

import (
  "context"
  "fmt"

  "github.com/micro-so/micro-sdk-go"
  "github.com/micro-so/micro-sdk-go/option"
)

func main() {
  client := micro.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithTeamID("My Team ID"),
  )
  views, err := client.Views.List(
    context.TODO(),
    micro.ViewListParamsObjectTypeComment,
    micro.ViewListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", views.Data)
}
{
  "data": [
    {
      "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"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}
Returns Examples
{
  "data": [
    {
      "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"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}