Update Heartbeat Monitor
This API endpoint allows an authenticated user to update a heartbeat resource by providing its ID as a path parameter and the updated details in the request body.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the heartbeat resource will be updated, and a confirmation message will be returned.
  • If the request is invalid or cannot be processed, an error message will indicate the issue, such as an invalid URL; if the heartbeat resource is not found, an error will specify that the heartbeat does not exist.
Path Parameters
  • id string
    The unique ID of the heartbeat to update.
    Example: '906a3444-15ce-4410-8041-89a238e9e91f'
Request Body Parameters
  • name string
    The name of the heartbeat resource.
    Example: 'My heartbeat'
  • service_id string
  • interval integer
  • enabled boolean
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/heartbeat/906a3444-15ce-4410-8041-89a238e9e91f';
const data = {
  name: 'My heartbeat',
  service_id: 'cc7e4e8b-417d-4be0-9bde-85e353a20fa4',
  methods: ['GET'],
  interval: 60,
  enabled: true
};

axios.put(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).