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

# Get Chat Cells

> Retrieve a chat's per-step execution detail: messages, generated SQL and Python, outputs, and assets



## OpenAPI

````yaml GET /v2/chats/{id}/cells
openapi: 3.1.0
info:
  title: TextQL v2 API
  version: '2.0'
  description: >
    REST API for TextQL platform operations. All endpoints require Bearer token
    authentication.
servers:
  - url: https://app.textql.com
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: Create and manage AI chat sessions
  - name: Connectors
    description: List available data connectors
  - name: Playbooks
    description: Create, configure, and run automated playbooks
  - name: Sandcastles
    description: Manage Python sandbox environments for code execution
  - name: Changes
    description: Review, approve, and deny Context Library changes
  - name: API Keys
    description: Mint and revoke scoped platform API keys
paths:
  /v2/chats/{id}/cells:
    get:
      tags:
        - Chat
      summary: Get Chat Cells
      description: >-
        Retrieve a chat's cells, the per-step execution detail behind each
        answer: user and assistant messages, generated SQL and Python with their
        outputs, and the assets each step produced, in conversation order.
        Paginated newest-first: the default page returns the most recent cells,
        and offset skips past them toward older ones. Pages extend backward to
        the start of a conversation turn, so a page can contain slightly more
        than limit cells.
      operationId: v2.getChatCells
      parameters:
        - $ref: '#/components/parameters/ChatId'
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
            default: 200
            maximum: 500
          description: Maximum cells per page (values outside 1-500 fall back to 200)
        - name: offset
          in: query
          schema:
            type: integer
            format: int32
            default: 0
          description: Number of most-recent cells to skip
      responses:
        '200':
          description: Chat cells
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetChatCellsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    ChatId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Chat ID
  schemas:
    GetChatCellsResponse:
      type: object
      properties:
        chat_id:
          type: string
          format: uuid
        cells:
          type: array
          items:
            $ref: '#/components/schemas/ChatCell'
        has_more:
          type: boolean
          description: Whether older cells exist beyond this page
    ChatCell:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Cell ID
        type:
          type: string
          description: >-
            Cell type (e.g. markdown, python, sql, tableau_sql, metrics,
            ontology_query, javascript, bash, mcp_tool, preview, web_search)
        status:
          type: string
          enum:
            - completed
            - running
            - pending
            - halted
            - failed
            - unknown
        created_at:
          type: string
          format: date-time
        error:
          type: string
          description: Execution error, when the step failed
        role:
          type: string
          enum:
            - user
            - assistant
          description: Message author (markdown cells only)
        content:
          type: string
          description: Markdown content (markdown cells only)
        code:
          type: string
          description: Executed code (python, javascript, and bash cells)
        query:
          type: string
          description: Executed query (sql, tableau_sql, metrics, and ontology_query cells)
        connector_id:
          type: integer
          format: int32
          description: Connector the query ran against (sql and ontology_query cells)
        output:
          type: array
          items:
            type: string
          description: Captured stdout/stderr (python, javascript, and bash cells)
        dataframe_preview:
          type: string
          description: Markdown preview of the result set (query and python cells)
        execution_time_ms:
          type: integer
          format: int64
        tool_name:
          type: string
          description: MCP tool invoked, as server/tool (mcp_tool cells only)
        assets:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
          description: Assets this cell produced
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
              enum:
                - invalid_request
                - unauthenticated
                - permission_denied
                - not_found
                - conflict
                - rate_limit_exceeded
                - internal
                - timeout
                - cancelled
                - execution_failed
                - no_report
            message:
              type: string
              description: Human-readable error message
    Asset:
      type: object
      properties:
        name:
          type: string
          description: Asset name
        type:
          type: string
          description: Asset type (e.g. chart, image, table, pdf, html, text, download)
        url:
          type: string
          description: Asset URL, freshly signed on every fetch
        content:
          type: string
          description: Inline text content, for text assets served without a URL
        cell_id:
          type: string
          format: uuid
          description: ID of the cell that produced this asset
        created_at:
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: invalid_request
              message: Invalid request body
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthenticated
              message: Authentication required
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: permission_denied
              message: Insufficient permissions
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: not_found
              message: Resource not found
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal
              message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or JWT token

````