---
title: "List all Datadog Agents"
method: GET
path: "/api/unstable/fleet/agents"
tags: ["Fleet Automation"]
---

# List all Datadog Agents

`GET /api/unstable/fleet/agents`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/unstable/fleet/agents`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

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.

## Query parameters

- `page_number` integer
- `page_size` integer
- `sort_attribute` string
- `sort_descending` boolean
- `tags` string
- `filter` string

## Response `200`

OK

- FleetAgentsResponse: Response containing a paginated list of Datadog Agents.
  - `data` FleetAgentsResponseData, required: The response data containing status and agents array.
    - `attributes` FleetAgentsResponseDataAttributes, required: Attributes of the fleet agents response containing the list of agents.
      - `agents` FleetAgentAttributes[]: 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` integer: 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` integer: 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` FleetAgentAttributesTagsItems[]: Tags associated with the agent.
          - `key` string: The tag key.
          - `value` string: The tag value.
        - `team` string: Team associated with the agent.
    - `id` string, required: Status identifier.
    - `type` string, required: Resource type.
  - `meta` FleetAgentsResponseMeta: Metadata for the list of agents response.
    - `total_filtered_count` integer: Total number of agents matching the filter criteria across all pages.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `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)
