# Records ## List records selected by a view (filters and sorts applied; pinned record_order overlaid first) `client.Views.Records.List(ctx, viewObjectType, viewID, params) (*ViewRecordListResponse, error)` **get** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records` List records selected by a view (filters and sorts applied; pinned record_order overlaid first) ### Parameters - `viewObjectType ViewRecordListParamsViewObjectType` - `const ViewRecordListParamsViewObjectTypeAction ViewRecordListParamsViewObjectType = "action"` - `const ViewRecordListParamsViewObjectTypeDeal ViewRecordListParamsViewObjectType = "deal"` - `const ViewRecordListParamsViewObjectTypeDocument ViewRecordListParamsViewObjectType = "document"` - `const ViewRecordListParamsViewObjectTypeEvent ViewRecordListParamsViewObjectType = "event"` - `const ViewRecordListParamsViewObjectTypeIdentity ViewRecordListParamsViewObjectType = "identity"` - `const ViewRecordListParamsViewObjectTypeOrganization ViewRecordListParamsViewObjectType = "organization"` - `viewID string` - `params ViewRecordListParams` - `TeamID param.Field[string]` Path param - `Cursor param.Field[string]` Query param: Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor. - `Limit param.Field[int64]` Query param - `Page param.Field[int64]` Query param: Page number (1-based). Prefer `cursor`. ### Returns - `type ViewRecordListResponse struct{…}` - `Data []map[string, unknown]` - `HasMore bool` True if more records 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"), ) records, err := client.Views.Records.List( context.TODO(), micro.ViewRecordListParamsViewObjectTypeAction, "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", micro.ViewRecordListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", records.Data) } ``` #### Response ```json { "data": [ { "foo": "bar" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Bulk reorder pinned records `client.Views.Records.Reorder(ctx, viewObjectType, viewID, params) error` **patch** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records` Bulk reorder pinned records ### Parameters - `viewObjectType ViewRecordReorderParamsViewObjectType` - `const ViewRecordReorderParamsViewObjectTypeAction ViewRecordReorderParamsViewObjectType = "action"` - `const ViewRecordReorderParamsViewObjectTypeDeal ViewRecordReorderParamsViewObjectType = "deal"` - `const ViewRecordReorderParamsViewObjectTypeDocument ViewRecordReorderParamsViewObjectType = "document"` - `const ViewRecordReorderParamsViewObjectTypeEvent ViewRecordReorderParamsViewObjectType = "event"` - `const ViewRecordReorderParamsViewObjectTypeIdentity ViewRecordReorderParamsViewObjectType = "identity"` - `const ViewRecordReorderParamsViewObjectTypeOrganization ViewRecordReorderParamsViewObjectType = "organization"` - `viewID string` - `params ViewRecordReorderParams` - `TeamID param.Field[string]` Path param - `ObjectIDs param.Field[[]string]` Body param - `IdempotencyKey param.Field[string]` Header param: A unique key (UUID or any opaque string up to 255 chars) that identifies this logical request. The server caches the first response under this key for 24 hours and replays it on retry — safe to use on every POST/PUT/PATCH to make network retries deterministic. Reusing the same key with a different body returns 409 `idempotency_key_mismatch`. Replays include the `idempotent-replay: true` response header. ### Example ```go package main import ( "context" "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"), ) err := client.Views.Records.Reorder( context.TODO(), micro.ViewRecordReorderParamsViewObjectTypeAction, "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", micro.ViewRecordReorderParams{ ObjectIDs: micro.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}), }, ) if err != nil { panic(err.Error()) } } ``` ## Pin a record to the view (append to record_order) `client.Views.Records.Pin(ctx, viewObjectType, viewID, objectID, params) error` **post** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}` Pin a record to the view (append to record_order) ### Parameters - `viewObjectType ViewRecordPinParamsViewObjectType` - `const ViewRecordPinParamsViewObjectTypeAction ViewRecordPinParamsViewObjectType = "action"` - `const ViewRecordPinParamsViewObjectTypeDeal ViewRecordPinParamsViewObjectType = "deal"` - `const ViewRecordPinParamsViewObjectTypeDocument ViewRecordPinParamsViewObjectType = "document"` - `const ViewRecordPinParamsViewObjectTypeEvent ViewRecordPinParamsViewObjectType = "event"` - `const ViewRecordPinParamsViewObjectTypeIdentity ViewRecordPinParamsViewObjectType = "identity"` - `const ViewRecordPinParamsViewObjectTypeOrganization ViewRecordPinParamsViewObjectType = "organization"` - `viewID string` - `objectID string` - `params ViewRecordPinParams` - `TeamID param.Field[string]` Path param - `IdempotencyKey param.Field[string]` Header param: A unique key (UUID or any opaque string up to 255 chars) that identifies this logical request. The server caches the first response under this key for 24 hours and replays it on retry — safe to use on every POST/PUT/PATCH to make network retries deterministic. Reusing the same key with a different body returns 409 `idempotency_key_mismatch`. Replays include the `idempotent-replay: true` response header. ### Example ```go package main import ( "context" "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"), ) err := client.Views.Records.Pin( context.TODO(), micro.ViewRecordPinParamsViewObjectTypeAction, "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", micro.ViewRecordPinParams{ }, ) if err != nil { panic(err.Error()) } } ``` ## Unpin a record from the view `client.Views.Records.Unpin(ctx, viewObjectType, viewID, objectID, body) error` **delete** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}` Unpin a record from the view ### Parameters - `viewObjectType ViewRecordUnpinParamsViewObjectType` - `const ViewRecordUnpinParamsViewObjectTypeAction ViewRecordUnpinParamsViewObjectType = "action"` - `const ViewRecordUnpinParamsViewObjectTypeDeal ViewRecordUnpinParamsViewObjectType = "deal"` - `const ViewRecordUnpinParamsViewObjectTypeDocument ViewRecordUnpinParamsViewObjectType = "document"` - `const ViewRecordUnpinParamsViewObjectTypeEvent ViewRecordUnpinParamsViewObjectType = "event"` - `const ViewRecordUnpinParamsViewObjectTypeIdentity ViewRecordUnpinParamsViewObjectType = "identity"` - `const ViewRecordUnpinParamsViewObjectTypeOrganization ViewRecordUnpinParamsViewObjectType = "organization"` - `viewID string` - `objectID string` - `body ViewRecordUnpinParams` - `TeamID param.Field[string]` ### Example ```go package main import ( "context" "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"), ) err := client.Views.Records.Unpin( context.TODO(), micro.ViewRecordUnpinParamsViewObjectTypeAction, "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", micro.ViewRecordUnpinParams{ }, ) if err != nil { panic(err.Error()) } } ```