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

# Get Widget Data

> Answer one saved widget for a window, with a status instead of an exception.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/widgets/{widget_id}/data
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/widgets/{widget_id}/data:
    get:
      tags:
        - Widgets
      summary: Get Widget Data
      description: >-
        Answer one saved widget for a window, with a status instead of an
        exception.
      operationId: get_widget_data
      parameters:
        - in: path
          name: widget_id
          required: true
          schema:
            title: Widget Id
            type: string
        - description: >-
            A preset window ending now, by the site picker's id. Give this or
            explicit start_time/end_time; neither means the site's 24-hour
            default.
          in: query
          name: range
          required: false
          schema:
            anyOf:
              - enum:
                  - 30m
                  - 1h
                  - 3h
                  - 6h
                  - 1d
                  - 7d
                  - 14d
                  - 30d
                  - 60d
                  - 90d
                type: string
              - type: 'null'
            description: >-
              A preset window ending now, by the site picker's id. Give this or
              explicit start_time/end_time; neither means the site's 24-hour
              default.
            title: Range
        - in: query
          name: start_time
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: Start Time
        - in: query
          name: end_time
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: End Time
        - description: >-
            Target project for the request. Required when authenticating with a
            user session token (a user credential is only meaningful scoped to a
            project); for an API key it is optional and, if given, must match
            the key's project.
          in: query
          name: project_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Target project for the request. Required when authenticating with
              a user session token (a user credential is only meaningful scoped
              to a project); for an API key it is optional and, if given, must
              match the key's project.
            title: Project Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WidgetDataResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Widget not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    WidgetDataResponse:
      description: >-
        One saved widget answered for one window.


        The per-widget answer of a dashboard data read, addressed by widget id:

        ``status`` says what happened — ``ok`` carries the engine's
        columns/rows/

        meta; ``skipped`` is a feed or legacy detector widget (a trace list, not

        an aggregate — read those with ``list_traces`` and the feed's filters);

        ``error`` carries a short reason and no rows when the stored spec no

        longer validates or the engine rejects it — so a broken widget is still
        a

        200 a script can branch on. One widget has no fan-out to protect, so the

        rows follow ``run_widget_query``: a series comes back whole and every

        other display returns what the engine returns. ``truncated`` is kept for

        parity with the dashboard read and is always false here. ``window`` is

        the window the rows were answered for — the one to name with any figure.
      properties:
        columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Columns
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        rows:
          anyOf:
            - items:
                items: {}
                type: array
              type: array
            - type: 'null'
          title: Rows
        status:
          enum:
            - ok
            - skipped
            - error
          title: Status
          type: string
        truncated:
          default: false
          title: Truncated
          type: boolean
        widget:
          $ref: '#/components/schemas/WidgetRef'
        window:
          $ref: '#/components/schemas/QueryWindow'
      required:
        - widget
        - window
        - status
      title: WidgetDataResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    WidgetRef:
      description: The identity of the widget a data read answered, with its dashboard.
      properties:
        dashboard_id:
          title: Dashboard Id
          type: string
        id:
          title: Id
          type: string
        title:
          title: Title
          type: string
        type:
          title: Type
          type: string
      required:
        - id
        - dashboard_id
        - title
        - type
      title: WidgetRef
      type: object
    QueryWindow:
      description: |-
        The window a query was actually answered for.

        ``range`` is the preset id the caller gave (or the default's, when they
        gave nothing) and None for explicit bounds. ``clamped`` is True when the
        plan's retention pulled ``start_time`` forward — the honest reason a
        caller's window and the answered one differ.
      properties:
        clamped:
          title: Clamped
          type: boolean
        end_time:
          format: date-time
          title: End Time
          type: string
        range:
          anyOf:
            - enum:
                - 30m
                - 1h
                - 3h
                - 6h
                - 1d
                - 7d
                - 14d
                - 30d
                - 60d
                - 90d
              type: string
            - type: 'null'
          title: Range
        start_time:
          format: date-time
          title: Start Time
          type: string
      required:
        - start_time
        - end_time
        - range
        - clamped
      title: QueryWindow
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.