Spaces method and path for this operation:
put /s/{space_id}/api/fleet/agents/{agentId}
Refer to Spaces for more information.
Update an agent by ID.
[Required authorization] Route required privileges: fleet-agents-all.
PUT
/api/fleet/agents/{agentId}
curl \
--request PUT 'https://<KIBANA_URL>/api/fleet/agents/{agentId}' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"tags":["production","linux"]}'
Request example
Update agent tags
{
"tags": [
"production",
"linux"
]
}
Response examples (200)
Updated agent details
{
"item": {
"active": true,
"enrolled_at": "2024-01-01T00:00:00.000Z",
"id": "agent-id-1",
"policy_id": "agent-policy-id-1",
"policy_revision": 1,
"status": "online",
"tags": [
"production",
"linux"
],
"type": "PERMANENT",
"updated_at": "2024-01-01T00:00:00.000Z"
}
}
Response examples (400)
Example of a generic error response
{
"error": "Bad Request",
"message": "An error message describing what went wrong",
"statusCode": 400
}
Response examples (404)
No agent was found with the given ID
{
"error": "Not Found",
"message": "Agent agent-id-1 not found",
"statusCode": 404
}