export const metadata = {
  title: "Heartbeats - OnlineOrNot API Documentation",
  description:
    "Monitor cron jobs and scheduled tasks with heartbeat pings",
}

## Send a heartbeat (GET)   {{ tag: 'GET', label: '/{heartbeat_id}' }}
<Row>
<Col>

<a id="opIdpingHeartbeatGet"></a>

*Send a heartbeat ping (GET). Use this from scripts or cron jobs to signal completion. Note: This endpoint uses oonchk.com, not api.onlineornot.com.*

This operation does not require authentication

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Heartbeat ID"},"required":true,"description":"Heartbeat ID","name":"heartbeat_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Heartbeat ID","style":"simple"}]} title="Path parameters" />

<h3 id="send-a-heartbeat-ping-(get).-use-this-from-scripts-or-cron-jobs-to-signal-completion.-note:-this-endpoint-uses-oonchk.com,-not-api.onlineornot.com.-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Heartbeat received successfully|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/{heartbeat_id}">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://oonchk.com/a1b2c3d4
```

```javascript
fetch("https://oonchk.com/a1b2c3d4", {
  "method": "GET",
  "headers": {}
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://oonchk.com/a1b2c3d4")
  .get()
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://oonchk.com/a1b2c3d4');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://oonchk.com/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://oonchk.com/a1b2c3d4"

response = requests.request("GET", url)

print(response.text)
```

</CodeGroup>

</Col>
</Row>

---

## Send a heartbeat (POST)   {{ tag: 'POST', label: '/{heartbeat_id}' }}
<Row>
<Col>

<a id="opIdpingHeartbeat"></a>

*Send a heartbeat ping (POST). Use this from scripts or cron jobs to signal completion. Note: This endpoint uses oonchk.com, not api.onlineornot.com.*

This operation does not require authentication

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Heartbeat ID"},"required":true,"description":"Heartbeat ID","name":"heartbeat_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Heartbeat ID","style":"simple"}]} title="Path parameters" />

<h3 id="send-a-heartbeat-ping-(post).-use-this-from-scripts-or-cron-jobs-to-signal-completion.-note:-this-endpoint-uses-oonchk.com,-not-api.onlineornot.com.-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Heartbeat received successfully|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

</Col>

<Col sticky>

<CodeGroup title="Request" tag="POST" label="/{heartbeat_id}">
```bash {{ title: 'cURL' }}
curl --request POST \
  --url https://oonchk.com/a1b2c3d4
```

```javascript
fetch("https://oonchk.com/a1b2c3d4", {
  "method": "POST",
  "headers": {}
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://oonchk.com/a1b2c3d4")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://oonchk.com/a1b2c3d4');
$request->setMethod(HTTP_METH_POST);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://oonchk.com/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://oonchk.com/a1b2c3d4"

response = requests.request("POST", url)

print(response.text)
```

</CodeGroup>

</Col>
</Row>

---

## List all heartbeats   {{ tag: 'GET', label: '/v1/heartbeats' }}
<Row>
<Col>

<a id="opIdlistHeartbeats"></a>

*Retrieve a paginated list of all heartbeat monitors*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","default":"1","example":1,"description":"Page number of paginated results."},"required":false,"description":"Page number of paginated results.","name":"page","in":"query","exampleValues":{"object":1,"json":"'1'"},"originalType":"string","safeType":"string","shortDesc":"Page number of paginated results.","style":"form"},{"schema":{"type":"string","default":"20","example":20,"description":"Number of items per page."},"required":false,"description":"Number of items per page.","name":"per_page","in":"query","exampleValues":{"object":20,"json":"'20'"},"originalType":"string","safeType":"string","shortDesc":"Number of items per page.","style":"form"},{"schema":{"type":"string","example":"example","description":"Search term to filter results."},"required":false,"description":"Search term to filter results.","name":"search","in":"query","exampleValues":{"object":"example","json":"'example'"},"originalType":"string","safeType":"string","shortDesc":"Search term to filter results.","style":"form"}]} title="Query parameters" />

<h3 id="retrieve-a-paginated-list-of-all-heartbeat-monitors-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns a list of OnlineOrNot Heartbeats|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]}},"in":"body","name":"result","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"in":"body","name":"id","depth":2,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"in":"body","name":"name","depth":2,"description":"Name of the heartbeat monitor","type":"string","safeType":"string","required":true,"displayName":"»» name"},{"schema":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"in":"body","name":"status","depth":2,"description":"Current status of the heartbeat","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» status"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"in":"body","name":"last_seen","depth":2,"description":"Last time a heartbeat ping was received","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» last_seen"},{"schema":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"in":"body","name":"report_period","depth":2,"description":"Expected interval in seconds between heartbeat pings","type":["number","null"],"safeType":["number","null"],"required":true,"displayName":"»» report_period"},{"schema":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"in":"body","name":"report_period_cron","depth":2,"description":"Cron expression for expected heartbeat schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» report_period_cron"},{"schema":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"in":"body","name":"timezone","depth":2,"description":"Timezone for cron schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» timezone"},{"schema":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"in":"body","name":"grace_period","depth":2,"description":"Grace period in seconds before alerting","type":"number","safeType":"number","required":true,"displayName":"»» grace_period"},{"schema":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"in":"body","name":"reminder_alert_interval_minutes","depth":2,"description":"Interval in minutes between reminder alerts","type":"number","safeType":"number","required":true,"displayName":"»» reminder_alert_interval_minutes"},{"schema":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"in":"body","name":"alert_priority","depth":2,"description":"Alert priority level","type":"string","safeType":"string","required":true,"displayName":"»» alert_priority"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"in":"body","name":"created_at","depth":2,"description":"When the heartbeat was created","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» created_at"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"},"in":"body","name":"updated_at","depth":2,"description":"When the heartbeat was last updated","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» updated_at"},{"schema":{"type":"object","properties":{"page":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"per_page":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"count":{"type":"number","example":1,"description":"Number of items on the current page."},"total_count":{"type":"number","example":1,"description":"Total number of items."}},"required":["count","total_count"]},"in":"body","name":"result_info","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result_info"},{"schema":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"in":"body","name":"page","depth":2,"description":"Page number of paginated results.","type":"number","safeType":"number","required":false,"displayName":"»» page"},{"schema":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"in":"body","name":"per_page","depth":2,"description":"Number of items per page.","type":"number","safeType":"number","required":false,"displayName":"»» per_page"},{"schema":{"type":"number","example":1,"description":"Number of items on the current page."},"in":"body","name":"count","depth":2,"description":"Number of items on the current page.","type":"number","safeType":"number","required":true,"displayName":"»» count"},{"schema":{"type":"number","example":1,"description":"Total number of items."},"in":"body","name":"total_count","depth":2,"description":"Total number of items.","type":"number","safeType":"number","required":true,"displayName":"»» total_count"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/heartbeats">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/heartbeats \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/heartbeats", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/heartbeats")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/heartbeats');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/heartbeats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/heartbeats"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": [
    {
      "id": "a1b2c3d4",
      "name": "Daily backup job",
      "status": "UP",
      "last_seen": "2021-01-01T00:00:00.000Z",
      "report_period": 3600,
      "report_period_cron": "0 0 * * *",
      "timezone": "America/New_York",
      "grace_period": 300,
      "reminder_alert_interval_minutes": 1440,
      "alert_priority": "LOW",
      "created_at": "2021-01-01T00:00:00.000Z",
      "updated_at": "2021-01-01T00:00:00.000Z"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Create a heartbeat   {{ tag: 'POST', label: '/v1/heartbeats' }}
<Row>
<Col>

<a id="opIdcreateHeartbeat"></a>

*Create a new heartbeat monitor for cron jobs or scheduled tasks*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"report_period":{"type":"integer","minimum":1,"example":3600,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)"},"report_period_cron":{"type":"string","example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":"string","example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"integer","minimum":1,"example":300,"description":"Grace period in seconds to wait after missed heartbeat before alerting"},"reminder_alert_interval_minutes":{"type":"integer","minimum":-1,"default":1440,"example":1440,"description":"Interval in minutes between reminder alerts (-1 for never)"},"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs to alert"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs to alert"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs to alert"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"IDs of webhooks to associate with this heartbeat"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs to alert"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs to alert"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs to alert"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs to alert"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"default":"LOW","example":"LOW","description":"Alert priority level"}},"required":["name","grace_period"]},"name":"body","required":true,"exampleValues":{"object":{"name":"Daily backup job","report_period":3600,"report_period_cron":"0 0 * * *","timezone":"America/New_York","grace_period":300,"reminder_alert_interval_minutes":1440,"user_alerts":["string"],"slack_alerts":["string"],"discord_alerts":["string"],"webhook_alerts":["string"],"oncall_alerts":["string"],"incident_io_alerts":["string"],"microsoft_teams_alerts":["string"],"telegram_alerts":["string"],"pushover_alerts":["string"],"alert_priority":"LOW"},"json":"{\n  \"name\": \"Daily backup job\",\n  \"report_period\": 3600,\n  \"report_period_cron\": \"0 0 * * *\",\n  \"timezone\": \"America/New_York\",\n  \"grace_period\": 300,\n  \"reminder_alert_interval_minutes\": 1440,\n  \"user_alerts\": [\n    \"string\"\n  ],\n  \"slack_alerts\": [\n    \"string\"\n  ],\n  \"discord_alerts\": [\n    \"string\"\n  ],\n  \"webhook_alerts\": [\n    \"string\"\n  ],\n  \"oncall_alerts\": [\n    \"string\"\n  ],\n  \"incident_io_alerts\": [\n    \"string\"\n  ],\n  \"microsoft_teams_alerts\": [\n    \"string\"\n  ],\n  \"telegram_alerts\": [\n    \"string\"\n  ],\n  \"pushover_alerts\": [\n    \"string\"\n  ],\n  \"alert_priority\": \"LOW\"\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"name":"» name","required":true,"description":"Name of the heartbeat monitor","safeType":"string","depth":1,"exampleValues":{"object":"Daily backup job","json":"'Daily backup job'"},"shortDesc":"Name of the heartbeat monitor"},{"in":"body","schema":{"type":"integer","minimum":1,"example":3600,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)"},"name":"» report_period","required":false,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)","safeType":"integer","depth":1,"exampleValues":{"object":3600,"json":"'3600'"},"shortDesc":"Expected interval in seconds between heartbeat pings (for simple schedule)"},{"in":"body","schema":{"type":"string","example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"name":"» report_period_cron","required":false,"description":"Cron expression for expected heartbeat schedule","safeType":"string","depth":1,"exampleValues":{"object":"0 0 * * *","json":"'0 0 * * *'"},"shortDesc":"Cron expression for expected heartbeat schedule"},{"in":"body","schema":{"type":"string","example":"America/New_York","description":"Timezone for cron schedule"},"name":"» timezone","required":false,"description":"Timezone for cron schedule","safeType":"string","depth":1,"exampleValues":{"object":"America/New_York","json":"'America/New_York'"},"shortDesc":"Timezone for cron schedule"},{"in":"body","schema":{"type":"integer","minimum":1,"example":300,"description":"Grace period in seconds to wait after missed heartbeat before alerting"},"name":"» grace_period","required":true,"description":"Grace period in seconds to wait after missed heartbeat before alerting","safeType":"integer","depth":1,"exampleValues":{"object":300,"json":"'300'"},"shortDesc":"Grace period in seconds to wait after missed heartbeat before alerting"},{"in":"body","schema":{"type":"integer","minimum":-1,"default":1440,"example":1440,"description":"Interval in minutes between reminder alerts (-1 for never)"},"name":"» reminder_alert_interval_minutes","required":false,"description":"Interval in minutes between reminder alerts (-1 for never)","safeType":"integer","depth":1,"exampleValues":{"object":1440,"json":"'1440'"},"shortDesc":"Interval in minutes between reminder alerts (-1 for never)"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of user IDs to alert"},"name":"» user_alerts","required":false,"description":"Array of user IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of user IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs to alert"},"name":"» slack_alerts","required":false,"description":"Array of Slack integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Slack integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs to alert"},"name":"» discord_alerts","required":false,"description":"Array of Discord integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Discord integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"IDs of webhooks to associate with this heartbeat"},"name":"» webhook_alerts","required":false,"description":"IDs of webhooks to associate with this heartbeat","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"IDs of webhooks to associate with this heartbeat"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},"name":"» oncall_alerts","required":false,"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs to alert"},"name":"» incident_io_alerts","required":false,"description":"Array of incident.io integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of incident.io integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs to alert"},"name":"» microsoft_teams_alerts","required":false,"description":"Array of Microsoft Teams integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Microsoft Teams integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs to alert"},"name":"» telegram_alerts","required":false,"description":"Array of Telegram integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Telegram integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs to alert"},"name":"» pushover_alerts","required":false,"description":"Array of Pushover integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Pushover integration IDs to alert"},{"in":"body","schema":{"type":"string","enum":["LOW","HIGH"],"default":"LOW","example":"LOW","description":"Alert priority level"},"name":"» alert_priority","required":false,"description":"Alert priority level","safeType":"string","depth":1,"exampleValues":{"object":"LOW","json":"'LOW'"},"shortDesc":"Alert priority level"}]} title="Body parameters" />

<h3 id="create-a-new-heartbeat-monitor-for-cron-jobs-or-scheduled-tasks-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Create a new OnlineOrNot Heartbeat|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"201","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"in":"body","name":"name","depth":3,"description":"Name of the heartbeat monitor","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"in":"body","name":"status","depth":3,"description":"Current status of the heartbeat","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» status"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"in":"body","name":"last_seen","depth":3,"description":"Last time a heartbeat ping was received","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» last_seen"},{"schema":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"in":"body","name":"report_period","depth":3,"description":"Expected interval in seconds between heartbeat pings","type":["number","null"],"safeType":["number","null"],"required":true,"displayName":"»»» report_period"},{"schema":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"in":"body","name":"report_period_cron","depth":3,"description":"Cron expression for expected heartbeat schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» report_period_cron"},{"schema":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"in":"body","name":"timezone","depth":3,"description":"Timezone for cron schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» timezone"},{"schema":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"in":"body","name":"grace_period","depth":3,"description":"Grace period in seconds before alerting","type":"number","safeType":"number","required":true,"displayName":"»»» grace_period"},{"schema":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"in":"body","name":"reminder_alert_interval_minutes","depth":3,"description":"Interval in minutes between reminder alerts","type":"number","safeType":"number","required":true,"displayName":"»»» reminder_alert_interval_minutes"},{"schema":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"in":"body","name":"alert_priority","depth":3,"description":"Alert priority level","type":"string","safeType":"string","required":true,"displayName":"»»» alert_priority"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"in":"body","name":"created_at","depth":3,"description":"When the heartbeat was created","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» created_at"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the heartbeat was last updated","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"in":"body","name":"user_alerts","depth":3,"description":"Array of user IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» user_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"in":"body","name":"slack_alerts","depth":3,"description":"Array of Slack integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» slack_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"in":"body","name":"discord_alerts","depth":3,"description":"Array of Discord integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» discord_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"in":"body","name":"webhook_alerts","depth":3,"description":"Array of generic webhook IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» webhook_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"in":"body","name":"oncall_alerts","depth":3,"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» oncall_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"in":"body","name":"incident_io_alerts","depth":3,"description":"Array of incident.io integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» incident_io_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"in":"body","name":"microsoft_teams_alerts","depth":3,"description":"Array of Microsoft Teams integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» microsoft_teams_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"in":"body","name":"telegram_alerts","depth":3,"description":"Array of Telegram integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» telegram_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"},"in":"body","name":"pushover_alerts","depth":3,"description":"Array of Pushover integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» pushover_alerts"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="POST" label="/v1/heartbeats">
```bash {{ title: 'cURL' }}
curl --request POST \
  --url https://api.onlineornot.com/v1/heartbeats \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Daily backup job","report_period":86400,"grace_period":300}'
```

```javascript
fetch("https://api.onlineornot.com/v1/heartbeats", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"name\":\"Daily backup job\",\"report_period\":86400,\"grace_period\":300}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"Daily backup job\",\"report_period\":86400,\"grace_period\":300}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/heartbeats")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/heartbeats');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"name":"Daily backup job","report_period":86400,"grace_period":300}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/heartbeats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"name\":\"Daily backup job\",\"report_period\":86400,\"grace_period\":300}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/heartbeats"

payload = {
    "name": "Daily backup job",
    "report_period": 86400,
    "grace_period": 300
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Daily backup job",
    "status": "UP",
    "last_seen": "2021-01-01T00:00:00.000Z",
    "report_period": 3600,
    "report_period_cron": "0 0 * * *",
    "timezone": "America/New_York",
    "grace_period": 300,
    "reminder_alert_interval_minutes": 1440,
    "alert_priority": "LOW",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-01-01T00:00:00.000Z",
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "pushover_alerts": [
      "string"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Retrieve a heartbeat   {{ tag: 'GET', label: '/v1/heartbeats/{heartbeat_id}' }}
<Row>
<Col>

<a id="opIdgetHeartbeat"></a>

*Look up detailed information about a specific heartbeat monitor*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Heartbeat ID"},"required":true,"description":"Heartbeat ID","name":"heartbeat_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Heartbeat ID","style":"simple"}]} title="Path parameters" />

<h3 id="look-up-detailed-information-about-a-specific-heartbeat-monitor-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Retrieve the specified OnlineOrNot Heartbeat|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"in":"body","name":"name","depth":3,"description":"Name of the heartbeat monitor","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"in":"body","name":"status","depth":3,"description":"Current status of the heartbeat","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» status"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"in":"body","name":"last_seen","depth":3,"description":"Last time a heartbeat ping was received","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» last_seen"},{"schema":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"in":"body","name":"report_period","depth":3,"description":"Expected interval in seconds between heartbeat pings","type":["number","null"],"safeType":["number","null"],"required":true,"displayName":"»»» report_period"},{"schema":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"in":"body","name":"report_period_cron","depth":3,"description":"Cron expression for expected heartbeat schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» report_period_cron"},{"schema":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"in":"body","name":"timezone","depth":3,"description":"Timezone for cron schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» timezone"},{"schema":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"in":"body","name":"grace_period","depth":3,"description":"Grace period in seconds before alerting","type":"number","safeType":"number","required":true,"displayName":"»»» grace_period"},{"schema":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"in":"body","name":"reminder_alert_interval_minutes","depth":3,"description":"Interval in minutes between reminder alerts","type":"number","safeType":"number","required":true,"displayName":"»»» reminder_alert_interval_minutes"},{"schema":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"in":"body","name":"alert_priority","depth":3,"description":"Alert priority level","type":"string","safeType":"string","required":true,"displayName":"»»» alert_priority"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"in":"body","name":"created_at","depth":3,"description":"When the heartbeat was created","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» created_at"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the heartbeat was last updated","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"in":"body","name":"user_alerts","depth":3,"description":"Array of user IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» user_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"in":"body","name":"slack_alerts","depth":3,"description":"Array of Slack integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» slack_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"in":"body","name":"discord_alerts","depth":3,"description":"Array of Discord integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» discord_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"in":"body","name":"webhook_alerts","depth":3,"description":"Array of generic webhook IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» webhook_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"in":"body","name":"oncall_alerts","depth":3,"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» oncall_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"in":"body","name":"incident_io_alerts","depth":3,"description":"Array of incident.io integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» incident_io_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"in":"body","name":"microsoft_teams_alerts","depth":3,"description":"Array of Microsoft Teams integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» microsoft_teams_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"in":"body","name":"telegram_alerts","depth":3,"description":"Array of Telegram integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» telegram_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"},"in":"body","name":"pushover_alerts","depth":3,"description":"Array of Pushover integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» pushover_alerts"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/heartbeats/{heartbeat_id}">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/heartbeats/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/heartbeats/a1b2c3d4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/heartbeats/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Daily backup job",
    "status": "UP",
    "last_seen": "2021-01-01T00:00:00.000Z",
    "report_period": 3600,
    "report_period_cron": "0 0 * * *",
    "timezone": "America/New_York",
    "grace_period": 300,
    "reminder_alert_interval_minutes": 1440,
    "alert_priority": "LOW",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-01-01T00:00:00.000Z",
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "pushover_alerts": [
      "string"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Modify a heartbeat   {{ tag: 'PATCH', label: '/v1/heartbeats/{heartbeat_id}' }}
<Row>
<Col>

<a id="opIdupdateHeartbeat"></a>

*Modify the configuration of an existing heartbeat monitor*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Heartbeat ID"},"required":true,"description":"Heartbeat ID","name":"heartbeat_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Heartbeat ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"report_period":{"type":["integer","null"],"minimum":1,"example":3600,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"integer","minimum":1,"example":300,"description":"Grace period in seconds to wait after missed heartbeat before alerting"},"reminder_alert_interval_minutes":{"type":"integer","minimum":-1,"example":1440,"description":"Interval in minutes between reminder alerts (-1 for never)"},"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs to alert"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs to alert"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs to alert"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"IDs of webhooks to associate with this heartbeat"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs to alert"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs to alert"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs to alert"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs to alert"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"paused":{"type":"boolean","example":false,"description":"Whether the heartbeat is paused"},"muted":{"type":"boolean","example":false,"description":"Whether the heartbeat is muted (continues monitoring but suppresses alerts)"}}},"name":"body","required":true,"exampleValues":{"object":{"name":"Daily backup job","report_period":3600,"report_period_cron":"0 0 * * *","timezone":"America/New_York","grace_period":300,"reminder_alert_interval_minutes":1440,"user_alerts":["string"],"slack_alerts":["string"],"discord_alerts":["string"],"webhook_alerts":["string"],"oncall_alerts":["string"],"incident_io_alerts":["string"],"microsoft_teams_alerts":["string"],"telegram_alerts":["string"],"pushover_alerts":["string"],"alert_priority":"LOW","paused":false,"muted":false},"json":"{\n  \"name\": \"Daily backup job\",\n  \"report_period\": 3600,\n  \"report_period_cron\": \"0 0 * * *\",\n  \"timezone\": \"America/New_York\",\n  \"grace_period\": 300,\n  \"reminder_alert_interval_minutes\": 1440,\n  \"user_alerts\": [\n    \"string\"\n  ],\n  \"slack_alerts\": [\n    \"string\"\n  ],\n  \"discord_alerts\": [\n    \"string\"\n  ],\n  \"webhook_alerts\": [\n    \"string\"\n  ],\n  \"oncall_alerts\": [\n    \"string\"\n  ],\n  \"incident_io_alerts\": [\n    \"string\"\n  ],\n  \"microsoft_teams_alerts\": [\n    \"string\"\n  ],\n  \"telegram_alerts\": [\n    \"string\"\n  ],\n  \"pushover_alerts\": [\n    \"string\"\n  ],\n  \"alert_priority\": \"LOW\",\n  \"paused\": false,\n  \"muted\": false\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"name":"» name","required":false,"description":"Name of the heartbeat monitor","safeType":"string","depth":1,"exampleValues":{"object":"Daily backup job","json":"'Daily backup job'"},"shortDesc":"Name of the heartbeat monitor"},{"in":"body","schema":{"type":["integer","null"],"minimum":1,"example":3600,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)"},"name":"» report_period","required":false,"description":"Expected interval in seconds between heartbeat pings (for simple schedule)","safeType":["integer","null"],"depth":1,"exampleValues":{"object":3600,"json":"'3600'"},"shortDesc":"Expected interval in seconds between heartbeat pings (for simple schedule)"},{"in":"body","schema":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"name":"» report_period_cron","required":false,"description":"Cron expression for expected heartbeat schedule","safeType":["string","null"],"depth":1,"exampleValues":{"object":"0 0 * * *","json":"'0 0 * * *'"},"shortDesc":"Cron expression for expected heartbeat schedule"},{"in":"body","schema":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"name":"» timezone","required":false,"description":"Timezone for cron schedule","safeType":["string","null"],"depth":1,"exampleValues":{"object":"America/New_York","json":"'America/New_York'"},"shortDesc":"Timezone for cron schedule"},{"in":"body","schema":{"type":"integer","minimum":1,"example":300,"description":"Grace period in seconds to wait after missed heartbeat before alerting"},"name":"» grace_period","required":false,"description":"Grace period in seconds to wait after missed heartbeat before alerting","safeType":"integer","depth":1,"exampleValues":{"object":300,"json":"'300'"},"shortDesc":"Grace period in seconds to wait after missed heartbeat before alerting"},{"in":"body","schema":{"type":"integer","minimum":-1,"example":1440,"description":"Interval in minutes between reminder alerts (-1 for never)"},"name":"» reminder_alert_interval_minutes","required":false,"description":"Interval in minutes between reminder alerts (-1 for never)","safeType":"integer","depth":1,"exampleValues":{"object":1440,"json":"'1440'"},"shortDesc":"Interval in minutes between reminder alerts (-1 for never)"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of user IDs to alert"},"name":"» user_alerts","required":false,"description":"Array of user IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of user IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs to alert"},"name":"» slack_alerts","required":false,"description":"Array of Slack integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Slack integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs to alert"},"name":"» discord_alerts","required":false,"description":"Array of Discord integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Discord integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"IDs of webhooks to associate with this heartbeat"},"name":"» webhook_alerts","required":false,"description":"IDs of webhooks to associate with this heartbeat","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"IDs of webhooks to associate with this heartbeat"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},"name":"» oncall_alerts","required":false,"description":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs to alert"},"name":"» incident_io_alerts","required":false,"description":"Array of incident.io integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of incident.io integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs to alert"},"name":"» microsoft_teams_alerts","required":false,"description":"Array of Microsoft Teams integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Microsoft Teams integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs to alert"},"name":"» telegram_alerts","required":false,"description":"Array of Telegram integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Telegram integration IDs to alert"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs to alert"},"name":"» pushover_alerts","required":false,"description":"Array of Pushover integration IDs to alert","safeType":"string[]","depth":1,"exampleValues":{"object":["string"],"json":"[\n  \"string\"\n]"},"shortDesc":"Array of Pushover integration IDs to alert"},{"in":"body","schema":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"name":"» alert_priority","required":false,"description":"Alert priority level","safeType":"string","depth":1,"exampleValues":{"object":"LOW","json":"'LOW'"},"shortDesc":"Alert priority level"},{"in":"body","schema":{"type":"boolean","example":false,"description":"Whether the heartbeat is paused"},"name":"» paused","required":false,"description":"Whether the heartbeat is paused","safeType":"boolean","depth":1,"exampleValues":{"object":false,"json":"'false'"},"shortDesc":"Whether the heartbeat is paused"},{"in":"body","schema":{"type":"boolean","example":false,"description":"Whether the heartbeat is muted (continues monitoring but suppresses alerts)"},"name":"» muted","required":false,"description":"Whether the heartbeat is muted (continues monitoring but suppresses alerts)","safeType":"boolean","depth":1,"exampleValues":{"object":false,"json":"'false'"},"shortDesc":"Whether the heartbeat is muted (continues monitoring but suppresses alerts)"}]} title="Body parameters" />

