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

# End Incognito Session

> Drop an incognito session's live context the moment the chat closes.

The context TTL is only the backstop for when this never arrives, such as
a hard tab close. Uploads are found by session id, so one still in flight
when the user leaves, or one attached before any message created the
session, is queued for deletion just the same.

> [!NOTE]
>
> **Required permission:** Basic access (`basic`) — any signed-in user or service account.
> You can only end your own incognito sessions.


## OpenAPI

````yaml POST /chat/end-incognito-session/{session_id}
openapi: 3.1.0
info:
  title: Onyx API
  description: Onyx API for AI-powered enterprise search and chat
  version: Development
servers:
  - url: https://cloud.onyx.app/api
security: []
paths:
  /chat/end-incognito-session/{session_id}:
    post:
      tags:
        - public
      summary: End Incognito Session
      description: >-
        Drop an incognito session's live context the moment the chat closes.


        The context TTL is only the backstop for when this never arrives, such
        as

        a hard tab close. Uploads are found by session id, so one still in
        flight

        when the user leaves, or one attached before any message created the

        session, is queued for deletion just the same.
      operationId: end_incognito_session
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization header with Bearer token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.