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

# Stream session events

> Provides a Server-Sent Events stream of session activity events



## OpenAPI

````yaml swagger.json get /sessions/events
openapi: 3.0.1
info:
  title: VPN-as-a-Service API
  description: API for managing VPN zones and sessions
  version: '1.0'
servers:
  - url: https://api.pingnetwork.io/customer/v2
security:
  - ApiKeyAuth: []
paths:
  /sessions/events:
    get:
      tags:
        - Sessions
      summary: Stream session events
      description: Provides a Server-Sent Events stream of session activity events
      responses:
        '200':
          description: SSE stream established successfully
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/sessions.SessionEvent'
        '401':
          description: Unauthorized
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
components:
  schemas:
    sessions.SessionEvent:
      required:
        - id
        - event_type
        - session_id
        - created_at
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique session event identifier
        session_id:
          type: string
          description: Unique session identifier
        event_type:
          $ref: '#/components/schemas/sessions.EventType'
        created_at:
          type: string
          format: date-time
          description: Event creation timestamp
        duration:
          type: integer
          description: Session duration in seconds
        downloaded_bytes:
          type: integer
          description: Total bytes downloaded
          format: int64
        uploaded_bytes:
          type: integer
          description: Total bytes uploaded
          format: int64
    errors.ErrorResponse:
      required:
        - error
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
              description: Unique error code identifier
            message:
              type: string
              description: Human-readable error message
            details:
              type: object
              properties: {}
              description: Additional error context
    sessions.EventType:
      type: string
      enum:
        - session_start
        - session_heartbeat
        - session_end
        - session_stats
      x-enum-varnames:
        - SessionStart
        - SessionHeartbeat
        - SessionEnd
        - SessionStats
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header

````