# Error: could not parse \[webhook\] action failed parsing http request template

**URL:** <https://discuss.elastic.co/t/error-could-not-parse-webhook-action-failed-parsing-http-request-template/342917>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring, painless\
**Created:** [September 13, 2023, 7:38am UTC](https://discuss.elastic.co/t/error-could-not-parse-webhook-action-failed-parsing-http-request-template/342917 "2023-09-13T07:38:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rathasatekun](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@rathasatekun](https://discuss.elastic.co/u/rathasatekun)\
**Post date:** [September 13, 2023, 7:38am UTC](https://discuss.elastic.co/t/error-could-not-parse-webhook-action-failed-parsing-http-request-template/342917/1 "2023-09-13T07:38:59Z")

</div>

I try to create Watcher , when i save it error  
could not parse [webhook] action [42407423-32c4-4a72-aedf-03e31c4d6856/xxxx\_webhook]. failed parsing http request template

"actions": {  
"gosd\_webhook": {  
"transform": {  
"script": {  
"source": """  
ctx.payload.xxxx= ctx.payload.aggregations.xxxx.buckets.stream().map(p -\> '{"Store\_id": "B'+p.key[0]+'", "Terminal\_No" : "'+p.key[1]+'" , "Type" : "'+p.key[2]+'" , "Event" : "'+p.key[3]+'" , "Description" : "'+p.key[4]+'"}').collect(Collectors.toList())  
""",  
"lang": "painless"  
}  
},  
"foreach": "ctx.payload.xxxx",  
"max\_iterations": 300,  
"webhook": {  
"scheme": "https",  
"host": "yyyyyyyy.xxxxxx.aa.bb",  
"port": 443,  
"method": "POST",  
"path": "/API/ticket/CreateTicketgo",  
"headers":  
{  
"Content-Type": "application/json"  
},  
"auth": {  
"basic": {  
"username": "Ticket",  
"password": "::es\_redacted::"  
}  
},  
"body": "{{ctx.payload.\_value}}"  
}  
}  
}

---

<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:** [October 11, 2023, 7:39am UTC](https://discuss.elastic.co/t/error-could-not-parse-webhook-action-failed-parsing-http-request-template/342917/2 "2023-10-11T07:39:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
