Skip to content

set_guest_portal

Change the guest captive-portal configuration.

Set portal_enabled=False to remove the click-through “Connect” page that guests see on every reconnection.

Side effects:

  • Read-modify-writes the site’s guest_access setting. Only the fields you pass are altered; the rest of the record is written back unchanged (full-object write, never a partial body).
  • Does not weaken network isolation when isolation is enforced by firewall rules or a guest VLAN. The portal is an interstitial authorisation page, not a security boundary. Disabling it changes who sees a login screen, not who can reach what.
  • Guests already authorised keep their existing session until it expires; the change affects subsequent authorisations.
  • Returns a before/after diff so any collateral edit by the controller is visible rather than silent.
  • Mutates controller state. dry_run=True previews; otherwise this returns a confirmation token that must be passed to confirm_destructive_action to commit.

Idempotent: applying the same values twice leaves the same state.

set_guest_portal(portal_enabled=False)
Parameter Type Required Default Description
portal_enabled `boolean null` no null
auth `string null` no null
expire_minutes `integer null` no null
restricted_subnet_1 `string null` no null
restricted_subnet_2 `string null` no null
restricted_subnet_3 `string null` no null
controller string no “default” Name of the UniFi controller to target. Defaults to "default".
dry_run boolean no false Preview the change without applying it. Returns the predicted patch and no confirmation token.