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

# Update Session

> Update a session.



## OpenAPI

````yaml /openapi.json patch /api/sessions/{session_id}
openapi: 3.1.0
info:
  title: Nenyax API
  description: Backend API for Nenyax Voice Agent Platform
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /api/sessions/{session_id}:
    patch:
      tags:
        - Sessions
      summary: Update Session
      description: Update a session.
      operationId: update_session_api_sessions__session_id__patch
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceSessionUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceSessionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    VoiceSessionUpdate:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/SessionStatus'
            - type: 'null'
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      title: VoiceSessionUpdate
    VoiceSessionResponse:
      properties:
        room_name:
          type: string
          title: Room Name
        session_data:
          additionalProperties: true
          type: object
          title: Session Data
          default: {}
        id:
          type: string
          title: Id
        status:
          $ref: '#/components/schemas/SessionStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
        user_id:
          type: string
          title: User Id
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        call_direction:
          anyOf:
            - $ref: '#/components/schemas/CallDirection'
            - type: 'null'
        outbound_phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Outbound Phone Number
        call_status:
          anyOf:
            - $ref: '#/components/schemas/CallStatus'
            - type: 'null'
        analysis:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Analysis
        transferred_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Transferred To
        transfer_type:
          anyOf:
            - $ref: '#/components/schemas/TransferType'
            - type: 'null'
        transfer_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Transfer Timestamp
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - room_name
        - id
        - status
        - started_at
        - ended_at
        - duration
        - user_id
        - agent_id
        - created_at
        - updated_at
      title: VoiceSessionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SessionStatus:
      type: string
      enum:
        - CREATED
        - ACTIVE
        - COMPLETED
        - FAILED
      title: SessionStatus
    CallDirection:
      type: string
      enum:
        - INBOUND
        - OUTBOUND
      title: CallDirection
    CallStatus:
      type: string
      enum:
        - RINGING
        - ANSWERED
        - COMPLETED
        - FAILED
        - NO_ANSWER
      title: CallStatus
    TransferType:
      type: string
      enum:
        - WARM
        - COLD
      title: TransferType
    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

````