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

# Update Session

> Update a session's metadata before it is committed. Use this to attach or correct `patient_details`, change the requested `templates`, adjust `language_hint`, or switch `session_mode` / `model`. `session_mode` and `model` can only be changed while the session is still open (before End Session) — attempting to change them afterwards returns `409`. Unknown fields are rejected.


Update session metadata — `patient_details`, `templates`, `language_hint`, etc. Send only the fields you want to change.

<Note>
  `session_mode` and `model` can only be changed **before** [End Session](/ekascribe/api-reference/sessions/end-session) — afterwards the call returns `409`.
</Note>


## OpenAPI

````yaml PATCH /voice/v1/sessions/{session_id}
openapi: 3.0.1
info:
  title: EkaScribe Protocol API (MedScribeAlliance v0.1)
  version: '0.1'
  description: >
    Session-based medical voice capture API implementing the MedScribeAlliance
    Protocol v0.1. Discover service capabilities, create a session, stream audio
    chunks, then end the session to trigger asynchronous transcription and
    structured-template extraction.
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
paths:
  /voice/v1/sessions/{session_id}:
    patch:
      tags:
        - sessions
      summary: Update Session
      description: >
        Update a session's metadata before it is committed. Use this to attach
        or correct `patient_details`, change the requested `templates`, adjust
        `language_hint`, or switch `session_mode` / `model`. `session_mode` and
        `model` can only be changed while the session is still open (before End
        Session) — attempting to change them afterwards returns `409`. Unknown
        fields are rejected.
      parameters:
        - name: session_id
          in: path
          required: true
          description: Session ID returned by Create Session
          schema:
            type: string
            example: ses_abc123def456
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchSessionRequest'
            example:
              patient_details:
                oid: PAT-12345
                name: John Doe
              templates:
                - clinical_notes_template
              language_hint:
                - en
                - hi
      responses:
        '200':
          description: Session updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchSessionResponse'
              example:
                session_id: ses_abc123def456
                status: success
                message: Session updated successfully
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            session_mode / model can no longer be changed (session already
            committed)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error (unknown or invalid fields)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - auth: []
components:
  schemas:
    PatchSessionRequest:
      type: object
      additionalProperties: false
      properties:
        patient_details:
          type: object
          additionalProperties: true
          description: >-
            Patient demographic / identifier metadata. The `oid` key is promoted
            to `patient_oid` for indexing.
        templates:
          type: array
          items:
            type: string
          description: Replace the requested template IDs (up to 2).
        language_hint:
          type: array
          items:
            type: string
          description: ISO 639-1 code(s) hinting the spoken language(s).
        additional_data:
          type: object
          additionalProperties: true
          description: Arbitrary pass-through metadata merged into the session.
        session_mode:
          type: string
          enum:
            - consultation
            - dictation
          description: Updatable only before the session is committed (End Session).
        model:
          type: string
          enum:
            - pro
            - lite
          description: Updatable only before the session is committed (End Session).
        user_status:
          type: string
          description: Client-side session status marker.
        processing_status:
          type: string
          description: Processing status override (advanced use).
    PatchSessionResponse:
      type: object
      properties:
        session_id:
          type: string
        status:
          type: string
          example: success
        message:
          type: string
          example: Session updated successfully
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: invalid_audio_format
            message:
              type: string
              description: Human-readable error message.
              example: Audio format 'audio/mp3' is not supported
            details:
              type: object
              additionalProperties: true
              description: Additional error context.
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````