Server Monitor API v1

Read-only API for status, components, incidents, and webhooks. Build status pages, badges, and alerting pipelines.

Examples

Use your API key only in server-side or trusted environments. Never expose it in browser apps.

cURL

curl -X GET "https://faciotech.com/modules/addons/faciotech_monitor/api.php/status" \
  -H "X-API-Key: YOUR_API_KEY"

JavaScript (fetch)

const res = await fetch('https://faciotech.com/modules/addons/faciotech_monitor/api.php/status', {
  headers: { 'X-API-Key': process.env.MONITOR_API_KEY }
});
const data = await res.json();
if (data.success) console.log(data.data.status);

Run this in Node.js or a server-side context; do not use the key in browser code.

Node.js

const apiKey = process.env.MONITOR_API_KEY;
const base = 'https://faciotech.com/modules/addons/faciotech_monitor/api.php';

const { data } = await fetch(`${base}/status`, {
  headers: { 'X-API-Key': apiKey }
}).then(r => r.json());

if (data) console.log('Overall:', data.status.overall_status);

Python (requests)

import os
import requests

api_key = os.environ.get('MONITOR_API_KEY')
base = 'https://faciotech.com/modules/addons/faciotech_monitor/api.php'

r = requests.get(f'{base}/status', headers={'X-API-Key': api_key})
data = r.json()
if data.get('success'):
    print(data['data']['status']['overall_status'])

Build a status page from the API

Poll the API from your backend or a cron job; do not call it from the browser with a key.

  1. Call GET /status to get overall status and active incidents.
  2. Call GET /monitors to list components and their status.
  3. Optionally call GET /incidents for recent history.
  4. Render states (operational / degraded / partial outage / major outage / maintenance) and incident list. Cache responses (e.g. 60-120 seconds) to reduce load.

Add a status badge to your website

To show a "systems operational" (or current state) badge:

  • Implement a small backend endpoint or serverless function that calls GET /status with your API key, then returns only the minimal data needed for the badge (e.g. overall_status and a label).
  • Your front end calls your own endpoint (no API key in the browser) and displays a cached result (e.g. 5-10 minutes) to limit traffic.