---
title: "List Hosts"
method: GET
path: "/v1/hosts"
---

# List Hosts

`GET /v1/hosts`

## Request

- Base URL: `https://api.ui.com`
- URL: `https://api.ui.com/v1/hosts`
- Auth: API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/ubiquiti/apis/unifi-site-manager-api/docs/v1/hosts/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves a list of all hosts associated with the UI account making the API call. <br/><br/>**Note**: The structure of `userData` and `reportedState` fields may vary depending on the UniFi OS or Network Server version. The example provided is based on UniFi OS 4.1.13.

## Query parameters

- `pageSize` string
- `nextToken` string

## Response `200`

200

- object
  - `code` unknown
  - `data` object[]: Generic response data, specific schema depends on the endpoint
    - `id` string: Unique identifier of the host device
    - `hardwareId` string: Hardware identifier of the device
    - `type` string: Type of the device (console, network-server)
    - `ipAddress` string: Current IP address of the device
    - `owner` boolean: Indicates if the current user is the owner of this device
    - `isBlocked` boolean: Indicates if the device is blocked from cloud access
    - `registrationTime` string, date-time: Time in RFC3339 format when the device was registered to the cloud
    - `lastConnectionStateChange` string, date-time: Time in RFC3339 format when the connection state last changed
    - `latestBackupTime` string, date-time: Time in RFC3339 format of the latest device backup
    - `userData` unknown
    - `reportedState` unknown
  - `httpStatusCode` integer: HTTP status code
  - `traceId` string: Request trace identifier
  - `nextToken` string: Pagination token for fetching the next set of results

## Other responses

- `401`: 401
- `429`: 429
- `500`: 500
- `502`: 502

---

[API](https://skmtc.dev/ubiquiti/apis/unifi-site-manager-api.md) - [All operations](https://skmtc.dev/ubiquiti/apis/unifi-site-manager-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ubiquiti/apis/unifi-site-manager-api/revisions/16daa37f17c9?raw)
