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

# Update session

> Update an existing session. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).



## OpenAPI

````yaml https://api.galtea.ai/openapi.json patch /sessions/{id}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /sessions/{id}:
    patch:
      tags:
        - sessions
      summary: Update session
      description: >-
        Update an existing session. See
        [Sessions](https://docs.galtea.ai/concepts/product/version/session).
      operationId: updateSession
      parameters:
        - name: id
          in: path
          description: Session ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Session'
      responses:
        '200':
          description: Session updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Session:
      type: object
      properties:
        id:
          type: string
          example: session_123
        customId:
          type: string
          nullable: true
          example: custom_session_123
        versionId:
          type: string
          example: ver_123
        userId:
          type: string
          nullable: true
          example: user_123
        testCaseId:
          type: string
          nullable: true
          example: tc_123
        context:
          type: object
          nullable: true
          description: >-
            Structured context data. For plain text context, format is { value:
            "..." }
          example:
            value: Session context information
        stoppingReason:
          type: string
          nullable: true
          example: GOAL_ACHIEVED
        recordingUri:
          type: string
          nullable: true
          description: >-
            Canonical storage URI of the full-call recording for a
            telephony-evaluation session. Null for non-telephony sessions or
            before the recording is processed. Resolve to a playable URL via GET
            /storage?uri=.
          example: s3://galtea-bucket/audio/org_123/session_abc-recording.mp3
        error:
          type: string
          nullable: true
          example: >-
            External API responded with HTTP 422: Unprocessable Entity —
            {"detail":"model not found"}
        status:
          type: string
          enum:
            - PENDING
            - COMPLETED
            - FAILED
          example: PENDING
        isProduction:
          type: boolean
          description: >-
            True when the session represents real production traffic (no
            associated test case).
          example: false
        metadata:
          type: object
          nullable: true
          example:
            key: value
        createdAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````