<h3 id="modify-the-configuration-of-an-existing-heartbeat-monitor-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Modify an OnlineOrNot Heartbeat|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]}]},"in":"body","name":"result","depth":1,"type":"any","safeType":"any","required":true,"displayName":"» result"},{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"status":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"last_seen":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"report_period":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"report_period_cron":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"timezone":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"grace_period":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"reminder_alert_interval_minutes":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"alert_priority":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"created_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"updated_at":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"}},"required":["id","name","status","last_seen","report_period","report_period_cron","timezone","grace_period","reminder_alert_interval_minutes","alert_priority","created_at","updated_at"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily backup job","description":"Name of the heartbeat monitor"},"in":"body","name":"name","depth":3,"description":"Name of the heartbeat monitor","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":["string","null"],"enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","MUTED"],"example":"UP","description":"Current status of the heartbeat"},"in":"body","name":"status","depth":3,"description":"Current status of the heartbeat","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» status"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"Last time a heartbeat ping was received"},"in":"body","name":"last_seen","depth":3,"description":"Last time a heartbeat ping was received","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» last_seen"},{"schema":{"type":["number","null"],"example":3600,"description":"Expected interval in seconds between heartbeat pings"},"in":"body","name":"report_period","depth":3,"description":"Expected interval in seconds between heartbeat pings","type":["number","null"],"safeType":["number","null"],"required":true,"displayName":"»»» report_period"},{"schema":{"type":["string","null"],"example":"0 0 * * *","description":"Cron expression for expected heartbeat schedule"},"in":"body","name":"report_period_cron","depth":3,"description":"Cron expression for expected heartbeat schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» report_period_cron"},{"schema":{"type":["string","null"],"example":"America/New_York","description":"Timezone for cron schedule"},"in":"body","name":"timezone","depth":3,"description":"Timezone for cron schedule","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» timezone"},{"schema":{"type":"number","example":300,"description":"Grace period in seconds before alerting"},"in":"body","name":"grace_period","depth":3,"description":"Grace period in seconds before alerting","type":"number","safeType":"number","required":true,"displayName":"»»» grace_period"},{"schema":{"type":"number","example":1440,"description":"Interval in minutes between reminder alerts"},"in":"body","name":"reminder_alert_interval_minutes","depth":3,"description":"Interval in minutes between reminder alerts","type":"number","safeType":"number","required":true,"displayName":"»»» reminder_alert_interval_minutes"},{"schema":{"type":"string","enum":["LOW","HIGH"],"example":"LOW","description":"Alert priority level"},"in":"body","name":"alert_priority","depth":3,"description":"Alert priority level","type":"string","safeType":"string","required":true,"displayName":"»»» alert_priority"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was created"},"in":"body","name":"created_at","depth":3,"description":"When the heartbeat was created","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» created_at"},{"schema":{"type":["string","null"],"example":"2021-01-01T00:00:00.000Z","description":"When the heartbeat was last updated"},"in":"body","name":"updated_at","depth":3,"description":"When the heartbeat was last updated","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»»» updated_at"},{"schema":{"type":"object","properties":{"user_alerts":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"slack_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"discord_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"webhook_alerts":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"oncall_alerts":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"incident_io_alerts":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"microsoft_teams_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"telegram_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"pushover_alerts":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"}},"required":["user_alerts","slack_alerts","discord_alerts","webhook_alerts","oncall_alerts","incident_io_alerts","microsoft_teams_alerts","telegram_alerts","pushover_alerts"]},"in":"body","name":"*anonymous*","depth":2,"type":"object","safeType":"object","required":false,"displayName":"»» *anonymous*"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of user IDs subscribed to alerts"},"in":"body","name":"user_alerts","depth":3,"description":"Array of user IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» user_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Slack integration IDs subscribed to alerts"},"in":"body","name":"slack_alerts","depth":3,"description":"Array of Slack integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» slack_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Discord integration IDs subscribed to alerts"},"in":"body","name":"discord_alerts","depth":3,"description":"Array of Discord integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» discord_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of generic webhook IDs subscribed to alerts"},"in":"body","name":"webhook_alerts","depth":3,"description":"Array of generic webhook IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» webhook_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts"},"in":"body","name":"oncall_alerts","depth":3,"description":"Array of on-call integration IDs (PagerDuty, Opsgenie, etc.) subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» oncall_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of incident.io integration IDs subscribed to alerts"},"in":"body","name":"incident_io_alerts","depth":3,"description":"Array of incident.io integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» incident_io_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Microsoft Teams integration IDs subscribed to alerts"},"in":"body","name":"microsoft_teams_alerts","depth":3,"description":"Array of Microsoft Teams integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» microsoft_teams_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Telegram integration IDs subscribed to alerts"},"in":"body","name":"telegram_alerts","depth":3,"description":"Array of Telegram integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» telegram_alerts"},{"schema":{"type":"array","items":{"type":"string"},"description":"Array of Pushover integration IDs subscribed to alerts"},"in":"body","name":"pushover_alerts","depth":3,"description":"Array of Pushover integration IDs subscribed to alerts","type":"array","safeType":"string[]","required":true,"displayName":"»»» pushover_alerts"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="PATCH" label="/v1/heartbeats/{heartbeat_id}">
```bash {{ title: 'cURL' }}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/heartbeats/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"report_period":7200,"grace_period":600}'
```

