# Heartbeats configure http json post request

**URL:** <https://discuss.elastic.co/t/heartbeats-configure-http-json-post-request/362497>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [July 3, 2024, 11:14pm UTC](https://discuss.elastic.co/t/heartbeats-configure-http-json-post-request/362497 "2024-07-03T23:14:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![solo\_etz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solo_etz/32/122280_2.png) [@solo\_etz](https://discuss.elastic.co/u/solo_etz)\
**Post date:** [July 3, 2024, 11:14pm UTC](https://discuss.elastic.co/t/heartbeats-configure-http-json-post-request/362497/1 "2024-07-03T23:14:28Z")

</div>

Hiii , i am new to heartbeats  
i need assistance with setup a http post request , how do i configure my json request body ..

here is how i configure mine currently

```auto
- type: http
  # Set enabled to true (or delete the following line) to enable this monitor
  enabled: true
  # ID used to uniquely identify this monitor in Elasticsearch even if the config changes
  id: Momoverify-monitor
  # Human readable display name for this service in Uptime UI and elsewhere
  name: Momoverify
  # List of URLs to query
  urls: ["https:// *****.******.com/cld/ ****"]
  # Configure task schedule
  schedule: '@every 60s'
  response.include_body: always
  check.request:
    method: POST
    headers:
      'Content-Type': 'application/json'
    # urlencode the body:
    body: ""

how do i pass the bellow body 
{ "apiId": "myapid",
    "mykey: "7di76u49393fHDeepE4S4zvstlXr",
    "reference": "my referrnce",
    "product": "myproduct",
    "action": "myaction",
    "account": "123456~686"}
```

---

<div class="post-metadata">

**Author:** ![emilioalvap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilioalvap/32/99310_2.png) [@emilioalvap](https://discuss.elastic.co/u/emilioalvap)\
**Post date:** [July 8, 2024, 2:56pm UTC](https://discuss.elastic.co/t/heartbeats-configure-http-json-post-request/362497/2 "2024-07-08T14:56:34Z")

</div>

Hi @solo_etz,

Welcome to the Elastic Community!

The JSON value can be stringified on a single line or using yaml multine format. This should work:

```yaml
check.request:
    method: POST
    headers:
      'Content-Type': 'application/json'
    # urlencode the body:
    body: |-
      { "apiId": "myapid",
      "mykey": "7di76u49393fHDeepE4S4zvstlXr",
      "reference": "my referrnce",
      "product": "myproduct",
      "action": "myaction",
      "account": "123456~686"}

```

As long as you specify the correct `Content-Type` header, any client should be capable of parsing the request correctly. Hope that helps!

---

<div class="post-metadata">

**Author:** ![solo\_etz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solo_etz/32/122280_2.png) [@solo\_etz](https://discuss.elastic.co/u/solo_etz)\
**Post date:** [July 19, 2024, 11:05am UTC](https://discuss.elastic.co/t/heartbeats-configure-http-json-post-request/362497/3 "2024-07-19T11:05:46Z")

</div>

thanks @emilioalvap this worked
