Sessions API

Monitor active proxy sessions, track usage, and retrieve session statistics

Overview

The Sessions API provides real-time monitoring of active proxy sessions, detailed usage statistics, and session management capabilities.

Base URL

https://api.enterpriseproxynetwork.com/v1/sessions

Endpoints

GET /sessions

List all active sessions with pagination

GET /v1/sessions?page=1&limit=50&status=active

Response:

{
  "data": [
    {
      "id": "sess_1234567890abcdef",
      "customer_id": "cust_123",
      "node_id": "node_1234567890abcdef",
      "status": "active",
      "started_at": "2024-01-15T10:30:00Z",
      "duration_seconds": 3600,
      "bytes_sent": 104857600,
      "bytes_received": 52428800,
      "target_host": "api.example.com",
      "target_port": 443,
      "country": "US",
      "session_type": "socks5"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 125
  }
}

GET /sessions/{id}

Retrieve detailed information about a specific session

GET /v1/sessions/sess_1234567890abcdef

Response:

{
  "id": "sess_1234567890abcdef",
  "customer_id": "cust_123",
  "node_id": "node_1234567890abcdef",
  "status": "active",
  "started_at": "2024-01-15T10:30:00Z",
  "duration_seconds": 3600,
  "bytes_sent": 104857600,
  "bytes_received": 52428800,
  "target_host": "api.example.com",
  "target_port": 443,
  "country": "US",
  "session_type": "socks5",
  "protocol": "tcp",
  "user_agent": "curl/7.88.1",
  "client_ip": "203.0.113.45",
  "error_count": 0,
  "last_activity": "2024-01-15T11:30:00Z"
}

GET /sessions/stats

Retrieve session statistics and metrics

GET /v1/sessions/stats

Response:

{
  "active_sessions": 1250,
  "total_sessions_today": 8500,
  "bandwidth_today_gb": 125.5,
  "peak_concurrent_sessions": 1500,
  "average_session_duration_seconds": 1800,
  "top_countries": [
    {"country": "US", "sessions": 450},
    {"country": "GB", "sessions": 320},
    {"country": "DE", "sessions": 280}
  ],
  "top_protocols": [
    {"protocol": "socks5", "sessions": 850},
    {"protocol": "http", "sessions": 300},
    {"protocol": "https", "sessions": 100}
  ]
}

GET /sessions/stats/hourly

Retrieve hourly session statistics for the last 24 hours

GET /v1/sessions/stats/hourly

Response:

{
  "data": [
    {
      "hour": "2024-01-15T10:00:00Z",
      "active_sessions": 1250,
      "new_sessions": 350,
      "bandwidth_gb": 5.2
    },
    {
      "hour": "2024-01-15T11:00:00Z",
      "active_sessions": 1350,
      "new_sessions": 400,
      "bandwidth_gb": 6.8
    }
  ]
}

Session Status Codes

active - Session is currently active and transferring data
connecting - Session is being established
closed - Session has been terminated normally
error - Session terminated due to an error
timeout - Session terminated due to inactivity timeout

Session Types

socks5

SOCKS5 proxy sessions for general-purpose TCP connections

http

HTTP proxy sessions for web traffic

https

HTTPS proxy sessions for encrypted web traffic

websocket

WebSocket proxy sessions for real-time communication

Authentication

All session endpoints require authentication with an API key with appropriate permissions.

Authorization: Bearer sk_live_1234567890abcdef

Required scopes: sessions:read (for GET), sessions:write (for admin operations)

Was this helpful?

Help us improve our documentation