---
title: "Request agent diagnostics"
method: POST
path: "/api/fleet/agents/{agentId}/request_diagnostics"
tags: ["Elastic Agent actions"]
---

# Request agent diagnostics

`POST /api/fleet/agents/{agentId}/request_diagnostics`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/agents/{agentId}/request_diagnostics</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Request a diagnostics bundle from a specific agent.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.

## Path parameters

- `agentId` string, required

## Headers

- `kbn-xsrf` string, required

## Request body

- object, nullable
  - `additional_metrics` string[]

## Response `200`

Successful response

- union
  - object
    - `actionId` string, required
  - object
    - `count` number, required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
