# To send JSON with webhook connectors

**URL:** <https://discuss.elastic.co/t/to-send-json-with-webhook-connectors/361781>\
**Category:** Kibana\
**Created:** [June 20, 2024, 8:46am UTC](https://discuss.elastic.co/t/to-send-json-with-webhook-connectors/361781 "2024-06-20T08:46:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kppriya](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@kppriya](https://discuss.elastic.co/u/kppriya)\
**Post date:** [June 20, 2024, 8:46am UTC](https://discuss.elastic.co/t/to-send-json-with-webhook-connectors/361781/1 "2024-06-20T08:46:25Z")

</div>

I am trying to send a JSON request to a webhook api, as per the document [Webhook connector and action | Kibana Guide [8.14] | Elastic](https://www.elastic.co/guide/en/kibana/current/webhook-action-type.html). But I am getting the below error.

Details:  
[415] UNSUPPORTED MEDIA TYPE: Did not attempt to load JSON data because the request Content-Type was not 'application/json'.

The endpoint is responding for the post, and I have tested with below.

_$url = "_ [_https://url/webhook/"_](https://url/webhook/%22)

_$headers = @{_  
_"Authorization" = "adkfjalsdjfkasdgkjasdkfj"_  
_# Add other headers here as needed_  
_}_

_# Create an object for the JSON body_  
_$body = @{_  
_"title" = "Disk Space alert from powershell"_  
_"description" = "Your Description Here"_

_}_

_# Convert the body object to a JSON string_  
_$jsonBody = $body | ConvertTo-Json_

_# Use Invoke-WebRequest with the URL, headers, and body_  
_$response = Invoke-WebRequest -Uri $url -Method Post -Headers $headers -Body $jsonBody -ContentType "application/json"_

_$responseObject = $response.Content | ConvertFrom-Json_

_Write-Host "Title is :"$responseObject.title_ ---- **I can able to print what im sending..**

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 20, 2024, 9:36am UTC](https://discuss.elastic.co/t/to-send-json-with-webhook-connectors/361781/2 "2024-06-20T09:36:51Z")

</div>

Hi @kppriya,

Welcome to the community! Can you share the payload that you're trying to send?

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [June 20, 2024, 10:08am UTC](https://discuss.elastic.co/t/to-send-json-with-webhook-connectors/361781/3 "2024-06-20T10:08:46Z")

</div>

I think you should try adding header `Content-Type:application/json`

 ![Screenshot 2024-06-20 at 3.37.25 PM](https://us1.discourse-cdn.com/elastic/original/3X/6/0/603b76cdc24d96cf4ea0dca9a6c27c502c07e6c7.png)
