> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrmex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# UniFi Controller

> Connect Ubiquiti UniFi to Myrmex with a UniFi Site Manager API key — create the key and add the integration.

import { Note, Steps, Step, CardGroup, Card, Tip } from '@mintlify/components';

Connect your **Ubiquiti UniFi** estate so Myrmex can read your sites, consoles, devices, and clients in real time for inventory and analysis. Myrmex connects over the **UniFi Site Manager API** (`api.ui.com`) using an API key.

## What Myrmex Can Do

<CardGroup cols={2}>
  <Card title="Read inventory" icon="boxes-stacked">
    List sites, consoles, UniFi devices, and connected clients across your estate, on demand.
  </Card>

  <Card title="Health & status" icon="chart-line">
    Check device status, adoption, and uptime for the sites you manage.
  </Card>

  <Card title="Hardening audit" icon="shield-halved">
    Bring UniFi inventory into a [Security Posture](/documentation/security-posture/overview) review.
  </Card>

  <Card title="Ask in the Workspace" icon="magnifying-glass">
    Query your UniFi environment in plain language during investigations.
  </Card>
</CardGroup>

## Before You Start

* A **UniFi Site Manager account** (`unifi.ui.com`) with access to the consoles and sites you want to connect.
* Permission to create an **API key** in Site Manager.
* The **Console ID** and **Site ID** for the console/site you want Myrmex to read.

## Step 1 — Create the API Key in UniFi Site Manager

<Steps>
  <Step title="Open UniFi Site Manager">
    Sign in to the UniFi Site Manager at `unifi.ui.com`.
  </Step>

  <Step title="Create an API key">
    Open **Settings → API** (Control Plane) and create a new **API Key**. Give it a descriptive name.
  </Step>

  <Step title="Copy the key">
    Copy the generated key immediately and store it securely — it is shown only once. You'll paste it into Myrmex.
  </Step>

  <Step title="Note the Console and Site IDs">
    Record the **Console ID** and **Site ID** for the environment you want Myrmex to read.
  </Step>
</Steps>

## Step 2 — Add the Integration in Myrmex

From the **Directory**, choose **Add Integration → UniFi Controller**, then fill in:

| Field           | Description                                                                                              |
| --------------- | -------------------------------------------------------------------------------------------------------- |
| **Name**        | A unique name for this UniFi environment.                                                                |
| **Description** | Optional note to identify it.                                                                            |
| **API Key**     | The UniFi Site Manager API key from Step 1, sent as the `X-API-Key` header.                              |
| **Host**        | The API host (default `api.ui.com`).                                                                     |
| **Port**        | The HTTPS port (default `443`).                                                                          |
| **Console ID**  | The UniFi console identifier to read.                                                                    |
| **Site ID**     | The site identifier within that console.                                                                 |
| **Collector**   | Optional [Collector](/documentation/agent-endpoint-security/collector-mode) to route the API connection. |

## Connect

Click **Connect** to validate the API key and finish. UniFi then appears under **Environment → Integrations**, ready to query in the Workspace.

<Note>
  Myrmex reads from UniFi in real time over the API each time you ask — nothing from your UniFi environment is stored on the Myrmex side.
</Note>
