---
title: "List unified hosts"
method: GET
path: "/api/v2/csm/settings/hosts"
tags: ["CSM Settings"]
---

# List unified hosts

`GET /api/v2/csm/settings/hosts`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/csm/settings/hosts`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Get the list of unified hosts for CSM, combining agent and agentless host data, with optional pagination and filtering.

## Query parameters

- `page` integer
- `size` integer
- `query` string

## Response `200`

OK

- CsmUnifiedHostsResponse: The response returned when listing unified hosts.
  - `data` CsmUnifiedHostData[], required: The list of unified hosts for the current page.
    - `attributes` CsmUnifiedHostAttributes, required: Attributes of a unified host, combining data from agent and agentless sources.
      - `account_id` string, nullable: The ID of the cloud account that the host belongs to. Present only when the host was discovered through agentless scanning.
      - `agent_csm_vm_containers_enabled` boolean, nullable: Whether CSM Vulnerabilities is enabled for containers through the Datadog Agent. `true` if enabled; `false` if disabled.
      - `agent_csm_vm_hosts_enabled` boolean, nullable: Whether CSM Vulnerabilities is enabled for hosts through the Datadog Agent. `true` if enabled; `false` if disabled.
      - `agent_cws_enabled` boolean, nullable: Whether CSM Threats is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled.
      - `agent_posture_management` boolean, nullable: Whether CSM Misconfigurations is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled.
      - `agent_version` string, nullable: The version of the Datadog Agent running on this host.
      - `agentless_posture_management` boolean, nullable: Whether CSM Misconfigurations is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled.
      - `agentless_vulnerability_scanning` boolean, nullable: Whether CSM Vulnerabilities is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled.
      - `cloud_provider` 'aws' | 'gcp' | 'azure' | 'oci': The cloud provider of a host resource.
      - `cluster_name` string, nullable: The name of the Kubernetes cluster the host belongs to, if applicable.
      - `datadog_agent_key` string, nullable: The Datadog Agent key associated with this host. Present only for agent-sourced hosts.
      - `env` string[], nullable: The list of environment tags associated with this host.
      - `host_id` integer, nullable: The internal Datadog host identifier. Present only for agent-sourced hosts.
      - `install_method_tool` string, nullable: The tool used to install the Datadog Agent on this host.
      - `os` string, nullable: The operating system of the host. Present only for agent-sourced hosts.
      - `resource_type` 'aws_ec2_instance' | 'azure_virtual_machine_instance' | 'gcp_compute_instance' | 'oci_instance': The type of cloud resource for an agentless host.
      - `source` 'agent' | 'agentless' | 'both', required: The source of a unified host entry, indicating whether it was discovered via agent, agentless scanning, or both.
    - `id` string, required: The resource identifier of the unified host.
    - `type` 'unified_host', required: The JSON:API type for unified host resources. The value should always be `unified_host`.
  - `meta` CsmUnifiedHostsMeta, required: Pagination metadata for a unified hosts list response.
    - `page_index` integer, required: The current page index (zero-based).
    - `page_size` integer, required: The number of hosts returned per page.
    - `total_filtered` integer, required: The total number of hosts matching the filter criteria.
    - `total_pages` integer, required: The total number of pages available.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
