## 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. ### Parameters - `objectType ViewListParamsObjectType` - `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]` Path param - `Cursor param.Field[string]` Query param: Opaque pagination cursor (from a prior response's next_cursor); supersedes page/limit when present. - `Limit param.Field[int64]` Query param: Maximum items per page (<= 50; defaults to 50). - `ListID param.Field[string]` Query param: List (CRM) id to scope the listing to. When omitted, views owned by the path team are returned. - `Page param.Field[int64]` Query param: 1-based page number. Prefer cursor. ### Returns - `type ViewListResponse struct{…}` - `Data []ViewListResponseData` - `Name string` - `ViewType string` - `ID string` - `AggregationPropDefID string` - `AggregationType string` - `ColumnLayout map[string, unknown]` - `Combinator ViewListResponseDataCombinator` - `const ViewListResponseDataCombinatorAnd ViewListResponseDataCombinator = "AND"` - `const ViewListResponseDataCombinatorOr ViewListResponseDataCombinator = "OR"` - `CreatedAt string` - `Filter []map[string, unknown]` Each entry is { slug: { comparator: value } } - `GroupBy string` Property slug to group by - `GroupHiddenOptionIDs []unknown` - `[]unknown` - `GroupHideEmpty bool` - `GroupSort string` - `Icon string` - `ListID string` - `Select []string` Property slugs (dot-paths permitted for refs) - `Sort []map[string, unknown]` Each entry is { slug: 'asc' | 'desc' } - `SortOrder int64` - `TeamID string` - `UpdatedAt string` - `UserID string` - `HasMore bool` True if more views exist beyond this page. - `NextCursor string` Opaque cursor for the next page; null when has_more is false. ### Example ```go 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) } ``` #### Response ```json { "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" } ```