Spaces method and path for this operation:
post /s/{space_id}/api/fleet/agents/{agentId}/actions
Refer to Spaces for more information.
Create a new action for a specific agent.
[Required authorization] Route required privileges: fleet-agents-all.
POST
/api/fleet/agents/{agentId}/actions
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agents/{agentId}/actions' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"action":{"type":"UNENROLL"}}'
Request example
Create a UNENROLL action for an agent
{
"action": {
"type": "UNENROLL"
}
}
Response examples (200)
Created agent action
{
"item": {
"agents": [
"agent-id-1"
],
"created_at": "2024-01-01T00:00:00.000Z",
"id": "action-id-1",
"type": "UNENROLL"
}
}
Response examples (400)
Example of a generic error response
{
"error": "Bad Request",
"message": "An error message describing what went wrong",
"statusCode": 400
}