---
type: api
title: List enrollment API keys
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-enrollment-api-keys
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-get-enrollment-api-keys
products:
  - Kibana
---

# List enrollment API keys

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

## Paths

- `GET` `/api/fleet/enrollment_api_keys`
- `GET` `/s/{space_id}/api/fleet/enrollment_api_keys`

## Description

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

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `perPage` (integer · default: 20) — optional
  The number of items to return
- `page` (integer · default: 1) — optional
- `kuery` (string) — optional

## Responses

#### `200`

OK

`application/json`

- `items` (object[])
  - `active` (boolean)
    When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents.
  - `api_key` (string)
    The enrollment API key (token) used for enrolling Elastic Agents.
  - `api_key_id` (string)
    The ID of the API key in the Security API.
  - `created_at` (string)
  - `id` (string)
  - `name` (string)
    The name of the enrollment API key.
  - `policy_id` (string)
    The ID of the agent policy the Elastic Agent will be enrolled in.
- `list` (object[]) — deprecated
  - `active` (boolean)
    When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents.
  - `api_key` (string)
    The enrollment API key (token) used for enrolling Elastic Agents.
  - `api_key_id` (string)
    The ID of the API key in the Security API.
  - `created_at` (string)
  - `id` (string)
  - `name` (string)
    The name of the enrollment API key.
  - `policy_id` (string)
    The ID of the agent policy the Elastic Agent will be enrolled in.
- `page` (number)
- `perPage` (number)
- `total` (number)
#### `400`

Generic Error

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
GET kbn:/api/fleet/enrollment_api_keys
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/enrollment_api_keys" \
  -H "Authorization: ApiKey ${API_KEY}"
```

