Integration API
Query live backup status counts from BackupMonitor using your API key. Use this to build internal dashboards, status displays, or monitoring scripts that react to backup failures.
Unlike the Ingest API which pushes data into BackupMonitor, the Integration API lets you pull current state out — for example to drive a wall display, a helpdesk widget, or an alert script that pages on-call when the error count rises.
Authentication
Every request must include your API key in the
X-Api-Key header. You can find your key in
Settings → API inside the app.
Keep your API key secret. Anyone with the key can read your backup status data. Do not commit it to version control or share it publicly.
X-Api-Key: bm_your-api-key-here
Endpoints
Get Status Counts
Returns the current number of active jobs in each status category. Counts reflect the latest known status for every active job in your account.
Response
| Field | Type | Description |
|---|---|---|
successCount |
number | Jobs whose last result was a success. |
errorCount |
number | Jobs whose last result was an error. |
warningCount |
number | Jobs whose last result was a warning. |
otherCount |
number | Jobs in any other state (e.g. running, unknown). |
Example response
{
"successCount": 42,
"errorCount": 3,
"warningCount": 1,
"otherCount": 0
}
Code Examples
Fetch Status Counts
API_KEY="bm_your-api-key-here" curl -s \ -H "X-Api-Key: $API_KEY" \ "https://app.backupmonitor.io/api/integration/counts"
$API_KEY = "bm_your-api-key-here"
$response = Invoke-RestMethod `
-Uri "https://app.backupmonitor.io/api/integration/counts" `
-Headers @{ "X-Api-Key" = $API_KEY }
Write-Host "Errors: $($response.errorCount)"
Write-Host "Warnings: $($response.warningCount)"
Write-Host "OK: $($response.successCount)"
Alert on Errors
Poll the endpoint periodically and trigger an alert when the error count exceeds a threshold. The example below sends a message when there are 5 or more errors.
#!/usr/bin/env bash
API_KEY="bm_your-api-key-here"
ERROR_THRESHOLD=5
ERRORS=$(curl -s \
-H "X-Api-Key: $API_KEY" \
"https://app.backupmonitor.io/api/integration/counts" \
| grep -o '"errorCount":[0-9]*' | grep -o '[0-9]*')
if [ "${ERRORS:-0}" -ge "$ERROR_THRESHOLD" ]; then
echo "ALERT: $ERRORS backup job(s) are in error state."
# add your notification logic here (e.g. send email, call webhook)
fi
$API_KEY = "bm_your-api-key-here"
$ERROR_THRESHOLD = 5
$response = Invoke-RestMethod `
-Uri "https://app.backupmonitor.io/api/integration/counts" `
-Headers @{ "X-Api-Key" = $API_KEY }
if ($response.errorCount -ge $ERROR_THRESHOLD) {
Write-Warning "ALERT: $($response.errorCount) backup job(s) are in error state."
# add your notification logic here
}