UniFi Controller API client class

UniFi Controller API client class

Art of WiFi maintains this PHP class which provides access to Ubiquiti’s UniFi Controller API. Versions 4.x.x and 5.x.x of the UniFi Controller software are supported (version 5.9.29 has been confirmed to work). It’s a “standalone” version of the class which is used in our API browser tool.

Since the class was first officially published as a standalone package in September 2017, the class has quickly become the most popular API client for the UniFi controller platform: to date, it has received more than 150 GitHub and Packagist stars and has been downloaded or cloned through GitHub and Packagist over 4500 times!

This class can be installed manually or using composer/packagist for easy inclusion in your projects.

We made the UniFi Controller API client class available under the MIT license and it can be downloaded from GitHub here:
https://github.com/Art-of-WiFi/UniFi-API-browser

or from Packagist here:
https://packagist.org/packages/art-of-wifi/unifi-api-client

Methods and functions supported

The class currently supports the following functions/methods to get/post/put/delete data through the UniFi Controller API:

  • login()
  • logout()
  • adopt_device()
  • archive_alarm()
  • authorize_guest()
  • block_sta()
  • count_alarms()
  • create_firewallgroup()
  • create_hotspotop()
  • create_network()
  • create_radius_account()
  • create_site()
  • create_usergroup()
  • create_user()
  • create_voucher()
  • create_wlan()
  • delete_device()
  • delete_firewallgroup()
  • delete_network()
  • delete_radius_account()
  • delete_site()
  • delete_usergroup()
  • delete_wlan()
  • disable_ap()
  • edit_client_fixedip()
  • edit_firewallgroup()
  • edit_usergroup()
  • extend_guest_validity()
  • forget_sta()
  • invite_admin()
  • revoke_admin()
  • led_override()
  • list_admins()
  • list_all_admins()
  • list_alarms()
  • list_backups()
  • list_clients()
  • list_country_codes()
  • list_current_channels()
  • list_dashboard()
  • list_devices()
  • list_dpi_stats()
  • list_dynamicdns()
  • list_events()
  • list_extension()
  • list_firewallgroups()
  • list_guests()
  • list_health()
  • list_hotspotop()
  • list_known_rogueaps()
  • list_networkconf()
  • list_portconf()
  • list_portforward_stats()
  • list_portforwarding()
  • list_radius_accounts()
  • list_radius_profiles()
  • list_rogueaps()
  • list_self()
  • list_settings()
  • list_sites()
  • list_tags()
  • list_usergroups()
  • list_users()
  • list_wlan_groups()
  • list_wlanconf()
  • locate_ap()
  • move_device()
  • power_cycle_switch_port()
  • reconnect_sta()
  • rename_ap()
  • restart_ap()
  • revoke_voucher()
  • set_ap_radiosettings()
  • set_device_settings_base()
  • set_guestlogin_settings()
  • set_guestlogin_settings_base()
  • set_networksettings_base()
  • set_radius_account_base()
  • set_site_connectivity()
  • set_site_country()
  • set_site_guest_access()
  • set_site_locale()
  • set_site_mgmt()
  • set_site_name()
  • set_site_ntp()
  • set_site_snmp()
  • set_sta_name()
  • set_sta_note()
  • set_usergroup()
  • set_wlan_mac_filter()
  • set_wlansettings()
  • set_wlansettings_base()
  • site_leds()
  • spectrum_scan()
  • spectrum_scan_state()
  • stat_allusers()
  • stat_auths()
  • stat_client()
  • stat_5minutes_aps()
  • stat_hourly_aps()
  • stat_daily_aps()
  • stat_5minutes_gateway()
  • stat_hourly_gateway()
  • stat_daily_gateway()
  • stat_5minutes_site()
  • stat_hourly_site()
  • stat_daily_site()
  • stat_5minutes_user
  • stat_hourly_user()
  • stat_daily_user()
  • stat_payment()
  • stat_sessions()
  • stat_sites()
  • stat_speedtest_results()
  • stat_sta_sessions_latest()
  • stat_status()
  • stat_sysinfo()
  • stat_voucher()
  • unauthorize_guest()
  • unblock_sta()
  • unset_locate_ap()
  • upgrade_device()
  • upgrade_device_external()
  • start_rolling_upgrade()
  • cancel_rolling_upgrade()