> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Rows

> List rows in a sheet, each containing a map of column_id to cell. For prompt-template column cells, each cell can include a `request_metrics` object with price, latency, and token usage when available. Pass `include_columns=true` on the first page to receive column metadata alongside rows. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.

List rows in a sheet. Each row contains a map of `column_id → cell`.

Pass `include_columns=true` (the default on the first page) to receive column metadata alongside rows — useful for building column headers.

Use cursor-based pagination for large sheets.

The response includes `version`, the current sheet version count for the returned rows.


## OpenAPI

````yaml GET /api/public/v2/tables/{table_id}/sheets/{sheet_id}/rows
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/tables/{table_id}/sheets/{sheet_id}/rows:
    get:
      tags:
        - smart-tables
      summary: List Rows
      description: >-
        List rows in a sheet, each containing a map of column_id to cell. For
        prompt-template column cells, each cell can include a `request_metrics`
        object with price, latency, and token usage when available. Pass
        `include_columns=true` on the first page to receive column metadata
        alongside rows. Requests are scoped to the workspace associated with the
        API key; table, sheet, column, cell, operation, and version IDs must
        belong to that workspace.
      operationId: list_table_sheet_rows
      parameters:
        - name: table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: sheet_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: include_system_columns
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            When true, include system-managed metadata columns such as price and
            latency columns for prompt-template outputs.
        - name: include_execution_metadata_aggregates
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            When true, include sheet-level and per-column aggregates for
            execution metrics such as price and latency.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 100
        - name: order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
        - name: include_columns
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Include column metadata in the response. Defaults to true on the
              first page.
        - name: include_row_count
          in: query
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: List of rows
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Each item represents one row.
                    items:
                      type: object
                      properties:
                        row_index:
                          type: integer
                        cells:
                          type: object
                          description: Map of column_id (UUID string) → cell object.
                          additionalProperties:
                            $ref: '#/components/schemas/Cell'
                  next_cursor:
                    type: string
                    nullable: true
                  has_more:
                    type: boolean
                  row_count:
                    type: integer
                  columns:
                    type: array
                    items:
                      $ref: '#/components/schemas/Column'
                  version:
                    type: integer
                    description: >-
                      Current sheet version_count for this response. It matches
                      the sheet's version_count after any committed changes.
                  execution_metadata_aggregates:
                    allOf:
                      - $ref: '#/components/schemas/ExecutionMetadataAggregates'
                    description: >-
                      Sheet-level and per-column aggregates for price and
                      latency metrics. Only present when
                      `include_execution_metadata_aggregates=true`.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Table or sheet not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Cell:
      type: object
      description: A single cell at the intersection of a column and a row.
      properties:
        id:
          type: string
          format: uuid
        sheet_id:
          type: string
          format: uuid
        column_id:
          type: string
          format: uuid
        row_index:
          type: integer
        status:
          type: string
          enum:
            - completed
            - stale
            - running
            - queued
            - error
            - cancelled
          description: Current computation status of the cell.
        display_value:
          type: string
          nullable: true
        value:
          description: Structured cell value (type depends on column type).
        error:
          type: string
          nullable: true
        input_hash:
          type: string
          nullable: true
          description: >-
            Hash of the inputs used to compute this cell, used for cache
            invalidation.
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the last update.
        request_metrics:
          allOf:
            - $ref: '#/components/schemas/SmartTableRequestMetrics'
          nullable: true
          description: >-
            Execution metrics populated for prompt-template column cells.
            Present only when the cell has an associated request log.
        execution_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Execution ID associated with the current or most recent computed
            value, when available.
        last_computed_version:
          type: integer
          nullable: true
          description: >-
            Sheet version_count when this cell was last computed. Null for text
            cells, virtual cells, or cells that have not completed computation.
        error_message:
          type: string
          nullable: true
          description: >-
            User-visible error message for failed computed cells, when
            available.
    Column:
      type: object
      description: A column within a Table sheet.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the column.
        sheet_id:
          type: string
          format: uuid
        workspace_id:
          type: integer
          description: >-
            Workspace that owns this resource; determined by the authenticated
            request scope.
        title:
          type: string
          description: Display title of the column.
        type:
          type: string
          description: >-
            Column type. 'text' columns store free-text; 'prompt_template',
            'llm', 'code', 'score', 'comparison', and 'composition' columns run
            automated computations.
          enum:
            - text
            - prompt_template
            - llm
            - code
            - score
            - comparison
            - composition
        config:
          type: object
          description: Type-specific configuration. Shape depends on the column type.
        position_rank:
          type: number
          description: Fractional position rank used for ordering.
        is_output_column:
          type: boolean
          description: Whether this column is designated as an output column.
    ExecutionMetadataAggregates:
      type: object
      description: >-
        Sheet-level and per-column aggregates for execution metrics (price and
        latency) across all prompt-template columns.
      properties:
        by_column_id:
          type: object
          description: >-
            Per-column aggregates keyed by the system-managed metadata column
            ID.
          additionalProperties:
            $ref: '#/components/schemas/ExecutionMetadataMetricAggregate'
        sheet:
          type: object
          description: Sheet-wide aggregates rolled up across all prompt-template columns.
          properties:
            by_metric:
              type: object
              description: Aggregates keyed by metric key (`price`, `latency_ms`).
              additionalProperties:
                $ref: '#/components/schemas/ExecutionMetadataMetricAggregate'
          required:
            - by_metric
      required:
        - by_column_id
        - sheet
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
    SmartTableRequestMetrics:
      type: object
      description: >-
        Execution metrics for a prompt-template cell, derived from the
        underlying request log.
      properties:
        request_count:
          type: integer
          description: Number of LLM requests made to produce this cell's value.
        request_ids:
          type: array
          items:
            type: integer
          description: IDs of the request logs associated with this cell.
        latency_ms:
          type: integer
          nullable: true
          description: Total end-to-end latency in milliseconds.
        price:
          type: number
          nullable: true
          description: Total cost in USD for all requests that produced this cell.
        input_tokens:
          type: integer
          nullable: true
          description: Total number of input tokens across all requests.
        output_tokens:
          type: integer
          nullable: true
          description: Total number of output tokens across all requests.
        trace_ids:
          type: array
          items:
            type: string
          description: >-
            Trace IDs linked to this cell (present when the cell was produced
            via an OpenTelemetry-traced workflow).
    ExecutionMetadataMetricAggregate:
      type: object
      description: >-
        Aggregated statistics for a single execution metric (e.g. price or
        latency) across all rows in a sheet.
      properties:
        metric_key:
          type: string
          description: Internal metric identifier. One of `price` or `latency_ms`.
          enum:
            - price
            - latency_ms
        metric_label:
          type: string
          nullable: true
          description: Human-readable label for the metric.
        count:
          type: integer
          description: Number of rows that have a value for this metric.
        sum:
          type: number
          description: Sum of all metric values.
        avg:
          type: number
          nullable: true
          description: Average metric value, or null if count is 0.
        min:
          type: number
          nullable: true
          description: Minimum metric value, or null if count is 0.
        max:
          type: number
          nullable: true
          description: Maximum metric value, or null if count is 0.
        column_id:
          type: string
          format: uuid
          description: >-
            ID of the system-managed metadata column for this metric. Omitted
            for sheet-level aggregates.
        source_column_id:
          type: string
          format: uuid
          description: >-
            ID of the prompt-template source column. Omitted for sheet-level
            aggregates.
      required:
        - metric_key
        - count
        - sum
  responses:
    UnauthorizedError:
      description: Unauthorized - missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````