Create an enrollment API key
Server:
https://{kibana_url}
- POST /api/fleet/enrollment_api_keys
- POST /s/{space_id}/api/fleet/enrollment_api_keys
Refer to Spaces for more information.
Create an enrollment API key for a given agent policy.
[Required authorization] Route required privileges: fleet-agents-all.
Request
-
expirationstring · max: 20 -
The expiration time for the enrollment token, expressed as a duration (for example, 30d, 24h, 90m). By default, enrollment tokens never expire.
-
namestring -
policy_idstringrequired
Responses
Successful response
-
actionrequired -
Values:
created -
itemrequired -
activebooleanrequired -
When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents.
-
api_keystringrequired -
The enrollment API key (token) used for enrolling Elastic Agents.
-
api_key_idstringrequired -
The ID of the API key in the Security API.
-
created_atstringrequired -
expire_atstring -
The expiration date of the enrollment token as an ISO 8601 date string. Absent when the token never expires.
-
idstringrequired -
namestring -
The name of the enrollment API key.
-
policy_idstring -
The ID of the agent policy the Elastic Agent will be enrolled in.
Bad Request
-
attributesobjectrequired -
errorstring -
errorTypestring -
messagestringrequired -
statusCodenumber