GET /api/fleet/enrollment_api_keys

Spaces method and path for this operation:

get /s/{space_id}/api/fleet/enrollment_api_keys

Refer to Spaces for more information.

List all enrollment API keys.

[Required authorization] Route required privileges: fleet-agents-all OR fleet-setup.

Query parameters

  • page number

    Default value is 1.

  • perPage number

    Default value is 20.

  • kuery string

Responses

  • 200 application/json

    Successful response

    Hide response attributes Show response attributes object
    • items array[object] Required

      Not more than 10000 elements.

      Hide items attributes Show items attributes object
      • 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
      • 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.

    • list array[object] Required Deprecated

      Not more than 10000 elements.

      Hide list attributes Show list attributes object
      • 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
      • 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.

    • page number Required
    • perPage number Required
    • total number Required
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
GET /api/fleet/enrollment_api_keys
curl \
 --request GET 'https://<KIBANA_URL>/api/fleet/enrollment_api_keys' \
 --header "Authorization: $API_KEY"
Response examples (200)
List of enrollment API keys
{
  "items": [
    {
      "active": true,
      "api_key": "api-key-value-1",
      "api_key_id": "api-key-id-1",
      "created_at": "2024-01-01T00:00:00.000Z",
      "id": "key-id-1",
      "name": "Default policy enrollment key",
      "policy_id": "policy-id-1"
    }
  ],
  "list": [
    {
      "active": true,
      "api_key": "api-key-value-1",
      "api_key_id": "api-key-id-1",
      "created_at": "2024-01-01T00:00:00.000Z",
      "id": "key-id-1",
      "name": "Default policy enrollment key",
      "policy_id": "policy-id-1"
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 1
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}