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

# List all materialized views for an app
GET /apps/:app_id/views



## OpenAPI

````yaml /openapi.yaml get /apps/{app_id}/views
openapi: 3.1.0
info:
  title: OnDB API
  description: Monetize anything
  license:
    name: ''
  version: 4.0.0
servers: []
security: []
tags:
  - name: Health
    description: Health check and system status
  - name: Applications
    description: Application management
  - name: Billing
    description: Billing information and usage
  - name: Pricing
    description: Pricing information and quotes
  - name: X402 Payment Protocol
    description: Payment verification and settlement
  - name: Data Storage
    description: Store data to Celestia blockchain
  - name: Data Query
    description: Query and retrieve data
  - name: Collections
    description: Collection management
  - name: Indexes
    description: Index management and relations
  - name: Retention
    description: Data retention policies
  - name: Materialized Views
    description: Materialized view management
  - name: Predefined Queries
    description: Create and execute predefined queries
  - name: View Query
    description: Query materialized view data
  - name: Wallet
    description: App wallet management
  - name: Tasks
    description: Task tracking and status
  - name: Transactions
    description: Transaction status
  - name: Authorization
    description: Authorization grant management
  - name: API Keys
    description: API key management
  - name: Encryption
    description: Encryption settings and configuration
  - name: Payout
    description: Payout settings and history
  - name: API Collections
    description: API collection management
paths:
  /apps/{app_id}/views:
    get:
      tags:
        - Materialized Views
      summary: |-
        List all materialized views for an app
        GET /apps/:app_id/views
      operationId: list_materialized_views
      parameters:
        - name: app_id
          in: path
          description: Application ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of materialized views
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListViewsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    ListViewsResponse:
      type: object
      description: Response body for listing views
      required:
        - views
      properties:
        views:
          type: array
          items:
            $ref: '#/components/schemas/ViewInfo'
    ViewInfo:
      type: object
      description: Information about a materialized view
      required:
        - name
        - source_collections
        - query
        - created_at
        - refresh_mode
        - refresh_metadata
      properties:
        created_at:
          type: string
        name:
          type: string
        query: {}
        refresh_metadata:
          $ref: '#/components/schemas/ViewRefreshMetadata'
          description: Incremental refresh metadata
        refresh_mode:
          type: string
          description: 'Refresh mode: "live" or "lazy"'
        source_collections:
          type: array
          items:
            type: string
        variables:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          propertyNames:
            type: string
    ViewRefreshMetadata:
      type: object
      required:
        - last_processed_block_height
        - last_processed_sequence
        - last_processed_timestamp
        - last_refresh_timestamp
        - total_source_records
        - total_view_records
      properties:
        last_processed_block_height:
          type: integer
          format: int64
          description: Last processed block height (for efficient incremental queries)
          minimum: 0
        last_processed_sequence:
          type: integer
          format: int64
          description: >-
            Last processed sequence number (for precise ordering within same
            block)
          minimum: 0
        last_processed_timestamp:
          type: string
          format: date-time
          description: Last processed record timestamp (for time-based incremental updates)
        last_processed_tx_id:
          type:
            - string
            - 'null'
          description: >-
            Last processed transaction ID (for tracking which data has been
            included)
        last_refresh_timestamp:
          type: string
          format: date-time
          description: Last refresh timestamp (when the view was last updated)
        total_source_records:
          type: integer
          description: Total number of source records processed into this view
          minimum: 0
        total_view_records:
          type: integer
          description: Total number of view records generated
          minimum: 0

````