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

# List items for a dataset with cursor-based pagination

> Returns items in a dataset ordered newest-first. Supports opaque
cursor pagination (`cursor`, `limit`) and optional filtering by
review label (`label`). Omitting `label` returns every item
regardless of label; passing `unlabeled` returns only items whose
label has never been set or was cleared back to null.




## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/datasets/{id}/items
openapi: 3.1.0
info:
  title: TruLayer API
  version: 0.1.0
  description: |
    Trace ingestion, evaluation, query, and feedback API for TruLayer AI.

    ### Authentication

    Two auth schemes coexist: SDK API keys (`Authorization: Bearer tl_...`)
    and Clerk session JWTs (dashboard). Routes marked "requires Clerk auth"
    in their summary are unreachable via API key.

    ### Roles (TRU-234)

    Dashboard requests carry one of three organization roles: `owner`,
    `member`, `viewer`. Endpoints enforce role allowlists, not rank
    comparisons. See `docs/security.md` for the full role-permission
    matrix.

    - **owner** — full control including billing, member management,
      destructive deletes on failure-rules/model-routes/webhooks/eval-rules,
      control-loop execution, and DLQ resolution.
    - **member** — read + write (ingest, feedback, evals, API keys,
      projects, failure-rules, model-routes, webhooks).
    - **viewer** — read-only dashboard access plus compliance read access
      to `/v1/audit-log` and `/v1/dlq`.
servers:
  - url: https://api.trulayer.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: health
  - name: ingest
  - name: traces
  - name: metrics
  - name: feedback
  - name: evals
  - name: eval-rules
  - name: control
  - name: apikeys
  - name: model-routes
  - name: datasets
  - name: search
  - name: anomaly
  - name: webhooks
  - name: failure-rules
  - name: eval-runs
  - name: ci
  - name: otlp
  - name: billing
  - name: deprecations
  - name: audit
  - name: failures
  - name: projects
  - name: compliance
  - name: dsr
  - name: policies
  - name: members
paths:
  /v1/datasets/{id}/items:
    get:
      tags:
        - datasets
      summary: List items for a dataset with cursor-based pagination
      description: |
        Returns items in a dataset ordered newest-first. Supports opaque
        cursor pagination (`cursor`, `limit`) and optional filtering by
        review label (`label`). Omitting `label` returns every item
        regardless of label; passing `unlabeled` returns only items whose
        label has never been set or was cleared back to null.
      operationId: listDatasetItems
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: cursor
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
        - name: label
          in: query
          required: false
          description: |
            Filter items by review label. Omit or leave empty to return
            all items. Any other value than the three listed is rejected
            with HTTP 400.
          schema:
            type: string
            enum:
              - pass
              - fail
              - unlabeled
      responses:
        '200':
          description: Dataset items list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetItemListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    DatasetItemListResponse:
      type: object
      required:
        - items
        - has_more
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DatasetItem'
        next_cursor:
          type: string
          nullable: true
        has_more:
          type: boolean
    DatasetItem:
      type: object
      required:
        - id
        - dataset_id
        - tenant_id
        - trace_id
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        dataset_id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        trace_id:
          type: string
          format: uuid
        span_id:
          type: string
          format: uuid
          nullable: true
        feedback_id:
          type: string
          format: uuid
          nullable: true
        label:
          type: string
          nullable: true
          enum:
            - pass
            - fail
            - unlabeled
            - null
          description: |
            Review label for the item. `null` (or omitted) means the item has
            not been labeled yet. The frontend toggles this value via
            `PATCH /v1/datasets/{id}/items/{itemId}`.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: SDK API key (`tl_...`) or Clerk session JWT

````