Bulk remove OpAMP collectors Experimental; added in 9.5.0

POST /api/fleet/agents/bulk_remove_collectors

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/agents/bulk_remove_collectors

Refer to Spaces for more information.

Remove multiple OpAMP collectors from the Fleet agents list. Marks the collectors as unenrolled. This action does not invalidate API keys, so collectors can reconnect on their own.

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

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • agents array[string] | string Required

    Any of:

    List of collector agent IDs

    Not more than 10000 elements.

    KQL query string. Leave empty to target all collectors

  • includeInactive boolean

    When passing collectors by KQL query, also removes inactive collectors

Responses

  • 200 application/json

    Successful response

    Hide response attribute Show response attribute object
    • actionId string Required
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/agents/bulk_remove_collectors
curl \
 --request POST 'https://localhost:5601/api/fleet/agents/bulk_remove_collectors' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"agents":["collector-id-1","collector-id-2"]}'
Request example
Remove multiple OpAMP collectors
{
  "agents": [
    "collector-id-1",
    "collector-id-2"
  ]
}
Response examples (200)
Bulk remove collectors action result
{
  "actionId": "action-id-1"
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}