go-unifi

Resources

A curated map of the Internal (legacy) API resource methods — grouped by domain, with each resource's CRUD verbs and the by-MAC, reorder, and upload extras.

The Internal (legacy) API exposes every resource as plain methods on the client (also reachable via c.Internal()). They follow a strict naming convention, so this page maps the resources rather than transcribing hundreds of generated struct fields — for those, browse the unifi package on pkg.go.dev.

The convention

Most resources expose the same five methods, named <Verb><Resource>:

VerbSignatureReturns
CreateCreate<R>(ctx, site, *R)(*R, error)
GetGet<R>(ctx, site, id)(*R, error)
ListList<R>(ctx, site)([]R, error)
UpdateUpdate<R>(ctx, site, *R)(*R, error)
DeleteDelete<R>(ctx, site, id)error

So the Network row below means CreateNetwork, GetNetwork, ListNetwork, UpdateNetwork, DeleteNetwork. Every method takes a context.Context first and a site name string ("default"); Get returns ErrNotFound when the resource doesn't exist, while List returns an empty slice (and a nil error) when there are none. In the tables below, CRUD is shorthand for all five; deviations are spelled out.

resources.go
package main

import (
	"context"
	"errors"
	"fmt"
	"log"

	"github.com/filipowm/go-unifi/v2/unifi"
)

func main() {
	ctx := context.Background()
	c, err := unifi.NewClient(&unifi.ClientConfig{URL: "https://unifi.example.com", APIKey: "your-api-key"})
	if err != nil {
		log.Fatal(err)
	}

	networks, err := c.ListNetwork(ctx, "default")
	if err != nil {
		log.Fatalf("list networks: %v", err)
	}
	for _, n := range networks {
		fmt.Printf("%s (%s)\n", n.Name, n.Purpose)
	}

	// Device and User add convenience by-MAC variants.
	dev, err := c.GetDeviceByMAC(ctx, "default", "00:11:22:33:44:55")
	if err != nil && !errors.Is(err, unifi.ErrNotFound) {
		log.Fatal(err)
	}
	_ = dev
}

Networking

ResourceMethodsNotes
NetworkCRUDLANs, VLANs, WAN, and VPN networks.
PortForwardCRUDPort-forwarding rules.
RoutingCRUDStatic routes.
DHCPOptionCRUDCustom DHCP options.
DNSRecordCRUDController DNS records.
DynamicDNSCRUDDynamic-DNS service configs.
RADIUSProfileCRUDRADIUS auth/accounting profiles.

Firewall

ResourceMethodsNotes
FirewallRuleCRUD + ReorderFirewallRulesClassic ruleset rules; reorder by ruleset.
FirewallGroupCRUDAddress/port groups referenced by rules.
FirewallZoneCRUD + ListFirewallZoneMatrixZone-based firewall zones; matrix lists zone-pair state.
FirewallZonePolicyCRUD + ReorderFirewallPoliciesZone-based firewall policies.
ContentFilteringCreate / List / Update / DeleteNo Get — fetch via ListContentFiltering.

Wireless

ResourceMethodsNotes
WLANCRUDWireless networks (SSIDs).
WLANGroupCRUDGroups of WLANs assigned to APs.
APGroupCRUDAccess-point groups.
ChannelPlanCRUDSaved RF channel plans.
Hotspot2ConfCRUDHotspot 2.0 / Passpoint configuration.

Devices

ResourceMethodsNotes
DeviceCRUD + GetDeviceByMAC, AdoptDevice, ForgetDeviceAdopt/forget take a MAC; GetDeviceByMAC looks up by MAC.
PortProfileCRUDSwitch-port profiles.
VirtualDeviceCRUDVirtual / logical devices.
TagCRUDDevice tags.
BroadcastGroupCRUDBroadcast (PA) groups of devices.

Clients & Users

ResourceMethodsNotes
UserCRUD + GetUserByMAC, DeleteUserByMAC, BlockUserByMAC, UnblockUserByMAC, KickUserByMAC, OverrideUserFingerprint"Users" are known clients; the extras act by MAC.
UserGroupCRUDBandwidth-limit groups.
AccountCRUDRADIUS / guest accounts.

Sites & System

ResourceMethodsNotes
SiteCreateSite(desc), GetSite(id), ListSites, UpdateSite(name, desc), DeleteSite(id)No site arg (sites are global); list is ListSites; mutations return []Site.
System infoGetSystemInformationContext(ctx), GetSystemInfo(ctx, id), GetSystemInformation()Returns *SysInfo. GetSystemInformation is the only method without a context.
FeaturesListFeatures, GetFeature(name), IsFeatureEnabled(name)Controller feature flags; names are the feature constants.
DashboardCRUDSaved dashboards.
ScheduleTaskCRUDScheduled tasks.
Traffic flowsGetTrafficFlows(ctx, site, req)Site-scoped analytics query; req is a *TrafficFlowsRequest.
SettingsGetSetting / SetSetting + typed pairsSee the Settings catalogue.

Layout & Media

ResourceMethodsNotes
MapCRUDFloor-plan / topology maps.
HeatMapCRUDCoverage heatmaps.
HeatMapPointCRUDIndividual heatmap survey points.
SpatialRecordCRUDSpatial survey records.
MediaFileCRUDUploaded media references.

Guest portal & hotspot

ResourceMethodsNotes
HotspotOpCRUDHotspot operators.
HotspotPackageCRUDHotspot payment packages.
PortalFileListPortalFiles, GetPortalFile, UploadPortalFile, UploadPortalFileFromReader, DeletePortalFileUpload-based — no Create/Update; upload from a path or an io.Reader.

This map is curated for orientation. The exact field set of each resource struct — and any rarely used helper — is authoritative on pkg.go.dev. The full method list also lives on the InternalClient interface.

See also

On this page