Change Uptime Monitor Status
This API allows authenticated users to change the status of an existing uptime monitoring resource. The ID of the resource must be included in the path, and the desired status (enable or disable) is provided in the request body. This API is useful for managing the operational status of a monitor based on current needs, such as temporarily disabling a monitor during maintenance periods or re-enabling it once the service is operational again.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the status of the uptime resource will be updated, and a confirmation message will be returned.
  • If the request is unauthorized or the provided ID is invalid, an error message will be returned, specifying the issue.
Path Parameters
  • id string
    The unique ID of the uptime resource whose status is being updated.
    Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
Request Body Parameters
  • enabled boolean
    A boolean value that determines the status of the uptime monitoring resource. Set to true to enable the resource or false to disable it.
    Example: true
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/resource/c03b02ec-244f-4d2c-8f68-3910071ed5c8/status';
const data = { 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).