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

# Update web chat thread session metadata

> Merge metadata and/or variables on a web chat thread. Requires chat JWT authentication.



## OpenAPI

````yaml patch /api/v1/chat/threads/{threadId}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Feather AI API
servers:
  - url: https://prod.featherhq.com
    description: Production environment
security: []
paths:
  /api/v1/chat/threads/{threadId}:
    patch:
      tags:
        - Chat
      summary: Update web chat thread session metadata
      description: >-
        Merge metadata and/or variables on a web chat thread. Requires chat JWT
        authentication.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: threadId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                variables:
                  type: object
                  additionalProperties:
                    type: string
      responses:
        '200':
          description: Updated chat thread session
          content:
            application/json:
              schema:
                type: object
                properties:
                  thread:
                    type: object
                    properties:
                      threadId:
                        type: string
                      metadata:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                      variables:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                      isActive:
                        type: boolean
                      createdAt:
                        type: string
                      lastActivityAt:
                        type: string
                        nullable: true
                    required:
                      - threadId
                      - isActive
                      - createdAt
                      - lastActivityAt
                required:
                  - thread
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 403
                  message:
                    type: string
                    default: Forbidden
                  code:
                    type: string
                    enum:
                      - FORBIDDEN
                    default: FORBIDDEN
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '404':
          description: Thread not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 404
                  message:
                    type: string
                    default: Not found
                  code:
                    type: string
                    enum:
                      - NOT_FOUND
                    default: NOT_FOUND
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  message:
                    type: string
                    default: Internal server error
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    default: INTERNAL_SERVER_ERROR
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false

````