> ## 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 Chats



## OpenAPI

````yaml api-reference/speakeasy/textql-api-with-code-samples.yaml POST /textql.rpc.public.chat.ChatService/GetChats
openapi: 3.1.0
info:
  title: TextQL API
  version: 1.0.0
  description: |
    TextQL public API. Generated from protobuf service definitions; internal
    endpoints are excluded via google.api.visibility / file_visibility.
servers:
  - url: https://app.textql.com
security:
  - apiKey: []
tags:
  - name: DashboardService
  - name: AppService
    description: |-
      AppService manages data apps: the generative app execution primitive.
       An app is agent-authored single-file HTML/JS/CSS executing in a CSP sandbox,
       fed a snapshot of its declared data sources. First-class resource, not a dashboard.
  - name: ConnectorService
  - name: PowerBIService
  - name: TableauService
  - name: DatasetService
  - name: OntologyManagementService
  - name: ChatService
  - name: AgentService
  - name: AuditLogService
  - name: MCPService
  - name: MetricsExportService
  - name: ObservabilityService
  - name: PlaybookService
  - name: RBACService
    description: RBAC service for managing roles, permissions, and access control
  - name: SandboxAdminService
  - name: SandboxQueryService
  - name: SandboxCapabilityService
  - name: ScimService
  - name: SecretService
  - name: SlackService
  - name: TeamsService
paths:
  /textql.rpc.public.chat.ChatService/GetChats:
    post:
      tags:
        - ChatService
      summary: GetChats
      operationId: ChatService_GetChats
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/textql.rpc.public.chat.GetChatsRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/textql.rpc.public.chat.GetChatsResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            import os
            from textql_sdk import Textql
            from textql_sdk.utils import parse_datetime


            with Textql(
                api_key=os.getenv("TEXTQL_API_KEY", ""),
            ) as textql:

                res = textql.chats.get_all(created_after=parse_datetime("2023-01-15T01:30:15.01Z"), created_before=parse_datetime("2023-01-15T01:30:15.01Z"))

                # Handle response
                print(res)
        - lang: typescript
          label: TypeScript (SDK)
          source: |-
            import { Textql } from "@textql/sdk";

            const textql = new Textql({
              apiKey: process.env["TEXTQL_API_KEY"] ?? "",
            });

            async function run() {
              const result = await textql.chats.getAll({
                body: {
                  createdAfter: new Date("2023-01-15T01:30:15.01Z"),
                  createdBefore: new Date("2023-01-15T01:30:15.01Z"),
                },
              });

              console.log(result);
            }

            run();
