{
 "openapi": "3.0.3",
 "info": {
  "title": "Bramble RMM API",
  "version": "2026-11-13",
  "description": "Bramble RMM for technicians — devices, sites and groups, scripts, remote terminal and screen, checks and alerts, applications, backups, databases, logs, dashboards, virtualisation and network discovery — plus the API the Bramble agent itself uses. RMM settings (check definitions, scheduled tasks, enrolment keys, device management) are in the [Admin Centre API](/apps/admin/api).\n"
 },
 "servers": [
  {
   "url": "https://{org}.brambleit.cloud/api",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   },
   "session": {
    "type": "apiKey",
    "in": "cookie",
    "name": "sso_session"
   },
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  }
 },
 "tags": [
  {
   "name": "Devices, sites & groups",
   "description": "Devices and how they're organised into sites and groups; a device's details, utilisation history and commands; running a command on a device.\n"
  },
  {
   "name": "Remote access",
   "description": "Opening a remote terminal or screen (VNC) session on a device. The response is a short-lived session the RMM page hands to Bramble Remote.\n"
  },
  {
   "name": "Scripts",
   "description": "The script library and running a script on a device. Scripts are written in Admin Centre → RMM."
  },
  {
   "name": "Checks & alerts",
   "description": "The monitoring checks that apply to devices, per-device exclusions and direct assignments, and the alerts they raise: list, acknowledge and resolve.\n"
  },
  {
   "name": "Applications",
   "description": "The application catalogue (winget, apt, Snap, Flathub, dnf and uploaded installers), search across package sources, assignments (required, uninstall, exclude) to all devices, sites, groups or single devices, and one-off installs.\n"
  },
  {
   "name": "Backups",
   "description": "File and whole-device backups: jobs per device, runs, browsing a backup's files, downloads, and restoring to the same or another device. Backups are stored encrypted in Bramble. Restore and download need their own permissions and are audited.\n"
  },
  {
   "name": "Databases",
   "description": "MySQL/MariaDB servers found on devices: overview, backup settings and backups, and opening a backup as a read-only copy to browse its tables.\n"
  },
  {
   "name": "Logs",
   "description": "Syslog collectors on devices and searching the collected logs."
  },
  {
   "name": "Dashboards",
   "description": "Personal and shared dashboards built from RMM and Warden data, and the query endpoint widgets use."
  },
  {
   "name": "Virtualisation",
   "description": "Proxmox VE and Proxmox Backup Server hosts, their guests and backup coverage, and links between a PVE host and the PBS that backs it up.\n"
  },
  {
   "name": "Network discovery",
   "description": "A device promoted to a **network probe** scans its subnets for devices that don't run the agent (printers, switches, cameras…). Configure, scan now, ping through it, and list what it found.\n"
  },
  {
   "name": "Network monitoring",
   "description": "Monitors for network devices: ping, TCP ports and SNMP (v2c or v3) with interface traffic history. Adopt a discovered device or add one by address.\n"
  },
  {
   "name": "Agent versions",
   "description": "The current agent version per platform (used by agents and installers to update themselves), and publishing a new release.\n"
  }
 ],
 "paths": {
  "/v1/app/rmm/version": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current versions",
    "operationId": "get-v1-app-rmm-version",
    "description": "Public. The current agent and server versions.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "app_latest": {},
          "server_latest": {},
          "agent_latest": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current agent version",
    "operationId": "get-v1-app-rmm-version-agent",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {},
          "legacy": {},
          "windows": {
           "type": "array",
           "items": {}
          },
          "windows_sha256": {
           "type": "array",
           "items": {}
          },
          "linux": {},
          "linux_sha256": {},
          "macos": {},
          "macos_sha256": {},
          "remote": {},
          "remote_sha256": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent/linux": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current Linux agent version and checksum",
    "operationId": "get-v1-app-rmm-version-agent-linux",
    "description": "Public — installers and agents use it to update. Returns the version and the release zip's SHA-256.\n\nRequires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {},
          "sha256": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent/windows": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current Windows agent version and checksum",
    "operationId": "get-v1-app-rmm-version-agent-windows",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {
           "type": "array",
           "items": {}
          },
          "sha256": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent/macos": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current macOS agent version and checksum",
    "operationId": "get-v1-app-rmm-version-agent-macos",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {},
          "sha256": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent/remote": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current Remote agent version and checksum",
    "operationId": "get-v1-app-rmm-version-agent-remote",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {},
          "sha256": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/agent/legacy": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current version for old agents",
    "operationId": "get-v1-app-rmm-version-agent-legacy",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/version/server": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current server version",
    "operationId": "get-v1-app-rmm-version-server",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Data not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/release/agent/{platform}": {
   "post": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Publish an agent release",
    "operationId": "post-v1-app-rmm-release-agent-platform",
    "description": "Publishes a new agent release: records the version + sha256 atomically once the artifact is already live at download.cloud.brambleit.com, so the two can never point at different builds. Called by the release pipeline, not by end users — auth is a dedicated bearer token, not a user JWT.\n\nRequires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "platform",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "linux",
        "windows",
        "macos",
        "remote"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "platform": {},
          "version": {},
          "sha256": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Unknown platform '…'. Expected one of: …"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "version": {
          "type": "string",
          "description": "The new version, e.g. `6.24.1`."
         },
         "sha256": {
          "type": "string",
          "description": "SHA-256 of the release zip."
         }
        },
        "required": [
         "version",
         "sha256"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/sites": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List sites (legacy)",
    "operationId": "get-v1-app-rmm-sites",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "client_id": {
              "type": "integer",
              "nullable": true
             },
             "site_name": {
              "type": "string"
             },
             "managed_tenant_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/deivce/{deivceid}:": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Get a device (legacy, misspelt path)",
    "operationId": "get-v1-app-rmm-deivce-deivceid",
    "description": "Kept for old pages. Use `GET /v2/app/rmm/device/:id`.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "deivceid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "client_id": {
              "type": "integer",
              "nullable": true
             },
             "site_name": {
              "type": "string"
             },
             "managed_tenant_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/groups": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List groups in a site (legacy)",
    "operationId": "post-v1-app-rmm-groups",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "groups": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "site_id": {
              "type": "integer"
             },
             "group_name": {
              "type": "string"
             }
            }
           }
          },
          "site": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "site_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/devices": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List devices in a group (legacy)",
    "operationId": "post-v1-app-rmm-devices",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "devices": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "site_id": {
              "type": "integer"
             },
             "group_id": {
              "type": "integer",
              "nullable": true
             },
             "device_id": {
              "type": "string"
             },
             "hostname": {
              "type": "string",
              "nullable": true
             },
             "display_name": {
              "type": "string",
              "nullable": true
             },
             "os_type": {
              "type": "string",
              "enum": [
               "windows",
               "linux",
               "mac",
               "other"
              ]
             },
             "device_type": {
              "type": "string",
              "enum": [
               "server",
               "workstation",
               "laptop",
               "virtual",
               "other"
              ]
             },
             "maintenance_mode": {
              "type": "boolean"
             },
             "full_inventory": {
              "type": "object",
              "nullable": true
             },
             "api_key": {
              "type": "string",
              "nullable": true
             },
             "last_seen": {
              "type": "string",
              "format": "date-time"
             },
             "agent_version": {
              "type": "string",
              "nullable": true
             },
             "agent_callback_url": {
              "type": "string",
              "nullable": true
             },
             "agent_cert_fingerprint_sha256": {
              "type": "string",
              "nullable": true
             },
             "agent_cert_serial": {
              "type": "string",
              "nullable": true
             },
             "agent_cert_pem": {
              "type": "string",
              "nullable": true
             },
             "agent_cert_issued_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "agent_cert_expires_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "is_maintenance": {
              "type": "boolean",
              "nullable": true
             },
             "is_network_probe": {
              "type": "boolean"
             },
             "pending_removal_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "pending_removal_command_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          },
          "group": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "group_id": {
          "type": "integer",
          "description": "The group."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/device/utilization": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "A device's utilisation (legacy)",
    "operationId": "post-v1-app-rmm-device-utilization",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "utilization": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "cpu_load": {
              "type": "number",
              "nullable": true
             },
             "ram_usage": {
              "type": "number",
              "nullable": true
             },
             "disk_usage": {
              "type": "number",
              "nullable": true
             },
             "network_usage": {
              "type": "number",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/device/command": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Send a command to a device (legacy)",
    "operationId": "post-v1-app-rmm-device-command",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id, command"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer"
         },
         "command": {},
         "data": {}
        },
        "required": [
         "device_id",
         "command"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/device/{id}": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Get a device (legacy)",
    "operationId": "get-v1-app-rmm-device-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "device": {},
          "utilization": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "cpu_load": {
              "type": "number",
              "nullable": true
             },
             "ram_usage": {
              "type": "number",
              "nullable": true
             },
             "disk_usage": {
              "type": "number",
              "nullable": true
             },
             "network_usage": {
              "type": "number",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Unauthorized: device does not belong to user's tenant"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/group/commands/list": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Recent commands in a group (legacy)",
    "operationId": "post-v1-app-rmm-group-commands-list",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "commands": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "device_id": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "command": {
              "type": "string"
             },
             "data": {},
             "result": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time"
             },
             "display_name": {
              "type": "string",
              "nullable": true
             },
             "hostname": {
              "type": "string",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Missing group_id in request body"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "group_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/device/commands/list": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "A device's recent commands (legacy)",
    "operationId": "post-v1-app-rmm-device-commands-list",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "commands": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "device_id": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "command": {
              "type": "string"
             },
             "data": {},
             "result": {
              "type": "string",
              "nullable": true
             },
             "display_name": {
              "type": "string",
              "nullable": true
             },
             "hostname": {
              "type": "string",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Missing device_id in request body"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/scripts": {
   "get": {
    "tags": [
     "Scripts"
    ],
    "summary": "List scripts (legacy)",
    "operationId": "get-v1-app-rmm-scripts",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "scripts": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer",
              "nullable": true
             },
             "name": {
              "type": "string"
             },
             "description": {
              "type": "string",
              "nullable": true
             },
             "language": {
              "type": "string"
             },
             "timeout_seconds": {
              "type": "integer"
             },
             "version": {
              "type": "integer"
             },
             "is_enabled": {
              "type": "boolean"
             },
             "is_global": {
              "type": "boolean"
             },
             "is_system": {
              "type": "boolean"
             },
             "created_at": {
              "type": "string",
              "format": "date-time"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "tenant_id is required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Scripts"
    ],
    "summary": "Create a script (legacy)",
    "operationId": "post-v1-app-rmm-scripts",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.scripts.manage`.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Missing required fields"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "language": {},
         "script_body": {},
         "timeout_seconds": {
          "type": "array",
          "items": {}
         }
        },
        "required": [
         "name",
         "language",
         "script_body"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/scripts/{id}": {
   "get": {
    "tags": [
     "Scripts"
    ],
    "summary": "Get a script (legacy)",
    "operationId": "get-v1-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "script": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "tenant_id is required"
     },
     "404": {
      "description": "Script not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Scripts"
    ],
    "summary": "Update a script (legacy)",
    "operationId": "put-v1-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.scripts.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "System/global scripts cannot be edited"
     },
     "404": {
      "description": "Script not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "language": {},
         "script_body": {},
         "timeout_seconds": {
          "type": "array",
          "items": {}
         },
         "is_enabled": {
          "type": "boolean"
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Scripts"
    ],
    "summary": "Delete a script (legacy)",
    "operationId": "delete-v1-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM. Permission (any of): `rmm.scripts.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "tenant_id is required"
     },
     "403": {
      "description": "System/global scripts cannot be deleted"
     },
     "404": {
      "description": "Script not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/rmm/scripts/run": {
   "post": {
    "tags": [
     "Scripts"
    ],
    "summary": "Run a script on a device (legacy)",
    "operationId": "post-v1-app-rmm-scripts-run",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "tenant_id, user_id, script_id and device_id are required"
     },
     "403": {
      "description": "Device does not belong to tenant"
     },
     "404": {
      "description": "User not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "script_id": {
          "type": "integer"
         },
         "device_id": {
          "type": "integer"
         },
         "script_args": {
          "type": "array",
          "items": {}
         }
        },
        "required": [
         "script_id",
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/app/rmm/device/terminal/session": {
   "post": {
    "tags": [
     "Remote access"
    ],
    "summary": "Open a remote terminal (legacy)",
    "operationId": "post-v1-app-rmm-device-terminal-session",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "session_id": {
             "type": "integer"
            },
            "device_id": {
             "type": "integer"
            },
            "hostname": {
             "type": "string"
            },
            "display_name": {
             "type": "string"
            },
            "launch_url": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id is required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer"
         }
        },
        "required": [
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/version/agent": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current agent version",
    "operationId": "get-v2-app-rmm-version-agent",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "latest": {},
          "legacy": {},
          "windows": {
           "type": "array",
           "items": {}
          },
          "linux": {},
          "macos": {},
          "remote": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/version": {
   "get": {
    "tags": [
     "Agent versions"
    ],
    "summary": "Current versions",
    "operationId": "get-v2-app-rmm-version",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "app_latest": {},
          "server_latest": {},
          "agent_latest": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/sites": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List sites and groups",
    "operationId": "get-v2-app-rmm-sites",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/groups": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List groups in a site",
    "operationId": "post-v2-app-rmm-groups",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "groups": {
           "type": "array",
           "items": {}
          },
          "site": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "site_id": {
          "type": "integer",
          "description": "The site."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/groups/{siteId}": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Fetch groups for a specific site (tenant-scoped)",
    "operationId": "get-v2-app-rmm-groups-siteid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "siteId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "groups": {
           "type": "array",
           "items": {}
          },
          "site": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/devices": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Body { site_id?, group_id?",
    "operationId": "post-v2-app-rmm-devices",
    "description": "Body { site_id?, group_id? } — RMM2's site/group selector (services/rmm-scope.js); neither = every device in the tenant.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "devices": {
           "type": "array",
           "items": {}
          },
          "group": {},
          "scope": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Get a device",
    "operationId": "get-v2-app-rmm-device-id",
    "description": "Everything RMM knows about one device — inventory, status, utilisation, signed-in user.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "The device's `device_id`."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "device": {},
          "utilization": {}
         }
        }
       }
      }
     },
     "403": {
      "description": "Unauthorized"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Update editable device fields",
    "operationId": "put-v2-app-rmm-device-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid site"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "display_name": {
          "type": "string"
         },
         "device_type": {
          "type": "string"
         },
         "site_id": {
          "type": "integer"
         },
         "group_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Remove a device from the dashboard immediately (hidden from every list/ get below) but defer the actual hard delete: queue the uninstall script, mark the dev…",
    "operationId": "delete-v2-app-rmm-device-id",
    "description": "Remove a device from the dashboard immediately (hidden from every list/ get below) but defer the actual hard delete: queue the uninstall script, mark the device pending_removal, and let services/rmm-device-cleanup.js finish the job once that command completes OR PENDING_REMOVAL_TIMEOUT_MINUTES passes, whichever's first. An offline device that comes back online later still gets uninstalled instead of becoming a silent orphan the dashboard can no longer reach — the earlier immediate-hard-delete version of this endpoint couldn't do that, since deleting device_commands+devices in the same request left nothing for a later check-in to find.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}/proxmox-config": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Save a Proxmox VE host's API login",
    "operationId": "post-v2-app-rmm-device-id-proxmox-config",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}/pbs-config": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Save a Proxmox Backup Server's API login",
    "operationId": "post-v2-app-rmm-device-id-pbs-config",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/hypervisor-hosts": {
   "get": {
    "tags": [
     "Virtualisation"
    ],
    "summary": "Tenant-wide list of devices flagged as Proxmox/PBS hosts, for the link picker on a device's Hypervisor tab and the site Backups tab",
    "operationId": "get-v2-app-rmm-hypervisor-hosts",
    "description": "Tenant-wide list of devices flagged as Proxmox/PBS hosts, for the link picker on a device's Hypervisor tab and the site Backups tab. Deliberately cross-site (see note above).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "proxmox": {
           "type": "array",
           "items": {}
          },
          "pbs": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/hypervisor-links": {
   "get": {
    "tags": [
     "Virtualisation"
    ],
    "summary": "List PVE ↔ PBS links",
    "operationId": "get-v2-app-rmm-hypervisor-links",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "links": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Virtualisation"
    ],
    "summary": "Link a PVE host to its backup server",
    "operationId": "post-v2-app-rmm-hypervisor-links",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "proxmox_device_id and pbs_device_id are required"
     },
     "404": {
      "description": "User not found"
     },
     "409": {
      "description": "These hosts are already linked"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "proxmox_device_id": {
          "type": "integer",
          "description": "The Proxmox VE host's device."
         },
         "pbs_device_id": {
          "type": "integer",
          "description": "The Proxmox Backup Server's device."
         }
        },
        "required": [
         "proxmox_device_id",
         "pbs_device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/hypervisor-links/{id}": {
   "delete": {
    "tags": [
     "Virtualisation"
    ],
    "summary": "Remove a PVE ↔ PBS link",
    "operationId": "delete-v2-app-rmm-hypervisor-links-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}/backup-status": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "ComputeGuestBackupPosture / summariseProxmoxHealth live in services/proxmox-health.js (shared with the check engine)",
    "operationId": "get-v2-app-rmm-device-id-backup-status",
    "description": "ComputeGuestBackupPosture / summariseProxmoxHealth live in services/proxmox-health.js (shared with the check engine). GET /device/:id/backup-status — per-guest backup posture for a single Proxmox host, using its own hypervisor-links. Powers the status shield next to each guest in the device page's Hypervisor tab.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "guests": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Not a Proxmox host"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/sites/{siteId}/backup-coverage": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Cross-references this site's Proxmox hosts against their linked PBS servers (which may live in a different site — see note above) to compute per-guest backup…",
    "operationId": "get-v2-app-rmm-sites-siteid-backup-coverage",
    "description": "Cross-references this site's Proxmox hosts against their linked PBS servers (which may live in a different site — see note above) to compute per-guest backup posture across the whole site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "siteId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "site": {},
          "proxmoxHosts": {
           "type": "array",
           "items": {}
          },
          "guests": {
           "type": "array",
           "items": {}
          },
          "summary": {
           "type": "object",
           "properties": {
            "protected": {
             "type": "integer"
            },
            "attention": {
             "type": "integer"
            },
            "unprotected": {
             "type": "integer"
            },
            "unlinked": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/virtualisation": {
   "get": {
    "tags": [
     "Virtualisation"
    ],
    "summary": "Everything RMM2's Virtualisation view needs in one call: each Proxmox host with its live guests (status, CPU, RAM from the agent's inventory) and each guest'…",
    "operationId": "get-v2-app-rmm-virtualisation",
    "description": "Everything RMM2's Virtualisation view needs in one call: each Proxmox host with its live guests (status, CPU, RAM from the agent's inventory) and each guest's backup posture (same computeGuestBackupPosture as backup-coverage), plus every PBS host as a backup target with its datastores. Tenant-wide unless site_id is given — a PBS host is always included when a listed PVE host links to it, wherever it lives.\n\nGuests are matched to the RMM device running inside them so the UI can open the agent's own device page: by NIC MAC first (the PVE agent reports each guest's MACs from its config since 6.12.0; every agent reports its own interfaces' MACs), then by name (guest name == the device's hostname or display name, case-insensitive, ignoring any domain suffix). An ambiguous MAC or name matches nothing rather than the wrong device.\n\nEach host also carries `issues` — its health (agent >= 6.12.0) reduced to error/warn/info lines by summariseProxmoxHealth.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "site_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "hosts": {
           "type": "array",
           "items": {}
          },
          "pbs": {
           "type": "array",
           "items": {}
          },
          "summary": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}/fetch-log": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Queues a fetch_log command — the agent reads its own local agent.log (tail, capped at ~200KB) and returns it as the command's stdout",
    "operationId": "post-v2-app-rmm-device-id-fetch-log",
    "description": "Queues a fetch_log command — the agent reads its own local agent.log (tail, capped at ~200KB) and returns it as the command's stdout. Returns the new command's id so the caller can poll /device/commands/list for it (same list the Command Log feed already reads) rather than needing a dedicated result-polling endpoint.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          },
          "command_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/{id}/refresh": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Queues a refresh_data command — the agent immediately re-posts heartbeat/utilization/full inventory instead of waiting for its normal 60s/30min timers",
    "operationId": "post-v2-app-rmm-device-id-refresh",
    "description": "Queues a refresh_data command — the agent immediately re-posts heartbeat/utilization/full inventory instead of waiting for its normal 60s/30min timers. Returns the new command's id so the caller can poll /device/commands/list for the ack, same pattern as fetch-log.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          },
          "command_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/maintenance/toggle": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Toggle maintenance mode for a device",
    "operationId": "post-v2-app-rmm-device-maintenance-toggle",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "is_maintenance": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer"
         }
        },
        "required": [
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/device/command": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Send a command to a device",
    "operationId": "post-v2-app-rmm-device-command",
    "description": "Queues a command for the device's agent; it's picked up on the next check-in. Read the output with `POST /v2/app/rmm/device/commands/list`.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id and command are required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer",
          "description": "The device."
         },
         "command": {
          "description": "The command name."
         },
         "data": {
          "description": "Its arguments."
         }
        },
        "required": [
         "device_id",
         "command"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/device/commands/list": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "A device's recent commands and their results",
    "operationId": "post-v2-app-rmm-device-commands-list",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "commands": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id is required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer",
          "description": "The device."
         }
        },
        "required": [
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/device/commands/{id}/output": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Output of a command archived to BRM-Blob (services/rmm-history.js); the list endpoints return output_archived = 1 and no output for those",
    "operationId": "get-v2-app-rmm-device-commands-id-output",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "404": {
      "description": "No archived output for this command"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/utilization/history": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Utilisation for a device over a date range (YYYY-MM-DD), including days archived to BRM-Blob",
    "operationId": "get-v2-app-rmm-device-utilization-history",
    "description": "Utilisation for a device over a date range (YYYY-MM-DD), including days archived to BRM-Blob. Points are [unix time, cpu, ram, disk, net].\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "device_id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "400": {
      "description": "device_id, from and to (YYYY-MM-DD) are required"
     },
     "404": {
      "description": "Device not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/group/commands/list": {
   "post": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "Command log for RMM2's site/group selection: body { site_id?, group_id?, limit } (neither = every device)",
    "operationId": "post-v2-app-rmm-group-commands-list",
    "description": "Command log for RMM2's site/group selection: body { site_id?, group_id?, limit } (neither = every device). Kept at /group/... for existing callers.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "commands": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/scripts": {
   "get": {
    "tags": [
     "Scripts"
    ],
    "summary": "List scripts",
    "operationId": "get-v2-app-rmm-scripts",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "scripts": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Scripts"
    ],
    "summary": "Create a script",
    "operationId": "post-v2-app-rmm-scripts",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          },
          "script_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "name, language, and script_body are required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The script's name."
         },
         "description": {
          "type": "string"
         },
         "language": {
          "description": "The interpreter, e.g. `bash`, `powershell`, `python`."
         },
         "script_body": {
          "description": "The script itself."
         },
         "timeout_seconds": {
          "type": "array",
          "items": {},
          "description": "Stop it after this many seconds."
         }
        },
        "required": [
         "name",
         "language",
         "script_body"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/script-categories": {
   "get": {
    "tags": [
     "Scripts"
    ],
    "summary": "List script folders",
    "operationId": "get-v2-app-rmm-script-categories",
    "description": "Read-only: folders are only created/renamed/deleted from BRM-Admin's Scripts tab. RMM2 just needs the tree to group the run-script picker.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "categories": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/scripts/{id}": {
   "get": {
    "tags": [
     "Scripts"
    ],
    "summary": "Get a script",
    "operationId": "get-v2-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "script": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Scripts"
    ],
    "summary": "Update a script",
    "operationId": "put-v2-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "System/global scripts cannot be edited"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "language": {},
         "script_body": {},
         "timeout_seconds": {
          "type": "array",
          "items": {}
         },
         "is_enabled": {
          "type": "boolean"
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Scripts"
    ],
    "summary": "Delete a script",
    "operationId": "delete-v2-app-rmm-scripts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "System/global scripts cannot be deleted"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/scripts/run": {
   "post": {
    "tags": [
     "Scripts"
    ],
    "summary": "Run a script on a device",
    "operationId": "post-v2-app-rmm-scripts-run",
    "description": "Needs `rmm.scripts.run`. Queues the script; its output appears in the device's command list.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "script_id and device_id are required"
     },
     "403": {
      "description": "Device does not belong to your tenant"
     },
     "404": {
      "description": "User not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "script_id": {
          "type": "number",
          "description": "The script."
         },
         "device_id": {
          "type": "integer",
          "description": "The device."
         },
         "script_args": {
          "type": "array",
          "items": {},
          "description": "Arguments for the script."
         }
        },
        "required": [
         "script_id",
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/enrollment/keys": {
   "get": {
    "tags": [
     "Devices, sites & groups"
    ],
    "summary": "List enrolment keys (for install commands)",
    "operationId": "get-v2-app-rmm-enrollment-keys",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "keys": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm/device/terminal/session": {
   "post": {
    "tags": [
     "Remote access"
    ],
    "summary": "Open a remote terminal",
    "operationId": "post-v2-app-rmm-device-terminal-session",
    "description": "Needs `rmm.remote.terminal`. Returns a short-lived token for Bramble Remote; the session is recorded.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "session_id": {
           "type": "integer"
          },
          "device_id": {
           "type": "integer"
          },
          "hostname": {
           "type": "string"
          },
          "display_name": {
           "type": "string"
          },
          "launch_url": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id is required"
     },
     "404": {
      "description": "User not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer",
          "description": "The device."
         }
        },
        "required": [
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm/device/vnc/session": {
   "post": {
    "tags": [
     "Remote access"
    ],
    "summary": "Open a remote screen (VNC)",
    "operationId": "post-v2-app-rmm-device-vnc-session",
    "description": "Needs `rmm.remote.vnc`. Returns a short-lived token for Bramble Remote; the session is recorded.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "session_id": {
           "type": "integer"
          },
          "device_id": {
           "type": "integer"
          },
          "hostname": {
           "type": "string"
          },
          "display_name": {
           "type": "string"
          },
          "launch_url": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "device_id is required"
     },
     "404": {
      "description": "User not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer",
          "description": "The device."
         }
        },
        "required": [
         "device_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-apps": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "?site_id=&group_id= (RMM2's selection) narrows the device counts",
    "operationId": "get-v2-app-rmm-apps",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "apps": {
           "type": "array",
           "items": {}
          },
          "platforms": {
           "type": "array",
           "items": {}
          },
          "managers": {
           "type": "array",
           "items": {}
          },
          "min_agent": {},
          "can": {
           "type": "object",
           "properties": {
            "manage": {},
            "deploy": {}
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/search": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "Search package sources",
    "operationId": "get-v2-app-rmm-apps-search",
    "description": "Searches winget, the Snap Store, Flathub and the apt/dnf repositories for an app to add.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/lookup": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "Check an exact package name",
    "operationId": "get-v2-app-rmm-apps-lookup",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [
     {
      "name": "manager",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "package": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/targets": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "Sites, groups and devices an app can be assigned to",
    "operationId": "get-v2-app-rmm-apps-targets",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {}
          },
          "groups": {
           "type": "array",
           "items": {}
          },
          "devices": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/apps": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Add an app to the catalogue",
    "operationId": "post-v2-app-rmm-apps-apps",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The app's name."
         },
         "publisher": {
          "description": "Who makes it."
         },
         "description": {
          "type": "string"
         },
         "sources": {
          "type": "array",
          "items": {},
          "description": "Where to install it from per platform, e.g. winget id, apt package, Flathub id."
         },
         "assignments": {
          "type": "array",
          "items": {},
          "description": "Who gets it: required / uninstall / exclude, for all devices, sites, groups or devices."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-apps/apps/{id}": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "Get an app",
    "operationId": "get-v2-app-rmm-apps-apps-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "404": {
      "description": "App not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Applications"
    ],
    "summary": "Update an app",
    "operationId": "put-v2-app-rmm-apps-apps-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "App not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "publisher": {},
         "description": {
          "type": "string"
         },
         "sources": {
          "type": "array",
          "items": {}
         },
         "assignments": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Applications"
    ],
    "summary": "Remove an app from the catalogue",
    "operationId": "delete-v2-app-rmm-apps-apps-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "App not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/apps/{id}/installers": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Start uploading an installer (Windows MSI/EXE)",
    "operationId": "post-v2-app-rmm-apps-apps-id-installers",
    "description": "Returns an upload id. Send the file in parts with the `PUT …/parts/:n` endpoint, then call `…/complete`.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "file_name": {
          "type": "string",
          "description": "The installer's file name."
         },
         "size": {
          "type": "integer",
          "description": "Its size in bytes."
         },
         "version": {
          "description": "The app version it installs."
         },
         "args": {
          "type": "array",
          "items": {},
          "description": "Silent-install arguments."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-apps/apps/{id}/installers/{iid}/parts/{n}": {
   "put": {
    "tags": [
     "Applications"
    ],
    "summary": "Upload one part of an installer",
    "operationId": "put-v2-app-rmm-apps-apps-id-installers-iid-parts-n",
    "description": "The request body is the raw bytes of part `n`.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "iid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "n",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/apps/{id}/installers/{iid}/complete": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Finish an installer upload",
    "operationId": "post-v2-app-rmm-apps-apps-id-installers-iid-complete",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "iid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "boolean"
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/apps/{id}/installers/{iid}": {
   "delete": {
    "tags": [
     "Applications"
    ],
    "summary": "Delete an uploaded installer",
    "operationId": "delete-v2-app-rmm-apps-apps-id-installers-iid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "iid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/apps/{id}/sync": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Push an app's assignments to devices now",
    "operationId": "post-v2-app-rmm-apps-apps-id-sync",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "queued": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "App not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/device/{deviceId}": {
   "get": {
    "tags": [
     "Applications"
    ],
    "summary": "A device's managed apps and their state",
    "operationId": "get-v2-app-rmm-apps-device-deviceid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.view`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "can": {
           "type": "object",
           "properties": {
            "manage": {},
            "deploy": {}
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Device not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/device/{deviceId}/install": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Install an app on a device once",
    "operationId": "post-v2-app-rmm-apps-device-deviceid-install",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.deploy`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/device/{deviceId}/uninstall": {
   "post": {
    "tags": [
     "Applications"
    ],
    "summary": "Uninstall an app from a device",
    "operationId": "post-v2-app-rmm-apps-device-deviceid-uninstall",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.deploy`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-apps/device/{deviceId}/apps/{appId}": {
   "delete": {
    "tags": [
     "Applications"
    ],
    "summary": "Clear an app's state on a device",
    "operationId": "delete-v2-app-rmm-apps-device-deviceid-apps-appid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.apps.manage`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "appId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "removed": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups": {
   "get": {
    "tags": [
     "Backups"
    ],
    "summary": "Backup overview",
    "operationId": "get-v2-app-rmm-backups",
    "description": "Every device's file, whole-device and database backups, plus Proxmox guest coverage.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "min_agent": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/devices/{id}": {
   "get": {
    "tags": [
     "Backups"
    ],
    "summary": "A device's backup jobs and history",
    "operationId": "get-v2-app-rmm-backups-devices-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/devices/{id}/jobs": {
   "post": {
    "tags": [
     "Backups"
    ],
    "summary": "Create a backup job",
    "operationId": "post-v2-app-rmm-backups-devices-id-jobs",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "job": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/jobs/{id}": {
   "put": {
    "tags": [
     "Backups"
    ],
    "summary": "Update a backup job",
    "operationId": "put-v2-app-rmm-backups-jobs-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "job": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Backups"
    ],
    "summary": "Delete a backup job",
    "operationId": "delete-v2-app-rmm-backups-jobs-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/jobs/{id}/run": {
   "post": {
    "tags": [
     "Backups"
    ],
    "summary": "Back up now",
    "operationId": "post-v2-app-rmm-backups-jobs-id-run",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "full": {
          "description": "`true` takes a full backup instead of an incremental."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-backups/runs/{id}/browse": {
   "get": {
    "tags": [
     "Backups"
    ],
    "summary": "Browse the files in a backup",
    "operationId": "get-v2-app-rmm-backups-runs-id-browse",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "path",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/runs/{id}/download": {
   "get": {
    "tags": [
     "Backups"
    ],
    "summary": "Download a backup",
    "operationId": "get-v2-app-rmm-backups-runs-id-download",
    "description": "Needs `rmm.backups.download`; audited.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/runs/{id}": {
   "delete": {
    "tags": [
     "Backups"
    ],
    "summary": "Delete a backup",
    "operationId": "delete-v2-app-rmm-backups-runs-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-backups/runs/{id}/restore": {
   "post": {
    "tags": [
     "Backups"
    ],
    "summary": "Restore from a backup",
    "operationId": "post-v2-app-rmm-backups-runs-id-restore",
    "description": "Needs `rmm.backups.restore`; audited. Restores to the same device or another with the same OS.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.backups.restore`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "target_device_id": {
          "type": "integer",
          "description": "The device to restore to."
         },
         "paths": {
          "type": "array",
          "items": {},
          "description": "Files and folders to restore (empty for everything)."
         },
         "destination": {
          "type": "string",
          "description": "`original` (where they came from) or `folder`."
         },
         "folder": {
          "description": "The folder to restore into, with `destination: folder`."
         },
         "overwrite": {
          "description": "Replace files that already exist."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-checks/checks": {
   "get": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "List monitoring checks",
    "operationId": "get-v2-app-rmm-checks-checks",
    "description": "List monitoring checks. Requires an active RMM license. Returns every check configured for the tenant, each annotated with its action count, assignment count, and number of currently firing alerts.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "checks": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Create a monitoring check",
    "operationId": "post-v2-app-rmm-checks-checks",
    "description": "Create a monitoring check. Requires an active RMM license. Creates the check row, then any provided notification actions and scope assignments in the same request.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          },
          "check_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "name, check_type and check_config are required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "check_type": {
          "type": "string"
         },
         "check_config": {},
         "severity": {},
         "actions": {
          "type": "array",
          "items": {}
         },
         "assignments": {
          "type": "array",
          "items": {}
         }
        },
        "required": [
         "name",
         "check_type",
         "check_config"
        ]
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-checks/checks/{id}": {
   "get": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Get a single check with its actions and assignments",
    "operationId": "get-v2-app-rmm-checks-checks-id",
    "description": "Get a single check with its actions and assignments. Requires an active RMM license. Returns the check row plus its notification actions and its site/group/device scope assignments (with resolved site/group/device names where applicable).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "check": {},
          "actions": {
           "type": "array",
           "items": {}
          },
          "assignments": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Update a check. Requires an active RMM license",
    "operationId": "put-v2-app-rmm-checks-checks-id",
    "description": "Update a check. Requires an active RMM license. Updates the check's fields, and if `actions` or `assignments` arrays are provided, fully replaces the existing rows for that check (delete-then-reinsert).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Unknown action_type"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "check_type": {
          "type": "string"
         },
         "check_config": {},
         "severity": {},
         "actions": {
          "type": "array",
          "items": {}
         },
         "assignments": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Delete a check. Requires an active RMM license",
    "operationId": "delete-v2-app-rmm-checks-checks-id",
    "description": "Delete a check. Requires an active RMM license. Also deletes any rmm_probe_results rows for this check first, since that table has no FK back to rmm_checks. Actions and assignments cascade via FK ON DELETE CASCADE.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/checks/{id}/toggle": {
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Toggle a check's enabled/disabled state",
    "operationId": "post-v2-app-rmm-checks-checks-id-toggle",
    "description": "Toggle a check's enabled/disabled state. Requires an active RMM license. Flips `is_enabled` in place (SQL `NOT is_enabled`) — does not report whether the resulting state is enabled or disabled.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/device/{deviceId}/checks": {
   "get": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "List checks that apply to a device",
    "operationId": "get-v2-app-rmm-checks-device-deviceid-checks",
    "description": "List checks that apply to a device. Requires an active RMM license. Resolves checks assigned directly to the device, to its group, or to its site, and annotates each with whether it's excluded for this device (rmm_check_exclusions) and whether it currently has a firing alert for this device.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "checks": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/device/{deviceId}/exclude/{checkId}": {
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Toggle exclusion of a check for a specific device",
    "operationId": "post-v2-app-rmm-checks-device-deviceid-exclude-checkid",
    "description": "Toggle exclusion of a check for a specific device. Requires an active RMM license. Pauses (or un-pauses) evaluation of a check for this one device only, without touching the check's broader site/group/device assignments.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "checkId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "excluded": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/device/{deviceId}/assign/{checkId}": {
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Assign an existing check directly to a device",
    "operationId": "post-v2-app-rmm-checks-device-deviceid-assign-checkid",
    "description": "Assign an existing check directly to a device. Requires an active RMM license. Creates a `device`-scoped rmm_check_assignments row for this check. Fails if the check is already directly assigned to this device.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "checkId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "409": {
      "description": "Already assigned"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/alerts": {
   "get": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "List recent alert log entries",
    "operationId": "get-v2-app-rmm-checks-alerts",
    "description": "List recent alert log entries. Requires an active RMM license. Returns the most recent 200 alert log rows for the tenant (both firing and resolved), newest first.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "alerts": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/alerts/{id}/resolve": {
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Manually resolve (dismiss) a firing alert",
    "operationId": "post-v2-app-rmm-checks-alerts-id-resolve",
    "description": "Manually resolve (dismiss) a firing alert. Requires an active RMM license. Marks the alert row `resolved` and stamps `resolved_at`. Only affects alerts currently in `firing` status.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-checks/alerts/acknowledge": {
   "post": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "Acknowledge firing alerts",
    "operationId": "post-v2-app-rmm-checks-alerts-acknowledge",
    "description": "Acknowledge firing alerts. \"Requires an active RMM license. Marks firing alerts as seen (acknowledged_at, acknowledged_by); they stay firing and resolve themselves when the check passes. Send ids (an array of alert IDs), or all = true for every firing alert; add undo = true to clear the acknowledgement.\"\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "changed": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Choose alerts to acknowledge"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "ids": {
          "type": "array",
          "items": {}
         },
         "all": {},
         "undo": {}
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-checks/alerts/active": {
   "get": {
    "tags": [
     "Checks & alerts"
    ],
    "summary": "List currently firing alerts",
    "operationId": "get-v2-app-rmm-checks-alerts-active",
    "description": "List currently firing alerts. Requires an active RMM license. Returns all alert log rows for the tenant with status `firing`, newest first.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "alerts": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-dashboards": {
   "get": {
    "tags": [
     "Dashboards"
    ],
    "summary": "List dashboards",
    "operationId": "get-v2-app-rmm-dashboards",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dashboards": {
           "type": "array",
           "items": {}
          },
          "sources": {
           "type": "array",
           "items": {}
          },
          "templates": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "app": {}
            }
           }
          },
          "can_manage_shared": {
           "type": "boolean"
          },
          "me": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Dashboards"
    ],
    "summary": "Create a dashboard",
    "operationId": "post-v2-app-rmm-dashboards",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dashboard": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "Unknown template"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "template": {},
         "widgets": {
          "type": "array",
          "items": {}
         },
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-dashboards/query": {
   "post": {
    "tags": [
     "Dashboards"
    ],
    "summary": "?site_id=&group_id= — RMM2's site/group selection; every widget follows it (sources with no site, like network scan findings, cover the organisation)",
    "operationId": "post-v2-app-rmm-dashboards-query",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "403": {
      "description": "You can't use that data source"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-dashboards/values": {
   "post": {
    "tags": [
     "Dashboards"
    ],
    "summary": "Values a field can take (for widget filters)",
    "operationId": "post-v2-app-rmm-dashboards-values",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "values": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "You can't use that data source"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "source": {},
         "field": {}
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-dashboards/{id}": {
   "put": {
    "tags": [
     "Dashboards"
    ],
    "summary": "Update a dashboard",
    "operationId": "put-v2-app-rmm-dashboards-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dashboard": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "shared": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Dashboards"
    ],
    "summary": "Delete a dashboard",
    "operationId": "delete-v2-app-rmm-dashboards-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-dashboards/{id}/duplicate": {
   "post": {
    "tags": [
     "Dashboards"
    ],
    "summary": "Copy a dashboard",
    "operationId": "post-v2-app-rmm-dashboards-id-duplicate",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dashboard": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Dashboard not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases": {
   "get": {
    "tags": [
     "Databases"
    ],
    "summary": "Database servers overview",
    "operationId": "get-v2-app-rmm-databases",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "servers": {
           "type": "array",
           "items": {}
          },
          "min_agent": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/devices/{id}": {
   "get": {
    "tags": [
     "Databases"
    ],
    "summary": "A server's databases, backups and settings",
    "operationId": "get-v2-app-rmm-databases-devices-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/devices/{id}/settings": {
   "put": {
    "tags": [
     "Databases"
    ],
    "summary": "Set a server's backup settings",
    "operationId": "put-v2-app-rmm-databases-devices-id-settings",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "settings": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "schedule_time": {
          "description": "Time of day, `HH:MM`."
         },
         "schedule_days": {
          "type": "array",
          "items": {},
          "description": "Days of the week."
         },
         "schedule_enabled": {
          "type": "boolean",
          "description": "Back up on a schedule."
         },
         "include_system": {
          "type": "boolean",
          "description": "Include system databases."
         },
         "databases": {
          "type": "array",
          "items": {},
          "description": "Which databases (empty for all)."
         },
         "login_password": {
          "description": "Its password."
         },
         "login_user": {
          "type": "string",
          "description": "A MySQL login to use (stored encrypted)."
         },
         "keep_daily": {
          "description": "Days of daily backups to keep."
         },
         "keep_weekly": {
          "description": "Weeks of weekly backups to keep."
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-databases/devices/{id}/backup": {
   "post": {
    "tags": [
     "Databases"
    ],
    "summary": "Back up databases now",
    "operationId": "post-v2-app-rmm-databases-devices-id-backup",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "databases": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-databases/devices/{id}/refresh": {
   "post": {
    "tags": [
     "Databases"
    ],
    "summary": "Refresh a server's overview now",
    "operationId": "post-v2-app-rmm-databases-devices-id-refresh",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/backups/{id}/download": {
   "get": {
    "tags": [
     "Databases"
    ],
    "summary": "Download a database backup",
    "operationId": "get-v2-app-rmm-databases-backups-id-download",
    "description": "Needs `rmm.databases.download`; audited.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/backups/{id}": {
   "delete": {
    "tags": [
     "Databases"
    ],
    "summary": "Delete a database backup",
    "operationId": "delete-v2-app-rmm-databases-backups-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.manage`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/backups/{id}/open": {
   "post": {
    "tags": [
     "Databases"
    ],
    "summary": "Opening a backup to look at its data: like a download, it shows everything",
    "operationId": "post-v2-app-rmm-databases-backups-id-open",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "mount": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "hours": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-databases/mounts/{id}": {
   "delete": {
    "tags": [
     "Databases"
    ],
    "summary": "Close an opened backup",
    "operationId": "delete-v2-app-rmm-databases-mounts-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "mount": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-databases/mounts/{id}/query": {
   "post": {
    "tags": [
     "Databases"
    ],
    "summary": "Browse an opened backup",
    "operationId": "post-v2-app-rmm-databases-mounts-id-query",
    "description": "Lists tables, or reads rows of one table (sort, filter, up to 10,000 rows for CSV). Read-only.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "op": {
          "type": "string",
          "enum": [
           "tables",
           "rows"
          ]
         },
         "table": {
          "type": "string"
         },
         "offset": {
          "type": "integer"
         },
         "limit": {
          "type": "integer"
         },
         "sort": {
          "type": "string"
         },
         "dir": {
          "type": "string"
         },
         "filter_col": {
          "type": "string"
         },
         "filter": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-databases/mounts/{id}/queries/{qid}": {
   "get": {
    "tags": [
     "Databases"
    ],
    "summary": "Result of a browse request",
    "operationId": "get-v2-app-rmm-databases-mounts-id-queries-qid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.databases.download`.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "qid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-logs": {
   "get": {
    "tags": [
     "Logs"
    ],
    "summary": "Log collectors and recent logs",
    "operationId": "get-v2-app-rmm-logs",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.logs.view`.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "collectors": {
           "type": "array",
           "items": {}
          },
          "candidates": {
           "type": "array",
           "items": {}
          },
          "stats": {
           "type": "array",
           "items": {}
          },
          "settings": {},
          "can_manage": {
           "type": "boolean"
          },
          "severities": {
           "type": "array",
           "items": {}
          },
          "min_agent": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-logs/search": {
   "get": {
    "tags": [
     "Logs"
    ],
    "summary": "Search collected logs",
    "operationId": "get-v2-app-rmm-logs-search",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.logs.view`.",
    "parameters": [
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "max_sev",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "device_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "app",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "400": {
      "description": "Choose a valid time range"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-logs/collectors/{deviceId}": {
   "put": {
    "tags": [
     "Logs"
    ],
    "summary": "Turn a device into a syslog collector",
    "operationId": "put-v2-app-rmm-logs-collectors-deviceid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.logs.manage`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "udp_port": {
          "description": "UDP port to listen on."
         },
         "tcp_port": {
          "description": "TCP port to listen on."
         },
         "enabled": {
          "type": "boolean",
          "description": "Collect logs."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Logs"
    ],
    "summary": "Stop a syslog collector",
    "operationId": "delete-v2-app-rmm-logs-collectors-deviceid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Permission (any of): `rmm.logs.manage`.",
    "parameters": [
     {
      "name": "deviceId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-monitor/monitors": {
   "get": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "List with 24h uptime and a 60-minute latency spark",
    "operationId": "get-v2-app-rmm-network-monitor-monitors",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "monitors": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "{ discovered_device_id } to adopt a discovered device, or { probe_device_id, ip_address, name } to add one by IP",
    "operationId": "post-v2-app-rmm-network-monitor-monitors",
    "description": "{ discovered_device_id } to adopt a discovered device, or { probe_device_id, ip_address, name } to add one by IP. Optional settings as in PUT.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "A valid IPv4 address is required"
     },
     "404": {
      "description": "Discovered device not found"
     },
     "409": {
      "description": "Already monitored"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "discovered_device_id": {
          "type": "integer"
         },
         "name": {
          "type": "string"
         },
         "probe_device_id": {
          "type": "integer"
         },
         "ip_address": {},
         "check_ping": {
          "type": "boolean"
         },
         "tcp_ports": {
          "type": "array",
          "items": {}
         },
         "snmp_enabled": {},
         "snmp_version": {
          "type": "string"
         },
         "snmp_community": {},
         "snmp_v3": {}
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-network-monitor/monitors/{id}": {
   "get": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "Detail: interfaces (latest rates) + 24h reachability",
    "operationId": "get-v2-app-rmm-network-monitor-monitors-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "hours",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "monitor": {},
          "interfaces": {
           "type": "array",
           "items": {}
          },
          "samples": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "t": {},
             "up": {
              "type": "number",
              "nullable": true
             },
             "latency_ms": {
              "type": "number",
              "nullable": true
             },
             "loss_pct": {}
            }
           }
          },
          "bucket_minutes": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Monitor not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "Name, is_enabled, is_maintenance, check_ping, tcp_ports, snmp_enabled, snmp_version, snmp_community, snmp_v3",
    "operationId": "put-v2-app-rmm-network-monitor-monitors-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Monitor not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "is_enabled": {
          "type": "boolean"
         },
         "is_maintenance": {
          "type": "boolean"
         },
         "check_ping": {},
         "tcp_ports": {
          "type": "array",
          "items": {}
         },
         "snmp_enabled": {},
         "snmp_version": {
          "type": "string"
         },
         "snmp_community": {
          "type": "string"
         },
         "snmp_community_clear": {},
         "snmp_v3": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "Delete a monitor",
    "operationId": "delete-v2-app-rmm-network-monitor-monitors-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Monitor not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-monitor/monitors/{id}/interfaces/{ifIndex}": {
   "get": {
    "tags": [
     "Network monitoring"
    ],
    "summary": "Traffic history for one port",
    "operationId": "get-v2-app-rmm-network-monitor-monitors-id-interfaces-ifindex",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "ifIndex",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "hours",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "samples": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "t": {
              "type": "string",
              "format": "date-time"
             },
             "in_bps": {
              "type": "integer",
              "nullable": true
             },
             "out_bps": {
              "type": "integer",
              "nullable": true
             },
             "in_errors": {
              "type": "integer",
              "nullable": true
             },
             "out_errors": {
              "type": "integer",
              "nullable": true
             },
             "oper_up": {
              "type": "boolean",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Monitor not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/device/{id}/promote": {
   "post": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Promote a device to a Network Probe",
    "operationId": "post-v2-app-rmm-network-probe-device-id-promote",
    "description": "Promote a device to a Network Probe. Requires an active RMM license. Sets devices.is_network_probe = 1 and upserts a row in rmm_network_probes (enabled), so the device begins subnet-scanning its own network plus any configured extra subnets.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "is_network_probe": {
           "type": "boolean"
          },
          "probe": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/device/{id}/demote": {
   "post": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Demote a device from Network Probe",
    "operationId": "post-v2-app-rmm-network-probe-device-id-demote",
    "description": "Demote a device from Network Probe. Requires an active RMM license. Sets devices.is_network_probe = 0 and disables the rmm_network_probes row. This pauses future scanning only — the config row and any already-discovered devices are kept, and re-promoting later restores the same config.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "is_network_probe": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/device/{id}": {
   "get": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Get a device's Network Probe status and configuration",
    "operationId": "get-v2-app-rmm-network-probe-device-id",
    "description": "Get a device's Network Probe status and configuration. Requires an active RMM license. If the device is not a promoted probe, returns just is_network_probe=false. Otherwise also returns the probe's scan config/status plus a display-only list of subnets detected from the device's last-known network inventory (not what's actually sent to the agent to scan — the agent recomputes its own subnets at scan time).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "is_network_probe": {
           "type": "boolean"
          },
          "probe": {
           "type": "object",
           "properties": {
            "extra_subnets": {
             "type": "array",
             "items": {}
            },
            "snmp_community": {
             "type": "string"
            },
            "is_enabled": {
             "type": "boolean"
            },
            "last_scan_at": {},
            "last_scan_status": {
             "type": "string"
            },
            "last_scan_host_count": {},
            "last_scan_error": {},
            "pending_scan_command_id": {},
            "scan_interval_minutes": {},
            "next_scan_at": {}
           }
          },
          "detected_subnets": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/device/{id}/config": {
   "post": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Save a Network Probe's scan configuration",
    "operationId": "post-v2-app-rmm-network-probe-device-id-config",
    "description": "Save a Network Probe's scan configuration. Requires an active RMM license. Device must already be a promoted probe. Each entry in extra_subnets is validated as a CIDR (e.g. 10.20.30.0/24). scan_interval_minutes is floored to a minimum of 15 when set (to avoid overlapping scans); null/0 disables auto-scan and clears the scheduled next_scan_at.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "\"…\" is not a valid subnet (expected e.g. 10.20.30.0/24)"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "extra_subnets": {
          "type": "array",
          "items": {}
         },
         "snmp_community": {},
         "is_enabled": {
          "type": "boolean"
         },
         "scan_interval_minutes": {
          "type": "number"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-network-probe/device/{id}/scan-now": {
   "post": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Trigger an immediate subnet scan",
    "operationId": "post-v2-app-rmm-network-probe-device-id-scan-now",
    "description": "Trigger an immediate subnet scan. Requires an active RMM license. Dispatches a `subnet_scan` device_commands row for this probe (shared dispatch logic also used by the recurring scheduler). Rejected if scanning is disabled for the probe, or if a prior scan for it is still genuinely in flight and within its timeout window.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "command_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     },
     "result.status": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/device/{id}/ping": {
   "post": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Run an ad-hoc ping against a single host via a Network Probe",
    "operationId": "post-v2-app-rmm-network-probe-device-id-ping",
    "description": "Run an ad-hoc ping against a single host via a Network Probe. Requires an active RMM license. A simpler, distinct tool from Scan Now — dispatches a `network_probe` / `ping_check` device_commands row directly to the probe device with no associated rmm_checks/rmm_probe_results row, so it's invisible to the recurring checker/scheduler.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "command_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "host is required"
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "host": {}
        }
       }
      }
     }
    }
   }
  },
  "/v2/app/rmm-network-probe/groups/{groupId}/discovered-devices": {
   "get": {
    "tags": [
     "Network discovery"
    ],
    "summary": "List discovered (non-agent) devices for a site group",
    "operationId": "get-v2-app-rmm-network-probe-groups-groupid-discovered-devices",
    "description": "List discovered (non-agent) devices for a site group. Requires an active RMM license. Returns rmm_network_discovered_devices rows for the group (switches, printers, APs, unmanaged boxes found by scans), each annotated with the discovering probe's hostname/display name, plus the list of Network Probes active in that group with their last scan status.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "groupId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "devices": {
           "type": "array",
           "items": {}
          },
          "probes": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/discovered-devices": {
   "get": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Same as the group listing above, for RMM2's site/group selection: one group, a whole site, or (neither) every site",
    "operationId": "get-v2-app-rmm-network-probe-discovered-devices",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "devices": {
           "type": "array",
           "items": {}
          },
          "probes": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v2/app/rmm-network-probe/discovered-device/{id}": {
   "get": {
    "tags": [
     "Network discovery"
    ],
    "summary": "Get full detail for one discovered network device",
    "operationId": "get-v2-app-rmm-network-probe-discovered-device-id",
    "description": "Get full detail for one discovered network device. Requires an active RMM license. Same enrichment as the group listing (vendor via OUI lookup, best-guess device type, \"has agent installed\" cross-reference against the devices table) plus every probe currently reporting this device (seen_by_probe_device_ids) resolved to hostname/display_name.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: RMM.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "device": {},
          "seen_by_probes": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  }
 }
}