> For AI agents: the complete documentation index is available at https://proxykite.com/docs/llms.txt, the full documentation bundle is available at https://proxykite.com/docs/llms-full.txt.

# Tunnel uplink

Every proxy already leaves the internet through **its own dongle**. The _tunnel uplink_ is something else: the link
your **box itself** uses to reach our server (the tunnel that carries all proxy connections, and the box's calls to the
panel). By default that is the box's default route, normally Ethernet. If Ethernet, your router or your ISP goes down,
the tunnel drops and every proxy of the node goes offline, even though each dongle still has data.

With a backup uplink the box moves the tunnel to one of its dongles instead, and back to Ethernet when it works again.
Needs **agent 1.7.0** or newer; older agents ignore the setting and keep using the default route
(`"supported": false`). In the panel: **Nodes → node → Tunnel uplink**. **Not available to reseller sub-users** (`404`).

| `mode`             | What happens                                                                                                                                                               |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `system` (default) | Default route (Ethernet) only (the behaviour before this feature).                                                                                                         |
| `auto`             | Default route first. When the tunnel over it fails, the dongles in `dongle_ids`, in that order. Back to the default route once it has worked for `return_after_s` seconds. |
| `dongle`           | Only the dongles in `dongle_ids`, in order, for a box without Ethernet.                                                                                                    |

:::warning What it costs

- While the box is on a backup dongle, **that SIM carries the traffic of all proxies of the node** (about the node's
  total traffic, both directions). Check its data plan.
- Rotating the uplink dongle (auto-rotate, rotation link, API) changes its IP: the tunnel reconnects within a few seconds
  and open connections on **every** proxy of the node drop. `warnings.auto_rotate_dongle_ids` lists chosen dongles that
  have auto-rotate on; consider Sticky IP for them.
- Switching uplink drops open proxy connections once; new ones work within seconds.
  :::

## The uplink object

```json
{"node_id": 12, "mode": "auto", "dongle_ids": [9, 7], "return_after_s": 60, "supported": true,
 "status": {"state": "dongle", "text": "Backup: Jio 1", "active": "dongle", "dongle_id": 9, "iface": "huawei81",
            "since": "2026-10-10T19:02:11Z", "switches": 3,
            "last_error": "default route: dial tcp ind1.proxykite.com:7443: i/o timeout",
            "reported_at": "2026-10-10T19:05:00+00:00"},
 "dongles": [{"id": 7, "label": "Port 30000", "port": 30000, "auto_rotate": false, "uplink_bytes_in": 0, "uplink_bytes_out": 0},
             {"id": 9, "label": "Jio 1", "port": 30001, "auto_rotate": true, "uplink_bytes_in": 1500000, "uplink_bytes_out": 420000}],
 "warnings": {"auto_rotate_dongle_ids": [9]}}
```

| Field                                    | Meaning                                                                                                                                                                                                        |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`, `dongle_ids`, `return_after_s`   | your setting (see below)                                                                                                                                                                                       |
| `supported`                              | the box's agent understands the setting (1.7.0+)                                                                                                                                                               |
| `status.state`                           | `system` = Ethernet / default route, `dongle` = a dongle carries the tunnel, `none` = nothing works right now, `unknown` = no report in the last 10 minutes (node offline), `too_old` = agent older than 1.7.0 |
| `status.active`, `dongle_id`, `iface`    | what the box reported in its last heartbeat (`null` when unknown)                                                                                                                                              |
| `status.since`, `switches`, `last_error` | when the current uplink became active (UTC), switches since the agent started, latest reason a link failed                                                                                                     |
| `dongles`                                | the node's dongles you can pick; `uplink_bytes_*` = tunnel + panel bytes sent over that dongle while it was the uplink (on top of its own proxy usage)                                                         |
| `warnings.auto_rotate_dongle_ids`        | chosen dongles with auto-rotate on                                                                                                                                                                             |

The [node object](https://proxykite.com/docs/api/nodes.md#the-node-object) also carries a short `"uplink": {"mode", "state", "text"}`.

## Get the uplink


`GET /nodes/{id}/uplink`

**Ability:** `read`



**curl**

```bash
curl 'https://proxykite.com/api/v1/nodes/12/uplink' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json'
```


**Python**

```python
import os
import requests

r = requests.get(
    "https://proxykite.com/api/v1/nodes/12/uplink",
    headers={"Authorization": f"Bearer {os.environ['HYP_TOKEN']}", "Accept": "application/json"},
    timeout=30,
)
print(r.status_code, r.json())
```


**Node.js**

```js
const res = await fetch('https://proxykite.com/api/v1/nodes/12/uplink', {
  headers: {
    Authorization: `Bearer ${process.env.HYP_TOKEN}`,
    Accept: 'application/json',
  },
  signal: AbortSignal.timeout(30000),
});
console.log(res.status, await res.json());
```


**PHP**

```php
<?php
$ch = curl_init('https://proxykite.com/api/v1/nodes/12/uplink');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('HYP_TOKEN'),
        'Accept: application/json',
    ],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($status, json_decode($body, true));
```



**Response `200`:** `{"data": <uplink object>}`

## Change the uplink


`PUT /nodes/{id}/uplink`

**Ability:** `manage` · **Who:** owner or team admin. The box picks the change up within one heartbeat (\~15 s).

| Body field       | Type                                              |                                                                 |
| ---------------- | ------------------------------------------------- | --------------------------------------------------------------- |
| `mode`           | `system` \| `auto` \| `dongle`                    | required                                                        |
| `dongle_ids`     | array of 0–3 proxy ids of **this node**, in order | optional; missing = keep; `auto` and `dongle` need at least one |
| `return_after_s` | integer 30–600                                    | optional; missing = keep (default 60); used by `auto`           |



**curl**

```bash
curl -X PUT 'https://proxykite.com/api/v1/nodes/12/uplink' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"mode":"auto","dongle_ids":[9,7],"return_after_s":60}'
```


**Python**

```python
import os
import requests

r = requests.put(
    "https://proxykite.com/api/v1/nodes/12/uplink",
    headers={"Authorization": f"Bearer {os.environ['HYP_TOKEN']}", "Accept": "application/json"},
    json={"mode": "auto", "dongle_ids": [9, 7], "return_after_s": 60},
    timeout=30,
)
print(r.status_code, r.json())
```


**Node.js**

```js
const res = await fetch('https://proxykite.com/api/v1/nodes/12/uplink', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.HYP_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"mode":"auto","dongle_ids":[9,7],"return_after_s":60}),
  signal: AbortSignal.timeout(30000),
});
console.log(res.status, await res.json());
```


**PHP**

```php
<?php
$ch = curl_init('https://proxykite.com/api/v1/nodes/12/uplink');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('HYP_TOKEN'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"mode":"auto","dongle_ids":[9,7],"return_after_s":60}',
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($status, json_decode($body, true));
```



**Response `200`:** `{"data": <uplink object>}`. `422 validation_failed` for an unknown mode, more than 3 ids, an id that
is not a dongle of this node, `return_after_s` out of range, or `auto`/`dongle` without a dongle.

## Alerts

Under **Account → Alerts** (or `PATCH /alerts/settings`, see [Alerts](https://proxykite.com/docs/api/alerts.md)) the owner gets, once per change:
`uplink_backup` (the tunnel moved to a dongle), `uplink_primary` (back on Ethernet) and `uplink_none` (no link worked
for two heartbeats in a row). Times are in your timezone.
