Setup Heartbeat Monitor

Create a new heartbeat monitoring resource by providing the required service_id and name in the request body. This resource acts as a check-in point for recurring jobs or processes that are expected to send heartbeat signals at defined intervals.

Once the heartbeat is created, your system or job must send regular requests (pings) to the assigned endpoint. If a ping is missed beyond the expected interval, the monitor will be marked as unhealthy, and an alert can be triggered based on your configuration.

Use cases:
  • Background job monitoring — Ensure cron jobs, queue workers, or scheduled scripts are executing on time.
  • System health visibility — Detect stalled or silently failed processes before they cause downstream issues.
  • Proactive alerting — Receive notifications when heartbeat pings stop, signaling a potential failure or delay.

To send check-ins, use the unique heartbeat endpoint returned in the creation response.

Authorization: Bearer YOUR_TOKEN

Request Body Parameters
  • service_id string
    The unique service ID associated with the heartbeat resource.
    Example: '6766163a-568d-47b4-a1fa-91a0957e06d4'
  • name string
  • interval integer
  • enabled boolean
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/heartbeat';
const data = {
  service_id: '6766163a-568d-47b4-a1fa-91a0957e06d4',
  name: 'Pinghome',
  interval: 60,
  enabled: true
};

axios.post(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).