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

# List agentless hosts

`GET /api/v2/csm/settings/agentless_hosts`

## Request

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

Get the list of agentless hosts for CSM, with optional pagination and filtering.

## Query parameters

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

## Response `200`

OK

- CsmAgentlessHostsResponse: The response returned when listing agentless hosts.
  - `data` CsmAgentlessHostData[], required: The list of agentless hosts for the current page.
    - `attributes` CsmAgentlessHostAttributes, required: Attributes of an agentless host.
      - `account_id` string, required: The ID of the cloud account that the host belongs to.
      - `cloud_provider` 'aws' | 'gcp' | 'azure' | 'oci', required: The cloud provider of a host resource.
      - `has_posture_management` boolean, required: Whether CSM Misconfigurations is enabled for this host. `true` if enabled; `false` if disabled.
      - `has_vulnerability_scanning` boolean, required: Whether CSM Vulnerabilities is enabled for this host. `true` if enabled; `false` if disabled.
      - `resource_type` 'aws_ec2_instance' | 'azure_virtual_machine_instance' | 'gcp_compute_instance' | 'oci_instance', required: The type of cloud resource for an agentless host.
    - `id` string, required: The resource identifier of the agentless host.
    - `type` 'agentless_host', required: The JSON:API type for agentless host resources. The value should always be `agentless_host`.
  - `meta` CsmSettingsMeta, required: Pagination metadata for a CSM settings list response.
    - `page_index` integer, required: The current page index (zero-based).
    - `page_size` integer, required: The number of resources returned per page.
    - `total_filtered` integer, required: The total number of resources matching the filter criteria.

## 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)
