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

# Rename or archive a chat thread, or set its standing context

> Whoever started the thread, or a workspace owner. Omitted fields are left alone. `instructions` and `defaults` are added to the workspace's, never replacing them, and cannot change which tools exist or which need approval.



## OpenAPI

````yaml patch /api/chat/threads/{thread_id}
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/threads/{thread_id}:
    patch:
      tags:
        - Chat
      summary: Rename or archive a chat thread, or set its standing context
      description: >-
        Whoever started the thread, or a workspace owner. Omitted fields are
        left alone. `instructions` and `defaults` are added to the workspace's,
        never replacing them, and cannot change which tools exist or which need
        approval.
      operationId: update_thread_api_chat_threads__thread_id__patch
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Thread Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChatThreadRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatThreadResponse'
        '403':
          description: You can see it but not do that.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Thread not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    UpdateChatThreadRequest:
      properties:
        title:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Title
          description: New title.
        status:
          anyOf:
            - $ref: '#/components/schemas/ChatThreadStatus'
            - type: 'null'
          description: Archive or restore the thread.
        instructions:
          anyOf:
            - type: string
              maxLength: 4000
            - 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. Empty clears them.
        defaults:
          anyOf:
            - $ref: '#/components/schemas/ChatContextDefaults'
            - type: 'null'
          description: Replaces the pinned defaults; send an empty object to clear them.
      type: object
      title: UpdateChatThreadRequest
      description: Rename, archive or unarchive a thread. Omitted fields are left alone.
    ChatThreadResponse:
      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.
      type: object
      required:
        - id
        - status
        - created_at
        - updated_at
        - created_by
        - can_post
        - can_manage
        - can_share
      title: ChatThreadResponse
      description: A chat thread as the thread list shows it, with what you may do with it.
    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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    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.