﻿---
title: stack kb security-endpoint-management-api get-endpoint-metadata-list cli command
description: Get a metadata list Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4083/reference/elastic-cli/cli/stack/kb/security-endpoint-management-api/get-endpoint-metadata-list
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-endpoint-management-api get-endpoint-metadata-list cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-endpoint-management-api get-endpoint-metadata-list \
  --host-statuses <host-statuses> \
  [options]
```

Get a metadata list
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--host-statuses string[] required">
    A set of host statuses to filter the results by (for example, `healthy`, `updating`).
    **Repeatable:** pass `--host-statuses` multiple times to supply more than one value
  </definition>
  <definition term="--page number">
    The page number to return.
  </definition>
  <definition term="--page-size number">
    The number of endpoints to return per page.
  </definition>
  <definition term="--kuery string">
    A KQL string to filter the endpoint metadata results.
  </definition>
  <definition term="--sort-field enum">
    The field used to sort the results.
    **Values:** enrolled_at, metadata.host.hostname, host_status, metadata.Endpoint.policy.applied.name, metadata.Endpoint.policy.applied.status, metadata.host.os.name, metadata.host.ip, metadata.agent.version, last_checkin
  </definition>
  <definition term="--sort-direction enum">
    The sort order, either `asc` or `desc`.
    **Values:** asc, desc
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>