---
type: api
title: Acknowledge a watch
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-watcher-ack-watch
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-watcher-ack-watch
products:
  - Elasticsearch
---

# Acknowledge a watch


## Paths

- `POST` (also `PUT`) `/_watcher/watch/{watch_id}/_ack/{action_id}`
- `POST` (also `PUT`) `/_watcher/watch/{watch_id}/_ack`

#### Path parameters

- `watch_id` (string) — required
  The watch identifier.
- `action_id` (union string | string[]) — optional, leave it out to use `/_watcher/watch/{watch_id}/_ack`
  A comma-separated list of the action identifiers to acknowledge.
If you omit this parameter, all of the actions of the watch are acknowledged.

## Description

Acknowledging a watch enables you to manually throttle the execution of the watch's actions.

The acknowledgement state of an action is stored in the `status.actions.<id>.ack.state` structure.

IMPORTANT: If the specified watch is currently being executed, this API will return an error
The reason for this behavior is to prevent overwriting the watch status from a watch execution.

Acknowledging an action throttles further executions of that action until its `ack.state` is reset to `awaits_successful_execution`.
This happens when the condition of the watch is not met (the condition evaluates to false).
To demonstrate how throttling works in practice and how it can be configured for individual actions within a watch, refer to External documentation.

[Learn more about actions](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/actions#example)

## Required authorization

- Cluster privileges: `manage_watcher`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Response

`application/json`

- `status` (object)
  - `actions` (object)
  - `last_checked` (union)
  - `last_met_condition` (union)
  - `state` (object)
    - `active` (boolean)
    - `timestamp` (union)
  - `version` (number)
  - `execution_state` (string)
## Code examples

#### Console

```console
POST _watcher/watch/my_watch/_ack
```

#### JavaScript

```javascript
const response = await client.watcher.ackWatch({
  watch_id: "my_watch",
});
```

#### Python

```python
resp = client.watcher.ack_watch(
    watch_id="my_watch",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_ack" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.watcher().ackWatch(a -> a
    .watchId("my_watch")
);
```

#### PHP

```php
$resp = $client->watcher()->ackWatch([
    "watch_id" => "my_watch",
]);
```

#### Ruby

```ruby
response = client.watcher.ack_watch(
  watch_id: "my_watch"
)
```

## Response examples

#### Watcher ack watch response example1

A successful response from `POST _watcher/watch/my_watch/_ack`.

```json
{
  "status": {
    "state": {
      "active": true,
      "timestamp": "2015-05-26T18:04:27.723Z"
    },
    "last_checked": "2015-05-26T18:04:27.753Z",
    "last_met_condition": "2015-05-26T18:04:27.763Z",
    "actions": {
      "test_index": {
        "ack" : {
          "timestamp": "2015-05-26T18:04:27.713Z",
          "state": "acked"
        },
        "last_execution" : {
          "timestamp": "2015-05-25T18:04:27.733Z",
          "successful": true
        },
        "last_successful_execution" : {
          "timestamp": "2015-05-25T18:04:27.773Z",
          "successful": true
        }
      }
    },
    "execution_state": "executed",
    "version": 2
  }
}
```

