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

# Query Result

> Get the results of a query.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.roe-ai.com/v1/database/query/YOUR_QUERY_ID/result/?organization_id=YOUR_ORG_ID" \
    --header "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/database/query/{worksheet_query_id}/result/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/database/query/{worksheet_query_id}/result/:
    get:
      tags:
        - v1
      description: Get the results of a query.
      operationId: v1_database_query_result_retrieve
      parameters:
        - in: path
          name: worksheet_query_id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseQueryResultRetrieveResponse'
          description: ''
        '404':
          description: Query not found
components:
  schemas:
    DatabaseQueryResultRetrieveResponse:
      type: object
      properties:
        worksheet_query_id:
          type: string
          format: uuid
          description: The query task UUID.
        status:
          type: string
          description: The status of the query task.
        results:
          type: array
          items:
            $ref: '#/components/schemas/DatabaseQueryResult'
          description: The results of the query.
        error:
          type:
            - string
            - 'null'
          description: An error message if the query failed.
      required:
        - status
        - worksheet_query_id
    DatabaseQueryResult:
      type: object
      properties:
        query_id:
          type: string
          description: The query UUID.
        query:
          type: string
          description: The query that was run.
        summary:
          allOf:
            - $ref: '#/components/schemas/DatabaseQueryResultSummary'
          description: The summary of the query results.
        row_count:
          type: integer
          description: The number of rows returned by the query.
        column_names:
          type: array
          items:
            type: string
          description: A list of strings representing the column names
        column_types:
          type: array
          items:
            type: string
          description: A list of strings representing the column types
        result_rows:
          type: array
          items:
            type: array
            items:
              type: string
          description: >-
            A matrix of the data returned in the form of a Sequence of rows,
            with each row element being a sequence of column values.
        start_timestamp:
          type: number
          format: double
          description: The timestamp when the query started running.
        end_timestamp:
          type: number
          format: double
          description: The timestamp when the query finished running.
      required:
        - column_names
        - column_types
        - end_timestamp
        - query
        - result_rows
        - row_count
        - start_timestamp
        - summary
    DatabaseQueryResultSummary:
      type: object
      properties:
        read_rows:
          type: integer
        read_bytes:
          type: integer
        written_rows:
          type: integer
        written_bytes:
          type: integer
        total_rows_to_read:
          type: integer
        result_rows:
          type: integer
        result_bytes:
          type: integer
        elapsed_ns:
          type: integer
        query_id:
          type: string

````