go-unifi

go-unifi

A Go client for the UniFi Network controller API — type-safe access to networks, clients, devices, firewall, and more.

go-unifi is a Go client library for the UniFi Network controller API. It powers the Terraform provider for UniFi but works standalone in any Go project that needs to talk to a UniFi controller.

It gives you strongly-typed access to networks, WLANs, clients, devices, firewall rules, settings and dozens of other resources — most of them generated directly from the controller's own API definitions for broad, accurate coverage.

Two API surfaces, one client

A single unifi.Client exposes both of the controller's APIs:

Start here

Requirements

  • Go 1.26 or later.
  • A UniFi OS console (new-style) running UniFi Network 9.0.114 or newer — API-key authentication is the only supported auth. The Official API surface additionally requires UniFi Network 10.1.78 or newer. (Both are Network Application versions; UniFi OS — the console's operating system — versions separately.)

Upgrading from go-unifi 1.x? See the migration guide. Coming from paultyng/go-unifi? See Migrating from upstream.

AI & LLMs

Pointing an LLM or AI coding agent at these docs? They're published in machine-readable form following the llms.txt convention:

  • /llms.txt — a compact index of every page, with descriptions.
  • /llms-full.txt — the entire documentation as a single plain-text file.

Every page header also has a button to copy that page as Markdown.

On this page