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

# Search your chat threads

> Finds threads you can see — your personal ones and your workspaces' — whose title, messages or replies contain the text (case-insensitive), most recently active first, archived ones included. Tool calls and results are not searched. `snippet` shows where the text matched; it is null when only the title did.



## OpenAPI

````yaml get /api/chat/search
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/chat/search:
    get:
      tags:
        - Chat
      summary: Search your chat threads
      description: >-
        Finds threads you can see — your personal ones and your workspaces' —
        whose title, messages or replies contain the text (case-insensitive),
        most recently active first, archived ones included. Tool calls and
        results are not searched. `snippet` shows where the text matched; it is
        null when only the title did.
      operationId: search_threads_api_chat_search_get
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            description: The text to find.
            title: Q
          description: The text to find.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            description: Maximum number of threads to return.
            default: 20
            title: Limit
          description: Maximum number of threads to return.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatThreadSearchResult'
                title: Response Search Threads Api Chat Search Get
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    ChatThreadSearchResult:
      properties:
        id:
          type: string
          title: Id
          description: Thread ID.
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Display title; null until the first message.
        status:
          $ref: '#/components/schemas/ChatThreadStatus'
          description: Active or archived.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the thread was created.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last activity in the thread.
        workspace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workspace Id
          description: The workspace the thread belongs to; null for a personal thread.
        created_by:
          type: string
          title: Created By
          description: Who started the thread.
        can_post:
          type: boolean
          title: Can Post
          description: Whether you can send messages in it.
        can_manage:
          type: boolean
          title: Can Manage
          description: Whether you can rename, archive or delete it.
        can_share:
          type: boolean
          title: Can Share
          description: Whether you can create share links for it.
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: >-
            Standing instructions for the assistant, as Markdown. Added to the
            base prompt, never replacing it, and added to rather than replacing
            any the workspace sets. Cannot change which tools exist or which
            need approval.
        defaults:
          $ref: '#/components/schemas/ChatContextDefaults'
          description: What the assistant reaches for first in this thread.
        subject:
          anyOf:
            - $ref: '#/components/schemas/ChatSubject'
            - type: 'null'
          description: The item this thread is about, if it is bound to one.
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          title: Snippet
          description: >-
            The text around the match, on one line; null when only the title
            matched.
      type: object
      required:
        - id
        - status
        - created_at
        - updated_at
        - created_by
        - can_post
        - can_manage
        - can_share
      title: ChatThreadSearchResult
      description: A thread that matched a search.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    ChatThreadStatus:
      type: string
      enum:
        - regular
        - archived
      title: ChatThreadStatus
      description: Whether a thread is in the active list or archived.
    ChatContextDefaults:
      properties:
        trino_catalog:
          anyOf:
            - type: string
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,127}$
            - type: 'null'
          title: Trino Catalog
          description: Trino catalog to query unless the user names another.
        trino_schema:
          anyOf:
            - type: string
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,127}$
            - type: 'null'
          title: Trino Schema
          description: Schema within that catalog.
        datahub_domain:
          anyOf:
            - type: string
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,127}$
            - type: 'null'
          title: Datahub Domain
          description: DataHub domain to search first.
        decisions_workspace:
          anyOf:
            - type: string
              maxLength: 64
              pattern: ^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,127}$
            - type: 'null'
          title: Decisions Workspace
          description: Business-rules workspace to author and read rules in.
      type: object
      title: ChatContextDefaults
      description: |-
        What the assistant should reach for first, unless told otherwise.

        Every field names something owned by another system, so none of them
        are checked here — see "Pinned defaults are preferences" in
        `api.services.chat.context`. The portal offers pickers rather than
        free text, which is where a typo is actually prevented.
    ChatSubject:
      properties:
        type:
          $ref: '#/components/schemas/ChatSubjectType'
          description: What kind of item.
        id:
          type: string
          title: Id
          description: 'The item''s id: a UUID, or `workspace/key` for a decision.'
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: The item's display name.
      type: object
      required:
        - type
        - id
      title: ChatSubject
      description: The item a bound thread is about.
    ChatSubjectType:
      type: string
      enum:
        - dataeng_query
        - dataeng_new
        - semantic_model
        - semantic_new
        - decision
        - data_access
        - registry_agent_test
        - dq_table
        - dq_new
        - function
        - function_new
        - ontology
        - ontology_new
        - feature_engineering
        - feature_engineering_new
        - airouter_builder
        - maintenance
        - spark_app
      title: ChatSubjectType
      description: What a bound thread is about.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.