# Unexpected token \[START\_ARRAY\] when updating watch with Slack action

**URL:** <https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 3, 2016, 1:18pm UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797 "2016-06-03T13:18:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![baud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baud/32/10129_2.png) [@baud](https://discuss.elastic.co/u/baud)\
**Post date:** [June 3, 2016, 1:18pm UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797/1 "2016-06-03T13:18:00Z")

</div>

Elasticsearch 2.2.1

I am trying to update a watch, adding a "to" field to a slack action, using [this](https://www.elastic.co/guide/en/watcher/2.2/actions.html#actions-slack) as example.

This works :

```
  "actions": {
    "notify-slack": {
      "slack": {
        "message": {
          "text": "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }

```

But when I try to add the "to" field :

```
  "actions": {
    "notify-slack": {
      "slack": {
        "to" : ["@bpoirson"],
        "message": {
          "text": "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }

```

Elasticsearch returns me this :

```
{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "failed to parse [slack] action [log_error_watch_test/notify-slack]. unexpected token [START_ARRAY]"
      }
    ],
    "type": "parse_exception",
    "reason": "failed to parse [slack] action [log_error_watch_test/notify-slack]. unexpected token [START_ARRAY]"
  },
  "status": 400
}

```

Any idea on what I'm doing wrong here?

Thanks

---

<div class="post-metadata">

**Author:** ![baud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baud/32/10129_2.png) [@baud](https://discuss.elastic.co/u/baud)\
**Post date:** [June 6, 2016, 7:40am UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797/2 "2016-06-06T07:40:39Z")

</div>

So I realized that the first snippet is wrong and the correct structure is :

```
  "actions": {
    "notify-slack": {
      "slack": {           
        "message": {
          "to" : ["@bpoirson"],
          "text": "Encountered {{ctx.payload.hits.total}} errors in the last 5 minutes"
        }
      }
    }
  }
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 7, 2016, 7:45am UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797/3 "2016-06-07T07:45:42Z")

</div>

Hey

thanks for the update, I just fixed the documentation, which should be updated over the day!

--Alex

---

<div class="post-metadata">

**Author:** ![baud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baud/32/10129_2.png) [@baud](https://discuss.elastic.co/u/baud)\
**Post date:** [June 7, 2016, 8:07am UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797/4 "2016-06-07T08:07:02Z")

</div>

Thanks.

On the same subject, the configuration option for the proxy is also missing:

```
watcher:
  http:
    proxy:
      host: proxy.adress
      post: 8080

```

It is only present in the release notes, which makes it harder to find.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:45pm UTC](https://discuss.elastic.co/t/unexpected-token-start-array-when-updating-watch-with-slack-action/51797/5 "2017-07-06T13:45:08Z")

</div>


