Retrieve a paginated list of all Datadog Agents.
This endpoint returns a paginated list of all Datadog Agents with support for pagination, sorting, and filtering.
Use the page_number and page_size query parameters to paginate through results.
This endpoint requires the hosts_read permission.
Arguments
Query Strings
Name
Type
Description
page_number
integer
Page number for pagination (starts at 0).
page_size
integer
Number of results per page (must be greater than 0 and less than or equal to 100).
sort_attribute
string
Attribute to sort by.
sort_descending
boolean
Sort order (true for descending, false for ascending).
Response containing a paginated list of Datadog Agents.
Expand All
Field
Type
Description
data [required]
object
The response data containing status and agents array.
attributes [required]
object
Attributes of the fleet agents response containing the list of agents.
agents
[object]
Array of agents matching the query criteria.
agent_version
string
The Datadog Agent version.
api_key_name
string
The API key name (if available and not redacted).
api_key_uuid
string
The API key UUID.
cloud_provider
string
The cloud provider where the agent is running.
cluster_name
string
Kubernetes cluster name (if applicable).
datadog_agent_key
string
The unique agent key identifier.
enabled_products
[string]
Datadog products enabled on the agent.
envs
[string]
Environments the agent is reporting from.
first_seen_at
int64
Timestamp when the agent was first seen.
hostname
string
The hostname of the agent.
ip_addresses
[string]
IP addresses of the agent.
is_single_step_instrumentation_enabled
boolean
Whether single-step instrumentation is enabled.
last_restart_at
int64
Timestamp of the last agent restart.
os
string
The operating system.
otel_collector_version
string
OpenTelemetry collector version (if applicable).
otel_collector_versions
[string]
List of OpenTelemetry collector versions (if applicable).
pod_name
string
Kubernetes pod name (if applicable).
remote_agent_management
string
Remote agent management status.
remote_config_status
string
Remote configuration status.
services
[string]
Services running on the agent.
tags
[object]
Tags associated with the agent.
key
string
The tag key.
value
string
The tag value.
team
string
Team associated with the agent.
id [required]
string
Status identifier.
type [required]
string
Resource type.
meta
object
Metadata for the list of agents response.
total_filtered_count
int64
Total number of agents matching the filter criteria across all pages.
{"data":{"attributes":{"agents":[{"agent_version":"7.50.0","api_key_name":"Production API Key","api_key_uuid":"a1b2c3d4-e5f6-4321-a123-123456789abc","cloud_provider":"aws","cluster_name":"string","datadog_agent_key":"my-agent-hostname","enabled_products":[],"envs":[],"first_seen_at":"integer","hostname":"my-hostname","ip_addresses":[],"is_single_step_instrumentation_enabled":false,"last_restart_at":"integer","os":"linux","otel_collector_version":"string","otel_collector_versions":[],"pod_name":"string","remote_agent_management":"enabled","remote_config_status":"connected","services":[],"tags":[{"key":"string","value":"string"}],"team":"string"}]},"id":"done","type":"status"},"meta":{"total_filtered_count":150}}
"""
List all Datadog Agents returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.fleet_automation_apiimportFleetAutomationApiconfiguration=Configuration()configuration.unstable_operations["list_fleet_agents"]=TruewithApiClient(configuration)asapi_client:api_instance=FleetAutomationApi(api_client)response=api_instance.list_fleet_agents()print(response)
# List all Datadog Agents returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_fleet_agents".to_sym]=trueendapi_instance=DatadogAPIClient::V2::FleetAutomationAPI.newpapi_instance.list_fleet_agents()
// List all Datadog Agents returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListFleetAgents",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewFleetAutomationApi(apiClient)resp,r,err:=api.ListFleetAgents(ctx,*datadogV2.NewListFleetAgentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `FleetAutomationApi.ListFleetAgents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `FleetAutomationApi.ListFleetAgents`:\n%s\n",responseContent)}
// List all Datadog Agents returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;usedatadog_api_client::datadogV2::api_fleet_automation::ListFleetAgentsOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListFleetAgents",true);letapi=FleetAutomationAPI::with_config(configuration);letresp=api.list_fleet_agents(ListFleetAgentsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List all Datadog Agents returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listFleetAgents"]=true;constapiInstance=newv2.FleetAutomationApi(configuration);apiInstance.listFleetAgents().then((data: v2.FleetAgentsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));