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

# Update Thread

> Update a thread. This is the autosave path — called once per turn.



## OpenAPI

````yaml /api/openapi.json patch /v1/playground/threads/{thread_id}
openapi: 3.1.0
info:
  title: MeshAPI
  description: One key, all AI models.
  version: 0.1.0
servers:
  - url: https://api.meshapi.ai
security:
  - BearerAuth: []
paths:
  /v1/playground/threads/{thread_id}:
    patch:
      tags:
        - Playground
      summary: Update Thread
      description: Update a thread. This is the autosave path — called once per turn.
      operationId: update_thread
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
        - in: header
          name: X-Mesh-Version
          required: false
          schema:
            type: string
            enum:
              - 2026-08
            default: 2026-08
          example: 2026-08
          description: >-
            Dated version of the API contract to pin this request to. Omit it
            and the request is served under `2026-08` — the oldest supported
            version, so an existing integration is never moved by a release. A
            malformed or unsupported value is rejected with `400
            invalid_api_version` rather than falling back silently. The version
            actually served is echoed as `X-Mesh-Version` on every response,
            including errors.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateThreadRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Thread'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateThreadRequest:
      properties:
        title:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Title
        surface:
          anyOf:
            - type: string
            - type: 'null'
          title: Surface
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
        messages:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Messages
      type: object
      title: UpdateThreadRequest
      description: >-
        Every field optional; only what is sent is written.


        `messages` replaces the whole list rather than appending. The client
        already

        holds the authoritative thread in memory (it is what the user is looking
        at),

        and an append endpoint would need to resolve conflicts between two tabs
        — a

        problem a last-writer-wins replace simply does not have.
    Thread:
      properties:
        id:
          type: string
          title: Id
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        surface:
          type: string
          title: Surface
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
        messages:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Messages
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - title
        - surface
        - model
        - params
        - messages
        - org_id
        - team_id
        - created_at
        - updated_at
      title: Thread
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter your MeshAPI key (`rsk_...`) — sent as `Authorization: Bearer
        <key>`.

````