# View records

View records in Views — Micro Go reference.

Reference for Go SDK **0.8.0**.

[Release source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/api.md) · [Setup and client configuration](/docs/reference/go)

## List

`GET /v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records`

````text
client.Views.Records.List(ctx context.Context, viewObjectType micro.ViewRecordListParamsViewObjectType, viewID string, params micro.ViewRecordListParams) (*micro.ViewRecordListResponse, error)
````

List records selected by a view (filters and sorts applied; pinned record_order overlaid first)

## Pin

`POST /v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}`

````text
client.Views.Records.Pin(ctx context.Context, viewObjectType micro.ViewRecordPinParamsViewObjectType, viewID string, objectID string, params micro.ViewRecordPinParams) error
````

Pin a record to the view (append to record_order)

## Reorder

`PATCH /v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records`

````text
client.Views.Records.Reorder(ctx context.Context, viewObjectType micro.ViewRecordReorderParamsViewObjectType, viewID string, params micro.ViewRecordReorderParams) error
````

Bulk reorder pinned records

## Unpin

`DELETE /v2/prism/{teamId}/{viewObjectType}/views/{viewId}/records/{objectId}`

````text
client.Views.Records.Unpin(ctx context.Context, viewObjectType micro.ViewRecordUnpinParamsViewObjectType, viewID string, objectID string, body micro.ViewRecordUnpinParams) error
````

Unpin a record from the view

## Parameter and response types

These declarations show the request parameters and response shapes used by the methods above.

### ViewRecordListResponse

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordListResponse struct {
	Data []map[string]interface{} `json:"data" api:"required"`
	// True if more records exist beyond this page.
	HasMore bool `json:"has_more" api:"required"`
	// Opaque cursor for the next page; null when `has_more` is false.
	NextCursor string                     `json:"next_cursor" api:"nullable"`
	JSON       viewRecordListResponseJSON `json:"-"`
}
````


### ViewRecordListParamsViewObjectType

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordListParamsViewObjectType string
````


### ViewRecordListParams

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordListParams struct {
	// Use [option.WithTeamID] on the client to set a global default for this field.
	TeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
	// 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.
	Cursor param.Field[string] `query:"cursor"`
	Limit  param.Field[int64]  `query:"limit"`
	// Page number (1-based). Prefer `cursor`.
	Page param.Field[int64] `query:"page"`
}
````


### ViewRecordPinParamsViewObjectType

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordPinParamsViewObjectType string
````


### ViewRecordPinParams

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordPinParams struct {
	// Use [option.WithTeamID] on the client to set a global default for this field.
	TeamID         param.Field[string] `path:"teamId" api:"required" format:"uuid"`
	IdempotencyKey param.Field[string] `header:"Idempotency-Key"`
}
````


### ViewRecordReorderParamsViewObjectType

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordReorderParamsViewObjectType string
````


### ViewRecordReorderParams

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordReorderParams struct {
	// Use [option.WithTeamID] on the client to set a global default for this field.
	TeamID         param.Field[string]   `path:"teamId" api:"required" format:"uuid"`
	ObjectIDs      param.Field[[]string] `json:"object_ids" api:"required" format:"uuid"`
	IdempotencyKey param.Field[string]   `header:"Idempotency-Key"`
}
````


### ViewRecordUnpinParamsViewObjectType

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordUnpinParamsViewObjectType string
````


### ViewRecordUnpinParams

[Source](https://github.com/micro-so/micro-sdk-go/blob/v0.8.0/viewrecord.go)

````text
type ViewRecordUnpinParams struct {
	// Use [option.WithTeamID] on the client to set a global default for this field.
	TeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
}
````
