---
title: "POST /api/fleet/agents/{id}/acks"
method: POST
path: "/api/fleet/agents/{id}/acks"
---

# POST /api/fleet/agents/{id}/acks

`POST /api/fleet/agents/{id}/acks`

The endpoint that an agent uses to acknowledge (and inform fleet-server) of events that it has recieved/executed.
A single action may have multiple different events associated with it.
Also an action may not have any acks associated with it.

## Path parameters

- `id` string, required

## Headers

- `X-Request-Id` string
- `Elastic-Api-Version` string

## Request body

- AckRequest — The request an elastic-agent sends to fleet-serve to acknowledge the execution of one or more actions.
  - `events` Event[], required
    - `type` 'STATE' | 'ERROR' | 'ACTION_RESULT' | 'ACTION', required — The event type of the ack. Currently the elastic-agent will only generate ACTION_RESULT events. Not used by fleet-server. Actions that have errored should use the error attribute to communicate an error status. Additional action status information can be provided in the data attribute.
    - `subtype` 'RUNNING' | 'STARTING' | 'IN_PROGRESS' | 'CONFIG' | 'FAILED' | 'STOPPING' | 'STOPPED' | 'DATA_DUMP' | 'ACKNOWLEDGED' | 'UNKNOWN', required — The subtype of the ack event. The elastic-agent will only generate ACKNOWLEDGED events. Not used by fleet-server. Actions that have errored should use the error attribute to communicate an error status. Additional action status information can be provided in the data attribute.
    - `agent_id` string, required — The ID of the agent that executed the action.
    - `action_id` string, required — The action ID.
    - `action_input_type` string, required — The input_type of the action for input actions.
    - `policy_id` string, required — Not used by the fleet-server.
    - `stream_id` string, required — Not used by the fleet-server.
    - `timestamp` string, required — The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
    - `message` string, required — An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
    - `payload` string, application/json — An embedded JSON object that contains additional information for the fleet-server to process. Defined as a json.RawMessage in both the fleet-server and the elastic-agent. Is currently used by UPGRADE actions to signal retries. If the error attribute is non empty payload is checked for `retry: bool` and `retry_attempt: int`. If retry is true, fleet-serve will mark the agent as retrying, if it's false the upgrade will be marked as failed. Additional action status information can be provided in the data attribute.
    - `started_at` string, required — The time at which the action was started. Used only when acknowledging input actions.
    - `completed_at` string, required — The time at which the action was completed. Used only when acknowledging input actions
    - `action_data` string, application/json — The action data for the input action being acknowledged.
    - `action_response` string, application/json — The action response for the input action being acknowledged.
    - `data` string, application/json — An embedded JSON object that has the data about the ack. Used by REQUEST_DIAGNOSTICS actions. Contains a `upload_id` attribute used to communicate the successfullly uploaded diagnostics ID.
    - `error` string — An error message. If this is non-empty an error has occured when executing the action. For some actions (such as UPGRADE actions) it may result in the action being marked as failed.

## Response `200`

Agent ack successfully received.

- AckResponse — Response to processing acknowledgement events.
  - `action` string, required — The action result. Will have the value "acks".
  - `errors` boolean, required — A flag to indicate if one or more errors occured when proccessing events.
  - `items` AckResponseItem[], required — The in-order list of results from processing events.
    - `status` integer, required — An HTTP status code that indicates if the event was processed successfully or not.
    - `message` string — HTTP status text.

## Other responses

- `400` — A 400 response for receiving an invalid User-Agent, Elastic-Api-Version header or version number (checkin and enroll endpoints). In the case where an invalid or unsupported Elastic-Api-Version header is requested, the response will contain the default version number. Or any other undefined error encounted by the fleet-server. May be returned by any endpoint except /api/fleet/status.
- `401` — 401 response when the API key is not enabled on any endpoint except /api/fleet/status. Or when there are issues updating an inactive agent on the ack endpoint.
- `404` — 404 response when the agent is not found. May be returned by checkin endpoint. or endpoints that use the agentApiKey auth scheme
- `408` — 408 request timeout.
- `500` — A 500 response for encountering not expected bahavior.
- `503` — 503 response when the server is not available for some reason. Such as if a context is cancelled or the connection (to ES) is refused. May be returned by any endpoint.

---

[API](https://skmtc.net/elastic/apis/fleet-server-api.md) · [All operations](https://skmtc.net/elastic/apis/fleet-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/fleet-server-api/versions/e1c8da877dd8/schema)
