# View records

View records in Views — Micro TypeScript reference.

Reference for TypeScript SDK **0.14.0**.

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

## list

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

````text
client.views.records.list(viewID, { ...params }) -> RecordListResponse
````

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

## pin

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

````text
client.views.records.pin(objectID, { ...params }) -> void
````

Pin a record to the view (append to record_order)

## reorder

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

````text
client.views.records.reorder(viewID, { ...params }) -> void
````

Bulk reorder pinned records

## unpin

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

````text
client.views.records.unpin(objectID, { ...params }) -> void
````

Unpin a record from the view

## Parameter and response types

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

### RecordListResponse

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export interface RecordListResponse {
  data: Array<{ [key: string]: unknown }>;

  /**
   * True if more records exist beyond this page.
   */
  has_more: boolean;

  /**
   * Opaque cursor for the next page; null when `has_more` is false.
   */
  next_cursor?: string | null;
}
````


### RecordListParams

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export interface RecordListParams {
  /**
   * Path param
   */
  teamId?: string;

  /**
   * Path param
   */
  objectType:
    | 'comment'
    | 'action'
    | 'deal'
    | 'engagement'
    | 'document'
    | 'event'
    | 'identity'
    | 'organization';

  /**
   * 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.
   */
  cursor?: string;

  /**
   * Query param
   */
  limit?: number;

  /**
   * Query param: Page number (1-based). Prefer `cursor`.
   */
  page?: number;
}
````


### RecordPinParams

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export interface RecordPinParams {
  /**
   * Path param
   */
  teamId?: string;

  /**
   * Path param
   */
  objectType:
    | 'comment'
    | 'action'
    | 'deal'
    | 'engagement'
    | 'document'
    | 'event'
    | 'identity'
    | 'organization';

  /**
   * Path param
   */
  viewId: 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;
}
````


### RecordReorderParams

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export interface RecordReorderParams {
  /**
   * Path param
   */
  teamId?: string;

  /**
   * Path param
   */
  objectType:
    | 'comment'
    | 'action'
    | 'deal'
    | 'engagement'
    | 'document'
    | 'event'
    | 'identity'
    | 'organization';

  /**
   * Body param
   */
  object_ids: Array<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;
}
````


### RecordUnpinParams

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export interface RecordUnpinParams {
  teamId?: string;

  objectType:
    | 'comment'
    | 'action'
    | 'deal'
    | 'engagement'
    | 'document'
    | 'event'
    | 'identity'
    | 'organization';

  viewId: string;
}
````


### Records

[Source](https://github.com/micro-so/micro-sdk-ts/blob/v0.14.0/src/resources/views/records.ts)

````text
export declare namespace Records {
  export {
    type RecordListResponse as RecordListResponse,
    type RecordListParams as RecordListParams,
    type RecordPinParams as RecordPinParams,
    type RecordReorderParams as RecordReorderParams,
    type RecordUnpinParams as RecordUnpinParams,
  };
}
````
