> 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.

# Rotation

Rotating gives a proxy a new mobile IP (the dongle reconnects to the carrier). You can rotate on demand, on a timer
(auto-rotate), or through the token-less [rotation link](https://proxykite.com/docs/guide/rotation-links.md).

## Rotate now


`POST /proxies/{id}/rotate`

**Ability:** `rotate` · **Who:** anyone on the account except team viewers; sub-users for their assigned proxies.

The call is **synchronous**: it returns when the rotation is done, normally in 5–30 s and at most about 60 s.
Use a client timeout of at least 90 s.



**curl**

```bash
curl -X POST 'https://proxykite.com/api/v1/proxies/7/rotate' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json'
```


**Python**

```python
import os
import requests

r = requests.post(
    "https://proxykite.com/api/v1/proxies/7/rotate",
    headers={"Authorization": f"Bearer {os.environ['HYP_TOKEN']}", "Accept": "application/json"},
    timeout=90,
)
print(r.status_code, r.json())
```


**Node.js**

```js
const res = await fetch('https://proxykite.com/api/v1/proxies/7/rotate', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.HYP_TOKEN}`,
    Accept: 'application/json',
  },
  signal: AbortSignal.timeout(90000),
});
console.log(res.status, await res.json());
```


**PHP**

```php
<?php
$ch = curl_init('https://proxykite.com/api/v1/proxies/7/rotate');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_TIMEOUT => 90,
    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`** (flat, no `data` wrapper)

```json
{"ok": true, "old_ip": "100.64.1.2", "new_ip": "100.64.9.8", "method": "netflip", "duration_ms": 8000}
```

`method` is how the dongle was rotated: `netflip` (network mode switched Auto ↔ 4G only; the dongle stays in the new mode until the next rotation), `netmode` (older toggle-and-restore) or `dataswitch` (mobile data off/on). Errors also carry `"ok": false`:

| Status | `error`                |                                                                     |
| ------ | ---------------------- | ------------------------------------------------------------------- |
| 403    | `dongle_disabled`      | the proxy is disabled (`message` names the reason)                  |
| 409    | `rotation_in_progress` | a rotation of this proxy is already running, retry in a few seconds |
| 501    | `not_implemented`      | the dongle cannot rotate this way                                   |
| 502    | `rotation_failed`      | no new IP; includes `old_ip`                                        |

Every rotation, successful or not, also fires the [`rotation.completed` webhook](https://proxykite.com/docs/guide/webhooks.md).

## Auto-rotate


`PUT /proxies/{id}/auto-rotate`

**Ability:** `manage` · **Who:** anyone on the account except team viewers; sub-users for their assigned proxies.

| Body field         | Type                               |                                                                |
| ------------------ | ---------------------------------- | -------------------------------------------------------------- |
| `interval_seconds` | integer 60–604800, or `null` / `0` | **required**; `null` or `0` turns auto-rotate off              |
| `sticky`           | boolean                            | optional; `true` pauses auto-rotation and keeps the current IP |

The panel offers 60, 120, 300, 600, 900, 1800, 3600, 7200, 21600, 43200, 86400, 259200 and 604800 seconds, but any
value in range is accepted. Auto-rotation is checked once a minute and skips a proxy for 5 minutes after a failed
auto-rotation.



**curl**

```bash
curl -X PUT 'https://proxykite.com/api/v1/proxies/7/auto-rotate' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"interval_seconds":600,"sticky":false}'
```


**Python**

```python
import os
import requests

r = requests.put(
    "https://proxykite.com/api/v1/proxies/7/auto-rotate",
    headers={"Authorization": f"Bearer {os.environ['HYP_TOKEN']}", "Accept": "application/json"},
    json={"interval_seconds": 600, "sticky": False},
    timeout=30,
)
print(r.status_code, r.json())
```


**Node.js**

```js
const res = await fetch('https://proxykite.com/api/v1/proxies/7/auto-rotate', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.HYP_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"interval_seconds":600,"sticky":false}),
  signal: AbortSignal.timeout(30000),
});
console.log(res.status, await res.json());
```


**PHP**

```php
<?php
$ch = curl_init('https://proxykite.com/api/v1/proxies/7/auto-rotate');
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 => '{"interval_seconds":600,"sticky":false}',
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($status, json_decode($body, true));
```



**Response `200`**

```json
{"data": {"auto_rotate_seconds": 600, "sticky": false}}
```

`422 validation_failed` with `fields.interval_seconds` if the value is out of range.

## Rotation history


`GET /proxies/{id}/rotations`

**Ability:** `read` · Newest first.

| Query   |                   |
| ------- | ----------------- |
| `limit` | 1–200, default 50 |



**curl**

```bash
curl 'https://proxykite.com/api/v1/proxies/7/rotations?limit=20' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json'
```


**Python**

```python
import os
import requests

r = requests.get(
    "https://proxykite.com/api/v1/proxies/7/rotations?limit=20",
    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/proxies/7/rotations?limit=20', {
  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/proxies/7/rotations?limit=20');
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`**

```json
{"data": [
  {"id": 981, "status": "ok", "old_ip": "100.64.1.2", "new_ip": "100.64.9.8", "method": "netmode",
   "duration_ms": 9000, "triggered_by": "api", "error": null, "created_at": "2026-10-09T18:00:00+00:00"}
]}
```

`status`: `running`, `ok`, `failed`, `not_implemented`. `triggered_by`: `api`, `link`, `panel`, `auto`.
