> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-06-24-docs-simplify-date-zoom-usage-description.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post apiv1projects aiagents threads



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json post /api/v1/projects/{projectUuid}/aiAgents/{agentUuid}/threads
openapi: 3.0.0
info:
  title: Lightdash API
  version: 0.3228.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/projects/{projectUuid}/aiAgents/{agentUuid}/threads:
    post:
      operationId: createAgentThread
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            type: string
        - in: path
          name: agentUuid
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiAiAgentThreadCreateRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAiAgentThreadCreateResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    ApiAiAgentThreadCreateRequest:
      properties:
        modelConfig:
          properties:
            reasoning:
              type: boolean
            modelProvider:
              type: string
            modelName:
              type: string
          required:
            - modelProvider
            - modelName
          type: object
        context:
          $ref: '#/components/schemas/AiPromptContextInput'
        prompt:
          type: string
      type: object
    ApiAiAgentThreadCreateResponse:
      $ref: '#/components/schemas/ApiSuccess_AiAgentThreadSummary_'
    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
    AiPromptContextInput:
      items:
        $ref: '#/components/schemas/AiPromptContextItemInput'
      type: array
    ApiSuccess_AiAgentThreadSummary_:
      properties:
        results:
          $ref: '#/components/schemas/AiAgentThreadSummary'
        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.
    AiPromptContextItemInput:
      anyOf:
        - properties:
            runtimeOverrides:
              $ref: '#/components/schemas/AiChartRuntimeOverrides'
            chartSlug:
              type: string
              nullable: true
            chartUuid:
              type: string
            type:
              type: string
              enum:
                - chart
              nullable: false
          required:
            - chartUuid
            - type
          type: object
        - properties:
            dashboardSlug:
              type: string
              nullable: true
            dashboardUuid:
              type: string
            type:
              type: string
              enum:
                - dashboard
              nullable: false
          required:
            - dashboardUuid
            - type
          type: object
        - properties:
            promptUuid:
              type: string
              nullable: true
            threadUuid:
              type: string
            type:
              type: string
              enum:
                - thread
              nullable: false
          required:
            - threadUuid
            - type
          type: object
        - properties:
            path:
              type: string
            type:
              type: string
              enum:
                - file
              nullable: false
          required:
            - path
            - type
          type: object
        - properties:
            fullName:
              type: string
            type:
              type: string
              enum:
                - repository
              nullable: false
          required:
            - fullName
            - type
          type: object
        - properties:
            prUrl:
              type: string
            type:
              type: string
              enum:
                - pull_request
              nullable: false
          required:
            - prUrl
            - type
          type: object
        - properties:
            fingerprint:
              type: string
            type:
              type: string
              enum:
                - proposed_change
              nullable: false
          required:
            - fingerprint
            - type
          type: object
        - properties:
            fingerprint:
              type: string
            type:
              type: string
              enum:
                - review_finding
              nullable: false
          required:
            - fingerprint
            - type
          type: object
        - properties:
            previewProjectUuid:
              type: string
            type:
              type: string
              enum:
                - preview_environment
              nullable: false
          required:
            - previewProjectUuid
            - type
          type: object
    AiAgentThreadSummary:
      properties:
        user:
          $ref: '#/components/schemas/AiAgentUser'
        firstMessage:
          properties:
            message:
              type: string
            uuid:
              type: string
          required:
            - message
            - uuid
          type: object
        titleGeneratedAt:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        createdFrom:
          type: string
        createdAt:
          type: string
        agentUuid:
          type: string
        uuid:
          type: string
      required:
        - user
        - firstMessage
        - titleGeneratedAt
        - title
        - createdFrom
        - createdAt
        - agentUuid
        - uuid
      type: object
    AiChartRuntimeOverrides:
      properties:
        dateZoom:
          $ref: '#/components/schemas/DateZoom'
        dashboardParameters:
          $ref: '#/components/schemas/ParametersValuesMap'
        dashboardFilters:
          $ref: '#/components/schemas/DashboardFilters'
      type: object
      description: >-
        Runtime state captured at pin time for a chart context. When a user pins
        a

        chart from a dashboard view, these are the dashboard-level overrides
        that

        were applied to the chart on screen at that moment.
    AiAgentUser:
      properties:
        name:
          type: string
        uuid:
          type: string
      required:
        - name
        - uuid
      type: object
    DateZoom:
      properties:
        xAxisFieldId:
          type: string
        granularity:
          anyOf:
            - $ref: '#/components/schemas/DateGranularity'
            - type: string
      type: object
    ParametersValuesMap:
      $ref: '#/components/schemas/Record_string.ParameterValue_'
    DashboardFilters:
      properties:
        tableCalculations:
          items:
            $ref: '#/components/schemas/DashboardFilterRule'
          type: array
        metrics:
          items:
            $ref: '#/components/schemas/DashboardFilterRule'
          type: array
        dimensions:
          items:
            $ref: '#/components/schemas/DashboardFilterRule'
          type: array
      required:
        - tableCalculations
        - metrics
        - dimensions
      type: object
    DateGranularity:
      enum:
        - Second
        - Minute
        - Hour
        - Day
        - Week
        - Month
        - Quarter
        - Year
      type: string
    Record_string.ParameterValue_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/ParameterValue'
      type: object
      description: Construct a type with a set of properties K of type T
    DashboardFilterRule:
      allOf:
        - $ref: >-
            #/components/schemas/FilterRule_FilterOperator.DashboardFieldTarget.AnyType.AnyType_
        - properties:
            lockedTabUuids:
              items:
                type: string
              type: array
              description: >-
                Tab UUIDs where this filter is locked. When the active tab is in
                this

                list, viewers see the filter but cannot change it, and URL /
                embed

                filter overrides targeting the same field are ignored on that
                tab.

                Empty or omitted means the filter is not locked anywhere.
            singleValue:
              type: boolean
            label:
              type: string
            tileTargets:
              $ref: '#/components/schemas/Record_string.DashboardTileTarget_'
          type: object
    ParameterValue:
      anyOf:
        - type: string
        - type: number
          format: double
        - items:
            type: string
          type: array
        - items:
            type: number
            format: double
          type: array
    FilterRule_FilterOperator.DashboardFieldTarget.AnyType.AnyType_:
      properties:
        values:
          items:
            $ref: '#/components/schemas/AnyType'
          type: array
          description: Values to filter by
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        id:
          type: string
          description: Unique identifier for the filter
        target:
          $ref: '#/components/schemas/DashboardFieldTarget'
          description: Target field for the filter
        settings:
          $ref: '#/components/schemas/AnyType'
          description: Additional settings for date/time filters
        disabled:
          type: boolean
          description: Whether this filter is disabled
        required:
          type: boolean
          description: Whether this filter is required
        caseSensitive:
          type: boolean
          description: >-
            Overrides the field/explore case-sensitivity for this rule only.

            Used by internal features like autocomplete search that must always

            match case-insensitively regardless of the field's configured
            setting.
      required:
        - operator
        - id
        - target
      type: object
      additionalProperties: true
    Record_string.DashboardTileTarget_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/DashboardTileTarget'
      type: object
      description: Construct a type with a set of properties K of type T
    FilterOperator:
      enum:
        - isNull
        - notNull
        - equals
        - notEquals
        - startsWith
        - endsWith
        - include
        - doesNotInclude
        - lessThan
        - lessThanOrEqual
        - greaterThan
        - greaterThanOrEqual
        - inThePast
        - notInThePast
        - inTheNext
        - inTheCurrent
        - notInTheCurrent
        - inBetween
        - notInBetween
        - inPeriodToDate
      type: string
    DashboardFieldTarget:
      properties:
        fallbackType:
          $ref: '#/components/schemas/DimensionType'
        isSqlColumn:
          type: boolean
        tableName:
          type: string
        fieldId:
          type: string
      required:
        - tableName
        - fieldId
      type: object
    DashboardTileTarget:
      anyOf:
        - $ref: '#/components/schemas/DashboardFieldTarget'
        - type: boolean
          enum:
            - false
    DimensionType:
      enum:
        - string
        - number
        - timestamp
        - date
        - boolean
      type: string

````