API coverage
About 1005 words
unifi-cli talks to three APIs. Which one serves a command decides how stable that command is across UniFi Network updates, so this page lists the split, command by command, and says what isn't covered at all.
The three APIs
The official Network Integration API (/integration/v1/... on the controller) is documented by Ubiquiti, versioned, and built for API keys. It needs UniFi Network 9.0 or newer and has grown with each release. unifi-cli uses it wherever it covers an operation.
The internal API (/api/s/{site}/... and /v2/api/site/{site}/...) is what the UniFi web interface itself uses. It covers nearly everything, accepts the same API key on current Network versions, and comes without documentation or compatibility promises: Ubiquiti renames fields and moves endpoints between releases. unifi-cli uses it for what the official API doesn't offer yet.
The Site Manager API (api.ui.com) is Ubiquiti's cloud API. unifi-cli uses it to list the consoles of a UI account, to read ISP metrics, and as a transport: its cloud connector forwards requests to a console's Network application, so a cloud context reaches the same two APIs above through it.
Whether a context is local or cloud changes the route and nothing else. Every command works on both.
Coverage by command
| Command | Official | Internal | Notes |
|---|---|---|---|
sites get, ctx describe | yes | controller info and the site list | |
devices get, devices describe | yes | yes | the official API lists devices; load, uplink, radios and port details are merged in from the internal one |
devices restart | yes | fallback | falls back to the internal command when the official action is missing |
devices adopt, forget, upgrade, locate | yes | ||
clients get, clients describe | yes | yes | the official API lists clients; signal, experience, rates and usage come from the internal one |
clients block, unblock, reconnect, forget | yes | ||
ports get | yes | yes | read from the device data above |
ports set, rename, enable, disable, poe on/off/auto | yes | port overrides on the device object | |
ports cycle, ports poe ... cycle | yes | ||
events get | yes | the system log; older controllers answer from the legacy event and alarm lists | |
dashboard, topology | yes | yes | health, traffic history, application usage and the aggregated dashboard are internal |
users get | yes | plus the console's user list on UniFi OS | |
networks, wifi | yes | ||
firewall zones, firewall policies | yes | zone-based firewall | |
acls, dns, traffic lists, vouchers | yes | ||
firewall groups, port-profiles, port-forwards, routes | yes | ||
internet, vpn servers, vpn clients, vpn site-to-site | yes | all four live in the controller's network configuration collection | |
radius, ddns, known-clients | yes | ||
traffic rules, traffic routes | yes | the v2 internal API | |
settings and its shortcuts | yes | ||
export, diff, apply | per kind | per kind | follow the kinds they touch |
consoles get | Site Manager API; cloud contexts only |
unifi resources get prints the per-kind part of this table from the binary you have, and --output wide adds the paths. To see what a specific command requested, run it with UNIFI_LOG_LEVEL=debug and read the request paths in the log.
What this means in practice
A command in the "official" column should keep working across Network updates, and when it breaks, that's a bug to report.
A command in the "internal" column works against the Network versions it was built and checked with, and may need a unifi-cli update after a Network update. Three things soften that:
- Configuration kinds pass their fields through untouched. A field Ubiquiti adds or renames shows up in
describeright away; your scripts and manifests need the new name, unifi-cli doesn't. - Read commands degrade instead of failing where they can: a device list without load figures is still a device list.
- The mock controller pins the wire formats unifi-cli expects, and a contract test suite compares them with a real controller.
As Ubiquiti adds endpoints to the official API, operations move over to it. The command line doesn't change when that happens.
What was checked against what
unifi-cli was developed against the mock controller, which imitates UniFi Network 10.0.
The read paths were checked against a real controller: UniFi Network 11.0 on a UCG Ultra.
The write paths (port changes, device and client actions, create, set, delete, apply) are verified against the mock only. They follow the documented and observed request formats, but until they've run against more hardware, preview changes with --dry-run or unifi diff and start with something you can afford to get wrong.
The sign-in flows were confirmed against the real services: the Site Manager API key path, the local key path, and once the experimental --sso path.
The experimental unifi login --sso relies on the UI account's sign-in endpoint (sso.ui.com) and the key service of the Site Manager web app (developer.svc.ui.com), which are undocumented and outside all three APIs above.
Not covered
| Area | Status |
|---|---|
| UniFi Protect, UniFi Access, Talk, Connect | Not supported. unifi-cli targets the Network application only. |
| Administrators | Read-only (users get). Inviting, changing and removing them isn't supported. |
| Backups | Not supported. unifi export writes configuration as manifests, which isn't a controller backup: it has no statistics, no device adoption state and, by default, no secrets. |
| Controller and console updates | settings updates configures automatic updates; triggering an update of the Network application or UniFi OS isn't supported. |
| Device configuration beyond ports | Radio settings, LED overrides and per-device network settings aren't exposed as commands. |
| Hotspot portal design, guest authorization | Vouchers only. |
| Live packet and flow data | Not supported. The dashboard shows the controller's aggregated statistics. |
| Site creation and deletion | Not supported. sites get and sites use only. |
| Legacy (non-zone) firewall rules | Not supported as a kind. firewall groups covers the legacy address and port groups. |
| Controllers older than Network 9.0 | Not supported, since the official API doesn't exist there. |
If something you need is missing, open an issue. Several of these are a descriptor away, as Architecture explains.
