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

# Get AI agent thread dump

> Download a sanitized debug dump of an AI agent thread for troubleshooting.
Requires AI_COPILOT_THREAD_DUMP_ENABLED on the instance.



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json get /api/v1/aiAgents/admin/threads/{threadUuid}/dump
openapi: 3.0.0
info:
  title: Lightdash API
  version: 1.194.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/aiAgents/admin/threads/{threadUuid}/dump:
    get:
      summary: Get AI agent thread dump
      description: >-
        Download a sanitized debug dump of an AI agent thread for
        troubleshooting.

        Requires AI_COPILOT_THREAD_DUMP_ENABLED on the instance.
      operationId: getAdminThreadDump
      parameters:
        - in: path
          name: threadUuid
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAiAgentThreadDumpResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    UUID:
      type: string
      format: uuid
      description: |-
        Stringified UUIDv4.
        See [RFC 4112](https://tools.ietf.org/html/rfc4122)
      pattern: >-
        [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
    ApiAiAgentThreadDumpResponse:
      $ref: '#/components/schemas/ApiSuccess_AiAgentThreadDump_'
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    ApiSuccess_AiAgentThreadDump_:
      properties:
        results:
          $ref: '#/components/schemas/AiAgentThreadDump'
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    AiAgentThreadDump:
      properties:
        turns:
          items:
            $ref: '#/components/schemas/AiAgentThreadDumpTurn'
          type: array
        agent:
          allOf:
            - $ref: '#/components/schemas/AiAgentThreadDumpAgent'
          nullable: true
        title:
          type: string
          nullable: true
        createdFrom:
          $ref: '#/components/schemas/AiThreadCreatedFrom'
        userUuid:
          type: string
          nullable: true
        agentUuid:
          type: string
          nullable: true
        threadUuid:
          type: string
        projectUuid:
          type: string
        organizationUuid:
          type: string
        defaultProvider:
          type: string
        lightdashVersion:
          type: string
        generatedAt:
          type: string
        schemaVersion:
          type: number
          enum:
            - 1
          nullable: false
      required:
        - turns
        - agent
        - title
        - createdFrom
        - userUuid
        - agentUuid
        - threadUuid
        - projectUuid
        - organizationUuid
        - defaultProvider
        - lightdashVersion
        - generatedAt
        - schemaVersion
      type: object
    AiAgentThreadDumpTurn:
      properties:
        artifacts:
          items:
            $ref: '#/components/schemas/AiAgentThreadDumpArtifact'
          type: array
        toolCalls:
          items:
            $ref: '#/components/schemas/AiAgentThreadDumpToolCall'
          type: array
        tokenUsage:
          allOf:
            - $ref: '#/components/schemas/AiPromptTokenUsage'
          nullable: true
        modelConfig:
          properties:
            modelProvider:
              type: string
            modelName:
              type: string
          required:
            - modelProvider
            - modelName
          type: object
          nullable: true
        steers:
          items:
            type: string
          type: array
        feedback:
          properties:
            comment:
              type: string
              nullable: true
            score:
              type: number
              format: double
          required:
            - comment
            - score
          type: object
          nullable: true
        interrupted:
          type: boolean
        error:
          type: string
          nullable: true
        assistant:
          type: string
          nullable: true
        user:
          type: string
        hidden:
          type: boolean
        respondedAt:
          type: string
          nullable: true
        createdAt:
          type: string
        promptUuid:
          type: string
      required:
        - artifacts
        - toolCalls
        - tokenUsage
        - modelConfig
        - steers
        - feedback
        - interrupted
        - error
        - assistant
        - user
        - hidden
        - respondedAt
        - createdAt
        - promptUuid
      type: object
    AiAgentThreadDumpAgent:
      $ref: >-
        #/components/schemas/Pick_AiAgentSummary.uuid-or-name-or-instruction-or-tags-or-integrations-or-modelConfig-or-enableDataAccess-or-enableSelfImprovement-or-enableContentTools-or-enableUserContext-or-enableSqlMode-or-adminOnly-or-version_
    AiThreadCreatedFrom:
      type: string
      enum:
        - slack
        - web_app
        - evals
        - scheduler
    AiAgentThreadDumpArtifact:
      properties:
        dashboardConfig:
          allOf:
            - $ref: '#/components/schemas/Record_string.unknown_'
          nullable: true
        chartConfig:
          allOf:
            - $ref: '#/components/schemas/Record_string.unknown_'
          nullable: true
        description:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        artifactType:
          type: string
          enum:
            - chart
            - dashboard
        versionNumber:
          type: number
          format: double
        versionUuid:
          type: string
        artifactUuid:
          type: string
      required:
        - dashboardConfig
        - chartConfig
        - description
        - title
        - artifactType
        - versionNumber
        - versionUuid
        - artifactUuid
      type: object
    AiAgentThreadDumpToolCall:
      properties:
        isError:
          type: boolean
        resultOmitted:
          type: string
          nullable: true
        result:
          type: string
          nullable: true
        args: {}
        source:
          type: string
          enum:
            - lightdash
            - mcp
        name:
          type: string
        parentToolCallId:
          type: string
          nullable: true
        toolCallId:
          type: string
      required:
        - isError
        - resultOmitted
        - result
        - args
        - source
        - name
        - parentToolCallId
        - toolCallId
      type: object
    AiPromptTokenUsage:
      properties:
        finalStepTotalTokens:
          type: number
          format: double
          description: >-
            Final step's total — the proxy for resident context size, drives
            compaction.
        totalTokens:
          type: number
          format: double
          description: 'Billing figure: tokens summed across every step of the run.'
      required:
        - totalTokens
      type: object
      description: >-
        Persisted shape. `finalStepTotalTokens` is absent on rows written before
        it existed.
    Pick_AiAgentSummary.uuid-or-name-or-instruction-or-tags-or-integrations-or-modelConfig-or-enableDataAccess-or-enableSelfImprovement-or-enableContentTools-or-enableUserContext-or-enableSqlMode-or-adminOnly-or-version_:
      properties:
        name:
          type: string
        uuid:
          type: string
        version:
          type: number
          format: double
        integrations:
          items:
            properties:
              channelId:
                type: string
              type:
                type: string
                enum:
                  - slack
                nullable: false
            required:
              - channelId
              - type
            type: object
          type: array
        tags:
          items:
            type: string
          type: array
          nullable: true
        instruction:
          type: string
          nullable: true
        enableDataAccess:
          type: boolean
        enableSelfImprovement:
          type: boolean
        enableContentTools:
          type: boolean
        enableUserContext:
          type: boolean
        enableSqlMode:
          type: boolean
        adminOnly:
          type: boolean
        modelConfig:
          allOf:
            - $ref: '#/components/schemas/AiAgentModelConfig'
          nullable: true
      required:
        - name
        - uuid
        - version
        - integrations
        - tags
        - instruction
        - enableDataAccess
        - enableSelfImprovement
        - enableContentTools
        - enableUserContext
        - enableSqlMode
        - adminOnly
        - modelConfig
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    Record_string.unknown_:
      properties: {}
      additionalProperties: {}
      type: object
      description: Construct a type with a set of properties K of type T
    AiAgentModelConfig:
      properties:
        reasoning:
          type: boolean
        modelProvider:
          type: string
        modelName:
          type: string
      required:
        - modelProvider
        - modelName
      type: object

````