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

# Session Mode Switching Interface

### Function

Remotely switches the proxy's session mode, supporting **sticky sessions** (fixed IP) and **rotating sessions** (auto IP switching), without manual adjustments in the dashboard.

### Applicable Scenarios

Automatically adapts to business needs (e.g., switch to sticky sessions for account login, switch to rotating sessions for data collection).

### Call Information

* **Request URL**: `https://api.xxx.com/proxies/session/switch`
* **Request Method**: `POST`
* **Request Header**: `Authorization: Bearer [Your API Key]`
* **Request Body** (JSON Format, Mandatory Parameters):

```json theme={null}
{
  "session_type": "sticky",
  "sticky_duration": 120,
  "rotate_interval": 60
}
```

### Example (Switch to 120-Minute Sticky Session)

* **Request Body**:

```json theme={null}
{
  "session_type": "sticky",
  "sticky_duration": 120
}
```

### Successful Response Example (Status Code: 200)

```json theme={null}
{
  "code": 200,
  "msg": "Session mode switched successfully. Current mode: sticky session, duration: 120 minutes.",
  "data": {
    "current_session": "sticky",
    "expire_time": "2025-12-26 15:30:00"
  }
}
```
