---
title: "Get an enrollment API key"
method: GET
path: "/api/fleet/enrollment_api_keys/{keyId}"
tags: ["Fleet enrollment API keys"]
---

# Get an enrollment API key

`GET /api/fleet/enrollment_api_keys/{keyId}`

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

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/enrollment_api_keys/{keyId}</span></div>

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

Get an enrollment API key by ID.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all OR fleet-setup.

## Path parameters

- `keyId` string, required

## Response `200`

Successful response

- KibanaHTTPAPIsEnrollmentApiKeyResponse
  - `item` KibanaHTTPAPIsEnrollmentApiKey, required
    - `active` boolean, required — When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents.
    - `api_key` string, required — The enrollment API key (token) used for enrolling Elastic Agents.
    - `api_key_id` string, required — The ID of the API key in the Security API.
    - `created_at` string, required
    - `expire_at` string — The expiration date of the enrollment token as an ISO 8601 date string. Absent when the token never expires.
    - `hidden` boolean
    - `id` string, required
    - `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.

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[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)
