- API Reference
- Box API
- Rotation
Get a new public IP for one slot
Use this to rotate the IP of a slot by its number. Returns at once; poll the slot status until it reports MODEM_READY. A slot stopped by the box (auto-stop) is refused with MODEM_STOPPED. With a rotation delay configured the answer is status: true with an empty msg.
/api/v1/rotate_ip/position/{position}Path parameters
Slot number (position) on the box, starting at 1. A value that is not an integer makes the box answer HTTP 500.
1Authentication
Open by default: with "Basic auth for all API" (api_auth_check) off, anyone who can reach the box can call it. When it is on, the caller must be trusted (loopback, LAN unless "force auth for local" is on, whitelisted IP, allowed Tailscale) or send dashboard Basic credentials, which are checked only when dashboard authentication (dashboard_disable_auth off) is enabled.
Responses
Rotation accepted or refused.
True when the box accepted the request.
Outcome code or message (see the operation's error table).
The caller is not trusted (not loopback, LAN, whitelisted or allowed Tailscale) and sent no valid Basic credentials. The body depends on whether "Basic auth for all API" is on. Routes that also use the panel login can answer a plain-text 401 "Unauthorized Access" instead.
Unhandled error, for example a non-integer position or a missing required parameter.
Error name, e.g. internal_server_error or bad_request.
Errors returned in msg
| msg | Meaning | What to do |
|---|---|---|
MODEM_STOPPED | The box stopped this slot (auto-stop after repeated failures). | Clear the stop in the panel first. |
command_sent | With status true, the rotation started. With status false, the modem did not accept the command. | On status false wait a few seconds and check the slot status before retrying. |
modem_resetting | A rotation is already running on this slot. | Wait for MODEM_READY before rotating again. |
reset_too_much | The last rotation was less than the minimum interval ago (5 seconds by default). | Wait and retry. |
modem_disconnected | The modem type cannot rotate. | Check the modem in the panel. |
need_upgrade | The license does not include IP rotation. | Upgrade the license. |
slot_not_found | No modem in this slot. | Use a position from /api/v1/info_list. |