Getting Started

The Site Manager API empowers developers to programmatically monitor and manage UniFi deployments at scale. It provides comprehensive tools to access and control your UniFi devices’ data, enabling you to retrieve detailed information, monitor performance metrics, and efficiently manage your network infrastructure.  
 
The Site Manager API primarily focuses on extracting data from the UniFi Site Manager (unifi.ui.com). Subsequent versions will extend functionality to include more granular configurations, facilitating the management of individual sites and their associated devices.  
 
Your feedback is invaluable in helping us enhance and tailor the API to better address your specific requirements.

Authentication

An API Key serves as a unique identifier used to authenticate API requests. These keys are essential for securing access to your UniFi account and its associated devices. Each key is linked to the specific UI account that generated it, ensuring secure and personalized API interactions.

Obtaining an API Key

  1. Sign in to the UniFi Site Manager at unifi.ui.com/api.
  2. Select “Create API Key.”
  3. Copy the generated key and store it securely, as it will only be displayed once.
  4. Ensure the key is properly hashed and securely stored.

Use the API Key

Incorporate the API key into the X-API-Key header for all requests. Follow the example provided, replacing YOUR_API_KEY with your actual API key.

Example
curl -X GET 'https://api.ui.com/v1/hosts' \
 -H 'X-API-KEY: YOUR_API_KEY' \
 -H 'Accept: application/json'

Rate Limiting

The API rate limits are enforced based on the API version:

  • Early Access (EA) version:

    • 100 requests per minute
  • v1 stable release:

    • 10,000 requests per minute

If you exceed these limits, the server will respond with a 429 Too Many Requests status code. The response will include a Retry-After header indicating the number of seconds to wait before making additional requests, following the RFC specification.