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

# Get last completed task run summary

> Retrieve the SQL results and text summary from the last completed run of a task.



## OpenAPI

````yaml get /api/v1/products/{product_id}/tasks/{task_id}/last-run-summary
openapi: 3.1.0
info:
  title: ClarityQ API
  description: ClarityQ API, authenticated via API keys.
  version: 1.0.0
servers:
  - url: https://api.clarityq.ai
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/products/{product_id}/tasks/{task_id}/last-run-summary:
    get:
      tags:
        - API
      summary: Get last completed task run summary
      description: >-
        Retrieve the SQL results and text summary from the last completed run of
        a task.
      operationId: >-
        get_last_run_summary_api_v1_products__product_id__tasks__task_id__last_run_summary_get
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Product Id
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationSummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConversationSummaryResponse:
      properties:
        assets:
          items:
            oneOf:
              - $ref: '#/components/schemas/SqlAsset'
            discriminator:
              propertyName: asset_type
              mapping:
                SQL:
                  $ref: '#/components/schemas/SqlAsset'
          type: array
          title: Assets
          description: Assets extracted from the last assistant message, grouped by type.
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
          description: Text summary from the assistant (last text part of the message).
      type: object
      title: ConversationSummaryResponse
      description: Summary of a conversation's last assistant response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SqlAsset:
      properties:
        asset_type:
          type: string
          const: SQL
          title: Asset Type
          description: The type of asset.
          default: SQL
        data:
          items:
            $ref: '#/components/schemas/SqlResultSummary'
          type: array
          title: Data
          description: List of SQL query result summaries.
      type: object
      title: SqlAsset
      description: SQL asset containing executed query results.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SqlResultSummary:
      properties:
        query:
          type: string
          title: Query
          description: The SQL query that was executed.
        title:
          type: string
          title: Title
          description: Human-readable title for the query.
          default: ''
        result_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Result Count
          description: Number of rows in the full result set.
        result_rows:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Result Rows
          description: Returned result rows.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if the query failed.
      type: object
      required:
        - query
      title: SqlResultSummary
      description: A single SQL query that was executed during the conversation.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from the ClarityQ dashboard.

````