unifi logout
About 320 words
Sign out: remove a context and its stored API key.
Usage
unifi logout [context] [flags]Sign out of a context; without an argument, of the current one.
The context is removed from the configuration. Its account and controller go with it when no other context uses them, and so does the account's API key in the credential store.
Removing the key from this machine does not invalidate it. A key that unifi login --sso created can be revoked at Ubiquiti as part of the sign-out: on a terminal you are asked, in scripts pass --revoke-key. That needs a session with your UI account; when the one saved at sign-in has expired you are asked for your password again, and without a terminal the key is kept and the command fails after signing out. With --yes and neither flag, the key is kept.
A key you created yourself is never revoked: delete it where you created it (https://unifi.ui.com/settings/api-keys, or the console's Settings → Control Plane → Integrations) if it should stop working.
Examples
unifi logout
unifi logout lab --yes
unifi logout --yes --revoke-key
unifi logout --allFlags
| Flag | Description |
|---|---|
--all | sign out of every context |
--keep-key | leave the API key valid at Ubiquiti without asking |
--revoke-key | also revoke the API key at Ubiquiti, if unifi login --sso created it |
-y, --yes | do not ask for confirmation |
Global flags
These flags are accepted by every command.
| Flag | Description |
|---|---|
--color-scheme <string> | color scheme: auto, dark or light |
--context <string> | context to use instead of the current one |
--no-cache | ask the controller for everything instead of using cached answers |
-o, --output <string> | output format: text, wide, json, yaml (table is another name for text) |
-s, --site <string> | site to act on instead of the context's default site |
--theme <string> | theme to render with instead of the configured one |
