---
type: api
title: Get a metadata list
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-getendpointmetadatalist
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-getendpointmetadatalist
products:
  - Kibana
---

# Get a metadata list

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/endpoint/metadata`
- `GET` `/s/{space_id}/api/endpoint/metadata`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

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

Get a list of all endpoint host metadata.

## Query String Parameters

- `page` (integer · min: 1 · default: 1)
  The page number to return.
- `pageSize` (integer · min: 1 · max: 100 · default: 10)
  The number of endpoints to return per page.
- `kuery` (string · max: 30000)
  A KQL string to filter the endpoint metadata results.
- `hostStatuses` ([] object · max: 20)
  A set of host statuses to filter the results by (for example, `healthy`, `updating`).
  Values: `healthy`, `offline`, `updating`, `inactive`, `unenrolled`
- `sortField` (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`
- `sortDirection` (enum)
  The sort order, either `asc` or `desc`.
  Values: `asc`, `desc`

## Response

Indicates a successful call.

`application/json`

Type: `object`

## Code Examples

#### Console

```console
GET /api/endpoint/metadata?hostStatuses={hostStatuses}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/endpoint/metadata?hostStatuses={hostStatuses}"
```

## Response Examples

#### A list of endpoint host metadata

```json
{
  "data": [
    {
      "host_status": "healthy",
      "last_checkin": "2023-07-04T15:47:57.432Z",
      "metadata": {
        "agent": {
          "id": "285297c6-3bff-4b83-9a07-f3e749801123",
          "type": "endpoint",
          "version": "8.10.0"
        },
        "Endpoint": {
          "policy": {
            "applied": {
              "id": "d5371dcd-93b7-4627-af88-4084f7d6aa3e",
              "name": "test",
              "status": "success"
            }
          },
          "status": "enrolled"
        },
        "host": {
          "hostname": "WinDev2104Eval",
          "os": {
            "name": "Windows",
            "platform": "windows",
            "version": "20H2"
          }
        }
      }
    }
  ],
  "page": 0,
  "pageSize": 10,
  "sortDirection": "desc",
  "sortField": "enrolled_at",
  "total": 1
}
```

