Update Uptime Monitor
This API endpoint enables authenticated users to update the details of an uptime resource. The resource is identified by its unique ID, which must be provided in the URL path. The updated details should be sent in the request body as a JSON object.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the specified uptime resource will be updated, and a JSON object containing the updated resource details will be returned.
  • If the request is unauthorized, or details are invalid, an error message will be returned specifying the issue.
Path Parameters
  • id string
    The unique ID of the uptime resource to be updated. Example: '906a3444-15ce-4410-8041-89a238e9e91f'
Request Body Parameters
  • name string
    The name of the uptime resource. Example: 'My website'
  • is_advanced boolean
  • method string
  • grace_period positive integer or zero
  • recovery_period positive integer or zero
  • maintenance_cron_expression (optional) string
  • maintenance_duration (optional) positive integer or zero
  • skip_ssl_error boolean
  • body (optional) string
  • headers (optional) string
  • data (optional) string
  • service_id string
  • conditions array of objects
  • regions array of strings
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/resource/906a3444-15ce-4410-8041-89a238e9e91f';
const data = {
  name: 'My website',
  is_advanced: true,
  method: 'POST',
  grace_period: 1,
  recovery_period: 1,
  maintenance_cron_expression: '*/8 * * * *',
  maintenance_duration: 5,
  skip_ssl_error: false,
  body: 'param1=value1&param2=value2',
  headers: '{"Authorization": "Bearer sometoken"}',
  data: 'pinghome',
  service_id: 'cc7e4e8b-417d-4be0-9bde-85e353a20fa4',
  conditions: [{ values: ['pinghome'], operator: 'contains', key: 'groups.user[0].name', type: 'response-json-check' }],
  regions: ['eu-central-1']
};

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).