Get an agent action status

GET /api/fleet/agents/action_status

Spaces method and path for this operation:

get /s/{space_id}/api/fleet/agents/action_status

Refer to Spaces for more information.

Get the current status of recent agent actions.

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

Query parameters

  • page number

    Page number

    Default value is 0.

  • perPage number

    Number of results per page

    Default value is 20.

  • date string

    Return actions created before this date

  • latest number

    Return only the latest N actions

  • errorSize number

    Number of error details to include per action

    Default value is 5.

Responses

  • 200 application/json

    Successful response

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

      Not more than 10000 elements.

      Hide items attributes Show items attributes object
      • actionId string Required
      • cancellationTime string
      • completionTime string
      • creationTime string Required

        creation time of action

      • expiration string
      • hasRolloutPeriod boolean
      • is_automatic boolean
      • latestErrors array[object]

        latest errors that happened when the agents executed the action

        Not more than 10 elements.

        Hide latestErrors attributes Show latestErrors attributes object

        latest errors that happened when the agents executed the action

        • agentId string Required
        • error string Required
        • hostname string
        • timestamp string Required
      • nbAgentsAck number Required

        number of agents that acknowledged the action

      • nbAgentsActionCreated number Required

        number of agents included in action from kibana

      • nbAgentsActioned number Required

        number of agents actioned

      • nbAgentsFailed number Required

        number of agents that failed to execute the action

      • newPolicyId string

        new policy id (POLICY_REASSIGN action)

      • policyId string

        policy id (POLICY_CHANGE action)

      • revision number

        new policy revision (POLICY_CHANGE action)

      • startTime string

        start time of action (scheduled actions)

      • status string Required

        Values are COMPLETE, EXPIRED, CANCELLED, FAILED, IN_PROGRESS, or ROLLOUT_PASSED.

      • type string Required

        Values are UPGRADE, UNENROLL, SETTINGS, POLICY_REASSIGN, CANCEL, FORCE_UNENROLL, REQUEST_DIAGNOSTICS, UPDATE_TAGS, POLICY_CHANGE, INPUT_ACTION, MIGRATE, PRIVILEGE_LEVEL_CHANGE, or ROLLBACK.

      • version string

        agent version number (UPGRADE action)

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • error string
    • errorType string
    • message string Required
    • statusCode number
GET /api/fleet/agents/action_status
curl \
 --request GET 'https://localhost:5601/api/fleet/agents/action_status' \
 --header "Authorization: $API_KEY"
Response examples (200)
Status of recent agent actions
{
  "items": [
    {
      "actionId": "action-id-1",
      "completionTime": "2024-01-01T00:05:00.000Z",
      "creationTime": "2024-01-01T00:00:00.000Z",
      "nbAgentsAck": 2,
      "nbAgentsActioned": 2,
      "nbAgentsFailed": 0,
      "status": "COMPLETE",
      "type": "UPGRADE"
    }
  ]
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}