Views
Views — Micro TypeScript reference.
Reference for TypeScript SDK 0.14.0.
Release source · Setup and client configuration
create
POST /v2/prism/{teamId}/{objectType}/views
client.views.create(objectType, { ...params }) -> ViewCreateResponseCreate a view bundle (view + select/filter/sort)
update
PATCH /v2/prism/{teamId}/{objectType}/views/{viewId}
client.views.update(viewID, { ...params }) -> ViewUpdateResponseUpdate a view bundle (select/filter/sort arrays are replaced wholesale when supplied)
list
GET /v2/prism/{teamId}/{objectType}/views
client.views.list(objectType, { ...params }) -> ViewListResponseReturns saved view bundles for the path team. Pass ?list_id= to scope to a
list (CRM) instead. Cursor pagination matches other Prism list endpoints.
delete
DELETE /v2/prism/{teamId}/{objectType}/views/{viewId}
client.views.delete(viewID, { ...params }) -> voidDelete a view bundle
get
GET /v2/prism/{teamId}/{objectType}/views/{viewId}
client.views.get(viewID, { ...params }) -> ViewGetResponseReturns 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}.
Parameter and response types
These declarations show the request parameters and response shapes used by the methods above.
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.
*/
export interface ViewCreateResponse {
name: string;
view_type: string;
id?: string;
aggregation_prop_def_id?: string | null;
aggregation_type?: string | null;
column_layout?: { [key: string]: unknown } | null;
combinator?: 'AND' | 'OR';
created_at?: string;
/**
* Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Property slug to group by
*/
group_by?: string | null;
group_hidden_option_ids?: Array<unknown> | unknown | null;
group_hide_empty?: boolean | null;
group_sort?: string | null;
icon?: string | null;
list_id?: string | null;
/**
* Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
sort_order?: number | null;
team_id?: string | null;
updated_at?: string | null;
user_id?: string | null;
}ViewUpdateResponse
/**
* 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.
*/
export interface ViewUpdateResponse {
name: string;
view_type: string;
id?: string;
aggregation_prop_def_id?: string | null;
aggregation_type?: string | null;
column_layout?: { [key: string]: unknown } | null;
combinator?: 'AND' | 'OR';
created_at?: string;
/**
* Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Property slug to group by
*/
group_by?: string | null;
group_hidden_option_ids?: Array<unknown> | unknown | null;
group_hide_empty?: boolean | null;
group_sort?: string | null;
icon?: string | null;
list_id?: string | null;
/**
* Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
sort_order?: number | null;
team_id?: string | null;
updated_at?: string | null;
user_id?: string | null;
}ViewListResponse
export interface ViewListResponse {
data: Array<ViewListResponse.Data>;
/**
* True if more views exist beyond this page.
*/
has_more: boolean;
/**
* Opaque cursor for the next page; null when has_more is false.
*/
next_cursor?: string | null;
}ViewListResponse
export namespace ViewListResponse {
/**
* 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.
*/
export interface Data {
name: string;
view_type: string;
id?: string;
aggregation_prop_def_id?: string | null;
aggregation_type?: string | null;
column_layout?: { [key: string]: unknown } | null;
combinator?: 'AND' | 'OR';
created_at?: string;
/**
* Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Property slug to group by
*/
group_by?: string | null;
group_hidden_option_ids?: Array<unknown> | unknown | null;
group_hide_empty?: boolean | null;
group_sort?: string | null;
icon?: string | null;
list_id?: string | null;
/**
* Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
sort_order?: number | null;
team_id?: string | null;
updated_at?: string | null;
user_id?: string | null;
}
}ViewGetResponse
/**
* 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.
*/
export type ViewGetResponse = ViewGetResponse.ViewBundle | ViewGetResponse.ViewBundleWithRecords;ViewGetResponse
export namespace ViewGetResponse {
/**
* 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.
*/
export interface ViewBundle {
name: string;
view_type: string;
id?: string;
aggregation_prop_def_id?: string | null;
aggregation_type?: string | null;
column_layout?: { [key: string]: unknown } | null;
combinator?: 'AND' | 'OR';
created_at?: string;
/**
* Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Property slug to group by
*/
group_by?: string | null;
group_hidden_option_ids?: Array<unknown> | unknown | null;
group_hide_empty?: boolean | null;
group_sort?: string | null;
icon?: string | null;
list_id?: string | null;
/**
* Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
sort_order?: number | null;
team_id?: string | null;
updated_at?: string | null;
user_id?: string | null;
}
/**
* Returned by `GET /views/{viewId}?include=records`. Same `records` shape as the
* standalone list-view-records endpoint.
*/
export interface ViewBundleWithRecords {
records: ViewBundleWithRecords.Records;
/**
* 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.
*/
view: ViewBundleWithRecords.View;
}
export namespace ViewBundleWithRecords {
export interface Records {
data: Array<{ [key: string]: unknown }>;
has_more: boolean;
next_cursor?: string | null;
}
/**
* 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.
*/
export interface View {
name: string;
view_type: string;
id?: string;
aggregation_prop_def_id?: string | null;
aggregation_type?: string | null;
column_layout?: { [key: string]: unknown } | null;
combinator?: 'AND' | 'OR';
created_at?: string;
/**
* Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Property slug to group by
*/
group_by?: string | null;
group_hidden_option_ids?: Array<unknown> | unknown | null;
group_hide_empty?: boolean | null;
group_sort?: string | null;
icon?: string | null;
list_id?: string | null;
/**
* Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
sort_order?: number | null;
team_id?: string | null;
updated_at?: string | null;
user_id?: string | null;
}
}
}ViewCreateParams
export interface ViewCreateParams {
/**
* Path param
*/
teamId?: string;
/**
* Body param
*/
name: string;
/**
* Body param
*/
view_type: string;
/**
* Body param
*/
id?: string;
/**
* Body param
*/
aggregation_prop_def_id?: string | null;
/**
* Body param
*/
aggregation_type?: string | null;
/**
* Body param
*/
column_layout?: { [key: string]: unknown } | null;
/**
* Body param
*/
combinator?: 'AND' | 'OR';
/**
* Body param
*/
created_at?: string;
/**
* Body param: Each entry is { slug: { comparator: value } }
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Body param: Property slug to group by
*/
group_by?: string | null;
/**
* Body param
*/
group_hidden_option_ids?: Array<unknown> | unknown | null;
/**
* Body param
*/
group_hide_empty?: boolean | null;
/**
* Body param
*/
group_sort?: string | null;
/**
* Body param
*/
icon?: string | null;
/**
* Body param
*/
list_id?: string | null;
/**
* Body param: Property slugs (dot-paths permitted for refs)
*/
select?: Array<string>;
/**
* Body param: Each entry is { slug: 'asc' | 'desc' }
*/
sort?: Array<{ [key: string]: unknown }>;
/**
* Body param
*/
sort_order?: number | null;
/**
* Body param
*/
team_id?: string | null;
/**
* Body param
*/
updated_at?: string | null;
/**
* Body param
*/
user_id?: string | null;
/**
* 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.
*/
'Idempotency-Key'?: string;
}ViewUpdateParams
export interface ViewUpdateParams {
/**
* Path param
*/
teamId?: string;
/**
* Path param
*/
objectType:
| 'comment'
| 'action'
| 'deal'
| 'engagement'
| 'document'
| 'event'
| 'identity'
| 'organization';
/**
* Body param
*/
aggregation_prop_def_id?: string | null;
/**
* Body param
*/
aggregation_type?: string | null;
/**
* Body param
*/
column_layout?: { [key: string]: unknown } | null;
/**
* Body param
*/
combinator?: 'AND' | 'OR';
/**
* Body param
*/
filter?: Array<{ [key: string]: unknown }>;
/**
* Body param
*/
group_by?: string | null;
/**
* Body param
*/
group_hidden_option_ids?: Array<unknown> | unknown | null;
/**
* Body param
*/
group_hide_empty?: boolean | null;
/**
* Body param
*/
group_sort?: string | null;
/**
* Body param
*/
icon?: string | null;
/**
* Body param
*/
list_id?: string | null;
/**
* Body param
*/
name?: string;
/**
* Body param
*/
select?: Array<string>;
/**
* Body param
*/
sort?: Array<{ [key: string]: unknown }>;
/**
* Body param
*/
sort_order?: number | null;
/**
* Body param
*/
team_id?: string | null;
/**
* Body param
*/
user_id?: string | null;
/**
* Body param
*/
view_type?: 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.
*/
'Idempotency-Key'?: string;
}ViewListParams
export interface ViewListParams {
/**
* Path param
*/
teamId?: string;
/**
* Query param: Opaque pagination cursor (from a prior response's next_cursor);
* supersedes page/limit when present.
*/
cursor?: string;
/**
* Query param: Maximum items per page (<= 50; defaults to 50).
*/
limit?: number;
/**
* Query param: List (CRM) id to scope the listing to. When omitted, views owned by
* the path team are returned.
*/
list_id?: string;
/**
* Query param: 1-based page number. Prefer cursor.
*/
page?: number;
}ViewDeleteParams
export interface ViewDeleteParams {
teamId?: string;
objectType:
| 'comment'
| 'action'
| 'deal'
| 'engagement'
| 'document'
| 'event'
| 'identity'
| 'organization';
}ViewGetParams
export interface ViewGetParams {
/**
* Path param
*/
teamId?: string;
/**
* Path param
*/
objectType:
| 'comment'
| 'action'
| 'deal'
| 'engagement'
| 'document'
| 'event'
| 'identity'
| 'organization';
/**
* Query param: Forwarded to the records sub-resource when `include=records`.
*/
cursor?: 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.
*/
include?: string;
/**
* Query param: Forwarded to the records sub-resource when `include=records`.
*/
limit?: number;
/**
* Query param: Forwarded to the records sub-resource when `include=records`.
*/
page?: number;
}Views
export declare namespace Views {
export {
type ViewCreateResponse as ViewCreateResponse,
type ViewUpdateResponse as ViewUpdateResponse,
type ViewListResponse as ViewListResponse,
type ViewGetResponse as ViewGetResponse,
type ViewCreateParams as ViewCreateParams,
type ViewUpdateParams as ViewUpdateParams,
type ViewListParams as ViewListParams,
type ViewDeleteParams as ViewDeleteParams,
type ViewGetParams as ViewGetParams,
};
export {
RecordsAPIRecords as Records,
type RecordListResponse as RecordListResponse,
type RecordListParams as RecordListParams,
type RecordPinParams as RecordPinParams,
type RecordReorderParams as RecordReorderParams,
type RecordUnpinParams as RecordUnpinParams,
};
}