execute_port_action
Power-cycle a PoE port on a UniFi switch to restore a stuck device. Provide host, site, device ID, and port index to restart power via the UniFi Fabric API.
Instructions
Execute a port action on a device interface.
OPERATIONAL-ACTION-ONLY, NOT A CONFIG WRITER: this Integration port-actions endpoint performs a transient operational action; it does NOT persist port configuration. A PoE power cycle ({'action': 'power-cycle'}, canonical id POWER_CYCLE) is the only valid action -- it powers a PoE port off and back on (only meaningful on PoE-capable ports). Config-style actions such as {'action': 'set-poe-mode', ...} are rejected by the controller with HTTP 400 'unknown-type-id' and leave the port unchanged (verified live). Do NOT use this to set PoE mode, STP, VLAN, or any persistent port setting -- there is no confirmed per-port persistent-config writer on this API; a shared Ethernet Port Profile (update_port_profile) is a different, wide-blast-radius surface.
host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID.
port_idx: port index number (1-based, matching the switch's physical port numbering).
action: the port-action payload, shape {'action': str}, forwarded verbatim to the
UniFi Network Integration API port-actions endpoint. 'power-cycle' (POWER_CYCLE)
is the one valid, documented action; other values return HTTP 400
'unknown-type-id' from the controller.
device_id: REQUIRED. Obtain it from list_devices (its id field).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| site | Yes | ||
| action | Yes | ||
| port_idx | Yes | ||
| device_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||