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

# Update chat session

> Update **`name`** and/or **`lastModelId`** for a platform session. At least one field is required.



## OpenAPI

````yaml /api-reference/ageneral-chat-openapi.json patch /v1/chat/sessions/{id}
openapi: 3.1.0
info:
  title: Chat
  version: 1.0.0
  description: >-
    **Platform chat** for the Ageneral web app: session-backed conversations
    tied to a **project**, with inference using your **project access**. **Base
    URL:** `https://ageneral.ai`.


    **Not** the inference-only host at `models.ageneral.ai` — use
    **`https://models.ageneral.ai`** instead. That host uses **API keys** only —
    no **`Ageneral-Project-Id`** or session headers.


    **Authentication:** `Authorization: Bearer <session JWT>` from Ageneral
    sign-in.


    **Project scope:** Every route requires header **`Ageneral-Project-Id`**
    with a project you can access.


    **Session:** For **`POST /v1/chat/completions`** and **`POST
    /v1/chat/responses`**, send optional **`Ageneral-Session-Id`** to continue
    an existing session; responses echo the active session id in the
    **`Ageneral-Session-Id`** response header. Omit the header to start a new
    session.
  contact:
    name: Ageneral
    url: https://ageneral.ai
servers:
  - url: https://ageneral.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Chat completions
    description: >-
      OpenAI Chat Completions–compatible body; server merges history and
      defaults model.
  - name: Responses
    description: >-
      Streaming responses compatible with OpenAI **Responses**; request uses
      `model` and `messages`.
  - name: Sessions
    description: List, update metadata, and load stored messages for platform chat.
paths:
  /v1/chat/sessions/{id}:
    patch:
      tags:
        - Sessions
      summary: Update chat session
      description: >-
        Update **`name`** and/or **`lastModelId`** for a platform session. At
        least one field is required.
      operationId: patchPlatformChatSession
      parameters:
        - $ref: '#/components/parameters/AgeneralProjectId'
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Chat session id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchChatSessionRequest'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchChatSessionResponse'
        '400':
          description: Invalid body or neither field set.
        '401':
          description: Missing or invalid session JWT.
        '403':
          description: User cannot access this project.
        '404':
          description: >-
            Session not found or not a platform session for this user and
            project.
      security:
        - bearerAuth: []
components:
  parameters:
    AgeneralProjectId:
      name: Ageneral-Project-Id
      in: header
      required: true
      schema:
        type: string
      description: Project id. You must be a member with access.
  schemas:
    PatchChatSessionRequest:
      type: object
      description: At least one of **`name`** or **`lastModelId`** must be present.
      properties:
        name:
          type: string
        lastModelId:
          type: string
          nullable: true
      minProperties: 1
    PatchChatSessionResponse:
      type: object
      required:
        - ok
      properties:
        ok:
          type: boolean
          example: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Session JWT from Ageneral sign-in. Send as `Authorization: Bearer
        <token>`.

````