Spaces method and path for this operation:
post /s/{space_id}/api/fleet/agents/bulk_update_agent_tags
Refer to Spaces for more information.
Add or remove tags across multiple agents.
[Required authorization] Route required privileges: fleet-agents-all.
POST
/api/fleet/agents/bulk_update_agent_tags
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/bulk_update_agent_tags' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"agents":["agent-id-1","agent-id-2"],"tagsToAdd":["production"],"tagsToRemove":["staging"]}'
Request example
Add and remove tags across multiple agents
{
"agents": [
"agent-id-1",
"agent-id-2"
],
"tagsToAdd": [
"production"
],
"tagsToRemove": [
"staging"
]
}
Response examples (200)
Bulk 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
}