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

# Get Chat Threads

> Get the list of chat threads.

Args:
    company_id (int): Cattix Company ID
    assistant_type (AssistantType | None): The type of the chat thread (optional)
    user (User): The current user

Returns:
    Dict containing the list of chat threads



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json get /api/v1/chat/threads
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/chat/threads:
    get:
      tags:
        - Chat
      summary: Get Chat Threads
      description: |-
        Get the list of chat threads.

        Args:
            company_id (int): Cattix Company ID
            assistant_type (AssistantType | None): The type of the chat thread (optional)
            user (User): The current user

        Returns:
            Dict containing the list of chat threads
      operationId: get_chat_threads_api_v1_chat_threads_get
      parameters:
        - name: company_id
          in: query
          required: true
          schema:
            type: integer
            title: Company Id
        - name: assistant_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AssistantType'
              - type: 'null'
            title: Assistant Type
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssistantChatThreadSchema'
                title: Response Get Chat Threads Api V1 Chat Threads Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AssistantType:
      type: string
      enum:
        - onboarding
        - general
        - market_analysis
        - campaign_creation
      title: AssistantType
      description: The Assistant types.
    AssistantChatThreadSchema:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: The name of the chat thread
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: The description of the chat thread
        extra_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: >-
            Extra data used to create the chat thread that is later passed to
            Assistant Functions (tool calls)
        google_ads_customer:
          anyOf:
            - $ref: >-
                #/components/schemas/api__google_ads__database_data__schemas__GoogleAdsCustomerSchema
            - type: 'null'
          title: The Google Ads customer used to fetch data for this chat thread
        google_ads_login_customer_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: The `login_customer_id` used to access the Google Ads API.
        google_business_location:
          anyOf:
            - $ref: '#/components/schemas/GoogleBusinessLocationSchema'
            - type: 'null'
          title: The Google Business Location used for this chat thread
        assistant:
          anyOf:
            - $ref: '#/components/schemas/AssistantSchema'
            - type: 'null'
          title: >-
            The assistant used in the chat thread. Might be `None` if the
            Assistant was deleted.
        thread_id:
          type: string
          title: The ID of the chat thread
        is_completed:
          type: boolean
          title: Whether the chat thread is finished
        date_added:
          type: string
          format: date-time
          title: The date the chat thread was added
        date_updated:
          type: string
          format: date-time
          title: The date the chat thread was updated
      type: object
      required:
        - thread_id
        - is_completed
        - date_added
        - date_updated
      title: AssistantChatThreadSchema
      description: The schema for an assistant's chat thread.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    api__google_ads__database_data__schemas__GoogleAdsCustomerSchema:
      properties:
        id:
          type: integer
          title: Id
          description: The customer ID
        date_added:
          type: string
          format: date-time
          title: Date Added
        date_updated:
          type: string
          format: date-time
          title: Date Updated
        is_active:
          type: boolean
          title: Is Active
          default: true
        is_deleted:
          type: boolean
          title: Is Deleted
          default: false
        descriptive_name:
          type: string
          title: Descriptive Name
          description: The descriptive name of the customer
        currency_code:
          type: string
          title: Currency Code
          description: The currency code
        time_zone:
          type: string
          title: Time Zone
          description: The time zone
        status:
          type: string
          title: Status
          description: The status of the customer
        manager:
          type: boolean
          title: Manager
          description: Whether the customer is a manager account
      type: object
      required:
        - id
        - date_added
        - date_updated
        - descriptive_name
        - currency_code
        - time_zone
        - status
        - manager
      title: GoogleAdsCustomerSchema
      description: Schema for GoogleAdsCustomer model.
    GoogleBusinessLocationSchema:
      properties:
        id:
          type: string
          title: Id
          description: Google identifier for this location
        title:
          type: string
          title: Title
          description: Location name
        store_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Store Code
          description: External identifier for this location
        maps_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Maps Uri
          description: A link to the location on Maps
        storefront_address:
          anyOf:
            - $ref: '#/components/schemas/GooglePostalAddressSchema'
            - type: 'null'
          description: Physical address of the storefront
      type: object
      required:
        - id
        - title
      title: GoogleBusinessLocationSchema
    AssistantSchema:
      properties:
        id:
          type: string
          title: The ID of the assistant
        assistant_type:
          $ref: '#/components/schemas/AssistantType'
          title: The type of the assistant
        date_added:
          type: string
          format: date-time
          title: The date the assistant was added
        date_updated:
          type: string
          format: date-time
          title: The date the assistant was updated
      type: object
      required:
        - id
        - assistant_type
        - date_added
        - date_updated
      title: AssistantSchema
      description: The schema for an assistant.
    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
    GooglePostalAddressSchema:
      properties:
        region_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Region Code
          description: >-
            CLDR region code of the country/region of the address. This is
            usually a two-letter code (e.g. 'UA', 'US').
        language_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Language Code
          description: The BCP-47 language code of the contents of this address (if known).
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
          description: Postal code of the address.
        administrative_area:
          anyOf:
            - type: string
            - type: 'null'
          title: Administrative Area
          description: >-
            Top-level administrative subdivision of the country/region (e.g.
            state, province, oblast).
        locality:
          anyOf:
            - type: string
            - type: 'null'
          title: Locality
          description: Generally refers to the city/town portion of the address.
        sublocality:
          anyOf:
            - type: string
            - type: 'null'
          title: Sublocality
          description: Sublocality of the address (e.g. neighborhood, district).
        address_lines:
          items:
            type: string
          type: array
          title: Address Lines
          description: >-
            Unstructured address lines describing the lower levels of an
            address.
      type: object
      title: GooglePostalAddressSchema
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````