{
  "openapi": "3.1.1",
  "info": {
    "title": "BackupMonitor API",
    "description": "Read the backup status of your account and push backup results from your own scripts. Every request needs the API key from Settings → API in the X-Api-Key header. Docs: https://www.backupmonitor.io/docs/integration.html and https://www.backupmonitor.io/docs/ingest-api.html",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.backupmonitor.io"
    }
  ],
  "paths": {
    "/api/integration/counts": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Number of jobs per status",
        "description": "The four status counts of the dashboard header for all active jobs of the API key's account.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusCountsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/jobs": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Status of every job",
        "description": "All active jobs of the API key's account as a flat list, sorted by group, device and job name: current status, the newest backup report, the time of the newest successful backup and, with days > 0, the dashboard's status per day. Polling every 5 minutes is plenty; the limit is 30 requests per minute per account, above that the API answers 429 with a Retry-After header.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Number of days (0-8) to include in days[], newest first. 0 (default) leaves days out.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationJob"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/ingest/backup": {
      "post": {
        "tags": [
          "Ingest"
        ],
        "summary": "Post a backup result",
        "description": "Records the result of a backup job run. Device and job are matched by deviceName, jobName, sender and tag, and created on the first post. The limit is 60 requests per minute per account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestBackupRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestBackupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestBackupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://ingest.backupmonitor.io"
        }
      ]
    },
    "/api/ingest/notification": {
      "post": {
        "tags": [
          "Ingest"
        ],
        "summary": "Post a notification",
        "description": "Sends a free-form notification event (alerts, health checks, script outcomes). The limit is 60 requests per minute per account, shared with /api/ingest/backup.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestNotificationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestNotificationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestNotificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "https://ingest.backupmonitor.io"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "BackupStatus": {
        "enum": [
          "success",
          "error",
          "warning",
          "inProgress"
        ]
      },
      "BackupType": {
        "enum": [
          "none",
          "veeam",
          "acronis",
          "veeamScaleOut",
          "veeamMs365",
          "veeamConfiguration",
          "easeUs",
          "altaroHornetSecurity",
          "altaro",
          "dellDrac",
          "powerChute",
          "synologyLocalBackup",
          "synologyMicrosoft365",
          "acronisCyberProtect",
          "veeamSureBackup",
          "veeamLogBackup",
          "commVault",
          "sage50",
          "iDrive",
          "storageCraft",
          "vmwareVsphere",
          "carbonCopyCloner",
          "proxmox",
          "updraftPlus",
          "veeamOracleRedoLog",
          "kerio",
          "robocopy",
          "arcServe",
          "acronisTrueImage",
          "hyperVReplica",
          "qnap",
          "sqlBackupAndFTP",
          "barracuda",
          "questRapid",
          "synologySnapshotReplication",
          "synologyAmazonS3",
          "duplicati",
          "terraCloud",
          "sophos",
          "proBackup",
          "profitBricks",
          "microsoftSqlServerAgent",
          "dreiCx",
          "windowsBackupImpit",
          "ninjaOne",
          "msP360",
          "veeamVeeMail",
          "iperius",
          "backupAssist",
          "syncBackFree",
          "hornetSecurity365TotalBackup",
          "backupExec",
          "windowsBackupSC24",
          "hornetVmBackup",
          "syncBack",
          "zyxelConfigBackup",
          "bobCloud",
          "azureBackup",
          "redstor",
          "custom1",
          "ingest",
          "terraCloudAlarmSummary",
          "synologyGoogleWorkspace",
          "lupusElectronicsXT4",
          "datto",
          "storageCraftImageManager",
          "storageCraftDailyReport",
          "elovade",
          "sqlBackupMaster",
          "coveDataProtection",
          "veritasSystemRecovery",
          "nakivo",
          "arxOneBackup",
          "proxmoxBackupServerSync",
          "windowsBackupComtech",
          "dbBackupTechlan",
          "dataTrustBackupservice",
          "snapshotReportSteurer",
          "hycu",
          "synologyLunBackup"
        ]
      },
      "IngestBackupRequest": {
        "type": "object",
        "properties": {
          "deviceName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. Name of the machine or device that ran the backup."
          },
          "jobName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. Name of the backup job."
          },
          "timestamp": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the backup ran, ISO 8601 with UTC offset (2024-06-04T12:00:00Z). Defaults to the time the request was received."
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. Result of the job: Success, Warning or Error (not case-sensitive; anything else counts as Error)."
          },
          "message": {
            "type": [
              "null",
              "string"
            ],
            "description": "Short summary of the result."
          },
          "sender": {
            "type": [
              "null",
              "string"
            ],
            "description": "Identifies the script or tool, e.g. rsync-backup. Together with deviceName, jobName and tag it decides which device and job the entry belongs to, so keep it constant. Defaults to unknown@ingest."
          },
          "tag": {
            "type": [
              "null",
              "string"
            ],
            "description": "Like the +tag of a mail address: the same device and sender under another tag is a separate device; depending on the account's group settings a new device also goes into the group named like the tag. a-z, 0-9, '.', '_' and '-', at most 64 characters; anything else is rejected with 400."
          }
        },
        "description": "Result of one backup job run."
      },
      "IngestNotificationRequest": {
        "type": "object",
        "properties": {
          "deviceName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. Name of the machine or device the event originated from."
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of an existing device (from /api/integration/jobs) to link the notification to."
          },
          "jobName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of a related job, if applicable."
          },
          "jobId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of an existing job (from /api/integration/jobs) to link the notification to."
          },
          "timestamp": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the event occurred, ISO 8601 with UTC offset (2024-06-04T12:00:00Z). Defaults to the time the request was received."
          },
          "message": {
            "type": [
              "null",
              "string"
            ],
            "description": "Description of the event."
          },
          "sender": {
            "type": [
              "null",
              "string"
            ],
            "description": "Identifies the script or tool that sent the event, e.g. disk-monitor."
          },
          "severity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. info, warning, error or critical."
          },
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. Short identifier of the event category, e.g. disk_space_low or ssl_expiry."
          },
          "tag": {
            "type": [
              "null",
              "string"
            ],
            "description": "Same rules as the tag of a backup entry, stored with the request; an invalid tag is rejected with 400."
          }
        },
        "description": "A free-form notification event."
      },
      "IntegrationJob": {
        "required": [
          "jobId",
          "jobName",
          "type",
          "deviceId",
          "deviceName",
          "groupId",
          "groupName",
          "status",
          "lastRun",
          "lastSuccessAt"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Unique ID of the job."
          },
          "jobName": {
            "type": "string",
            "description": "Job name as shown in the dashboard (the alias, if one is set)."
          },
          "type": {
            "description": "Backup software that reports this job.",
            "$ref": "#/components/schemas/BackupType"
          },
          "deviceId": {
            "type": "string",
            "description": "Unique ID of the device the job belongs to."
          },
          "deviceName": {
            "type": "string",
            "description": "Device name as shown in the dashboard (the alias, if one is set)."
          },
          "groupId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unique ID of the device's group, null if the device is not in a group."
          },
          "groupName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of the device's group, null if the device is not in a group."
          },
          "status": {
            "description": "Current overall status of the job, the same as in the dashboard and in /api/integration/counts.",
            "$ref": "#/components/schemas/JobStatus"
          },
          "lastRun": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The newest backup report of the job, null if none was ever received.",
                "$ref": "#/components/schemas/IntegrationLastRun"
              }
            ]
          },
          "lastSuccessAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC time of the newest successful backup, null if there never was one.",
            "format": "date-time"
          },
          "days": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationJobDay"
            },
            "description": "Status per day, newest first, only present when the days parameter is greater than 0."
          }
        },
        "description": "One monitored backup job with its current status."
      },
      "IntegrationJobDay": {
        "required": [
          "date",
          "status",
          "timestamp",
          "message"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day in the account's timezone (YYYY-MM-DD).",
            "format": "date"
          },
          "status": {
            "description": "Status of the job on that day, the same as the dashboard cell.",
            "$ref": "#/components/schemas/JobDayStatus"
          },
          "timestamp": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC time of the newest backup report on that day, null if there was none.",
            "format": "date-time"
          },
          "message": {
            "type": "string",
            "description": "Summary of the day as in the dashboard, plain text, at most 500 characters."
          }
        },
        "description": "Status of a job on one day."
      },
      "IntegrationLastRun": {
        "required": [
          "timestamp",
          "status",
          "message"
        ],
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "description": "UTC time of the backup.",
            "format": "date-time"
          },
          "status": {
            "description": "Result of this backup run.",
            "$ref": "#/components/schemas/BackupStatus"
          },
          "message": {
            "type": "string",
            "description": "Message of the backup software, plain text, at most 500 characters."
          }
        },
        "description": "A single backup report."
      },
      "JobDayStatus": {
        "enum": [
          "none",
          "success",
          "error",
          "warning",
          "missingButNotDue",
          "notPlanned",
          "forcedSuccess",
          "ignoredError"
        ]
      },
      "JobStatus": {
        "enum": [
          "none",
          "success",
          "error",
          "warning",
          "forcedSuccess",
          "ignoredError"
        ]
      },
      "StatusCountsResponse": {
        "required": [
          "successCount",
          "errorCount",
          "warningCount",
          "otherCount"
        ],
        "type": "object",
        "properties": {
          "successCount": {
            "type": "integer",
            "description": "Jobs whose current status is success (incl. forced success).",
            "format": "int32"
          },
          "errorCount": {
            "type": "integer",
            "description": "Jobs whose current status is error.",
            "format": "int32"
          },
          "warningCount": {
            "type": "integer",
            "description": "Jobs whose current status is warning.",
            "format": "int32"
          },
          "otherCount": {
            "type": "integer",
            "description": "Jobs without a status yet or with an ignored error.",
            "format": "int32"
          }
        },
        "description": "Number of active jobs per current status."
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API key of your account (Settings → API).",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Integration"
    },
    {
      "name": "Ingest"
    }
  ]
}