```javascript
fetch("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4", {
  "method": "PATCH",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"report_period\":7200,\"grace_period\":600}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"report_period\":7200,\"grace_period\":600}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")
  .patch(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

HttpRequest::methodRegister('PATCH');
$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/heartbeats/a1b2c3d4');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"report_period":7200,"grace_period":600}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"report_period\":7200,\"grace_period\":600}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/heartbeats/a1b2c3d4"

payload = {
    "report_period": 7200,
    "grace_period": 600
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Daily backup job",
    "status": "UP",
    "last_seen": "2021-01-01T00:00:00.000Z",
    "report_period": 3600,
    "report_period_cron": "0 0 * * *",
    "timezone": "America/New_York",
    "grace_period": 300,
    "reminder_alert_interval_minutes": 1440,
    "alert_priority": "LOW",
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-01-01T00:00:00.000Z",
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "pushover_alerts": [
      "string"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Delete a heartbeat   {{ tag: 'DELETE', label: '/v1/heartbeats/{heartbeat_id}' }}
<Row>
<Col>

<a id="opIddeleteHeartbeat"></a>

*Permanently delete a heartbeat monitor*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Heartbeat ID"},"required":true,"description":"Heartbeat ID","name":"heartbeat_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Heartbeat ID","style":"simple"}]} title="Path parameters" />

<h3 id="permanently-delete-a-heartbeat-monitor-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the deleted OnlineOrNot Heartbeat's ID|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"}},"required":["id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Heartbeat ID"},"in":"body","name":"id","depth":2,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="DELETE" label="/v1/heartbeats/{heartbeat_id}">
```bash {{ title: 'cURL' }}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/heartbeats/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4", {
  "method": "DELETE",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/heartbeats/a1b2c3d4');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/heartbeats/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/heartbeats/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

