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

# Close Session

> Requests session closure. To let current media finish, wait for `response.render.stopped` before closing. The endpoint usually returns `closing`; retrieve the Session to confirm `closed` or handle `failed`.

<AccordionGroup>
  <Accordion title="Errors">
    See [Session errors](/streaming-avatar/api-references/sessions#errors) for the error codes session endpoints return.
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml streaming-avatar/api-references/openapi.json POST /v1/realtime-avatar/sessions/{session_id}/close
openapi: 3.1.0
info:
  title: Vivix Streaming Avatar API
  version: 1.0.0
  description: REST endpoints for Streaming Avatar sessions, voices, and characters.
servers:
  - url: https://api.vivix.ai
security:
  - bearerAuth: []
paths:
  /v1/realtime-avatar/sessions/{session_id}/close:
    post:
      summary: Close Session
      description: >-
        Requests session closure. To let current media finish, wait for
        `response.render.stopped` before closing. The endpoint usually returns
        `closing`; retrieve the Session to confirm `closed` or handle `failed`.
      operationId: closeSession
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the Streaming Avatar session to close.
          example: avatar-session-123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                close_reason:
                  type: string
                  description: Caller-defined reason stored as the session close reason.
            example:
              close_reason: user_requested
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: '`0` on success; any other value is an error code.'
                  message:
                    type: string
                    description: '`success`, or an English error description.'
                  data:
                    type: object
                    properties:
                      session_id:
                        type: string
                        description: Identifier for the closing avatar session.
                      status:
                        type: string
                        description: >-
                          Close status. Returns `closing` while shutdown is in
                          progress, or `closed` when it has completed.
                    required:
                      - session_id
                      - status
              example:
                code: 0
                message: success
                data:
                  session_id: avatar-session-123
                  status: closed
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your Vivix API key. Keep it on your server.

````