# Watcher webhooks and a 400 error

**URL:** <https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 9, 2015, 6:55am UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181 "2015-06-09T06:55:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattgolding](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mattgolding](https://discuss.elastic.co/u/mattgolding)\
**Post date:** [June 9, 2015, 6:55am UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181/1 "2015-06-09T06:55:43Z")

</div>

I have created a watcher and it is running as expected except for the action. I continue to get a http 400 error for the request. Is there a good way to debug this? Fiddler doesn't pick up this request. If I execute a http request to my desired end point manually then it works as expected. Any advice on this would be great. Below is my action part of my wacther

```
"actions": {
    "my_webhook": {
        "webhook": {
            "method": "POST",
            "host": "localhost",
            "port": 80,
            "path": "/testapp/api/watcher/10?type={{ctx.watch_id}}",
            "headers" : {
                "Content-Type": "application/json"
            },
            "body": "something"
        }
    }
}

```

I also noted that if I didn't add a body then I recieved errors about invalid content-length.

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [June 9, 2015, 9:06am UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181/2 "2015-06-09T09:06:12Z")

</div>

good chance your problem is with the `path`. The `path` only holds the path part of the URI... without the query string, try the following:

```
"actions": {
    "my_webhook": {
        "webhook": {
            "method": "POST",
            "host": "localhost",
            "port": 80,
            "path": "/testapp/api/watcher/10",
            "params" : {
                "type" : "{{ctx.watch_id}}"
            },
            "headers" : {
                "Content-Type": "application/json"
            },
            "body": "something"
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![mattgolding](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mattgolding](https://discuss.elastic.co/u/mattgolding)\
**Post date:** [June 9, 2015, 10:16pm UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181/3 "2015-06-09T22:16:59Z")

</div>

Thanks Uri that worked a treat. I spoke with you @ Elasticon and you were just as helpful then too.

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [June 9, 2015, 10:39pm UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181/4 "2015-06-09T22:39:23Z")

</div>

oh thx.. happy to help 😊

---

<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:49pm UTC](https://discuss.elastic.co/t/watcher-webhooks-and-a-400-error/2181/5 "2017-07-06T13:49:38Z")

</div>