components:
  schemas:
    connect-protocol-version:
      type: number
      title: Connect-Protocol-Version
      enum:
        - 1
      description: Define the version of the Connect protocol
      const: 1
      default: 1
    connect-timeout-header:
      type: number
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    textql.rpc.public.chat.GetChatsRequest:
      type: object
      properties:
        memberOnly:
          type: boolean
          title: member_only
          description: whether to return only the user's chats or all of the org's chats
        searchTerm:
          type: string
          title: search_term
          nullable: true
        limit:
          type: integer
          title: limit
          format: int32
          nullable: true
        offset:
          type: integer
          title: offset
          format: int32
          nullable: true
        creatorMemberId:
          type: string
          title: creator_member_id
          nullable: true
        sortBy:
          $ref: '#/components/schemas/textql.rpc.public.chat.ChatSortField'
          title: sort_by
        sortDirection:
          $ref: '#/components/schemas/textql.rpc.public.chat.ChatSortDirection'
          title: sort_direction
        bookmarkedOnly:
          type: boolean
          title: bookmarked_only
          description: filter to only bookmarked chats
          nullable: true
        createdAfter:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_after
          description: filter chats created after this time
          nullable: true
        createdBefore:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_before
          description: filter chats created before this time
          nullable: true
        excludeBatchRuns:
          type: boolean
          title: exclude_batch_runs
          description: exclude chats created from template batch runs
          nullable: true
        excludeUnusedPlaybooks:
          type: boolean
          title: exclude_unused_playbooks
          description: >-
            exclude chats created from playbooks that have no user messages
            beyond the initial prompt
          nullable: true
        source:
          $ref: '#/components/schemas/textql.rpc.public.chat.ChatSource'
          title: source
          description: >-
            filter chats by source (single-select; superseded by `sources` when
            that is non-empty)
          nullable: true
        hasThreadWarning:
          type: boolean
          title: has_thread_warning
          description: >-
            When true (and thread_warning_types empty), only chats that have at
            least one thread_warning row of any type.
          nullable: true
        creatorMemberIds:
          type: array
          items:
            type: string
          title: creator_member_ids
          description: >-
            Filter org chats to these creator member IDs (union). Ignored when
            empty. Supersedes creator_member_id when non-empty.
        sharedWithMe:
          type: boolean
          title: shared_with_me
          nullable: true
        excludeFeed:
          type: boolean
          title: exclude_feed
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/textql.rpc.public.chat.ChatSource'
          title: sources
          description: >-
            Filter chats by source (union). Ignored when empty. Supersedes the
            single `source` when non-empty.
        threadWarningTypes:
          type: array
          items:
            $ref: '#/components/schemas/textql.rpc.public.chat.ThreadWarningType'
          title: thread_warning_types
          description: >-
            Filter to chats with at least one thread_warning of any of these
            types (union).
        topicIds:
          type: array
          items:
            type: string
          title: topic_ids
          description: |-
            Only chats tagged with at least one of these custom topics
             (verdict='tagged'). Ignored when empty.
        connectorIds:
          type: array
          items:
            type: integer
            format: int32
          title: connector_ids
          description: >-
            Filter chats that have any of these connector IDs in their paradigm
            options (union). Ignored when empty.
      title: GetChatsRequest
      additionalProperties: false
    textql.rpc.public.chat.GetChatsResponse:
      type: object
      properties:
        chats:
          type: array
          items:
            $ref: '#/components/schemas/textql.rpc.public.chat.Chat'
          title: chats
        totalCount:
          type: integer
          title: total_count
          format: int32
      title: GetChatsResponse
      additionalProperties: false
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/connect.error_details.Any'
          description: >-
            A list of messages that carry the error details. There is no limit
            on the number of messages.
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    textql.rpc.public.chat.ChatSortField:
      type: string
      title: ChatSortField
      enum:
        - CHAT_SORT_FIELD_UNKNOWN
        - CHAT_SORT_FIELD_NAME
        - CHAT_SORT_FIELD_CREATED_AT
        - CHAT_SORT_FIELD_UPDATED_AT
    textql.rpc.public.chat.ChatSortDirection:
      type: string
      title: ChatSortDirection
      enum:
        - CHAT_SORT_DIRECTION_UNKNOWN
        - CHAT_SORT_DIRECTION_ASC
        - CHAT_SORT_DIRECTION_DESC
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2023-01-15T01:30:15.01Z'
        - '2024-12-25T12:00:00Z'
      format: date-time
      description: >-
        A Timestamp represents a point in time independent of any time zone or
        local
         calendar, encoded as a count of seconds and fractions of seconds at
         nanosecond resolution. The count is relative to an epoch at UTC midnight on
         January 1, 1970, in the proleptic Gregorian calendar which extends the
         Gregorian calendar backwards to year one.

         All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
         second table is needed for interpretation, using a [24-hour linear
         smear](https://developers.google.com/time/smear).

         The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
         restricting to that range, we ensure that we can convert to and from [RFC
         3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.

         # Examples

         Example 1: Compute Timestamp from POSIX `time()`.

             Timestamp timestamp;
             timestamp.set_seconds(time(NULL));
             timestamp.set_nanos(0);

         Example 2: Compute Timestamp from POSIX `gettimeofday()`.

             struct timeval tv;
             gettimeofday(&tv, NULL);

             Timestamp timestamp;
             timestamp.set_seconds(tv.tv_sec);
             timestamp.set_nanos(tv.tv_usec * 1000);

         Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.

             FILETIME ft;
             GetSystemTimeAsFileTime(&ft);
             UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;

             // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
             // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
             Timestamp timestamp;
             timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
             timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));

         Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.

             long millis = System.currentTimeMillis();

             Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
                 .setNanos((int) ((millis % 1000) * 1000000)).build();

         Example 5: Compute Timestamp from Java `Instant.now()`.

             Instant now = Instant.now();

             Timestamp timestamp =
                 Timestamp.newBuilder().setSeconds(now.getEpochSecond())
                     .setNanos(now.getNano()).build();

         Example 6: Compute Timestamp from current time in Python.

             timestamp = Timestamp()
             timestamp.GetCurrentTime()

         # JSON Mapping

         In JSON format, the Timestamp type is encoded as a string in the
         [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
         format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
         where {year} is always expressed using four digits while {month}, {day},
         {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
         seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
         are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
         is required. A proto3 JSON serializer should always use UTC (as indicated by
         "Z") when printing the Timestamp type and a proto3 JSON parser should be
         able to accept both UTC and other timezones (as indicated by an offset).

         For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
         01:30 UTC on January 15, 2017.

         In JavaScript, one can convert a Date object to this format using the
         standard
         [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
         method. In Python, a standard `datetime.datetime` object can be converted
         to this format using
         [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
         the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
         the Joda Time's [`ISODateTimeFormat.dateTime()`](
         http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
         ) to obtain a formatter capable of generating timestamps in this format.
    textql.rpc.public.chat.ChatSource:
      type: string
      title: ChatSource
      enum:
        - CHAT_SOURCE_UNKNOWN
        - CHAT_SOURCE_THREAD
        - CHAT_SOURCE_PLAYBOOK
        - CHAT_SOURCE_SLACK
        - CHAT_SOURCE_FEED
        - CHAT_SOURCE_TEAMS
        - CHAT_SOURCE_SMS
        - CHAT_SOURCE_MCP
        - CHAT_SOURCE_SYSTEM
    textql.rpc.public.chat.ThreadWarningType:
      type: string
      title: ThreadWarningType
      enum:
        - THREAD_WARNING_TYPE_UNSPECIFIED
        - THREAD_WARNING_TYPE_MISSING_CONTEXT
        - THREAD_WARNING_TYPE_ERROR_LOOP
        - THREAD_WARNING_TYPE_EXCESSIVE_TOOL_CALLS
        - THREAD_WARNING_TYPE_SLOW_QUERY
        - THREAD_WARNING_TYPE_NO_RESULTS
        - THREAD_WARNING_TYPE_USER_FRUSTRATION
        - THREAD_WARNING_TYPE_POTENTIAL_HALLUCINATION
        - THREAD_WARNING_TYPE_IGNORED_INSTRUCTION
        - THREAD_WARNING_TYPE_USER_THUMBS_DOWN
        - THREAD_WARNING_TYPE_NO_CONCLUSION
        - THREAD_WARNING_TYPE_USER_THUMBS_UP
        - THREAD_WARNING_TYPE_GOAL_ACHIEVED
        - THREAD_WARNING_TYPE_USER_SATISFACTION
      description: ThreadWarningType is the canonical set of thread warning types
    textql.rpc.public.chat.Chat:
      type: object
      properties:
        id:
          type: string
          title: id
          description: UUID
        paradigm:
          $ref: '#/components/schemas/textql.rpc.public.paradigm.Paradigm'
          title: paradigm
        model:
          $ref: '#/components/schemas/textql.rpc.public.chat.LlmModel'
          title: model
        timestamp:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: timestamp
        orgId:
          type: string
          title: org_id
        memberId:
          type: string
          title: member_id
        summary:
          type: string
          title: summary
          nullable: true
        playbookId:
          type: string
          title: playbook_id
          nullable: true
        research:
          type: boolean
          title: research
          description: whether this chat was created with report mode enabled
          nullable: true
        creatorEmail:
          type: string
          title: creator_email
          nullable: true
        apiKeyClientId:
          type: string
          title: api_key_client_id
          nullable: true
        updatedAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: updated_at
          description: when chat was last updated
        isBookmarked:
          type: boolean
          title: is_bookmarked
          description: whether this chat is bookmarked by the user
          nullable: true
        preferredProvider:
          type: string
          title: preferred_provider
          nullable: true
        templateDataId:
          type: string
          title: template_data_id
          description: UUID reference to playbook_template_data
          nullable: true
        batchRunId:
          type: string
          title: batch_run_id
          description: UUID reference to playbook_batch_run
          nullable: true
        preview:
          type: string
          title: preview
          description: preview/snippet of first message content
          nullable: true
        dashboardMode:
          type: boolean
          title: dashboard_mode
          description: whether this chat was created with dashboard mode enabled
          nullable: true
        source:
          $ref: '#/components/schemas/textql.rpc.public.chat.ChatSource'
          title: source
          description: source of the chat
          nullable: true
        methodology:
          $ref: '#/components/schemas/textql.rpc.public.chat.Methodology'
          title: methodology
          description: chat-level methodology preference
          nullable: true
        isRunning:
          type: boolean
          title: is_running
          description: whether this chat has an active stream
          nullable: true
        isUnread:
          type: boolean
          title: is_unread
          description: whether updated_at > last_read_at for the requesting user
          nullable: true
        vllmModelId:
          type: string
          title: vllm_model_id
          description: >-
            vllm_model_id is the per-chat model identifier for the org's vLLM
            endpoint.
             Only meaningful when model == MODEL_VLLM.
          nullable: true
        fastMode:
          type: boolean
          title: fast_mode
          description: |-
            fast_mode enables Anthropic's fast inference mode (speed: "fast").
             Currently supported on Opus 4.6 only. Pricing is 6x standard rates.
          nullable: true
        agentId:
          type: string
          title: agent_id
          description: Agent that owns this chat, unset for human-initiated chats.
          nullable: true
        agentName:
          type: string
          title: agent_name
          nullable: true
        agentProfileImageUrl:
          type: string
          title: agent_profile_image_url
          nullable: true
        maxThinking:
          type: boolean
          title: max_thinking
          description: >-
            max_thinking runs extended thinking at max effort with visible
            reasoning.
             Supported on Sonnet 5, Fable 5, and Opus 4.8. Thinking tokens bill as output tokens.
          nullable: true
      title: Chat
      additionalProperties: false
    connect.error_details.Any:
      type: object
      properties:
        type:
          type: string
          description: >-
            A URL that acts as a globally unique identifier for the type of the
            serialized message. For example:
            `type.googleapis.com/google.rpc.ErrorInfo`. This is used to
            determine the schema of the data in the `value` field and is the
            discriminator for the `debug` field.
        value:
          type: string
          format: binary
          description: >-
            The Protobuf message, serialized as bytes and base64-encoded. The
            specific message type is identified by the `type` field.
        debug:
          oneOf:
            - type: object
              title: Any
              additionalProperties: true
              description: Detailed error information.
          discriminator:
            propertyName: type
          title: Debug
          description: >-
            Deserialized error detail payload. The 'type' field indicates the
            schema. This field is for easier debugging and should not be relied
            upon for application logic.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message, with an additional debug
        field for ConnectRPC error details.
    textql.rpc.public.paradigm.Paradigm:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/textql.rpc.paradigm_params.ParadigmType'
          title: type
        version:
          type: integer
          title: version
          format: int32
        options:
          $ref: '#/components/schemas/textql.rpc.public.paradigm.ParadigmOptions'
          title: options
      title: Paradigm
      additionalProperties: false
      description: ChatParadigm includes paradigm options
    textql.rpc.public.chat.LlmModel:
      type: string
      title: LlmModel
      enum:
        - MODEL_UNKNOWN
        - MODEL_DEFAULT_SMALL
        - MODEL_DEFAULT
        - MODEL_DEFAULT_LARGE
        - MODEL_DEFAULT_REASONING
        - MODEL_HAIKU_4_5
        - MODEL_OPUS_4_8
        - MODEL_FABLE_5
        - MODEL_SONNET_5
        - MODEL_GPT_5_6_SOL
        - MODEL_GEMINI_3_FLASH
        - MODEL_GEMINI_3_PRO
        - MODEL_GEMINI_3_1_PRO
        - MODEL_GEMINI_3_5_FLASH
        - MODEL_GPT_5_6_TERRA
        - MODEL_GPT_5_6_LUNA
        - MODEL_DEEPSEEK_3_2
        - MODEL_GLM_5
        - MODEL_VLLM
        - MODEL_KIMI_K2_6
        - MODEL_GLM_5_2
        - MODEL_KIMI_K2_7_CODE
        - MODEL_QWEN3_7_PLUS
        - MODEL_MUSE_SPARK_1_1
    textql.rpc.public.chat.Methodology:
      type: string
      title: Methodology
      enum:
        - METHODOLOGY_UNKNOWN
        - METHODOLOGY_ADAPTIVE
        - METHODOLOGY_PRESCRIPTIVE
        - METHODOLOGY_THOROUGH
        - METHODOLOGY_CAREFUL
        - METHODOLOGY_ONTOLOGY_BUILDING
    textql.rpc.paradigm_params.ParadigmType:
      type: string
      title: ParadigmType
      enum:
        - TYPE_UNKNOWN
        - TYPE_UNIVERSAL
    textql.rpc.public.paradigm.ParadigmOptions:
      type: object
      oneOf:
        - type: object
          properties:
            universal:
              $ref: '#/components/schemas/textql.rpc.public.paradigm.UniversalOptions'
              title: universal
          title: universal
          required:
            - universal
      title: ParadigmOptions
      additionalProperties: false
    textql.rpc.public.paradigm.UniversalOptions:
      type: object
      properties:
        connectorIds:
          type: array
          items:
            type: integer
            format: int32
          title: connector_ids
        datasetId:
          type: string
          title: dataset_id
          nullable: true
        webSearchEnabled:
          type: boolean
          title: web_search_enabled
        sqlEnabled:
          type: boolean
          title: sql_enabled
        ontologyEnabled:
          type: boolean
          title: ontology_enabled
        ontologyEditingEnabled:
          type: boolean
          title: ontology_editing_enabled
        pythonEnabled:
          type: boolean
          title: python_enabled
        autoApproveEnabled:
          type: boolean
          title: auto_approve_enabled
        googleDriveEnabled:
          type: boolean
          title: google_drive_enabled
        powerbiEnabled:
          type: boolean
          title: powerbi_enabled
        contextEditingEnabled:
          type: boolean
          title: context_editing_enabled
        formEditorEnabled:
          type: boolean
          title: form_editor_enabled
        playbookToolsEnabled:
          type: boolean
          title: playbook_tools_enabled
        microsoft365Enabled:
          type: boolean
          title: microsoft365_enabled
        feedExplorerEnabled:
          type: boolean
          title: feed_explorer_enabled
        bashEnabled:
          type: boolean
          title: bash_enabled
        javascriptEnabled:
          type: boolean
          title: javascript_enabled
        feedPostEnabled:
          type: boolean
          title: feed_post_enabled
        feedCommentEnabled:
          type: boolean
          title: feed_comment_enabled
        feedEngageEnabled:
          type: boolean
          title: feed_engage_enabled
        streamlitEnabled:
          type: boolean
          title: streamlit_enabled
        compactionDisabled:
          type: boolean
          title: compaction_disabled
        gmailEnabled:
          type: boolean
          title: gmail_enabled
        chatHistorySearchEnabled:
          type: boolean
          title: chat_history_search_enabled
        googleCalendarEnabled:
          type: boolean
          title: google_calendar_enabled
        emailOutputEnabled:
          type: boolean
          title: email_output_enabled
        powerbiSelections:
          type: array
          items:
            $ref: '#/components/schemas/textql.rpc.powerbi_selection.PowerBISelection'
          title: powerbi_selections
        smsMode:
          type: boolean
          title: sms_mode
        apiAccessKeyIds:
          type: array
          items:
            type: string
          title: api_access_key_ids
      title: UniversalOptions
      additionalProperties: false
    textql.rpc.powerbi_selection.PowerBISelection:
      type: object
      properties:
        workspaceId:
          type: string
          title: workspace_id
        reportIds:
          type: array
          items:
            type: string
          title: report_ids
        datasetIds:
          type: array
          items:
            type: string
          title: dataset_ids
        workspaceName:
          type: string
          title: workspace_name
        connectorId:
          type: integer
          title: connector_id
          format: int32
      title: PowerBISelection
      additionalProperties: false
      description: |-
        PowerBISelection captures a chosen PowerBI workspace (and optionally the
         specific reports/datasets within it) for attaching to a chat. Field shape
         mirrors textql.rpc.public.paradigm.PowerBISelection; kept in a standalone
         package so it can be shared by paradigm_params without an import cycle
         (public/paradigm.proto already imports paradigm_params.proto).
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: tql_api_key

````