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

# Query History

> Page the current operator's retained query history, scoped to this project and database.



## OpenAPI

````yaml /openapi.json get /v1/orgs/{orgId}/projects/{projectId}/databases/{databaseId}/query-history
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/orgs/{orgId}/projects/{projectId}/databases/{databaseId}/query-history:
    get:
      tags:
        - databases
      summary: Query History
      description: >-
        Page the current operator's retained query history, scoped to this
        project and database.
      operationId: databases.queryHistory
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: The organization's id (UUID) or slug — either form is accepted.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The project's id (UUID) or slug — either form is accepted.
        - name: databaseId
          in: path
          required: true
          schema:
            type: string
          description: The database's id (UUID), from databases.list.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque cursor from the previous page.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: Page size from 1 to 100. Defaults to 50.
      responses:
        '200':
          description: A page of query history.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        statement:
                          type: string
                        status:
                          type: string
                          enum:
                            - running
                            - succeeded
                            - failed
                            - canceled
                        durationMs:
                          type:
                            - number
                            - 'null'
                        rowCount:
                          type:
                            - integer
                            - 'null'
                        bytes:
                          type:
                            - integer
                            - 'null'
                        truncated:
                          type: boolean
                        errorCode:
                          type:
                            - string
                            - 'null'
                        createdAt:
                          type: string
                          format: date-time
                        finishedAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                      required:
                        - id
                        - statement
                        - status
                        - durationMs
                        - rowCount
                        - bytes
                        - truncated
                        - errorCode
                        - createdAt
                        - finishedAt
                  nextCursor:
                    type:
                      - string
                      - 'null'
                required:
                  - items
                  - nextCursor
        '404':
          description: No such database in this project.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````