{
  "openapi": "3.1.0",
  "info": {
    "title": "LiMDM Admin API",
    "version": "1",
    "description": "REST API of the LiMDM console. Every action runs through the same functions as the console, with the same role rules, validation and audit entries. Authenticate with an API token from the console (Administration, API tokens) as a bearer token. The console app (/app/) uses the session cookie instead: every request must come from the console origin (Origin, Sec-Fetch-Site) and every state change must carry the CSRF token of GET /api/v1/me in the X-CSRF-Token header. Errors are RFC 9457 problem details. Lists are paged with limit and an opaque cursor. Each token may send 600 requests per minute; failed authentications are limited to 20 per client address in five minutes. Tenants: a token created in a tenant (multi tenancy, see docs/tenants.md) sees and changes only that tenant's devices, commands, library items, blueprints, tags and audit entries; shared library items and blueprints of the Default tenant are readable but not writable, and objects of other tenants answer 404. Global tokens see every tenant. Metrics need a global token. List conventions (devices is the reference): filter takes the query language (free words, key:value, key:\"quoted value\", every term must match), sort takes a field with - for descending, cursor continues a page from next_cursor, and <list>/facets answers counts per value for the same filter. Trying it out: the reference at /api/v1/docs sends real requests to this server under your role, tenant and scope, with the same audit rules as the console. Start with GET calls; calls marked Warning change devices or delete data."
  },
  "servers": [
    {
      "url": "/",
      "description": "The console's public URL"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "session": []
    }
  ],
  "tags": [
    {
      "name": "Devices",
      "description": "Fleet inventory, device details, tags, saved filters and the commands queued for devices."
    },
    {
      "name": "Remote shell",
      "description": "Recorded remote shell sessions on devices."
    },
    {
      "name": "Enrollment",
      "description": "Enrollment tokens and the install data for new devices."
    },
    {
      "name": "Compliance",
      "description": "Compliance results, checks, history and risk exceptions."
    },
    {
      "name": "Configuration",
      "description": "Library items, blueprints, declaration schemas, versions, previews and pilot rollouts."
    },
    {
      "name": "Software",
      "description": "Software catalog, Flathub, app requests, Flatpak remotes and the package repository."
    },
    {
      "name": "Updates",
      "description": "Security updates, update rings and waves, CVE feeds and agent releases."
    },
    {
      "name": "Vulnerabilities",
      "description": "CVEs of the devices in scope and their risk acceptances."
    },
    {
      "name": "Logs",
      "description": "Central log search, archive and log alert rules."
    },
    {
      "name": "Audit and activity",
      "description": "Audit log with its hash chain, the activity stream and evidence exports."
    },
    {
      "name": "Reports",
      "description": "Scheduled reports and their runs."
    },
    {
      "name": "Statistics",
      "description": "Dashboard figures of the fleet, compliance, updates and tenants."
    },
    {
      "name": "Approvals",
      "description": "Four eyes approval requests."
    },
    {
      "name": "Access",
      "description": "API tokens, console users and the directory (SCIM, Google Workspace)."
    },
    {
      "name": "Tenants",
      "description": "Tenants, the tenant view and shared objects."
    },
    {
      "name": "Settings",
      "description": "Server settings, keys, backup, notification channels and the network CA."
    },
    {
      "name": "Session",
      "description": "The caller, own profile, live events and the glossary."
    },
    {
      "name": "Meta",
      "description": "This document, the reference page and Prometheus metrics."
    }
  ],
  "paths": {
    "/api/v1/devices": {
      "get": {
        "operationId": "listDevices",
        "summary": "List devices",
        "description": "All filters given apply together. Any API role except metrics.",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1000
            },
            "description": "Query language: free words match host name, OS, id, blueprint or tags; keys status (compliant, in-grace, non-compliant, stale, pending, retired, locked), os, kind (desktop, server), tag, blueprint, agent, check (failing check id), pkg (name with optional version comparison), app, flatpak, remote, seen (>7d older, <2h newer; m, h, d). Example: status:non-compliant os:\"Ubuntu 24\" tag:prod. German names work too: zustand, system, schlagwort, pruefung, paket, zuletzt, offline (offline:7d), art; status konform, nicht-konform, in-karenz, veraltet, offline, ausstehend, ausgemustert, gesperrt; art arbeitsplatz, laptop, server. Unknown keys are an error."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hostname",
                "-hostname",
                "os",
                "-os",
                "agent",
                "-agent",
                "failing",
                "-failing",
                "last_seen",
                "-last_seen"
              ]
            },
            "description": "Sort field, - for descending; default hostname. The cursor belongs to the sort it came with."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Substring of host name, OS, id, blueprint or tag, case insensitive"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "compliant",
                "in grace",
                "non-compliant",
                "stale",
                "pending",
                "retired"
              ]
            },
            "description": "Device status"
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Device tag"
          },
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Catalog app id that is installed"
          },
          {
            "name": "flatpak",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Installed Flatpak application id"
          },
          {
            "name": "remote",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Configured Flatpak remote name"
          },
          {
            "name": "blueprint",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Effective blueprint name"
          },
          {
            "name": "agent",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Agent version"
          },
          {
            "name": "failing",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Id of a failing compliance check"
          },
          {
            "name": "pkg",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Installed package, optionally with a version comparison: openssl, openssl < 3.0.13 (operators < <= = != >= >). Versions compare by their runs of digits; the epoch is ignored."
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Device id"
        }
      ],
      "get": {
        "operationId": "getDevice",
        "summary": "Get a device with its inventory",
        "description": "Any API role except metrics.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Device"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "patch": {
        "operationId": "updateDevice",
        "summary": "Change tags, blueprint, desktop users and primary user",
        "description": "Fields left out stay unchanged; blueprint_id null assigns the default blueprint, primary_user empty clears it. Audited as device.assign. Role admin, not read only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevicePatch"
              },
              "example": {
                "tags": [
                  "prod",
                  "berlin"
                ],
                "primary_user": "jane@example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Device"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteDevice",
        "summary": "Delete a retired device for good",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Deletes the device with its events, metrics, commands, recovery keys and app requests. Audited as device.delete. Role admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The host name"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/commands": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Device id"
        }
      ],
      "get": {
        "operationId": "listDeviceCommands",
        "summary": "List a device's commands, newest first",
        "description": "Any API role except metrics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "enqueueCommand",
        "summary": "Queue a command",
        "description": "Warning: queues a command on a real device; wipe, lost mode, reboot, shutdown and scripts act on the machine and wipe cannot be undone. Same commands and rules as the console: scripts, lost mode, wipe, allow_uninstall, user, software and app commands need the admin role; lost and wipe need confirm set to the host name. Audited as command.<type>. Roles admin and helpdesk, not read only. With four eyes approval on (wipe, lost mode, scripts) nothing is queued: the answer is 202 with the approval_id of a pending request that another admin decides in the console or through /api/v1/approvals/{id}. sync is accepted once per device and 30 seconds (429 with Retry-After otherwise); workload_action is refused with 409 while another action for the same workload or 5 actions in all wait for the device.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandRequest"
              },
              "example": {
                "type": "sync"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued (a Command), or, when the command needs four eyes approval, an approval request (ApprovalPending) with Location /api/v1/approvals/{id}",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Command"
                    },
                    {
                      "$ref": "#/components/schemas/ApprovalPending"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Path of the new resource"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Repeating the request with the same key within 24 hours returns the first answer (header Idempotent-Replayed: true) instead of queuing again; the same key with another request is 422, one still running 409."
          }
        ],
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/commands/{id}": {
      "get": {
        "operationId": "getCommand",
        "summary": "Get a command's status",
        "description": "Any API role except metrics.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Command"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/library-items": {
      "get": {
        "operationId": "listLibraryItems",
        "summary": "List library items",
        "description": "Any API role except metrics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItemPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createLibraryItem",
        "summary": "Create a library item",
        "description": "Validated and signed like in the console, audited as library.save. Role admin, not read only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryItem"
              },
              "example": {
                "name": "base packages",
                "type": "com.limdm.packages",
                "description": "Tools on every device",
                "payload": {
                  "install": [
                    "htop"
                  ],
                  "remove": [
                    "telnet"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Path of the new resource"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/library-items/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      ],
      "get": {
        "operationId": "getLibraryItem",
        "summary": "Get a library item",
        "description": "Any API role except metrics.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "send it as If-Match with a PUT"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "put": {
        "operationId": "replaceLibraryItem",
        "summary": "Replace a library item",
        "description": "Audited as library.save. Role admin, not read only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryItem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "ETag of the version the change is based on; another version answers 412"
          }
        ],
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteLibraryItem",
        "summary": "Delete a library item no blueprint uses",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Audited as library.delete. Role admin, not read only.",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/blueprints": {
      "get": {
        "operationId": "listBlueprints",
        "summary": "List blueprints",
        "description": "Any API role except metrics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueprintPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createBlueprint",
        "summary": "Create a blueprint",
        "description": "Audited as blueprint.save. Role admin, not read only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlueprintInput"
              },
              "example": {
                "name": "workstations",
                "description": "Office desktops",
                "parent_id": null,
                "tree": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blueprint"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "Path of the new resource"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/blueprints/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      ],
      "get": {
        "operationId": "getBlueprint",
        "summary": "Get a blueprint",
        "description": "Any API role except metrics.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blueprint"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "send it as If-Match with a PUT"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "put": {
        "operationId": "replaceBlueprint",
        "summary": "Replace a blueprint",
        "description": "The default blueprint cannot be renamed and never inherits. Audited as blueprint.save. Role admin, not read only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlueprintInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blueprint"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "ETag of the version the change is based on; another version answers 412"
          }
        ],
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteBlueprint",
        "summary": "Delete a blueprint",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Its devices fall back to default; default itself cannot be deleted. Audited as blueprint.delete. Role admin, not read only.",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/tags": {
      "get": {
        "operationId": "listTags",
        "summary": "List the tags of active devices",
        "description": "Not paged. Any API role except metrics.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/audit": {
      "get": {
        "operationId": "listAudit",
        "summary": "Read the audit log, newest first",
        "description": "Roles admin and auditor.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Substring of actor, action, target or detail"
          },
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Substring of the actor"
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Action prefix, for example command."
          },
          {
            "name": "target",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Exact target"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "First day (inclusive)"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Last day (inclusive)"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "openapi",
        "summary": "This document",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [
          "Meta"
        ]
      }
    },
    "/metrics": {
      "get": {
        "operationId": "metrics",
        "summary": "Prometheus metrics",
        "description": "Text exposition format. Tokens of the metrics, admin or auditor role.",
        "responses": {
          "200": {
            "description": "Metrics",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Meta"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/api/v1/approvals": {
      "get": {
        "operationId": "listApprovals",
        "summary": "List approval requests",
        "description": "Newest first, of the token's tenant; helpdesk tokens see their own requests. Scope read for the role, admin for the scope check.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "rejected",
                "expired",
                "used"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Approvals"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/approvals/{id}": {
      "get": {
        "operationId": "getApproval",
        "summary": "Get an approval request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Approvals"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/approvals/{id}/approve": {
      "post": {
        "operationId": "approveApproval",
        "summary": "Approve an approval request",
        "description": "Admin tokens, not read only. Never a request of the same token or of the person who created it (409); an approved command is queued at once. Audited as approval.approve.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionInput"
              }
            }
          }
        },
        "tags": [
          "Approvals"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/approvals/{id}/reject": {
      "post": {
        "operationId": "rejectApproval",
        "summary": "Reject an approval request",
        "description": "Admin tokens, not read only. Never a request of the same token or of the person who created it (409); an approved command is queued at once. Audited as approval.reject. A console session must give a reason (422 otherwise); it is stored as decision_reason and audited.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionInput"
              }
            }
          }
        },
        "tags": [
          "Approvals"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/exceptions": {
      "get": {
        "operationId": "listExceptions",
        "summary": "List risk exceptions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Exception"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "addException",
        "summary": "Add a risk exception",
        "description": "Admin tokens, not read only. With four eyes approval off it is added directly and the approver must be another person; with it on the request goes to the inbox (202, Location of the approval), and the admin who approves it is recorded as approver. Audited as exception.add.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExceptionInput"
              },
              "example": {
                "check_id": "ssh.baseline",
                "mode": "advisory",
                "tag": "lab",
                "reason": "Lab machines need password login until the migration",
                "owner": "jane@example.com",
                "approver": "ciso@example.com",
                "expires": "2027-03-31"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "API path of the new or pending resource"
              }
            }
          },
          "202": {
            "description": "Four eyes: stored as a request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "approval_id": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "API path of the approval"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/exceptions/{id}": {
      "delete": {
        "operationId": "revokeException",
        "summary": "Revoke a risk exception",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/tokens": {
      "get": {
        "operationId": "listTokens",
        "summary": "List API tokens",
        "description": "Admin and auditor tokens; the secrets are never shown again.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Token"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createToken",
        "summary": "Create an API token",
        "description": "Admin tokens, not read only. The answer holds the secret once. Rotate by creating the successor and deleting the old token. Audited as api_token.create.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenInput"
              },
              "example": {
                "name": "reporting",
                "role": "auditor",
                "days": 30,
                "read_only": true,
                "scopes": [
                  "read"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "API path of the new or pending resource"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/tokens/{id}": {
      "delete": {
        "operationId": "revokeToken",
        "summary": "Revoke an API token",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/tenants": {
      "get": {
        "operationId": "listTenants",
        "summary": "List tenants",
        "description": "Global admin tokens with multi tenancy on (else 404).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tenant"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createTenant",
        "summary": "Create a tenant",
        "description": "Global admin tokens, not read only. Audited as tenant.add.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "API path of the new or pending resource"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/docs": {
      "get": {
        "operationId": "apiReference",
        "summary": "This reference as an interactive page (Swagger UI)",
        "security": [],
        "responses": {
          "200": {
            "description": "HTML",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "tags": [
          "Meta"
        ]
      }
    },
    "/api/v1/devices/facets": {
      "get": {
        "operationId": "deviceFacets",
        "summary": "Count devices per status, OS, agent, blueprint and tag",
        "description": "Takes the filters of listDevices; also lists the filter keys with help texts. Any API role except metrics.",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1000
            },
            "description": "Query language: free words match host name, OS, id, blueprint or tags; keys status (compliant, in-grace, non-compliant, stale, pending, retired, locked), os, kind (desktop, server), tag, blueprint, agent, check (failing check id), pkg (name with optional version comparison), app, flatpak, remote, seen (>7d older, <2h newer; m, h, d). Example: status:non-compliant os:\"Ubuntu 24\" tag:prod. German names work too: zustand, system, schlagwort, pruefung, paket, zuletzt, offline (offline:7d), art; status konform, nicht-konform, in-karenz, veraltet, offline, ausstehend, ausgemustert, gesperrt; art arbeitsplatz, laptop, server. Unknown keys are an error."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Substring of host name, OS, id, blueprint or tag, case insensitive"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "compliant",
                "in grace",
                "non-compliant",
                "stale",
                "pending",
                "retired"
              ]
            },
            "description": "Device status"
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Device tag"
          },
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Catalog app id that is installed"
          },
          {
            "name": "flatpak",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Installed Flatpak application id"
          },
          {
            "name": "remote",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Configured Flatpak remote name"
          },
          {
            "name": "blueprint",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Effective blueprint name"
          },
          {
            "name": "agent",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Agent version"
          },
          {
            "name": "failing",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Id of a failing compliance check"
          },
          {
            "name": "pkg",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Installed package, optionally with a version comparison: openssl, openssl < 3.0.13 (operators < <= = != >= >). Versions compare by their runs of digits; the epoch is ignored."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceFacets"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "The caller: role, tenant, scope, permissions, locale",
        "description": "Permissions name what the caller may do by the rules every endpoint applies: read, audit, commands, admin, tenants. Session callers get the CSRF token.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/events/stream": {
      "get": {
        "operationId": "eventStream",
        "summary": "Live updates (server sent events)",
        "description": "Events device (id, hostname, status, last_seen), activity (new audit entries: id, at, actor, action, target; admin and auditor) and inbox (pending approvals: pending), limited to the caller's tenant and scope. The stream ends after four minutes; EventSource reconnects. At most five open streams per caller.",
        "responses": {
          "200": {
            "description": "event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/views": {
      "get": {
        "operationId": "listViews",
        "summary": "Own and shared saved views",
        "parameters": [
          {
            "name": "list",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only views of this list, e.g. devices"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedViewPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createView",
        "summary": "Save a view",
        "description": "Every role with write access to its own data; only admins share. At most 100 views per person.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedViewInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/views/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer"
          }
        }
      ],
      "put": {
        "operationId": "updateView",
        "summary": "Replace an own view",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedViewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteView",
        "summary": "Delete an own view, or (admins) a shared one",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/schemas": {
      "get": {
        "operationId": "listSchemas",
        "summary": "Declaration types with a payload schema",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en",
                "fr",
                "es",
                "it",
                "ru"
              ]
            },
            "description": "language of titles and help texts; default from the request"
          }
        ],
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/schemas/{type}": {
      "get": {
        "operationId": "getSchema",
        "summary": "JSON Schema of a declaration payload",
        "description": "Draft 2020-12, derived from the Go types the server and agent decode the payload into. x-order keeps the field order; titles, descriptions, x-section, enum with x-enumTitles, x-widget (textarea, code, secret, checkboxes), x-secret, minimum, maximum and default describe the form.",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "com.limdm.firewall"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en",
                "fr",
                "es",
                "it",
                "ru"
              ]
            },
            "description": "language of titles and help texts; default from the request"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/fleet": {
      "get": {
        "operationId": "statsFleet",
        "summary": "Fleet health: devices per status, online, agent versions, OS, fleet grid",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsFleet"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/compliance": {
      "get": {
        "operationId": "statsCompliance",
        "summary": "Compliance score, frameworks, most failing checks and history",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsCompliance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/attention": {
      "get": {
        "operationId": "statsAttention",
        "summary": "What needs attention: approvals, failed commands, non compliant and stale devices, expiring exceptions, last backup",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsAttention"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/compliance": {
      "get": {
        "operationId": "complianceOverview",
        "summary": "Device states, every reported check with its counts and the framework controls",
        "description": "Check titles are translated to the caller's language. Follows the device scope and tenant.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Compliance"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/compliance/checks/{id}": {
      "get": {
        "operationId": "complianceCheck",
        "summary": "One check with the result of every device that reports it",
        "description": "Failing devices first, at most 500 devices (truncated); the counts cover all.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCheckDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/compliance/heatmap": {
      "get": {
        "operationId": "complianceHeatmap",
        "summary": "Passed and failed results per check area and blueprint or tenant",
        "parameters": [
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "blueprint",
                "tenant"
              ],
              "default": "blueprint"
            },
            "description": "tenant only in the global view of several tenants"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceHeatmap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/compliance/history": {
      "get": {
        "operationId": "complianceHistory",
        "summary": "Compliance state at the end of a day, of every device or one device with its changes",
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "day, default today"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "device ID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/compliance/policies": {
      "get": {
        "operationId": "compliancePolicies",
        "summary": "Compliance policies and custom checks of the library with the blueprints using them",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompliancePolicies"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/exports/{kind}": {
      "get": {
        "operationId": "export",
        "summary": "Evidence and data exports",
        "description": "Admins and auditors (scope audit). Streams the same file as the console export and writes two audit entries: export before, export.done after with the row count and the SHA-256 of the bytes sent. Audit exports take the filters of /api/v1/audit. evidence.json is a bundle signed with the command key (Ed25519; check it with limdm-server evidence verify FILE), evidence.pdf the report rendered from such a bundle with its SHA-256 and signature; both also write evidence.sign with the bundle's SHA-256.",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "compliance.csv",
                "compliance-history.csv",
                "exceptions.csv",
                "inventory.csv",
                "packages.csv",
                "audit.csv",
                "audit.jsonl",
                "evidence.json",
                "evidence.pdf"
              ]
            }
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "compliance-history.csv: day"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "compliance-history.csv: device ID"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 90
            },
            "description": "evidence.json and evidence.pdf: history window"
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text in any field",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "description": "Actor contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "description": "Action starts with",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "description": "Target or device id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "First day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Last day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedEvidence"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/exception-requests": {
      "post": {
        "operationId": "requestException",
        "summary": "Ask for a risk exception (four eyes)",
        "description": "Admins and the helpdesk. Always stored as a request another admin approves in the inbox (action exception.add); the approving admin becomes the approver. Scoped accounts must name one of their tags.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExceptionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Four eyes: stored as a request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "approval_id": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "API path of the approval"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Compliance"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/tenants": {
      "get": {
        "operationId": "statsTenants",
        "summary": "Tenant comparison: devices, score, non compliant, stale, pending approvals per tenant",
        "description": "Super admins in the all tenants view only; 404 without multi tenancy.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsTenantList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/commands": {
      "get": {
        "operationId": "statsCommands",
        "summary": "Commands per day by their last change: failed and all, devices in scope",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "1..90, default 14",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsCommandDays"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/onboarding": {
      "get": {
        "operationId": "onboarding",
        "summary": "First steps of a new installation (admins in the global view until done or hidden); empty else",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/commands": {
      "get": {
        "operationId": "listCommands",
        "summary": "Commands of every device in scope, newest first; never the payload",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "One status",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "sent",
                "ok",
                "failed",
                "expired"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "description": "Changed within 1..90 days, default 7",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetCommandPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/activity": {
      "get": {
        "operationId": "listActivity",
        "summary": "Audit log and device events as one stream, newest first",
        "description": "The audit log only for admins and auditors (and audit scoped tokens), audited as a read like /api/v1/audit; device events in the device scope.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "audit or device",
            "schema": {
              "type": "string",
              "enum": [
                "audit",
                "device"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "One category",
            "schema": {
              "type": "string",
              "enum": [
                "commands",
                "changes",
                "approvals",
                "access",
                "devices",
                "audit",
                "events"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text in any field",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "description": "Actor contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "description": "Action starts with",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "description": "Target or device id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "First day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Last day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/activity/histogram": {
      "get": {
        "operationId": "activityHistogram",
        "summary": "The filtered stream counted per day and category (default the last 30 days, at most 400)",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "audit or device",
            "schema": {
              "type": "string",
              "enum": [
                "audit",
                "device"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "One category",
            "schema": {
              "type": "string",
              "enum": [
                "commands",
                "changes",
                "approvals",
                "access",
                "devices",
                "audit",
                "events"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text in any field",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "description": "Actor contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "description": "Action starts with",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "description": "Target or device id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "First day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Last day",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityHistogram"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/audit/status": {
      "get": {
        "operationId": "auditStatus",
        "summary": "State of the audit hash chain (checked from the last checkpoint), last full verification, known actions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/audit/verify": {
      "post": {
        "operationId": "auditVerify",
        "summary": "Verify the whole audit chain now (admins and auditors); audited as audit.verify",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Audit and activity"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/updates": {
      "get": {
        "operationId": "statsUpdates",
        "summary": "Pending security updates and devices on the newest approved agent release, devices in scope; daily history in the global view",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "1..400, default 30",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsUpdates"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/stats/annotations": {
      "get": {
        "operationId": "statsAnnotations",
        "summary": "Events the history charts mark: key rotations, approved agent releases, blueprint changes, failed backups (audit log, admins and auditors)",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "1..400, default 30",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsAnnotationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Statistics"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/report-schedules": {
      "get": {
        "operationId": "listReportSchedules",
        "summary": "Own report schedules (admins: all of the tenant view) and the channels a schedule may use",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportScheduleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "saveReportSchedule",
        "summary": "Schedule a saved report preset (create or replace the caller's schedule of it)",
        "description": "People with the admin or auditor role, not tokens. The report runs as its owner with the role and scope the owner has at run time, in the tenant view it was scheduled in; recipients get a link, never the file. Audited as report.schedule, each run as report.run.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportScheduleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSchedule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/report-schedules/{id}": {
      "delete": {
        "operationId": "deleteReportSchedule",
        "summary": "Delete a schedule (owner or admin of the tenant view); audited as report.unschedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/report-schedules/{id}/run": {
      "post": {
        "operationId": "runReportSchedule",
        "summary": "Run a schedule now and send it",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRun"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/report-schedules/{id}/runs": {
      "get": {
        "operationId": "listReportRuns",
        "summary": "The kept runs of a schedule (last 10)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRunList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/report-runs/{id}": {
      "get": {
        "operationId": "downloadReportRun",
        "summary": "The file of a run: its owner, or admins and auditors without a device scope in the same or the all tenants view; audited as report.download",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/detail": {
      "get": {
        "operationId": "deviceDetail",
        "summary": "Everything the device page shows",
        "description": "The device with its inventory, check results, declaration states, resolved blueprint chain, protective actions, recovery key metadata, network certificates, catalog state, app requests, 7 day metrics and the switches that decide which actions the caller sees. Any API role except metrics; diagnostics only for admin and helpdesk.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/packages": {
      "get": {
        "operationId": "devicePackages",
        "summary": "Installed packages of a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DevicePackage"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/timeline": {
      "get": {
        "operationId": "deviceTimeline",
        "summary": "Activity of a device, newest first",
        "description": "Merges device events, commands, script results, remote shell sessions (the helpdesk sees its own), diagnostics bundles (admin and helpdesk), compliance check changes (title is the check id, status the new result) and audit entries with the device as target (audit permission; title is the action, by the actor, extra the translated action label).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "event",
                "command",
                "script",
                "shell",
                "diagnostics",
                "compliance",
                "audit"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelinePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/diagnostics/{cid}": {
      "get": {
        "operationId": "downloadDiagnostics",
        "summary": "Download a diagnostics bundle",
        "description": "Plain text attachment; audited as device.diagnostics.download. Roles admin and helpdesk.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          },
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The bundle",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/retire": {
      "post": {
        "operationId": "retireDevice",
        "summary": "Retire a device and revoke its certificates",
        "description": "Warning: revokes the device certificates; the device stops being managed. Audited as device.retire. Role admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "responses": {
          "200": {
            "description": "The retired device",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Device"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/agent-update": {
      "post": {
        "operationId": "requestAgentUpdate",
        "summary": "Update the agent at the next check in",
        "description": "version empty: the newest approved version. Audited as agent_update.request. Role admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Requested",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/recovery-keys/{uuid}/view": {
      "post": {
        "operationId": "viewRecoveryKey",
        "summary": "Show a disk recovery key",
        "description": "Warning: reveals a disk recovery key; audited. Audited as recovery.view and announced on the device. With four eyes for recovery keys the answer has no key but a state: reason (send a reason to request approval), requested, pending. Roles admin and helpdesk.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          },
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryKeyView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/shell": {
      "post": {
        "operationId": "startShell",
        "summary": "Start a remote shell session",
        "description": "Warning: opens a root shell on a real device; the session is recorded. Console sessions only; the terminal connects to /shell/{session}/ws with the CSRF token. 202 when the session waits for four eyes approval. Audited as shell.start.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Remote shell"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/shell-sessions": {
      "get": {
        "operationId": "deviceShellSessions",
        "summary": "Remote shell sessions of a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Device id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShellSession"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Remote shell"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/shell-sessions/{sid}": {
      "get": {
        "operationId": "shellSession",
        "summary": "One remote shell session with its transcript",
        "description": "The transcript goes to admins and auditors after the session ended.",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShellSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Remote shell"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/shell-sessions/{sid}/transcript": {
      "get": {
        "operationId": "shellTranscript",
        "summary": "Raw recorded bytes of an ended remote shell session",
        "description": "The terminal output as recorded (escape sequences included) for replay in a terminal or download as .log. Admins and auditors; the read is audited like /api/v1/audit. 409 while the session runs.",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Remote shell"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/shell-sessions/{sid}/end": {
      "post": {
        "operationId": "endShell",
        "summary": "End a running remote shell session",
        "description": "The user who started it or an admin.",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Ended"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Remote shell"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/bulk": {
      "post": {
        "operationId": "bulkDevices",
        "summary": "Run one action on many devices",
        "description": "Warning: acts on many devices at once. action: command:<type> (not lost or wipe), agent-update, tag-add, tag-remove. params are the fields of the command (as createCommand) or tag. Commands under four eyes become one approval per device. Roles admin and helpdesk (helpdesk: its commands only).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued or requested",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "approval"
                      ]
                    },
                    "devices": {
                      "type": "integer"
                    },
                    "approvals": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/primary-users": {
      "get": {
        "operationId": "primaryUserSuggestions",
        "summary": "Directory people for the primary user field",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Role admin.",
        "responses": {
          "200": {
            "description": "Up to 20 email addresses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/enrollment-tokens": {
      "get": {
        "operationId": "listEnrollmentTokens",
        "summary": "Active enrollment tokens and the install data",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrollmentInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Enrollment"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createEnrollmentToken",
        "summary": "Create an enrollment token",
        "description": "The token is in this answer only. Audited as token.create. Role admin. Uses and days are limited by Settings, Enrollment (hard limits 500 and 30).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "blueprint_id": {
                    "type": "integer"
                  },
                  "uses": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500,
                    "description": "0 or missing: the default of Settings, Enrollment; at most its maximum"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "description": "0 or missing: the default of Settings, Enrollment; at most its maximum"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "token"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Enrollment"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/enrollment-tokens/{id}": {
      "delete": {
        "operationId": "revokeEnrollmentToken",
        "summary": "Revoke an enrollment token",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it. Devices enrolled with it stay. Audited as token.revoke. Role admin.",
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Enrollment"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/catalog-apps": {
      "get": {
        "operationId": "deviceCatalogApps",
        "summary": "Enabled catalog apps for bulk install and removal",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/blueprints": {
      "get": {
        "operationId": "configBlueprints",
        "summary": "Blueprints with usage",
        "description": "Every visible blueprint with its devices, their compliance status, assignment sources (devices, directory groups, default), inheritance, the deleted blueprints that can be restored and the rule fields of conditions.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigBlueprints"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/blueprints/preview": {
      "post": {
        "operationId": "configBlueprintPreview",
        "summary": "Review a blueprint change",
        "description": "Validates the blueprint like a save and answers the diff to the stored version, the devices it reaches and the library items it adds or removes. Nothing is saved.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigPreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "parent_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "tree": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Node"
                    }
                  }
                },
                "required": [
                  "name",
                  "tree"
                ]
              }
            }
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/library": {
      "get": {
        "operationId": "configLibrary",
        "summary": "Library with usage",
        "description": "Every visible library item (network secrets masked) with the blueprints that use it, an invalid signature flag, read only for shared items of the default tenant, and the deleted items that can be restored.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigLibrary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/library/render": {
      "post": {
        "operationId": "configItemRender",
        "summary": "Render a files, firewall or hostname template for one device",
        "description": "Admins. Validates the payload like a save, then renders its templates with the values of the device (an ID or hostname in the caller's scope). Nothing is saved. A render error comes back in error with the payload as the agent would get it. For com.limdm.hostname the response adds hostname: the name the declaration computes for the device from its last report (current name, target FQDN, source used or the reason it keeps its name).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "payload",
                  "device"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "payload": {
                    "type": "object"
                  },
                  "device": {
                    "type": "string",
                    "description": "device ID or hostname"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "payload",
                    "vars"
                  ],
                  "properties": {
                    "payload": {
                      "type": "object"
                    },
                    "error": {
                      "type": "string"
                    },
                    "vars": {
                      "type": "object",
                      "required": [
                        "hostname",
                        "id",
                        "tags",
                        "tenant",
                        "primary_user",
                        "attributes"
                      ],
                      "properties": {
                        "hostname": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tenant": {
                          "type": "string"
                        },
                        "primary_user": {
                          "type": "string"
                        },
                        "attributes": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "serial": {
                          "type": "string",
                          "description": "DMI serial number, empty for a placeholder"
                        },
                        "mac": {
                          "type": "string",
                          "description": "MAC address of the primary interface"
                        },
                        "vendor": {
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        }
                      }
                    },
                    "hostname": {
                      "type": "object",
                      "required": [
                        "current"
                      ],
                      "description": "com.limdm.hostname only",
                      "properties": {
                        "current": {
                          "type": "string",
                          "description": "host name the device reported"
                        },
                        "target": {
                          "type": "string",
                          "description": "FQDN (or short name) the declaration computes"
                        },
                        "source": {
                          "type": "string",
                          "description": "source used, \"template (fallback)\" for the fallback"
                        },
                        "error": {
                          "type": "string",
                          "description": "why the device keeps its name"
                        },
                        "serial": {
                          "type": "string"
                        },
                        "facts": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "hostname_info of the inventory: address, mac, ptr, fqdn, target, source, result, detail, previous, changed_at, warning"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "description": "Invalid payload or unknown device"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/scripts/results": {
      "get": {
        "operationId": "configScriptResults",
        "summary": "Last run of a recurring script per device",
        "description": "Role read. The latest result of the named recurring script on every device in the caller's scope that reported one, with the last lines of its output.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "script name"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "device_id",
                          "hostname",
                          "exit_code",
                          "start",
                          "end",
                          "output"
                        ],
                        "properties": {
                          "device_id": {
                            "type": "string"
                          },
                          "hostname": {
                            "type": "string"
                          },
                          "exit_code": {
                            "type": "integer"
                          },
                          "start": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "end": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "output": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/library/preview": {
      "post": {
        "operationId": "configItemPreview",
        "summary": "Review a library item change",
        "description": "Validates the item like a save and answers the diff to the stored version, the devices it reaches, whether four eyes approval is needed and, for compliance items, the effect on the checks. Nothing is saved.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigPreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryItem"
              }
            }
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/library/template": {
      "get": {
        "operationId": "configItemTemplate",
        "summary": "Start of a new library item",
        "description": "Admins, not for device scoped callers. With device: a sources item from a source file (file) or a Flatpak item from a remote (remote, inst) that device reported, mode edit, disable or enable. Without device: the example payload of type. Nothing is saved.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "declaration type (without device)"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "device ID to take a source or remote from"
          },
          {
            "name": "file",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "source file of the device"
          },
          {
            "name": "remote",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Flatpak remote of the device"
          },
          {
            "name": "inst",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Flatpak installation of the remote"
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "edit",
                "disable",
                "enable"
              ]
            },
            "description": "what the item does with it"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "type",
                    "name",
                    "description",
                    "payload"
                  ],
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "payload": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/{kind}/{id}/versions": {
      "get": {
        "operationId": "configVersions",
        "summary": "Versions",
        "description": "Every saved version, newest first, with the readable text diffs compare. Not for device scoped accounts.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigVersions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "blueprints or library"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID"
          }
        ],
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/{kind}/{id}/rollback": {
      "post": {
        "operationId": "configRollback",
        "summary": "Roll back or restore",
        "description": "Warning: changes what devices apply at their next check in. Saves an old version again as the newest one, or restores a deleted object, audited like a save. Root effective library items wait for four eyes approval (202).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "202": {
            "description": "Four eyes: waits for another administrator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "blueprints or library"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer"
                  }
                },
                "required": [
                  "version"
                ]
              }
            }
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/catalog": {
      "get": {
        "operationId": "softwareCatalog",
        "summary": "Software catalog",
        "description": "Catalog apps with their installs, Flatpaks installed in the fleet that no app covers yet, and the number of pending requests. Global accounts only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/apps": {
      "post": {
        "operationId": "softwareAppCreate",
        "summary": "Add a catalog app",
        "description": "Required apps wait for four eyes approval (202).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "202": {
            "description": "Four eyes: waits for another administrator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogAppInput"
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/apps/{id}": {
      "put": {
        "operationId": "softwareAppSave",
        "summary": "Change a catalog app",
        "description": "Required apps wait for four eyes approval (202).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "202": {
            "description": "Four eyes: waits for another administrator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "app ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogAppInput"
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "softwareAppDelete",
        "summary": "Remove a catalog app",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Installed copies stay on the devices.",
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "app ID"
          }
        ],
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/import": {
      "post": {
        "operationId": "softwareImport",
        "summary": "Take over installed Flatpaks",
        "description": "Adds Flatpaks installed in the fleet to the catalog, mode available.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "added": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "added"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "flatpaks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "flatpaks"
                ]
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/flathub/search": {
      "get": {
        "operationId": "flathubSearch",
        "summary": "Search Flathub",
        "description": "Through the server; nothing is sent from the browser to Flathub.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FlatpakHit"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/flathub": {
      "post": {
        "operationId": "flathubAdd",
        "summary": "Add a Flathub app",
        "description": "Name, summary, category and icon come from Flathub.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "202": {
            "description": "Four eyes: waits for another administrator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "502": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "available",
                      "request",
                      "required"
                    ]
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/requests": {
      "get": {
        "operationId": "appRequests",
        "summary": "App requests of users",
        "description": "Pending first, then the newest 300.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AppRequest"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/requests/{id}/{op}": {
      "post": {
        "operationId": "appRequestDecide",
        "summary": "Decide an app request",
        "description": "approve, approve-all (an app from outside the catalog becomes available for everyone) or deny. An optional body {\"install\": true} on approve and approve-all has the agent install the app at once; without it the user may install it. The device learns the decision within its next poll (about ten seconds while a request is open).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID"
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "approve",
                "approve-all",
                "deny"
              ]
            }
          }
        ],
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "install": {
                    "type": "boolean",
                    "description": "Approve and install on the requesting device."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/software/remotes": {
      "get": {
        "operationId": "softwareRemotes",
        "summary": "Flatpak remotes",
        "description": "Managed remotes and remotes found on devices (managed false).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Remote"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/remotes/{name}": {
      "put": {
        "operationId": "softwareRemoteSave",
        "summary": "Manage a remote",
        "description": "Allowed remotes need an https URL.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": ""
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Remote"
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/remotes/{name}/{op}": {
      "post": {
        "operationId": "softwareRemoteOp",
        "summary": "Allow, block, filter or unmanage a remote",
        "description": "filter switches catalog only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "allow",
                "block",
                "filter",
                "unmanage"
              ]
            }
          }
        ],
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/software/settings": {
      "get": {
        "operationId": "softwareSettings",
        "summary": "Store settings",
        "description": "",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SoftwareSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "put": {
        "operationId": "softwareSettingsSave",
        "summary": "Save the store settings",
        "description": "",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SoftwareSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SoftwareSettings"
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/packages": {
      "get": {
        "operationId": "packages",
        "summary": "Package repository",
        "description": "Uploads of the tenant with usage, limits and quota use.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Packages"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "packageUpload",
        "summary": "Upload a package",
        "description": "multipart/form-data with name, version, kind, reason and file; the body may be as large as the upload limit. With four eyes on it waits for approval (status pending).",
        "responses": {
          "201": {
            "description": "Uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "file"
                ]
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/packages/{id}": {
      "delete": {
        "operationId": "packageDelete",
        "summary": "Delete an upload",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Refused while a library item references it.",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID"
          }
        ],
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/packages/settings": {
      "put": {
        "operationId": "packageSettings",
        "summary": "Package limits and store",
        "description": "Global administrators. The S3 secret is sealed; empty keeps the stored one.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageConfig"
              }
            }
          }
        },
        "tags": [
          "Software"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/blueprints/{id}/pilot": {
      "post": {
        "operationId": "configPilotStart",
        "summary": "Start a pilot rollout",
        "description": "Saves the changed map as a copy of the blueprint (<name>.pilot, same parent) and sets it on the chosen devices, which must use this blueprint. Promote or abort ends it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tree",
                  "devices"
                ],
                "properties": {
                  "tree": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Node"
                    }
                  },
                  "devices": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigPilot"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/config/blueprints/{id}/pilot/{op}": {
      "post": {
        "operationId": "configPilotEnd",
        "summary": "Promote or abort a pilot rollout",
        "description": "Warning: promoting rolls the change out to every device of the blueprint. promote saves the pilot map into the blueprint (a new version), abort drops it; both put the devices back on what they had set and delete the copy.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "promote",
                "abort"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigSaved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Configuration"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/settings": {
      "get": {
        "operationId": "getSettings",
        "summary": "Server settings",
        "description": "Admins and auditors of the whole installation; secrets are never returned.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/settings/{section}": {
      "patch": {
        "operationId": "saveSettings",
        "summary": "Save one settings section",
        "description": "Sections: general (local_login, stale_hours), network (console_allow, console_block, scim_allow, network_cert_domain), security (password_policy, four_eyes*, geolocation, fallback_dns), remote_shell, sso (oidc_*, allowed_domain, require_mfa, mfa_acr, role_groups, oidc_client_secret, clear_secret), monitoring (webhook_url, notify_private_networks), branding (company_name, logo_png, remove_logo), operations (ops), retention, enrollment (enrollment), cve_feeds, logs (logs). Fields left out keep their value. The same guards as the console: no self lockout, local login only off with an OIDC admin, four eyes needs two admins, OIDC changes are checked against the provider. Audited as settings.save.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "section",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "general",
                "network",
                "security",
                "remote_shell",
                "sso",
                "monitoring",
                "branding",
                "operations",
                "retention",
                "enrollment",
                "cve_feeds",
                "logs"
              ]
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/users": {
      "get": {
        "operationId": "listUsers",
        "summary": "Console users",
        "description": "OIDC and local accounts of the caller's tenant (all in the global view).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleUserList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "addUser",
        "summary": "Add a console user",
        "description": "Local accounts answer their credentials once. New admins wait for approval while four eyes approval is on. Audited as user.add.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credentials"
                }
              }
            }
          },
          "202": {
            "description": "Waits for four eyes approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The approval"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsoleUserInput"
              }
            }
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/users/{login}": {
      "patch": {
        "operationId": "updateUser",
        "summary": "Change role, state or scope",
        "description": "Own account cannot be demoted or disabled; the last admin stays. Role changes and admin edits wait for approval while four eyes approval is on. Audited as user.update.",
        "responses": {
          "202": {
            "description": "Waits for four eyes approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The approval"
              }
            }
          },
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsoleUserPatch"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "login",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Email or local:name"
          }
        ],
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/users/{login}/reset": {
      "post": {
        "operationId": "resetUser",
        "summary": "Reset password and TOTP of a local account",
        "description": "Warning: the user's password and authenticator stop working at once. Not the own account. For admins with four eyes approval the approver gets the credentials. Audited as user.reset.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credentials"
                }
              }
            }
          },
          "202": {
            "description": "Waits for four eyes approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPending"
                }
              }
            },
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "The approval"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "parameters": [
          {
            "name": "login",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Email or local:name"
          }
        ],
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/tenants/switch": {
      "post": {
        "operationId": "switchTenant",
        "summary": "Switch the tenant view",
        "description": "Console sessions of super admins; 0 is the view of all tenants. Changes the session cookie. Audited as tenant.switch.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "integer"
                  }
                },
                "required": [
                  "tenant"
                ]
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/tenants/shared": {
      "get": {
        "operationId": "getSharedObjects",
        "summary": "Shared objects",
        "description": "Blueprints and library items of the default tenant and whether every tenant may use them.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedObjects"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "put": {
        "operationId": "setSharedObjects",
        "summary": "Set shared objects",
        "description": "Ids of the blueprints and library items every tenant may use. Audited as tenant.shared.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "blueprints": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "blueprints",
                  "items"
                ]
              }
            }
          }
        },
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/tenants/{id}": {
      "get": {
        "operationId": "getTenant",
        "summary": "A tenant",
        "description": "Super admins every tenant, tenant admins their own.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "patch": {
        "operationId": "updateTenant",
        "summary": "Change a tenant",
        "description": "Name and state by super admins (the default tenant stays enabled), branding also by the tenant's admins. Audited as tenant.update.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantPatch"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Tenants"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/keys": {
      "get": {
        "operationId": "listKeys",
        "summary": "Server keys",
        "description": "Admins of the whole installation without device scope.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KeyStatus"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/keys/{kind}/{op}": {
      "post": {
        "operationId": "keyRotation",
        "summary": "Rotate or finish a key rotation",
        "description": "Warning: rotates a server key; read docs/keys.md first. rotate starts a rotation (name: HSM key label), finish ends it (force: before every device moved). Audited.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "force": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ca",
                "netca",
                "command",
                "session",
                "webhook",
                "logs"
              ]
            },
            "description": ""
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "rotate",
                "finish"
              ]
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup": {
      "get": {
        "operationId": "getBackup",
        "summary": "Backup configuration and history",
        "description": "Global admins. Target secrets are never returned.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "put": {
        "operationId": "saveBackup",
        "summary": "Save recipients, time zone and retention",
        "description": "Audited as backup.settings.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupInput"
              }
            }
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/run": {
      "post": {
        "operationId": "runBackup",
        "summary": "Back up now",
        "description": "Starts a backup to every target; the history shows the result.",
        "responses": {
          "202": {
            "description": "Started"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/{id}/verify": {
      "post": {
        "operationId": "verifyBackup",
        "summary": "Verify an archive",
        "description": "Checks the checksum of a stored archive on its targets.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/targets/{name}": {
      "put": {
        "operationId": "saveBackupTarget",
        "summary": "Add or replace a target",
        "description": "S3, B2, SFTP, WebDAV or a local directory. Audited as backup.settings.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupTargetInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteBackupTarget",
        "summary": "Remove a target",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Refused while a schedule uses it; archives on it stay.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/targets/{name}/test": {
      "post": {
        "operationId": "testBackupTarget",
        "summary": "Test a target",
        "description": "Writes, reads and deletes a test object.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/schedules/preview": {
      "post": {
        "operationId": "previewBackupSchedule",
        "summary": "Preview a schedule",
        "description": "Validates a schedule and answers its next runs and the archives its retention keeps over a year, without saving.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupSchedule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupScheduleInput"
              }
            }
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/schedules/{name}": {
      "put": {
        "operationId": "saveBackupSchedule",
        "summary": "Add or replace a schedule",
        "description": "Audited as backup.settings.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupScheduleInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteBackupSchedule",
        "summary": "Delete a schedule",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Its archives follow the retention for archives outside a schedule.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/backup/schedules/{name}/{op}": {
      "post": {
        "operationId": "backupScheduleAction",
        "summary": "Run, pause or resume a schedule",
        "description": "run answers 202 and backs up in the background.",
        "responses": {
          "202": {
            "description": "Started"
          },
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Lower case letters, digits, underscore"
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "run",
                "pause",
                "resume"
              ]
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/notification-channels": {
      "get": {
        "operationId": "listChannels",
        "summary": "Notification channels",
        "description": "Channels of the caller's tenant (all in the global view); webhook URLs and passwords are never returned.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "addChannel",
        "summary": "Add a notification channel",
        "description": "Audited as notification.channel_add.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInput"
              }
            }
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/notification-channels/{id}": {
      "patch": {
        "operationId": "setChannel",
        "summary": "Switch a channel on or off",
        "description": "Audited as notification.channel_enable or _disable.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteChannel",
        "summary": "Delete a channel",
        "description": "Warning: deletes or revokes data; the API cannot undo it. Audited as notification.channel_delete.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/notification-channels/{id}/test": {
      "post": {
        "operationId": "testChannel",
        "summary": "Send a test notification",
        "description": "A failed delivery answers 502 with the reason (tenant accounts without network details).",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory": {
      "get": {
        "operationId": "getDirectory",
        "summary": "Directory groups and connections",
        "description": "Groups with their blueprint, Google Workspace and SCIM state, console roles from groups.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Directory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory/users": {
      "get": {
        "operationId": "listDirectoryUsers",
        "summary": "People of the directory",
        "description": "At most 500, filtered by q (name, email, department).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DirectoryUser"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory/groups/{id}": {
      "put": {
        "operationId": "assignGroup",
        "summary": "Map a group to a blueprint",
        "description": "blueprint_id 0 removes the mapping; priority 0 to 10000 (default 100). Audited as directory.group_assign.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "blueprint_id": {
                    "type": "integer"
                  },
                  "priority": {
                    "type": "integer"
                  }
                },
                "required": [
                  "blueprint_id"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": ""
          }
        ],
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory/scim-token": {
      "post": {
        "operationId": "rotateSCIMToken",
        "summary": "New SCIM token",
        "description": "Warning: the old SCIM token stops working at once. The previous token stops working; the answer holds the token once.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "token",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory/google": {
      "put": {
        "operationId": "configureGoogle",
        "summary": "Configure Google Workspace sync",
        "description": "Delegated admin email and the service account JSON key (empty keeps the stored key); syncs at once.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "admin_email": {
                    "type": "string"
                  },
                  "service_account": {
                    "type": "string"
                  }
                },
                "required": [
                  "admin_email"
                ]
              }
            }
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/directory/google/sync": {
      "post": {
        "operationId": "syncGoogle",
        "summary": "Sync Google Workspace now",
        "description": "",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Access"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/network": {
      "get": {
        "operationId": "getNetwork",
        "summary": "Network CA and certificates",
        "description": "The latest 500 certificates of the caller's tenant.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Network"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/network/crl-token": {
      "post": {
        "operationId": "rotateCRLToken",
        "summary": "New CRL download token",
        "description": "Warning: the old CRL download token stops working at once. For RADIUS servers fetching /network/crl.pem; shown once. Audited as network.crl_token.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token1"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/agents": {
      "get": {
        "operationId": "getAgents",
        "summary": "Agent releases and update policy",
        "description": "Releases newest first with their spread in the fleet.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agents"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/agents/policy": {
      "put": {
        "operationId": "saveUpdatePolicy",
        "summary": "Save the agent update policy",
        "description": "delay 0 to 90 days, spread 0 to 720 hours, pilot tag a simple word. Audited as agent_updates.policy.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePolicy"
              }
            }
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/agents/fetch": {
      "post": {
        "operationId": "fetchAgentReleases",
        "summary": "Check for agent releases",
        "description": "Fetches signed releases from the release repository.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fetched": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "fetched"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/agents/releases/{version}/{op}": {
      "post": {
        "operationId": "agentReleaseAction",
        "summary": "Approve or block a version",
        "description": "Audited as agent_release.approve or .block.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "op",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "approve",
                "block"
              ]
            },
            "description": ""
          }
        ],
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/profile": {
      "get": {
        "operationId": "getProfile",
        "summary": "Own profile",
        "description": "Console sessions only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/profile/password": {
      "post": {
        "operationId": "changePassword",
        "summary": "Change the own password",
        "description": "Local accounts; checks the current password with the login lockout; other sessions end. Audited as profile.password.",
        "responses": {
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current": {
                    "type": "string"
                  },
                  "new": {
                    "type": "string"
                  },
                  "repeat": {
                    "type": "string"
                  }
                },
                "required": [
                  "current",
                  "new",
                  "repeat"
                ]
              }
            }
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/profile/totp/qr.svg": {
      "get": {
        "operationId": "totpQR",
        "summary": "QR code of the pending authenticator secret",
        "description": "",
        "responses": {
          "200": {
            "description": "SVG",
            "content": {
              "image/svg+xml": {}
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/profile/totp/{step}": {
      "post": {
        "operationId": "profileTOTP",
        "summary": "Replace the authenticator app",
        "description": "start (current password) answers a pending secret, confirm (code) activates it and ends other sessions, cancel drops it.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    },
                    "uri": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "secret",
                    "uri"
                  ]
                }
              }
            }
          },
          "204": {
            "description": "Done"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "parameters": [
          {
            "name": "step",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "start",
                "confirm",
                "cancel"
              ]
            },
            "description": ""
          }
        ],
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/profile/recovery-codes": {
      "post": {
        "operationId": "newRecoveryCodes",
        "summary": "New recovery codes",
        "description": "Replaces all recovery codes; shown once. Audited as profile.recovery_codes.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "codes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "codes"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current": {
                    "type": "string"
                  }
                },
                "required": [
                  "current"
                ]
              }
            }
          }
        },
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/glossary": {
      "get": {
        "operationId": "getGlossary",
        "summary": "Glossary",
        "description": "Terms of the console and the device states, translated (lang de, en, fr, es, it or ru; default from the request).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Glossary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en",
                "fr",
                "es",
                "it",
                "ru"
              ]
            }
          }
        ],
        "tags": [
          "Session"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/update-rings": {
      "get": {
        "operationId": "listUpdateRings",
        "summary": "Update rings with their wave and device count, the newest waves",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateRingList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createUpdateRing",
        "summary": "Create an update ring (admin); audited as update_ring.save",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateRing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/update-rings/{id}": {
      "put": {
        "operationId": "updateUpdateRing",
        "summary": "Change an update ring (admin); audited as update_ring.save",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateRing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteUpdateRing",
        "summary": "Delete an update ring (admin); its devices are in no ring until their next check in",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/update-rings/{id}/{action}": {
      "post": {
        "operationId": "updateRingAction",
        "summary": "Pause, resume or approve an update ring (admin)",
        "description": "pause stops installs in the ring and the rollout to later rings; approve lets the wave of the ring before it through (rings with require_approval). Audited as update_ring.<action>.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pause",
                "resume",
                "approve"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateRing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/update-waves": {
      "post": {
        "operationId": "startUpdateWave",
        "summary": "Start a new update wave in the caller's tenant (admin); the first ring has it at once",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWave"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: starts installing updates on devices."
      }
    },
    "/api/v1/devices/{id}/updates": {
      "get": {
        "operationId": "getDeviceUpdates",
        "summary": "Pending updates, last run per source and update ring of a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceUpdates"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/workloads": {
      "get": {
        "operationId": "getDeviceWorkloads",
        "summary": "Containers and VMs of a device, tool versions and whether workload actions are allowed",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceWorkloads"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/workloads": {
      "get": {
        "operationId": "listWorkloads",
        "summary": "Containers and VMs of the fleet in the caller's scope, at most 2000",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "docker",
                "podman",
                "lxc",
                "lxd",
                "incus",
                "pct",
                "qm",
                "libvirt"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Exact state, for example running or exited",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "image",
            "in": "query",
            "description": "Part of the image reference or OS template, case insensitive",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetWorkloads"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/updates/fleet": {
      "get": {
        "operationId": "getUpdatesFleet",
        "summary": "Open security updates and CVEs of the devices in scope",
        "description": "CVEs come from the advisories the devices' package managers know (dnf, zypper); a CVE counts as open while an update that fixes it is pending. With ?cve= the answer lists the devices it affects instead.",
        "parameters": [
          {
            "name": "cve",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^CVE-[0-9]{4}-[0-9]{4,7}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UpdatesFleet"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "hostname": {
                                "type": "string"
                              },
                              "packages": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/updates/package-versions": {
      "get": {
        "operationId": "getPackageVersions",
        "summary": "Installed versions of one package across the devices in scope",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string"
                          },
                          "arch": {
                            "type": "string"
                          },
                          "devices": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/updates/cve-feeds": {
      "get": {
        "operationId": "getCVEFeeds",
        "summary": "State of the Debian, Ubuntu, Arch, Alpine and CISA KEV imports",
        "description": "Last successful import (time, fixes kept, bytes), last error. A failed import keeps the last data.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CVEFeedState"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/updates/cve-feeds/refresh": {
      "post": {
        "operationId": "refreshCVEFeeds",
        "summary": "Import the switched on security data feeds now (admin); audited as cve_feeds.refresh",
        "description": "Runs in the background; poll GET /api/v1/updates/cve-feeds. 409 while the feeds are off or an import runs.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "running": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Updates"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/vulnerabilities": {
      "get": {
        "operationId": "listVulnerabilities",
        "summary": "CVEs of the devices in scope",
        "description": "One row per CVE, aggregated over the findings (CVE, package, device) of the devices in scope. format=csv exports up to 10000 rows.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "part of the CVE ID or a package name"
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "comma list of critical, high, medium, low, unknown"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "comma list of active, accepted, remediated, or all; active when empty"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only findings of this device"
          },
          {
            "name": "os",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only devices with this os_id (debian, ubuntu, fedora ...)"
          },
          {
            "name": "package",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only findings in this package"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "first detected on or after"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "first detected on or before"
          },
          {
            "name": "kev",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "only CVEs in the KEV catalog"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "severity",
                "-severity",
                "cvss",
                "-cvss",
                "first_detected",
                "-first_detected",
                "devices",
                "-devices",
                "cve",
                "-cve"
              ]
            },
            "description": "-severity when empty"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "csv"
              ]
            },
            "description": "CSV instead of JSON"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VulnerabilityList"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Vulnerabilities"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/vulnerabilities/summary": {
      "get": {
        "operationId": "getVulnerabilitySummary",
        "summary": "Open CVEs by severity, findings by status, packages with the most open CVEs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VulnerabilitySummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Vulnerabilities"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/vulnerabilities/{cve}": {
      "get": {
        "operationId": "getVulnerability",
        "summary": "One CVE: packages, devices, fixed versions, sources, KEV entry, references, risk acceptances",
        "parameters": [
          {
            "name": "cve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^CVE-[0-9]{4}-[0-9]{4,7}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VulnerabilityDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Vulnerabilities"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/vulnerabilities/{cve}/accept": {
      "post": {
        "operationId": "acceptVulnerability",
        "summary": "Accept the risk of a CVE",
        "description": "Admin tokens, not read only. For every device of the tenant (global for a global admin) or one device and/or package, until the given day. Accepted findings count as accepted, not active, until the acceptance expires or is revoked. Audited as vulnerability.accept.",
        "parameters": [
          {
            "name": "cve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^CVE-[0-9]{4}-[0-9]{4,7}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CVEAcceptanceInput"
              },
              "example": {
                "reason": "Service not exposed, fix scheduled",
                "expires": "2027-01-31"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Vulnerabilities"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/vulnerabilities/{cve}/reopen": {
      "post": {
        "operationId": "reopenVulnerability",
        "summary": "Revoke the risk acceptances of a CVE",
        "description": "Admin tokens, not read only. Revokes every active acceptance of the CVE the caller may change, or only acceptance_id. Audited as vulnerability.reopen.",
        "parameters": [
          {
            "name": "cve",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^CVE-[0-9]{4}-[0-9]{4,7}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "acceptance_id": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "415": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Vulnerabilities"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/firewall": {
      "get": {
        "operationId": "getDeviceFirewall",
        "summary": "Firewall inventory of a device: backend, default policies and every rule grouped managed, foreign and system",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceFirewall"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/firewall/rules/{rid}/{action}": {
      "post": {
        "operationId": "firewallRuleAction",
        "summary": "Adopt a foreign firewall rule into a firewall library item, keep it as an exception there, or list it to be removed",
        "description": "Warning: a removed rule is deleted on the device at its next check in. adopt adds the rule in the declaration format, keep adds its match to keep, remove adds its match to remove: every agent that gets the item deletes the rule whenever it finds it, also after a reboot (a rule with a risk needs confirm_risk; an item with a remove list needs four eyes approval when it is on, and a new item is then refused with 409). item_id names an existing com.limdm.firewall item, saved through the library save (validation, signature, audit, four eyes). Without it a new item with name is created (enforce off) and assigned in blueprint_id, one of GET /api/v1/devices/{id}/firewall/targets, in one transaction with both audit entries: nothing is created when the assignment fails. A blueprint that is the global default or reaches more than one device needs confirm (422 on field confirm otherwise). Tenant accounts pick only blueprints of their tenant. System and managed rules are refused. Admins only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "rule id from the inventory"
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "adopt",
                "keep",
                "remove"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "item_id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "existing firewall item; 0 or missing creates one"
                  },
                  "name": {
                    "type": "string",
                    "description": "name of the new item"
                  },
                  "blueprint_id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "blueprint the new item is assigned in (required without item_id)"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "confirms a blueprint that is the global default or reaches more than this device"
                  },
                  "confirm_risk": {
                    "type": "boolean",
                    "description": "remove: confirms a rule that may cut SSH or the server"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "item_id",
                    "item_name",
                    "created"
                  ],
                  "properties": {
                    "item_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "item_name": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Four eyes: the save waits for another admin",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "approval_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/devices/{id}/firewall/targets": {
      "get": {
        "operationId": "getFirewallTargets",
        "summary": "Blueprints a new firewall item adopted from this device can be assigned in, with the devices each reaches",
        "description": "Tenant accounts get the blueprints of their tenant (never the global default); accounts of the whole installation those of the device's tenant and of the default tenant. Admins only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FirewallTarget"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "tags": [
          "Devices"
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs": {
      "get": {
        "operationId": "searchLogs",
        "tags": [
          "Logs"
        ],
        "summary": "Search log lines",
        "description": "Lines of the devices in the caller's tenant and scope, newest first. Admins and auditors; the helpdesk only with device and when Settings, Logs allows it. Runs under a statement timeout of 20 s (422 when exceeded).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "query language: device:, tag:, blueprint:, os:, source:, unit:, container:, file:, host:, prio:, field.NAME:, \"phrase\", /regex/, -term"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default one hour before to"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default now"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only this device ID (the helpdesk needs it)"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1 to 1000, default 200"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/histogram": {
      "get": {
        "operationId": "logHistogram",
        "tags": [
          "Logs"
        ],
        "summary": "Lines per time bucket and priority",
        "description": "About 120 buckets over the range (1 minute to 7 days each). Same filter and access as searchLogs.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "query language: device:, tag:, blueprint:, os:, source:, unit:, container:, file:, host:, prio:, field.NAME:, \"phrase\", /regex/, -term"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default one hour before to"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default now"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only this device ID (the helpdesk needs it)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogHistogram"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/facets": {
      "get": {
        "operationId": "logFacets",
        "tags": [
          "Logs"
        ],
        "summary": "Most frequent units, containers and files",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "query language: device:, tag:, blueprint:, os:, source:, unit:, container:, file:, host:, prio:, field.NAME:, \"phrase\", /regex/, -term"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default one hour before to"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default now"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only this device ID (the helpdesk needs it)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogFacets"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/context": {
      "get": {
        "operationId": "logContext",
        "tags": [
          "Logs"
        ],
        "summary": "Lines before and after a line on the same device",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "id of a log line"
          },
          {
            "name": "n",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "lines on each side, 1 to 200, default 25"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogContext"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/export": {
      "get": {
        "operationId": "exportLogs",
        "tags": [
          "Logs"
        ],
        "summary": "Export the filtered lines",
        "description": "NDJSON (LogLine per line) or CSV, newest first, at most 100000 lines. Audited as logs.export with the filter.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "query language: device:, tag:, blueprint:, os:, source:, unit:, container:, file:, host:, prio:, field.NAME:, \"phrase\", /regex/, -term"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default one hour before to"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; default now"
          },
          {
            "name": "device",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "only this device ID (the helpdesk needs it)"
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "ndjson",
                "csv"
              ]
            },
            "description": "ndjson or csv",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/status": {
      "get": {
        "operationId": "logStatus",
        "tags": [
          "Logs"
        ],
        "summary": "State of the log store, the archive and the keys",
        "description": "Admins and auditors of the whole installation.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/keys/rotate": {
      "post": {
        "operationId": "rotateLogKeys",
        "tags": [
          "Logs"
        ],
        "summary": "Start new archive data keys",
        "description": "Global admins. Every tenant with a data key gets a new active one; older archives keep theirs. Audited as logs.key_rotate.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rotated"
                  ],
                  "properties": {
                    "rotated": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/archive/run": {
      "post": {
        "operationId": "runLogArchive",
        "tags": [
          "Logs"
        ],
        "summary": "Archive finished days now",
        "description": "Global admins; runs in the background. Audited as logs.archive_run.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/archive/restore": {
      "post": {
        "operationId": "restoreLogs",
        "tags": [
          "Logs"
        ],
        "summary": "Restore an archived day",
        "description": "Global admins. Downloads, verifies (SHA-256 against the manifest), decrypts and loads the day into its partition, searchable for restore_hours. Audited as logs.restore.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "day"
                ],
                "properties": {
                  "day": {
                    "type": "string",
                    "format": "date"
                  },
                  "tenant_id": {
                    "type": "integer",
                    "description": "0 or absent: every tenant of the day"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines",
                    "day"
                  ],
                  "properties": {
                    "lines": {
                      "type": "integer"
                    },
                    "day": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/alerts": {
      "get": {
        "operationId": "listLogAlerts",
        "tags": [
          "Logs"
        ],
        "summary": "Log alert rules of the tenant",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogAlert"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "operationId": "createLogAlert",
        "tags": [
          "Logs"
        ],
        "summary": "Create a log alert rule",
        "description": "Admins. When at least threshold lines matched in the last window, a logs.alert notification goes out, at most once per window. Audited as logs.alert_save.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogAlertInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogAlert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/api/v1/logs/alerts/{id}": {
      "put": {
        "operationId": "saveLogAlert",
        "tags": [
          "Logs"
        ],
        "summary": "Change a log alert rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogAlertInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogAlert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "422": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteLogAlert",
        "tags": [
          "Logs"
        ],
        "summary": "Delete a log alert rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ],
        "description": "Warning: deletes or revokes data; the API cannot undo it."
      }
    },
    "/api/v1/logs/alerts/{id}/test": {
      "post": {
        "operationId": "testLogAlert",
        "tags": [
          "Logs"
        ],
        "summary": "Count a rule now and send a test notification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "matches"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "matches": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "429": {
            "$ref": "#/components/responses/Problem"
          },
          "503": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token (lma_...) from the console"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-limdm_session",
        "description": "Console session (console app only). State changes also need the X-CSRF-Token header with csrf_token from GET /api/v1/me."
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "next_cursor of the previous page"
      }
    },
    "responses": {
      "Problem": {
        "description": "Error as RFC 9457 problem details",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "urn:limdm:problem:<code>"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "machine readable error code, also the last part of type (urn:limdm:problem:<code>)",
            "enum": [
              "bad_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "method_not_allowed",
              "conflict",
              "precondition_failed",
              "too_large",
              "unsupported_media_type",
              "invalid",
              "precondition_required",
              "rate_limited",
              "internal",
              "busy"
            ]
          },
          "errors": {
            "type": "array",
            "description": "422 only: the request field the error is about (empty: the request as a whole)",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Device": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "agent_version": {
            "type": "string"
          },
          "blueprint": {
            "type": "string",
            "description": "Effective blueprint name"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "compliant",
              "in grace",
              "non-compliant",
              "stale",
              "pending",
              "retired"
            ]
          },
          "failing": {
            "type": "integer"
          },
          "checks": {
            "type": "integer"
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retired": {
            "type": "boolean"
          },
          "blueprint_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Explicitly assigned blueprint (single device only)"
          },
          "enrolled_at": {
            "type": "string",
            "format": "date-time",
            "description": "Single device only"
          },
          "inventory": {
            "type": "object",
            "description": "Inventory as reported by the agent (single device only)"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom attributes for file and firewall templates (single device only)"
          },
          "desktop": {
            "type": "string",
            "description": "Desktop environment, empty on servers"
          },
          "memory_mb": {
            "type": "integer"
          },
          "auto_locked": {
            "type": "boolean",
            "description": "Locked by the compliance policy"
          }
        },
        "required": [
          "id",
          "hostname",
          "os",
          "agent_version",
          "blueprint",
          "tags",
          "status",
          "failing",
          "checks",
          "last_seen",
          "retired",
          "desktop",
          "memory_mb",
          "auto_locked"
        ]
      },
      "DevicePage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Device"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as cursor to get the next page; absent on the last page."
          }
        }
      },
      "DevicePatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 32,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "description": "Replaces all tags; stored in lower case"
          },
          "blueprint_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "admin": {
                  "type": "boolean"
                }
              },
              "required": [
                "username",
                "email"
              ]
            }
          },
          "primary_user": {
            "type": "string",
            "description": "Email of a directory person; empty clears it"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom attributes for templates ({{.Attributes.name}}), replacing all; names start with a letter (letters, digits, _), at most 50, values up to 1024 bytes"
          }
        }
      },
      "CommandRequest": {
        "type": "object",
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "description": "A command type of the console, for example sync, update, reboot, shutdown, lock, unlock, message, lost, found, wipe, script, app_install, user_create, package_hold, package_downgrade, workload_action, firewall_remove_rule"
          },
          "params": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            },
            "description": "The console form fields: minutes (reboot, shutdown), confirm and message (lost, wipe), title and text (message), payload (script), app (app_install, app_remove), username, full_name, password, admin, keep_home (user commands), kind, name, installation (software_remove), name and release (package_hold), name and version (package_downgrade), kind, id and action (workload_action: start, stop or restart of a workload of the last inventory), rule_id and confirm_risk (firewall_remove_rule: a foreign rule of the inventory; confirm_risk for a rule that may cut SSH or the server). true is sent as on; reason (wipe, lost, script, package_downgrade, firewall_remove_rule, workload_action stop and restart: the reason shown to the approving admin when four eyes approval is on)."
          }
        }
      },
      "Command": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "device_id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sent",
              "ok",
              "failed",
              "expired"
            ]
          },
          "output": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CommandPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Command"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as cursor to get the next page; absent on the last page."
          }
        }
      },
      "LibraryItem": {
        "type": "object",
        "required": [
          "name",
          "type",
          "payload"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Declaration type, for example com.limdm.packages"
          },
          "description": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "description": "Declaration payload, validated like in the console"
          }
        }
      },
      "LibraryItemPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryItem"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as cursor to get the next page; absent on the last page."
          }
        }
      },
      "BlueprintInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          },
          "description": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tree": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          }
        }
      },
      "Blueprint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tree": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BlueprintPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Blueprint"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as cursor to get the next page; absent on the last page."
          }
        }
      },
      "Node": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "assign",
              "if"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "assign: library item ids"
          },
          "branches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "match": {
                  "type": "string",
                  "enum": [
                    "all",
                    "any"
                  ]
                },
                "rules": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "field",
                      "op",
                      "value"
                    ],
                    "properties": {
                      "field": {
                        "type": "string",
                        "example": "tag"
                      },
                      "op": {
                        "type": "string",
                        "example": "has"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  }
                },
                "nodes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Node"
                  }
                }
              },
              "required": [
                "match",
                "rules",
                "nodes"
              ]
            }
          },
          "else": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          }
        }
      },
      "TagList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "devices": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "AuditEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "prev": {
            "type": "string",
            "description": "Hash of the previous entry, hex"
          },
          "hash": {
            "type": "string",
            "description": "SHA-256 chain hash, hex"
          },
          "tenant_id": {
            "type": "integer",
            "description": "Tenant of the entry; absent for global entries. When set it is hashed as a fifth field after detail (decimal)."
          }
        }
      },
      "AuditPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as cursor to get the next page; absent on the last page."
          }
        }
      },
      "ApprovalPending": {
        "type": "object",
        "required": [
          "approval_id",
          "status"
        ],
        "properties": {
          "approval_id": {
            "type": "integer",
            "description": "ID of the pending approval request"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending"
            ]
          }
        }
      },
      "ApiToken": {
        "type": "object",
        "description": "An API token as the console creates it (Administration, API tokens); shown for reference, tokens are not managed through this API.",
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor",
              "metrics"
            ]
          },
          "read_only": {
            "type": "boolean"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Device scope of a helpdesk or auditor token: only devices with one of these tags are visible and reachable; empty means every device (of the token's tenant). Scoped tokens get no metrics."
          },
          "tenant_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tenant of the token; null for a global token. Set from the console's tenant context when the token is created."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Approval": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "action": {
            "type": "string",
            "description": "command, user.update, user.add, user.reset, recovery.view or remote_shell"
          },
          "target": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true,
            "description": "The request as stored; its shape depends on action"
          },
          "reason": {
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "expired",
              "used"
            ]
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "credentials": {
            "type": "string",
            "description": "new local credentials of an approved user.add or user.reset, only in the decision's answer"
          },
          "decision_reason": {
            "type": "string",
            "description": "Why the deciding admin approved or rejected"
          }
        },
        "required": [
          "id",
          "action",
          "target",
          "payload",
          "reason",
          "requested_by",
          "status",
          "decided_by",
          "decided_at",
          "created_at",
          "expires_at",
          "decision_reason"
        ]
      },
      "ApprovalPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Approval"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "Exception": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "check_id": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "exclude",
              "advisory"
            ]
          },
          "tag": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "approver": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        }
      },
      "ExceptionInput": {
        "type": "object",
        "required": [
          "check_id",
          "mode",
          "reason",
          "owner",
          "approver",
          "expires"
        ],
        "properties": {
          "check_id": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "exclude",
              "advisory"
            ]
          },
          "tag": {
            "type": "string",
            "description": "one device tag, empty for every device"
          },
          "reason": {
            "type": "string",
            "maxLength": 1000
          },
          "owner": {
            "type": "string",
            "maxLength": 200
          },
          "approver": {
            "type": "string",
            "maxLength": 200
          },
          "expires": {
            "type": "string",
            "format": "date",
            "description": "last day it applies, within three years"
          }
        }
      },
      "Token": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "read_only": {
            "type": "boolean"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "token": {
            "type": "string",
            "description": "the secret, only in the answer that created it"
          }
        }
      },
      "TokenInput": {
        "type": "object",
        "required": [
          "name",
          "role",
          "days"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor",
              "metrics"
            ]
          },
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "read_only": {
            "type": "boolean"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "device tags, helpdesk and auditor tokens only"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "commands",
                "library",
                "audit",
                "admin"
              ]
            },
            "description": "limits the token; empty: everything its role allows"
          }
        }
      },
      "Tenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "company_name": {
            "type": "string"
          },
          "devices": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Created": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          }
        }
      },
      "FacetCount": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        },
        "required": [
          "value",
          "count"
        ]
      },
      "DeviceFacets": {
        "type": "object",
        "required": [
          "total",
          "facets",
          "keys"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "facets": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/FacetCount"
              }
            },
            "description": "status, os, agent, blueprint, tag: at most 25 values each, most first"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "help": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "help"
              ]
            }
          }
        }
      },
      "Me": {
        "type": "object",
        "required": [
          "login",
          "role",
          "tenant",
          "super",
          "multi_tenant",
          "scope_tags",
          "scope_groups",
          "scopes",
          "permissions",
          "four_eyes",
          "locale",
          "date_format",
          "stale_hours",
          "version",
          "company_name",
          "accent"
        ],
        "properties": {
          "login": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor"
            ]
          },
          "tenant": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ],
            "description": "null: the global view"
          },
          "super": {
            "type": "boolean",
            "description": "may see every tenant and switch between them"
          },
          "multi_tenant": {
            "type": "boolean"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scope_groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "token scopes; empty: all the role allows"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "audit",
                "commands",
                "admin",
                "tenants"
              ]
            }
          },
          "four_eyes": {
            "type": "boolean"
          },
          "locale": {
            "type": "string",
            "enum": [
              "de",
              "en",
              "fr",
              "es",
              "it",
              "ru"
            ]
          },
          "date_format": {
            "type": "string"
          },
          "stale_hours": {
            "type": "integer"
          },
          "version": {
            "type": "string"
          },
          "company_name": {
            "type": "string"
          },
          "accent": {
            "type": "string",
            "description": "tenant color #rrggbb or empty; the app adjusts it to keep 4.5:1 contrast"
          },
          "csrf_token": {
            "type": "string",
            "description": "session callers only: send as X-CSRF-Token on state changes"
          }
        }
      },
      "SavedViewInput": {
        "type": "object",
        "required": [
          "list",
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "list": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "query": {
            "type": "string",
            "maxLength": 1000
          },
          "sort": {
            "type": "string",
            "maxLength": 64
          },
          "columns": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "shared": {
            "type": "boolean",
            "description": "visible to everybody in the tenant; admins only, audited"
          }
        }
      },
      "SavedView": {
        "type": "object",
        "required": [
          "id",
          "list",
          "name",
          "query",
          "sort",
          "columns",
          "shared",
          "owner",
          "mine",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "list": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "sort": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "shared": {
            "type": "boolean"
          },
          "owner": {
            "type": "string"
          },
          "mine": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SavedViewPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedView"
            }
          }
        }
      },
      "SchemaList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "description",
                "doc",
                "four_eyes",
                "title",
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "doc": {
                  "type": "string",
                  "description": "documentation link"
                },
                "four_eyes": {
                  "type": "boolean",
                  "description": "root effective: saves need four eyes approval while it is on"
                }
              }
            }
          }
        }
      },
      "StatsFleet": {
        "type": "object",
        "required": [
          "total",
          "online",
          "status",
          "agent_versions",
          "os",
          "cells",
          "truncated"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "active devices"
          },
          "online": {
            "type": "integer"
          },
          "status": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "agent_versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacetCount"
            }
          },
          "os": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacetCount"
            }
          },
          "cells": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "hostname",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            },
            "description": "one per device, worst status first, at most 5000"
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "StatsCompliance": {
        "type": "object",
        "required": [
          "score",
          "reporting",
          "compliant",
          "frameworks",
          "top_failing",
          "history"
        ],
        "properties": {
          "score": {
            "type": "number",
            "description": "percent of reporting devices that pass every check"
          },
          "reporting": {
            "type": "integer"
          },
          "compliant": {
            "type": "integer"
          },
          "frameworks": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "pass",
                "fail",
                "rate"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "bsi",
                    "cis",
                    "iso"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "pass": {
                  "type": "integer"
                },
                "fail": {
                  "type": "integer"
                },
                "rate": {
                  "type": "number",
                  "description": "percent of passing check results"
                }
              }
            }
          },
          "top_failing": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "title",
                "fail"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "fail": {
                  "type": "integer"
                }
              }
            }
          },
          "history": {
            "type": "array",
            "description": "global view only, oldest first",
            "items": {
              "type": "object",
              "required": [
                "day",
                "compliant",
                "noncompliant",
                "in_grace",
                "stale",
                "pending",
                "score"
              ],
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "compliant": {
                  "type": "integer"
                },
                "noncompliant": {
                  "type": "integer"
                },
                "in_grace": {
                  "type": "integer"
                },
                "stale": {
                  "type": "integer"
                },
                "pending": {
                  "type": "integer"
                },
                "score": {
                  "type": "number"
                }
              }
            }
          }
        }
      },
      "StatsAttention": {
        "type": "object",
        "required": [
          "approvals_pending",
          "commands_failed_24h",
          "commands_sent_24h",
          "noncompliant",
          "stale",
          "exceptions_expiring_7d",
          "last_backup"
        ],
        "properties": {
          "approvals_pending": {
            "type": "integer"
          },
          "commands_failed_24h": {
            "type": "integer"
          },
          "commands_sent_24h": {
            "type": "integer"
          },
          "noncompliant": {
            "type": "integer"
          },
          "stale": {
            "type": "integer"
          },
          "exceptions_expiring_7d": {
            "type": "integer"
          },
          "last_backup": {
            "description": "global view, admin and auditor only",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "status",
                  "started_at",
                  "size",
                  "error"
                ],
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "started_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "size": {
                    "type": "integer"
                  },
                  "error": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "CheckRefs": {
        "type": "object",
        "properties": {
          "bsi": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cis_benchmark": {
            "type": "string"
          },
          "iso": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ComplianceCheck": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "level": {
            "type": "integer"
          },
          "severity": {
            "type": "string"
          },
          "refs": {
            "$ref": "#/components/schemas/CheckRefs"
          },
          "pass": {
            "type": "integer"
          },
          "fail": {
            "type": "integer"
          },
          "na": {
            "type": "integer"
          },
          "excepted": {
            "type": "integer"
          },
          "failing_hosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "title",
          "level",
          "refs",
          "pass",
          "fail",
          "na",
          "excepted",
          "failing_hosts"
        ]
      },
      "ComplianceControl": {
        "type": "object",
        "properties": {
          "framework": {
            "type": "string",
            "enum": [
              "bsi",
              "cis",
              "iso"
            ]
          },
          "control": {
            "type": "string"
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pass": {
            "type": "integer"
          },
          "fail": {
            "type": "integer"
          }
        },
        "required": [
          "framework",
          "control",
          "checks",
          "pass",
          "fail"
        ]
      },
      "Compliance": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "compliant": {
            "type": "integer"
          },
          "noncompliant": {
            "type": "integer"
          },
          "stale": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "stale_hours": {
            "type": "integer"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplianceCheck"
            }
          },
          "controls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplianceControl"
            }
          }
        },
        "required": [
          "total",
          "compliant",
          "noncompliant",
          "stale",
          "pending",
          "stale_hours",
          "checks",
          "controls"
        ]
      },
      "ComplianceCheckDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ComplianceCheck"
          },
          {
            "type": "object",
            "properties": {
              "devices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "hostname": {
                      "type": "string"
                    },
                    "blueprint": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "remediated": {
                      "type": "boolean"
                    },
                    "last_seen": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "hostname",
                    "blueprint",
                    "status",
                    "detail",
                    "remediated",
                    "last_seen"
                  ]
                }
              },
              "truncated": {
                "type": "boolean"
              }
            },
            "required": [
              "devices",
              "truncated"
            ]
          }
        ]
      },
      "ComplianceHeatmap": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string",
            "enum": [
              "blueprint",
              "tenant"
            ]
          },
          "cells": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string"
                },
                "area": {
                  "type": "string"
                },
                "pass": {
                  "type": "integer"
                },
                "fail": {
                  "type": "integer"
                }
              },
              "required": [
                "column",
                "area",
                "pass",
                "fail"
              ]
            }
          }
        },
        "required": [
          "group",
          "cells"
        ]
      },
      "ComplianceHistory": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date"
          },
          "device": {
            "type": "string"
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "pass": {
                  "type": "integer"
                },
                "fail": {
                  "type": "integer"
                },
                "other": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "hostname",
                "pass",
                "fail",
                "other"
              ]
            }
          },
          "state": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "check_id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "since": {
                  "type": "string",
                  "format": "date-time"
                },
                "catalog_version": {
                  "type": "string"
                }
              },
              "required": [
                "check_id",
                "status",
                "detail",
                "since",
                "catalog_version"
              ]
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "check_id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "since": {
                  "type": "string",
                  "format": "date-time"
                },
                "catalog_version": {
                  "type": "string"
                }
              },
              "required": [
                "check_id",
                "status",
                "detail",
                "since",
                "catalog_version"
              ]
            }
          }
        },
        "required": [
          "at",
          "device",
          "devices",
          "state",
          "changes"
        ]
      },
      "CompliancePolicies": {
        "type": "object",
        "properties": {
          "policies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "blueprints": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "level": {
                  "type": "integer"
                },
                "remediate": {
                  "type": "boolean"
                },
                "exclude": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "advisory": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "grace_hours": {
                  "type": "integer"
                },
                "notify": {
                  "type": "boolean"
                },
                "lock_after_hours": {
                  "type": "integer"
                },
                "unlock_when_compliant": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "blueprints",
                "level",
                "remediate",
                "exclude"
              ]
            }
          },
          "custom_checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "item_id": {
                  "type": "integer"
                },
                "item_name": {
                  "type": "string"
                },
                "blueprints": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "level": {
                  "type": "integer"
                },
                "refs": {
                  "$ref": "#/components/schemas/CheckRefs"
                },
                "test": {
                  "type": "string"
                }
              },
              "required": [
                "item_id",
                "item_name",
                "blueprints",
                "id",
                "title",
                "severity",
                "level",
                "refs",
                "test"
              ]
            }
          }
        },
        "required": [
          "policies",
          "custom_checks"
        ]
      },
      "SignedEvidence": {
        "type": "object",
        "required": [
          "payload",
          "signature"
        ],
        "properties": {
          "payload": {
            "type": "object",
            "description": "format limdm-evidence/1: generated_at, generated_by, tenant, window_days, score, device states, frameworks, catalog_versions, agent_versions, devices with their check results, exceptions, history, changes"
          },
          "signature": {
            "type": "object",
            "required": [
              "alg",
              "public_key",
              "key_id",
              "value"
            ],
            "properties": {
              "alg": {
                "type": "string",
                "enum": [
                  "ed25519"
                ]
              },
              "public_key": {
                "type": "string"
              },
              "key_id": {
                "type": "string",
                "description": "SHA-256 of the public key, hex"
              },
              "value": {
                "type": "string",
                "description": "hex Ed25519 signature of 'limdm-evidence/1\\n' followed by the compact payload"
              }
            }
          }
        }
      },
      "ExceptionRequest": {
        "type": "object",
        "required": [
          "check_id",
          "mode",
          "reason",
          "owner",
          "expires"
        ],
        "properties": {
          "check_id": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "exclude",
              "advisory"
            ]
          },
          "tag": {
            "type": "string",
            "description": "one device tag, empty for every device"
          },
          "reason": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "expires": {
            "type": "string",
            "format": "date",
            "description": "last day it applies, within three years"
          }
        }
      },
      "DecisionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "description": "Why; required to reject from the console app"
          }
        }
      },
      "StatsTenant": {
        "type": "object",
        "required": [
          "id",
          "name",
          "devices",
          "compliant",
          "noncompliant",
          "stale",
          "pending",
          "score",
          "approvals_pending"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "devices": {
            "type": "integer"
          },
          "compliant": {
            "type": "integer"
          },
          "noncompliant": {
            "type": "integer"
          },
          "stale": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "score": {
            "type": "number",
            "description": "Compliant share of reporting devices, percent"
          },
          "approvals_pending": {
            "type": "integer"
          }
        }
      },
      "StatsTenantList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsTenant"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "StatsCommandDay": {
        "type": "object",
        "required": [
          "day",
          "failed",
          "total"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "failed": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "StatsCommandDays": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsCommandDay"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "OnboardingStep": {
        "type": "object",
        "required": [
          "id",
          "done"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "branding",
              "sso",
              "token",
              "blueprint",
              "device"
            ]
          },
          "done": {
            "type": "boolean"
          }
        }
      },
      "OnboardingList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnboardingStep"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "FleetCommand": {
        "type": "object",
        "required": [
          "id",
          "device_id",
          "hostname",
          "type",
          "status",
          "output",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "device_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sent",
              "ok",
              "failed",
              "expired"
            ]
          },
          "output": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FleetCommandPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FleetCommand"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ActivityItem": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "category",
          "at",
          "actor",
          "action",
          "label",
          "target",
          "detail"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "a<audit id> or e<device event id>"
          },
          "kind": {
            "type": "string",
            "enum": [
              "audit",
              "device"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "commands",
              "changes",
              "approvals",
              "access",
              "devices",
              "audit",
              "events"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "Readable action in the request language"
          },
          "target": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "description": "Device events: the event in the request language"
          },
          "key": {
            "type": "string",
            "description": "Device events: key of the event format (EventFormats in internal/api/events.go)"
          },
          "params": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Device events: parameters of the event format"
          }
        }
      },
      "ActivityPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ActivityHistogram": {
        "type": "object",
        "required": [
          "days",
          "categories"
        ],
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "day",
                "counts"
              ],
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "counts": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "commands",
                "changes",
                "approvals",
                "access",
                "devices",
                "audit",
                "events"
              ]
            }
          }
        }
      },
      "AuditStatus": {
        "type": "object",
        "required": [
          "broken_at",
          "verified_at",
          "keyed_from",
          "actions"
        ],
        "properties": {
          "broken_at": {
            "type": "integer",
            "format": "int64",
            "description": "First broken entry, 0 = intact"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last full verification"
          },
          "keyed_from": {
            "type": "integer",
            "format": "int64"
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "StatsUpdatesDay": {
        "type": "object",
        "required": [
          "day",
          "security_devices",
          "security_old",
          "agent_current",
          "agent_total"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "security_devices": {
            "type": [
              "integer",
              "null"
            ]
          },
          "security_old": {
            "type": [
              "integer",
              "null"
            ]
          },
          "agent_current": {
            "type": [
              "integer",
              "null"
            ]
          },
          "agent_total": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "StatsUpdates": {
        "type": "object",
        "required": [
          "security_devices",
          "security_updates",
          "security_old",
          "agent_newest",
          "agent_approved",
          "agent_current",
          "agent_total",
          "history"
        ],
        "properties": {
          "security_devices": {
            "type": "integer",
            "description": "Devices with pending security updates"
          },
          "security_updates": {
            "type": "integer",
            "description": "Pending security updates in total"
          },
          "security_old": {
            "type": "integer",
            "description": "Devices failing updates.security for more than 14 days"
          },
          "agent_newest": {
            "type": "string",
            "description": "Newest approved agent release, else the newest version reported"
          },
          "agent_approved": {
            "type": "boolean"
          },
          "agent_current": {
            "type": "integer"
          },
          "agent_total": {
            "type": "integer"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsUpdatesDay"
            },
            "description": "Global view only, oldest first"
          }
        }
      },
      "StatsAnnotation": {
        "type": "object",
        "required": [
          "day",
          "action",
          "label",
          "target",
          "count"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "action": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "StatsAnnotationList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsAnnotation"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ReportSchedule": {
        "type": "object",
        "required": [
          "id",
          "view_id",
          "name",
          "query",
          "owner",
          "tenant_id",
          "cadence",
          "channels",
          "emails",
          "next_run",
          "last_run",
          "last_error"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "view_id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "tenant_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "next_run": {
            "type": "string",
            "format": "date-time"
          },
          "last_run": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": "string"
          }
        }
      },
      "ReportScheduleList": {
        "type": "object",
        "required": [
          "items",
          "channels"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSchedule"
            }
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "kind"
              ],
              "properties": {
                "id": {
                  "type": "integer",
                  "format": "int64"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ReportScheduleInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "view_id",
          "cadence"
        ],
        "properties": {
          "view_id": {
            "type": "integer",
            "format": "int64",
            "description": "A saved view of the list reports"
          },
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "emails": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "email"
            }
          }
        }
      },
      "ReportRun": {
        "type": "object",
        "required": [
          "id",
          "schedule_id",
          "at",
          "kind",
          "rows",
          "sha256",
          "error"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "schedule_id": {
            "type": "integer",
            "format": "int64"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string"
          },
          "rows": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "ReportRunList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportRun"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "DevicePackage": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "arch": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "version",
          "arch"
        ]
      },
      "TimelineEntry": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "event",
              "command",
              "script",
              "shell",
              "diagnostics",
              "compliance",
              "audit"
            ]
          },
          "id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "by": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "extra": {
            "type": "string",
            "description": "Audit: label of the action; event: the event in the request language"
          },
          "key": {
            "type": "string",
            "description": "Device events: key of the event format (EventFormats in internal/api/events.go)"
          },
          "params": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Device events: parameters of the event format"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "title",
          "status",
          "by",
          "detail",
          "extra"
        ]
      },
      "TimelinePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineEntry"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "items"
        ]
      },
      "RecoveryKeyView": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string"
          },
          "device": {
            "type": "string"
          },
          "uuid": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "",
              "reason",
              "pending",
              "requested"
            ]
          },
          "key": {
            "type": "string"
          },
          "rotate": {
            "type": "boolean"
          }
        },
        "required": [
          "hostname",
          "device",
          "uuid",
          "state",
          "rotate"
        ]
      },
      "ShellSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "device_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "local_user": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "end_reason": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "connected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "bytes": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          },
          "live": {
            "type": "boolean"
          },
          "can_end": {
            "type": "boolean"
          },
          "transcript": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "device_id",
          "hostname",
          "requested_by",
          "local_user",
          "state",
          "end_reason",
          "created_at",
          "connected_at",
          "ended_at",
          "bytes",
          "truncated",
          "live",
          "can_end"
        ]
      },
      "BulkRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "action": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          }
        },
        "required": [
          "ids",
          "action"
        ]
      },
      "EnrollmentToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "blueprint": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "uses_left": {
            "type": "integer"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "note",
          "blueprint",
          "created_by",
          "uses_left",
          "expires_at"
        ]
      },
      "EnrollmentInfo": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnrollmentToken"
            }
          },
          "agent_url": {
            "type": "string"
          },
          "public_url": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "release_repo": {
            "type": "string"
          },
          "limits": {
            "$ref": "#/components/schemas/EnrollSettings"
          }
        },
        "required": [
          "items",
          "agent_url",
          "public_url",
          "fingerprint",
          "release_repo",
          "limits"
        ]
      },
      "DeviceDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Device"
          },
          {
            "type": "object",
            "properties": {
              "inventory": {
                "type": "object",
                "additionalProperties": true
              },
              "check_results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "declarations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "identifier": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "info": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "notes of the reported state (com.limdm.hostname: target, source, result, warnings)"
                    }
                  },
                  "required": [
                    "identifier",
                    "type",
                    "state",
                    "reasons"
                  ]
                }
              },
              "chain": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assigned": {
                      "type": "boolean"
                    },
                    "applies": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type"
                  ]
                }
              },
              "blueprints": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "assigned": {
                      "type": "boolean"
                    },
                    "applies": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              },
              "blueprint_source": {
                "type": "object",
                "properties": {
                  "Kind": {
                    "type": "string"
                  },
                  "Group": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "integer"
                  }
                },
                "required": [
                  "Kind",
                  "Group",
                  "Priority"
                ]
              },
              "primary_user": {
                "type": "string"
              },
              "desktop_users": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "username": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "admin": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "username",
                    "email",
                    "admin"
                  ]
                }
              },
              "protective": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "by": {
                      "type": "string"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "type",
                    "status",
                    "by",
                    "at"
                  ]
                }
              },
              "tampered_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "auto_locked": {
                "type": "boolean"
              },
              "failing_since": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "grace_until": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "lock_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "notify_on_grace": {
                "type": "boolean"
              },
              "cert_expires": {
                "type": "string",
                "format": "date-time"
              },
              "update_state": {
                "type": "string"
              },
              "update_version": {
                "type": "string"
              },
              "update_requested": {
                "type": "boolean"
              },
              "external_ip": {
                "type": "string"
              },
              "geo": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              },
              "place": {
                "type": "string"
              },
              "recovery_keys": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "uuid": {
                      "type": "string"
                    },
                    "device": {
                      "type": "string"
                    },
                    "escrowed": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "viewed_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "viewed_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rotate": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "uuid",
                    "device",
                    "escrowed",
                    "viewed_at",
                    "viewed_by",
                    "rotate"
                  ]
                }
              },
              "agent_versions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "network_certs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "serial": {
                      "type": "string"
                    },
                    "sans": {
                      "type": "string"
                    },
                    "not_before": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "not_after": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "state": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "serial",
                    "sans",
                    "not_before",
                    "not_after",
                    "state"
                  ]
                }
              },
              "app_names": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "app_busy": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "app_notes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "app",
                    "type",
                    "ok",
                    "at"
                  ]
                }
              },
              "catalog_flatpaks": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "catalog_requests": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "app": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "decided_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decided_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "install": {
                      "type": "boolean",
                      "description": "Approved with install: the agent installs the app at once."
                    },
                    "install_state": {
                      "type": "string",
                      "enum": [
                        "",
                        "installed",
                        "install_failed"
                      ],
                      "description": "Result of an approval with install, empty until the device reports it."
                    },
                    "install_error": {
                      "type": "string",
                      "description": "Why the install failed (install_failed)."
                    }
                  },
                  "required": [
                    "id",
                    "app",
                    "name",
                    "username",
                    "note",
                    "status",
                    "decided_by",
                    "decided_at",
                    "created_at",
                    "install",
                    "install_state",
                    "install_error"
                  ]
                }
              },
              "encryption_exempt": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "metrics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "mem_pct": {
                      "type": "number"
                    },
                    "root_pct": {
                      "type": "number"
                    },
                    "load1": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "at",
                    "mem_pct",
                    "root_pct",
                    "load1"
                  ]
                }
              },
              "package_count": {
                "type": "integer"
              },
              "password_min": {
                "type": "integer"
              },
              "shell": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "allowed": {
                    "type": "boolean"
                  },
                  "allow_root": {
                    "type": "boolean"
                  },
                  "max_minutes": {
                    "type": "integer"
                  },
                  "idle_minutes": {
                    "type": "integer"
                  },
                  "four_eyes": {
                    "type": "boolean"
                  },
                  "policy": {
                    "type": "boolean",
                    "description": "The device's policy allows remote shells (com.limdm.agent remote_shell)."
                  }
                },
                "required": [
                  "enabled",
                  "allowed",
                  "allow_root",
                  "max_minutes",
                  "idle_minutes",
                  "four_eyes",
                  "policy"
                ]
              },
              "four_eyes_commands": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "four_eyes_recovery": {
                "type": "boolean"
              },
              "diagnostics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "command_id": {
                      "type": "integer"
                    },
                    "size": {
                      "type": "integer"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "command_id",
                    "size",
                    "at"
                  ]
                }
              },
              "tpm_bound": {
                "type": "boolean",
                "description": "The mTLS key was attested as held by a TPM 2.0"
              },
              "tpm_ek_sha256": {
                "type": "string",
                "description": "SHA-256 of the TPM endorsement key's public area, when bound"
              }
            },
            "required": [
              "inventory",
              "check_results",
              "declarations",
              "chain",
              "items",
              "blueprints",
              "blueprint_source",
              "primary_user",
              "desktop_users",
              "protective",
              "tampered_at",
              "auto_locked",
              "failing_since",
              "grace_until",
              "lock_at",
              "notify_on_grace",
              "cert_expires",
              "update_state",
              "update_version",
              "update_requested",
              "external_ip",
              "geo",
              "place",
              "recovery_keys",
              "agent_versions",
              "network_certs",
              "app_names",
              "app_busy",
              "app_notes",
              "catalog_flatpaks",
              "catalog_requests",
              "encryption_exempt",
              "metrics",
              "package_count",
              "password_min",
              "shell",
              "four_eyes_commands",
              "four_eyes_recovery",
              "diagnostics",
              "tpm_bound",
              "tpm_ek_sha256"
            ]
          }
        ]
      },
      "ConfigDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "by": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "at",
          "by"
        ]
      },
      "ConfigBlueprintSource": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "device",
              "group",
              "default"
            ]
          },
          "group": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "devices": {
            "type": "integer"
          }
        }
      },
      "ConfigBlueprint": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Blueprint"
          },
          {
            "type": "object",
            "properties": {
              "parent": {
                "type": "string"
              },
              "devices": {
                "type": "integer"
              },
              "status": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "items": {
                "type": "integer"
              },
              "sources": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConfigBlueprintSource"
                }
              },
              "read_only": {
                "type": "boolean"
              },
              "deletable": {
                "type": "boolean"
              },
              "inherited": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "pilot": {
                "$ref": "#/components/schemas/ConfigPilot"
              },
              "pilot_of": {
                "type": "integer",
                "description": "this blueprint is the pilot copy of that one"
              }
            },
            "required": [
              "parent",
              "devices",
              "status",
              "items",
              "sources",
              "read_only",
              "deletable",
              "inherited"
            ]
          }
        ]
      },
      "ConfigBlueprints": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigBlueprint"
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigDeleted"
            }
          },
          "rule_fields": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "items",
          "deleted",
          "rule_fields"
        ]
      },
      "ConfigLibraryItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LibraryItem"
          },
          {
            "type": "object",
            "properties": {
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "used_by": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "invalid": {
                "type": "boolean"
              },
              "read_only": {
                "type": "boolean"
              }
            },
            "required": [
              "updated_at",
              "used_by",
              "invalid",
              "read_only"
            ]
          }
        ]
      },
      "ConfigLibrary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigLibraryItem"
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigDeleted"
            }
          }
        },
        "required": [
          "items",
          "deleted"
        ]
      },
      "ConfigPreview": {
        "type": "object",
        "properties": {
          "diff": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "op": {
                  "type": "string",
                  "enum": [
                    "same",
                    "add",
                    "del"
                  ]
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "op",
                "text"
              ]
            }
          },
          "blueprints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "devices": {
            "type": "integer"
          },
          "online": {
            "type": "integer"
          },
          "offline": {
            "type": "integer"
          },
          "status": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "sample": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "hostname",
                "status"
              ]
            }
          },
          "needs_approval": {
            "type": "boolean"
          },
          "impact": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "level",
                    "excluded_added",
                    "excluded_removed",
                    "advisory_added",
                    "advisory_removed",
                    "items_added",
                    "items_removed"
                  ]
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "code",
                "values"
              ]
            }
          }
        },
        "required": [
          "diff",
          "blueprints",
          "devices",
          "online",
          "offline",
          "status",
          "sample",
          "needs_approval",
          "impact"
        ]
      },
      "ConfigVersions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "exists": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "integer"
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "by": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "deleted": {
                  "type": "boolean"
                },
                "doc": {
                  "type": "string",
                  "description": "readable text the diff compares"
                }
              },
              "required": [
                "version",
                "at",
                "by",
                "note",
                "deleted",
                "doc"
              ]
            }
          }
        },
        "required": [
          "id",
          "name",
          "exists",
          "items"
        ]
      },
      "ConfigSaved": {
        "type": "object",
        "properties": {
          "id": {},
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ]
      },
      "AppSource": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "flatpak",
              "package"
            ]
          },
          "flatpak": {
            "type": "string"
          },
          "remote": {
            "type": "string"
          },
          "debian": {
            "type": "string"
          },
          "fedora": {
            "type": "string"
          },
          "repos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "family": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "suites": {
                  "type": "string"
                },
                "components": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "signed_metadata": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "required": [
          "kind"
        ]
      },
      "CatalogApp": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "available",
              "request",
              "required"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSource"
            }
          },
          "detect": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "icon_hash": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "has_icon": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "installs": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "mode",
          "sources",
          "enabled",
          "scope",
          "has_icon",
          "updated_at",
          "installs"
        ]
      },
      "CatalogAppInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "available",
              "request",
              "required"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSource"
            }
          },
          "detect": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "icon": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "PNG"
          },
          "remove_icon": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "mode",
          "sources"
        ]
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogApp"
            }
          },
          "fleet": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "origin": {
                  "type": "string"
                },
                "devices": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "name",
                "origin",
                "devices"
              ]
            }
          },
          "pending_requests": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "fleet",
          "pending_requests"
        ]
      },
      "FlatpakHit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "remote": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "developer": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "remote"
        ]
      },
      "AppRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "device_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "app": {
            "type": "string"
          },
          "app_name": {
            "type": "string"
          },
          "user": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "denied"
            ]
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "flatpak": {
            "type": "string"
          },
          "remote": {
            "type": "string"
          },
          "install": {
            "type": "boolean",
            "description": "Approved with install: the agent installs the app at once."
          },
          "install_state": {
            "type": "string",
            "enum": [
              "",
              "installed",
              "install_failed"
            ],
            "description": "Result of an approval with install, empty until the device reports it."
          },
          "install_error": {
            "type": "string",
            "description": "Why the install failed (install_failed)."
          }
        },
        "required": [
          "id",
          "device_id",
          "hostname",
          "app",
          "app_name",
          "user",
          "note",
          "status",
          "created_at",
          "flatpak",
          "remote",
          "install",
          "install_state",
          "install_error"
        ]
      },
      "Remote": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "allowed",
              "blocked",
              ""
            ]
          },
          "catalog_only": {
            "type": "boolean"
          },
          "devices": {
            "type": "integer"
          },
          "managed": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "url",
          "title",
          "state",
          "catalog_only",
          "devices",
          "managed"
        ]
      },
      "SoftwareSettings": {
        "type": "object",
        "properties": {
          "restrict_flathub": {
            "type": "boolean"
          },
          "stores_read_only": {
            "type": "boolean"
          },
          "only_managed_remotes": {
            "type": "boolean"
          }
        },
        "required": [
          "restrict_flathub",
          "stores_read_only",
          "only_managed_remotes"
        ]
      },
      "Package": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "tenant_id": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "store": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "uploaded_by": {
            "type": "string"
          },
          "approved_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "usage": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "snippet": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "sha256",
          "name",
          "version",
          "kind",
          "filename",
          "store",
          "size",
          "uploaded_by",
          "approved_by",
          "created_at",
          "usage",
          "snippet"
        ]
      },
      "PackageConfig": {
        "type": "object",
        "properties": {
          "max_upload_mb": {
            "type": "integer"
          },
          "quota_mb": {
            "type": "integer"
          },
          "quota_count": {
            "type": "integer"
          },
          "store": {
            "type": "string",
            "enum": [
              "local",
              "s3"
            ]
          },
          "s3": {
            "type": "object",
            "properties": {
              "endpoint": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "bucket": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "access_key": {
                "type": "string"
              },
              "path_style": {
                "type": "boolean"
              },
              "secret": {
                "type": "string",
                "description": "write only; kept when empty"
              }
            }
          }
        },
        "required": [
          "max_upload_mb",
          "quota_mb",
          "quota_count",
          "store"
        ]
      },
      "Packages": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Package"
            }
          },
          "config": {
            "$ref": "#/components/schemas/PackageConfig"
          },
          "used_bytes": {
            "type": "integer"
          },
          "used_count": {
            "type": "integer"
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "four_eyes": {
            "type": "boolean"
          },
          "global": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "config",
          "used_bytes",
          "used_count",
          "kinds",
          "four_eyes",
          "global",
          "type"
        ]
      },
      "ConfigPilot": {
        "type": "object",
        "required": [
          "id",
          "devices",
          "by",
          "at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "the pilot copy"
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "by": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PasswordPolicy": {
        "type": "object",
        "properties": {
          "min_length": {
            "type": "integer"
          },
          "upper": {
            "type": "boolean"
          },
          "lower": {
            "type": "boolean"
          },
          "digit": {
            "type": "boolean"
          },
          "symbol": {
            "type": "boolean"
          },
          "no_name": {
            "type": "boolean"
          }
        },
        "required": []
      },
      "RoleGroup": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "group",
          "role"
        ]
      },
      "RemoteShellSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "helpdesk": {
            "type": "boolean"
          },
          "allow_root": {
            "type": "boolean"
          },
          "max_minutes": {
            "type": "integer"
          },
          "idle_minutes": {
            "type": "integer"
          }
        },
        "required": []
      },
      "OpsSettings": {
        "type": "object",
        "properties": {
          "log_level": {
            "type": "string",
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ]
          },
          "access_log": {
            "type": "boolean"
          },
          "audit_api_reads": {
            "type": "string",
            "enum": [
              "off",
              "sensitive",
              "all"
            ]
          },
          "update_downloads": {
            "type": "integer"
          },
          "max_checkins": {
            "type": "integer"
          },
          "agent_proxy_protocol": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "syslog": {
            "type": "string"
          },
          "syslog_ca": {
            "type": "string"
          }
        },
        "required": [
          "log_level",
          "access_log",
          "audit_api_reads",
          "update_downloads",
          "max_checkins",
          "agent_proxy_protocol",
          "syslog",
          "syslog_ca"
        ]
      },
      "SettingsInput": {
        "type": "object",
        "properties": {
          "oidc_issuer": {
            "type": "string"
          },
          "oidc_client_id": {
            "type": "string"
          },
          "allowed_domain": {
            "type": "string"
          },
          "local_login": {
            "type": "boolean"
          },
          "stale_hours": {
            "type": "integer"
          },
          "webhook_url": {
            "type": "string"
          },
          "company_name": {
            "type": "string"
          },
          "console_allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "console_block": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scim_allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notify_private_networks": {
            "type": "boolean"
          },
          "password_policy": {
            "$ref": "#/components/schemas/PasswordPolicy"
          },
          "four_eyes": {
            "type": "boolean"
          },
          "four_eyes_recovery": {
            "type": "boolean"
          },
          "four_eyes_shell": {
            "type": "boolean"
          },
          "four_eyes_workloads": {
            "type": "boolean",
            "description": "Stopping and restarting containers and VMs waits for a second admin (needs four_eyes)"
          },
          "workloads_helpdesk": {
            "type": "boolean",
            "description": "The helpdesk role may start, stop and restart containers and VMs"
          },
          "require_mfa": {
            "type": "boolean"
          },
          "mfa_acr": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retention": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Days per data type (retention_kinds); 0 keeps the audit log forever"
          },
          "role_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleGroup"
            }
          },
          "geolocation": {
            "type": "boolean"
          },
          "fallback_dns": {
            "type": "boolean"
          },
          "remote_shell": {
            "$ref": "#/components/schemas/RemoteShellSettings"
          },
          "ops": {
            "$ref": "#/components/schemas/OpsSettings"
          },
          "oidc_client_secret": {
            "type": "string",
            "description": "New OIDC client secret; empty keeps the stored one"
          },
          "clear_secret": {
            "type": "boolean"
          },
          "logo_png": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "PNG, square, up to 256 KiB"
          },
          "remove_logo": {
            "type": "boolean"
          },
          "network_cert_domain": {
            "type": "string",
            "description": "EAP-TLS certificates carry <device ID>.<domain> as DNS SAN; empty: no DNS SAN"
          },
          "enrollment": {
            "$ref": "#/components/schemas/EnrollSettings"
          },
          "cve_feeds": {
            "$ref": "#/components/schemas/CVEFeedSettings"
          },
          "logs": {
            "$ref": "#/components/schemas/LogSettings"
          }
        },
        "required": []
      },
      "RetentionKind": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "days": {
            "type": "integer"
          },
          "default": {
            "type": "integer"
          },
          "min": {
            "type": "integer"
          },
          "max": {
            "type": "integer"
          },
          "forever": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "days",
          "default",
          "min",
          "max",
          "forever"
        ]
      },
      "Settings": {
        "type": "object",
        "properties": {
          "oidc_issuer": {
            "type": "string"
          },
          "oidc_client_id": {
            "type": "string"
          },
          "allowed_domain": {
            "type": "string"
          },
          "local_login": {
            "type": "boolean"
          },
          "stale_hours": {
            "type": "integer"
          },
          "webhook_url": {
            "type": "string"
          },
          "company_name": {
            "type": "string"
          },
          "console_allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "console_block": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scim_allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notify_private_networks": {
            "type": "boolean"
          },
          "password_policy": {
            "$ref": "#/components/schemas/PasswordPolicy"
          },
          "four_eyes": {
            "type": "boolean"
          },
          "four_eyes_recovery": {
            "type": "boolean"
          },
          "four_eyes_shell": {
            "type": "boolean"
          },
          "four_eyes_workloads": {
            "type": "boolean",
            "description": "Stopping and restarting containers and VMs waits for a second admin (needs four_eyes)"
          },
          "workloads_helpdesk": {
            "type": "boolean",
            "description": "The helpdesk role may start, stop and restart containers and VMs"
          },
          "require_mfa": {
            "type": "boolean"
          },
          "mfa_acr": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retention": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Days per data type (retention_kinds); 0 keeps the audit log forever"
          },
          "role_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleGroup"
            }
          },
          "geolocation": {
            "type": "boolean"
          },
          "fallback_dns": {
            "type": "boolean"
          },
          "remote_shell": {
            "$ref": "#/components/schemas/RemoteShellSettings"
          },
          "ops": {
            "$ref": "#/components/schemas/OpsSettings"
          },
          "has_oidc_secret": {
            "type": "boolean"
          },
          "has_logo": {
            "type": "boolean"
          },
          "public_url": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          },
          "client_ip": {
            "type": "string"
          },
          "webhook_secret": {
            "type": "string",
            "description": "Signing key of the compliance webhook; admins only"
          },
          "retention_kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetentionKind"
            }
          },
          "network_cert_domain": {
            "type": "string",
            "description": "EAP-TLS certificates carry <device ID>.<domain> as DNS SAN; empty: no DNS SAN"
          },
          "enrollment": {
            "$ref": "#/components/schemas/EnrollSettings"
          },
          "cve_feeds": {
            "$ref": "#/components/schemas/CVEFeedSettings"
          },
          "logs": {
            "$ref": "#/components/schemas/LogSettings"
          }
        },
        "required": [
          "local_login",
          "stale_hours",
          "password_policy",
          "ops",
          "has_oidc_secret",
          "has_logo",
          "public_url",
          "redirect_uri",
          "client_ip",
          "retention_kinds",
          "enrollment"
        ]
      },
      "ConsoleUser": {
        "type": "object",
        "properties": {
          "login": {
            "type": "string",
            "description": "Email (OIDC) or local:name"
          },
          "role": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "local": {
            "type": "boolean"
          },
          "last_login": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scope_groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from_group": {
            "type": "boolean"
          },
          "tenant": {
            "type": "string"
          },
          "self": {
            "type": "boolean"
          }
        },
        "required": [
          "login",
          "role",
          "disabled",
          "local",
          "last_login",
          "scope_tags",
          "scope_groups",
          "from_group",
          "tenant",
          "self"
        ]
      },
      "ConsoleUserList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsoleUser"
            }
          },
          "local_login": {
            "type": "boolean"
          },
          "oidc": {
            "type": "boolean"
          },
          "four_eyes": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "local_login",
          "oidc",
          "four_eyes"
        ]
      },
      "ConsoleUserInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "oidc",
              "local"
            ]
          },
          "login": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "login",
          "role"
        ]
      },
      "ConsoleUserPatch": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "helpdesk",
              "auditor"
            ]
          },
          "disabled": {
            "type": "boolean"
          },
          "scope_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scope_groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "role"
        ]
      },
      "Credentials": {
        "type": "object",
        "properties": {
          "credentials": {
            "type": "string",
            "description": "User, role, password, TOTP secret and otpauth URI; shown once"
          }
        },
        "required": [
          "credentials"
        ]
      },
      "SharedObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "shared": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "shared"
        ]
      },
      "SharedObjects": {
        "type": "object",
        "properties": {
          "blueprints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SharedObject"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SharedObject"
            }
          }
        },
        "required": [
          "blueprints",
          "items"
        ]
      },
      "TenantDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "company_name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "has_logo": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "require_tpm": {
            "type": "boolean",
            "description": "Enrollment into this tenant needs a TPM bound key"
          }
        },
        "required": [
          "id",
          "name",
          "disabled",
          "company_name",
          "color",
          "has_logo",
          "created_at",
          "require_tpm"
        ]
      },
      "TenantPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "company_name": {
            "type": "string"
          },
          "color": {
            "type": "string",
            "description": "#rrggbb or empty"
          },
          "logo_png": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "remove_logo": {
            "type": "boolean"
          },
          "require_tpm": {
            "type": "boolean",
            "description": "Tenant admins may only switch it on"
          }
        },
        "required": []
      },
      "KeyStatus": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "ca",
              "netca",
              "command",
              "session",
              "webhook",
              "logs"
            ]
          },
          "active": {
            "type": "string"
          },
          "previous": {
            "type": "string"
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "done": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "restart": {
            "type": "boolean"
          },
          "location": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "active",
          "previous",
          "since",
          "done",
          "total",
          "restart",
          "location"
        ]
      },
      "KeepRule": {
        "type": "object",
        "properties": {
          "last": {
            "type": "integer"
          },
          "days": {
            "type": "integer"
          },
          "daily": {
            "type": "integer"
          },
          "weekly": {
            "type": "integer"
          },
          "monthly": {
            "type": "integer"
          },
          "yearly": {
            "type": "integer"
          }
        },
        "required": []
      },
      "BackupTarget": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "local",
              "s3",
              "b2",
              "sftp",
              "webdav"
            ]
          },
          "dir": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "access_key": {
            "type": "string"
          },
          "path_style": {
            "type": "boolean"
          },
          "lock_mode": {
            "type": "string",
            "enum": [
              "",
              "GOVERNANCE",
              "COMPLIANCE"
            ]
          },
          "lock_days": {
            "type": "integer"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "user": {
            "type": "string"
          },
          "host_key": {
            "type": "string"
          },
          "has_secret": {
            "type": "boolean"
          },
          "has_key": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "kind",
          "has_secret",
          "has_key"
        ]
      },
      "BackupTargetInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "local",
              "s3",
              "b2",
              "sftp",
              "webdav"
            ]
          },
          "dir": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "access_key": {
            "type": "string"
          },
          "path_style": {
            "type": "boolean"
          },
          "lock_mode": {
            "type": "string",
            "enum": [
              "",
              "GOVERNANCE",
              "COMPLIANCE"
            ]
          },
          "lock_days": {
            "type": "integer"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "user": {
            "type": "string"
          },
          "host_key": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "Secret key or password; empty keeps the stored one while the target points at the same server"
          },
          "private_key": {
            "type": "string",
            "description": "SFTP private key (PEM); empty keeps the stored one"
          }
        },
        "required": [
          "kind"
        ]
      },
      "BackupScheduleInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "paused": {
            "type": "boolean"
          },
          "kind": {
            "type": "string",
            "enum": [
              "interval",
              "weekly",
              "monthly",
              "cron"
            ]
          },
          "every": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "days": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "times": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "day": {
            "type": "integer"
          },
          "cron": {
            "type": "string"
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keep": {
            "$ref": "#/components/schemas/KeepRule"
          }
        },
        "required": [
          "kind",
          "targets",
          "keep"
        ]
      },
      "RetentionPreview": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "integer"
          },
          "kept": {
            "type": "integer"
          },
          "oldest": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dates": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "required": [
          "runs",
          "kept",
          "oldest",
          "dates"
        ]
      },
      "BackupSchedule": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "paused": {
            "type": "boolean"
          },
          "kind": {
            "type": "string",
            "enum": [
              "interval",
              "weekly",
              "monthly",
              "cron"
            ]
          },
          "every": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "days": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "times": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "day": {
            "type": "integer"
          },
          "cron": {
            "type": "string"
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keep": {
            "$ref": "#/components/schemas/KeepRule"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "next": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            }
          },
          "preview": {
            "$ref": "#/components/schemas/RetentionPreview"
          }
        },
        "required": [
          "name",
          "kind",
          "targets",
          "keep",
          "next",
          "preview"
        ]
      },
      "BackupRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "size": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "verify_error": {
            "type": "string"
          },
          "restore_tested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "restore_test_error": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "reason",
          "actor",
          "started_at",
          "size",
          "sha256",
          "targets",
          "status",
          "error",
          "verified_at",
          "verify_error",
          "restore_tested_at",
          "restore_test_error",
          "deleted_at"
        ]
      },
      "Backup": {
        "type": "object",
        "properties": {
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "time_zone": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "keep": {
            "$ref": "#/components/schemas/KeepRule"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackupTarget"
            }
          },
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackupSchedule"
            }
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackupRun"
            }
          },
          "offsite": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "rule_321": {
            "type": "boolean"
          }
        },
        "required": [
          "recipients",
          "time_zone",
          "zone",
          "keep",
          "targets",
          "schedules",
          "history",
          "offsite",
          "locked",
          "rule_321"
        ]
      },
      "BackupInput": {
        "type": "object",
        "properties": {
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "age X25519 public keys (age1...)"
          },
          "time_zone": {
            "type": "string"
          },
          "keep": {
            "$ref": "#/components/schemas/KeepRule"
          }
        },
        "required": [
          "recipients",
          "keep"
        ]
      },
      "ChannelConfig": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "tls": {
            "type": "string",
            "enum": [
              "starttls",
              "tls"
            ]
          },
          "user": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "de",
              "fr",
              "es",
              "it",
              "ru"
            ],
            "description": "Language of email, Slack and Discord notifications (webhooks stay English); English when empty"
          }
        },
        "required": []
      },
      "Channel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "slack",
              "discord",
              "email",
              "webhook"
            ]
          },
          "target": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "global": {
            "type": "boolean"
          },
          "config": {
            "$ref": "#/components/schemas/ChannelConfig"
          },
          "last_ok": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "last_error": {
            "type": "string"
          },
          "last_event": {
            "type": "string"
          },
          "last_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "target",
          "events",
          "enabled",
          "global",
          "config",
          "last_ok",
          "last_error",
          "last_event",
          "last_at"
        ]
      },
      "ChannelList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Channel"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "label"
              ]
            }
          },
          "notify_private": {
            "type": "boolean"
          },
          "tenant_signing_key": {
            "type": "string"
          },
          "tenant_id": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "events",
          "notify_private"
        ]
      },
      "ChannelInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "slack",
              "discord",
              "email",
              "webhook"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "description": "Webhook URL (https), stored encrypted"
          },
          "password": {
            "type": "string",
            "description": "SMTP password, stored encrypted"
          },
          "config": {
            "$ref": "#/components/schemas/ChannelConfig"
          }
        },
        "required": [
          "name",
          "kind"
        ]
      },
      "DirectoryGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "external_id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "members": {
            "type": "integer"
          },
          "blueprint_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "external_id",
          "source",
          "name",
          "members",
          "blueprint_id",
          "priority"
        ]
      },
      "Directory": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryGroup"
            }
          },
          "google": {
            "type": "object",
            "properties": {
              "admin_email": {
                "type": "string"
              },
              "configured": {
                "type": "boolean"
              },
              "last_result": {
                "type": "string"
              },
              "last_sync": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "admin_email",
              "configured",
              "last_result",
              "last_sync"
            ]
          },
          "scim": {
            "type": "object",
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "configured",
              "url"
            ]
          },
          "role_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleGroup"
            }
          }
        },
        "required": [
          "groups",
          "google",
          "scim",
          "role_groups"
        ]
      },
      "DirectoryUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "external_id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "user_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "department": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "group_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "external_id",
          "source",
          "user_name",
          "email",
          "display_name",
          "department",
          "title",
          "active",
          "groups",
          "group_ids",
          "updated_at"
        ]
      },
      "NetworkCert": {
        "type": "object",
        "properties": {
          "serial": {
            "type": "string"
          },
          "device_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "sans": {
            "type": "string"
          },
          "not_before": {
            "type": "string",
            "format": "date-time"
          },
          "not_after": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "valid",
              "expired",
              "revoked"
            ]
          }
        },
        "required": [
          "serial",
          "device_id",
          "hostname",
          "subject",
          "sans",
          "not_before",
          "not_after",
          "revoked_at",
          "reason",
          "state"
        ]
      },
      "Network": {
        "type": "object",
        "properties": {
          "certs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetworkCert"
            }
          },
          "crl_token_set": {
            "type": "boolean"
          },
          "crl_url": {
            "type": "string"
          },
          "ca_url": {
            "type": "string"
          },
          "ca_fingerprint": {
            "type": "string"
          },
          "ca_subject": {
            "type": "string"
          },
          "ca_not_after": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "certs",
          "crl_token_set",
          "crl_url",
          "ca_url",
          "ca_fingerprint",
          "ca_subject",
          "ca_not_after"
        ]
      },
      "UpdatePolicy": {
        "type": "object",
        "properties": {
          "auto": {
            "type": "boolean"
          },
          "delay_days": {
            "type": "integer"
          },
          "pilot_tag": {
            "type": "string"
          },
          "spread_hours": {
            "type": "integer"
          }
        },
        "required": [
          "auto",
          "delay_days",
          "pilot_tag",
          "spread_hours"
        ]
      },
      "AgentRelease": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "signed": {
            "type": "boolean"
          },
          "approved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approved_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocked": {
            "type": "boolean"
          },
          "blocked_reason": {
            "type": "string"
          },
          "devices": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "older": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "published_at",
          "signed",
          "approved_at",
          "approved_by",
          "blocked",
          "blocked_reason",
          "devices",
          "failed",
          "older"
        ]
      },
      "Agents": {
        "type": "object",
        "properties": {
          "policy": {
            "$ref": "#/components/schemas/UpdatePolicy"
          },
          "releases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRelease"
            }
          },
          "fleet": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "string"
                },
                "devices": {
                  "type": "integer"
                }
              },
              "required": [
                "version",
                "devices"
              ]
            }
          },
          "latest": {
            "type": "string"
          },
          "outdated": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "last_seen": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "hostname",
                "version",
                "last_seen"
              ]
            }
          },
          "repo": {
            "type": "string"
          }
        },
        "required": [
          "policy",
          "releases",
          "fleet",
          "latest",
          "outdated",
          "repo"
        ]
      },
      "Profile": {
        "type": "object",
        "properties": {
          "login": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "local": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "password_min": {
            "type": "integer"
          },
          "password_rules": {
            "$ref": "#/components/schemas/PasswordPolicy"
          },
          "recovery_left": {
            "type": "integer"
          },
          "totp_pending": {
            "type": "boolean"
          }
        },
        "required": [
          "login",
          "role",
          "local",
          "password_min",
          "password_rules",
          "recovery_left",
          "totp_pending"
        ]
      },
      "Token1": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token"
        ]
      },
      "Glossary": {
        "type": "object",
        "properties": {
          "terms": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "term": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "doc": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "term",
                "text"
              ]
            }
          },
          "states": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "docs": {
            "type": "string"
          }
        },
        "required": [
          "terms",
          "states",
          "docs"
        ]
      },
      "EnrollSettings": {
        "type": "object",
        "description": "Limits of new enrollment tokens (hard limits 500 uses and 30 days) and the TPM requirement for every tenant",
        "properties": {
          "default_uses": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "default_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "max_uses": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "max_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "require_tpm": {
            "type": "boolean",
            "description": "Refuse enrollments without a TPM bound key"
          }
        },
        "required": [
          "default_uses",
          "default_days",
          "max_uses",
          "max_days",
          "require_tpm"
        ]
      },
      "UpdateRingInput": {
        "type": "object",
        "required": [
          "name",
          "position"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "order of the ring, lowest first"
          },
          "deferral_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 90,
            "description": "days after a wave started before it may reach this ring"
          },
          "wave_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 90,
            "description": "first ring only: start a new wave every N days, 0 is manual"
          },
          "require_approval": {
            "type": "boolean",
            "description": "a wave reaches this ring only after an admin approved it"
          },
          "all_devices": {
            "type": "boolean",
            "description": "every device that is in no earlier ring"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "directory groups of the primary user"
          },
          "blueprints": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "blueprint IDs; a device matches its blueprint and the ones it inherits from"
          }
        }
      },
      "UpdateRing": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "order of the ring, lowest first"
          },
          "deferral_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 90,
            "description": "days after a wave started before it may reach this ring"
          },
          "wave_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 90,
            "description": "first ring only: start a new wave every N days, 0 is manual"
          },
          "require_approval": {
            "type": "boolean",
            "description": "a wave reaches this ring only after an admin approved it"
          },
          "all_devices": {
            "type": "boolean",
            "description": "every device that is in no earlier ring"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "directory groups of the primary user"
          },
          "blueprints": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "blueprint IDs; a device matches its blueprint and the ones it inherits from"
          },
          "id": {
            "type": "integer"
          },
          "tenant_id": {
            "type": "integer"
          },
          "paused": {
            "type": "boolean"
          },
          "approved_wave": {
            "type": "integer"
          },
          "wave": {
            "type": "integer",
            "description": "the newest wave that reached the ring"
          },
          "wave_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "devices": {
            "type": "integer",
            "description": "devices in the ring at their last check in"
          }
        }
      },
      "UpdateWave": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "integer"
          },
          "wave": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_by": {
            "type": "string"
          }
        }
      },
      "UpdateRingList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateRing"
            }
          },
          "waves": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateWave"
            },
            "description": "the newest 20"
          },
          "unassigned": {
            "type": "integer",
            "description": "devices in no ring"
          }
        }
      },
      "PendingUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "current": {
            "type": "string"
          },
          "candidate": {
            "type": "string"
          },
          "origin": {
            "type": "string",
            "description": "apt origin, dnf or zypper repo, Flatpak remote"
          },
          "source": {
            "type": "string",
            "enum": [
              "os_all",
              "third_party",
              "flatpak"
            ]
          },
          "security": {
            "type": "boolean"
          },
          "severity": {
            "type": "string",
            "description": "as the advisory states it"
          },
          "cves": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "patch": {
            "type": "boolean",
            "description": "a SUSE patch, not a package"
          }
        }
      },
      "UpdateRun": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "os_security",
              "os_all",
              "third_party",
              "flatpak"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "result": {
            "type": "string",
            "enum": [
              "installed",
              "no_updates",
              "failed",
              "unsupported"
            ]
          },
          "count": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "wave": {
            "type": "integer"
          }
        }
      },
      "WorkloadTool": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "Workload": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "docker",
              "podman",
              "lxc",
              "lxd",
              "incus",
              "pct",
              "qm",
              "libvirt"
            ]
          },
          "id": {
            "type": "string",
            "description": "Container ID, VMID or name: what workload_action takes"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "container or vm"
          },
          "image": {
            "type": "string",
            "description": "Image reference or OS template"
          },
          "image_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "The tool's state in lower case, for example running, exited, stopped, paused, shut off"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "started": {
            "type": "string",
            "format": "date-time"
          },
          "restart": {
            "type": "string",
            "description": "Restart policy or autostart"
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "project": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "cpus": {
            "type": "integer"
          },
          "memory_mb": {
            "type": "integer"
          }
        }
      },
      "Workloads": {
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkloadTool"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Workload"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "DeviceWorkloads": {
        "type": "object",
        "properties": {
          "reports": {
            "type": "boolean",
            "description": "The device has reported workloads"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the inventory last changed"
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The device's last check in: an unchanged inventory is not sent again, so it is current as of then"
          },
          "sync_wait": {
            "type": "integer",
            "description": "Seconds until a sync command for this device is accepted again (one per device and 30 seconds, 0 when allowed now)"
          },
          "inventory": {
            "$ref": "#/components/schemas/Workloads"
          },
          "control": {
            "type": "object",
            "properties": {
              "policy": {
                "type": "boolean",
                "description": "The device's policy allows workload actions (com.limdm.agent workload_control)"
              },
              "allowed": {
                "type": "boolean",
                "description": "The caller's role may send workload actions"
              },
              "four_eyes": {
                "type": "boolean",
                "description": "Stop and restart wait for a second admin"
              }
            }
          }
        }
      },
      "FleetWorkloads": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "device_id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "workload": {
                  "$ref": "#/components/schemas/Workload"
                }
              }
            }
          }
        }
      },
      "DeviceUpdates": {
        "type": "object",
        "properties": {
          "ring": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpdateRing"
              },
              {
                "type": "null"
              }
            ]
          },
          "reports": {
            "type": "boolean",
            "description": "the agent reports its update status"
          },
          "status": {
            "type": "object",
            "properties": {
              "pending": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PendingUpdate"
                }
              },
              "pending_error": {
                "type": "string"
              },
              "pending_warning": {
                "type": "string",
                "description": "the list is usable but incomplete, e.g. the Proxmox enterprise repository refused access"
              },
              "runs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UpdateRun"
                }
              },
              "ring": {
                "type": "string"
              },
              "security_since": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "vulnerabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cve": {
                  "type": "string"
                },
                "package": {
                  "type": "string"
                },
                "installed": {
                  "type": "string"
                },
                "fixed": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "via": {
                  "type": "string",
                  "description": "base distribution whose feed matched a derivative (ubuntu, debian, arch); absent for a direct match"
                }
              }
            },
            "description": "CVEs matched from the Debian and Ubuntu security data: the installed version is older than the fixed one"
          }
        }
      },
      "UpdatesFleet": {
        "type": "object",
        "properties": {
          "reporting": {
            "type": "integer"
          },
          "security_devices": {
            "type": "integer"
          },
          "pending_devices": {
            "type": "integer"
          },
          "security_no_cve": {
            "type": "integer",
            "description": "pending security updates without CVE IDs (apt)"
          },
          "devices_by_source": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "cves": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "devices": {
                  "type": "integer"
                },
                "packages": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "packages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "security": {
                  "type": "boolean"
                },
                "severity": {
                  "type": "string"
                },
                "devices": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "CVEFeedSettings": {
        "type": "object",
        "description": "Security data of Debian, Ubuntu, Arch and Alpine and the CISA KEV list; every feed is off by default. A distribution feed is downloaded only while at least one device runs that distribution.",
        "properties": {
          "debian": {
            "type": "boolean",
            "description": "import the Debian Security Tracker daily"
          },
          "ubuntu": {
            "type": "boolean",
            "description": "import the Ubuntu OSV export daily"
          },
          "arch": {
            "type": "boolean",
            "description": "import the Arch Security Tracker daily"
          },
          "alpine": {
            "type": "boolean",
            "description": "import the Alpine secdb of the branches the Alpine devices run daily"
          },
          "debian_url": {
            "type": "string",
            "description": "https URL of the Debian Security Tracker JSON; empty is https://security-tracker.debian.org/tracker/data/json"
          },
          "ubuntu_url": {
            "type": "string",
            "description": "https URL of the Ubuntu OSV export (zip); empty is https://osv-vulnerabilities.storage.googleapis.com/Ubuntu/all.zip"
          },
          "arch_url": {
            "type": "string",
            "description": "https URL of the Arch tracker's AVG list; empty is https://security.archlinux.org/issues/all.json"
          },
          "alpine_url": {
            "type": "string",
            "description": "https base URL of the Alpine secdb (…/v3.20/main.json); empty is https://secdb.alpinelinux.org"
          },
          "max_mb": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4096,
            "description": "download limit per feed in MB, 1024 when 0"
          },
          "kev": {
            "type": "boolean",
            "description": "import the CISA Known Exploited Vulnerabilities list daily"
          },
          "kev_url": {
            "type": "string",
            "description": "https URL of the KEV JSON; empty is https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
          }
        }
      },
      "CVEFeedState": {
        "type": "object",
        "properties": {
          "distro": {
            "type": "string",
            "enum": [
              "debian",
              "ubuntu",
              "arch",
              "alpine",
              "kev"
            ]
          },
          "url": {
            "type": "string"
          },
          "fetched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rows": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "error_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "skipped": {
            "type": "boolean",
            "description": "switched on, but no device runs the distribution: not downloaded"
          }
        }
      },
      "FirewallInventoryRule": {
        "type": "object",
        "required": [
          "id",
          "match",
          "source",
          "origin",
          "raw"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "identity of the rule now; a removal names it"
          },
          "match": {
            "type": "string",
            "description": "stable text of the rule (tool, place, raw text without counters); keep entries store it"
          },
          "source": {
            "type": "string",
            "description": "tool it was read with: ufw, firewalld, nftables, iptables, ip6tables"
          },
          "origin": {
            "type": "string",
            "enum": [
              "managed",
              "foreign",
              "system"
            ]
          },
          "table": {
            "type": "string"
          },
          "chain": {
            "type": "string"
          },
          "zone": {
            "type": "string",
            "description": "firewalld zone or policy"
          },
          "direction": {
            "type": "string",
            "description": "in, out or forward"
          },
          "action": {
            "type": "string"
          },
          "proto": {
            "type": "string"
          },
          "port": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "iface": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "raw": {
            "type": "string",
            "description": "the rule as the tool shows it"
          },
          "handle": {
            "type": "string",
            "description": "nftables rule handle"
          },
          "risk": {
            "type": "string",
            "description": "ssh or server: removing it may cut remote access; a removal needs confirm_risk"
          }
        }
      },
      "DeviceFirewallRule": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FirewallInventoryRule"
          },
          {
            "type": "object",
            "required": [
              "kept"
            ],
            "properties": {
              "kept": {
                "type": "boolean",
                "description": "listed in keep of the device's firewall declaration"
              },
              "adopt_error": {
                "type": "string",
                "description": "why the rule cannot be adopted"
              }
            }
          }
        ]
      },
      "DeviceFirewall": {
        "type": "object",
        "required": [
          "reports",
          "updated_at",
          "inventory",
          "rules",
          "managed"
        ],
        "properties": {
          "reports": {
            "type": "boolean",
            "description": "the agent reported a firewall inventory"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "managed": {
            "type": "boolean",
            "description": "a firewall declaration applies to the device"
          },
          "inventory": {
            "type": "object",
            "required": [
              "backend",
              "active",
              "policy"
            ],
            "properties": {
              "backend": {
                "type": "string",
                "description": "ufw, firewalld, nftables, iptables; empty when none was found"
              },
              "active": {
                "type": "boolean"
              },
              "default_zone": {
                "type": "string"
              },
              "policy": {
                "type": "object",
                "properties": {
                  "in": {
                    "type": "string"
                  },
                  "out": {
                    "type": "string"
                  },
                  "forward": {
                    "type": "string"
                  }
                }
              },
              "truncated": {
                "type": "boolean"
              },
              "errors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "bridge_nets": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "subnets of the local container and VM bridges; rules on these addresses are system rules"
              }
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeviceFirewallRule"
            }
          }
        }
      },
      "FirewallTarget": {
        "type": "object",
        "required": [
          "id",
          "name",
          "devices",
          "global_default",
          "device"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "devices": {
            "type": "integer",
            "description": "active devices the blueprint reaches, children included"
          },
          "global_default": {
            "type": "boolean",
            "description": "the default blueprint of the whole installation"
          },
          "device": {
            "type": "boolean",
            "description": "the device's own effective blueprint"
          }
        }
      },
      "Vulnerability": {
        "type": "object",
        "description": "One CVE across the devices in scope",
        "properties": {
          "cve": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "medium",
              "low",
              "unknown"
            ],
            "description": "highest level the sources state; the CVSS score when none does"
          },
          "cvss": {
            "type": [
              "number",
              "null"
            ],
            "description": "CVSS v3 base score where a source provides a vector (Ubuntu OSV)"
          },
          "kev": {
            "type": "boolean",
            "description": "listed in the CISA Known Exploited Vulnerabilities catalog"
          },
          "packages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "first_detected": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          },
          "remediated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "when the last finding was remediated (status remediated)"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "accepted",
              "remediated"
            ],
            "description": "active when any finding is, else accepted when any is, else remediated"
          },
          "devices": {
            "type": "integer",
            "description": "devices with an open finding (remediated: with a remediated one)"
          },
          "active_devices": {
            "type": "integer"
          },
          "accepted_devices": {
            "type": "integer"
          },
          "remediated_devices": {
            "type": "integer"
          }
        }
      },
      "VulnerabilityList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vulnerability"
            }
          },
          "total": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "VulnerabilitySummary": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "object",
            "description": "active CVEs per level",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "findings": {
            "type": "object",
            "description": "device and CVE pairs per status (active, accepted, remediated)",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "top_packages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "cves": {
                  "type": "integer"
                },
                "devices": {
                  "type": "integer"
                }
              }
            }
          },
          "feeds_enabled": {
            "type": "boolean",
            "description": "any CVE data feed is switched on"
          },
          "os": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "os_id of the devices with findings"
          },
          "devices": {
            "type": "array",
            "description": "up to 500 devices with findings",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CVEAcceptance": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "tenant_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null: every tenant"
          },
          "device_id": {
            "type": "string",
            "description": "empty: every device"
          },
          "package": {
            "type": "string",
            "description": "empty: every package"
          },
          "reason": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_by": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        }
      },
      "VulnerabilityDetail": {
        "type": "object",
        "properties": {
          "cve": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "medium",
              "low",
              "unknown"
            ]
          },
          "cvss": {
            "type": [
              "number",
              "null"
            ]
          },
          "vector": {
            "type": "string"
          },
          "kev": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "added": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "due": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "ransomware": {
                "type": "boolean"
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "accepted",
              "remediated"
            ]
          },
          "first_detected": {
            "type": "string",
            "format": "date-time"
          },
          "packages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "installed": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "fixed": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "devices": {
                  "type": "integer"
                }
              }
            }
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "os": {
                  "type": "string"
                },
                "package": {
                  "type": "string"
                },
                "installed": {
                  "type": "string"
                },
                "fixed": {
                  "type": "string"
                },
                "severity": {
                  "type": "string",
                  "description": "as the source states it"
                },
                "first_detected": {
                  "type": "string",
                  "format": "date-time"
                },
                "last_seen": {
                  "type": "string",
                  "format": "date-time"
                },
                "remediated_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "accepted",
                    "remediated"
                  ]
                },
                "via": {
                  "type": "string",
                  "description": "base distribution whose feed matched a derivative (ubuntu, debian, arch); absent for a direct match"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "debian, ubuntu, arch, alpine, or package manager (advisories of pending dnf and zypper updates)"
          },
          "references": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "acceptances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CVEAcceptance"
            }
          }
        }
      },
      "CVEAcceptanceInput": {
        "type": "object",
        "required": [
          "reason",
          "expires"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "expires": {
            "type": "string",
            "format": "date",
            "description": "last day it applies, within the next year"
          },
          "device_id": {
            "type": "string",
            "description": "only this device; required for an admin limited to tags"
          },
          "package": {
            "type": "string",
            "maxLength": 200,
            "description": "only this package"
          }
        }
      },
      "LogSettings": {
        "type": "object",
        "description": "Settings, Logs (docs/logs.md)",
        "properties": {
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "description": "days of log lines on the server, default 7"
          },
          "max_store_gb": {
            "type": "integer",
            "minimum": 0,
            "description": "size of the log store (partitions with indexes) that stops new lines; 0: no limit"
          },
          "min_free_pct": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50,
            "description": "free space of the database disk that stops new lines; 0: off"
          },
          "device_mb_per_day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10240,
            "description": "per device and day, default 200"
          },
          "tenant_mb_per_day": {
            "type": "integer",
            "minimum": 0,
            "description": "per tenant and day; 0: no limit"
          },
          "tenant_quotas": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "tenant ID: MB per day, overrides tenant_mb_per_day"
          },
          "helpdesk_device_logs": {
            "type": "boolean",
            "description": "the helpdesk reads the logs of single devices in its scope"
          },
          "archive": {
            "type": "boolean",
            "description": "export each finished day, encrypted, to archive_target"
          },
          "archive_target": {
            "type": "string",
            "description": "name of a storage target of Settings, Backup"
          },
          "archive_retention_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650,
            "description": "archived days are deleted from the target after this; 0 keeps them"
          },
          "restore_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "a restored day stays searchable this long, default 24"
          }
        }
      },
      "LogLine": {
        "type": "object",
        "required": [
          "id",
          "at",
          "device_id",
          "hostname",
          "source",
          "unit",
          "priority",
          "host",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "device~unix nanoseconds~dedup key; for /logs/context"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "device_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "journald",
              "container",
              "file"
            ]
          },
          "unit": {
            "type": "string",
            "description": "systemd unit, container name or file path"
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 7,
            "description": "0 emerg to 7 debug"
          },
          "host": {
            "type": "string",
            "description": "host name the journal recorded"
          },
          "message": {
            "type": "string"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "extra fields: _PID, SYSLOG_IDENTIFIER, container_id, image, compose_project ..."
          }
        }
      },
      "LogList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogLine"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "LogHistogram": {
        "type": "object",
        "required": [
          "bucket_seconds",
          "from",
          "to",
          "buckets"
        ],
        "properties": {
          "bucket_seconds": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "buckets": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "at",
                "counts"
              ],
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "counts": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "description": "lines per priority 0 to 7"
                }
              }
            }
          }
        }
      },
      "LogFacets": {
        "type": "object",
        "required": [
          "units"
        ],
        "properties": {
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "source",
                "unit",
                "count"
              ],
              "properties": {
                "source": {
                  "type": "string"
                },
                "unit": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "LogContext": {
        "type": "object",
        "required": [
          "items",
          "id"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogLine"
            },
            "description": "newest first, the line itself included"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "LogStatus": {
        "type": "object",
        "required": [
          "partitions",
          "store_bytes",
          "free_pct",
          "guard",
          "keys",
          "archives",
          "restores",
          "today"
        ],
        "properties": {
          "partitions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "day",
                "rows",
                "bytes"
              ],
              "properties": {
                "day": {
                  "type": "string"
                },
                "rows": {
                  "type": "integer",
                  "description": "estimate"
                },
                "bytes": {
                  "type": "integer"
                }
              }
            }
          },
          "store_bytes": {
            "type": "integer"
          },
          "free_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "free space of the database disk where readable"
          },
          "guard": {
            "type": "string",
            "description": "why new lines are refused; empty when they are accepted"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "tenant_id",
                "created_at",
                "active",
                "kek_id"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "tenant_id": {
                  "type": "integer"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "active": {
                  "type": "boolean"
                },
                "kek_id": {
                  "type": "string",
                  "description": "key encryption key (key kind logs) that wraps the data key"
                }
              }
            }
          },
          "archives": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tenant_id",
                "day",
                "target",
                "objects",
                "lines",
                "bytes",
                "key_id",
                "verified_at"
              ],
              "properties": {
                "tenant_id": {
                  "type": "integer"
                },
                "day": {
                  "type": "string"
                },
                "target": {
                  "type": "string"
                },
                "objects": {
                  "type": "integer"
                },
                "lines": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                },
                "key_id": {
                  "type": "string"
                },
                "verified_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          },
          "restores": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "day",
                "until",
                "restored_by"
              ],
              "properties": {
                "day": {
                  "type": "string"
                },
                "until": {
                  "type": "string",
                  "format": "date-time"
                },
                "restored_by": {
                  "type": "string"
                }
              }
            }
          },
          "today": {
            "type": "object",
            "required": [
              "devices",
              "lines",
              "bytes",
              "dropped"
            ],
            "properties": {
              "devices": {
                "type": "integer"
              },
              "lines": {
                "type": "integer"
              },
              "bytes": {
                "type": "integer"
              },
              "dropped": {
                "type": "integer",
                "description": "lines the devices dropped (rate, volume, full buffer)"
              }
            }
          }
        }
      },
      "LogAlertInput": {
        "type": "object",
        "required": [
          "name",
          "query",
          "threshold",
          "window_minutes"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string",
            "description": "a query of the Logs page (docs/logs.md#search)"
          },
          "threshold": {
            "type": "integer",
            "minimum": 1,
            "description": "lines in the window that fire the rule"
          },
          "window_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "LogAlert": {
        "type": "object",
        "required": [
          "id",
          "name",
          "query",
          "threshold",
          "window_minutes",
          "severity",
          "enabled",
          "created_by",
          "last_count",
          "last_fired_at"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string",
            "description": "a query of the Logs page (docs/logs.md#search)"
          },
          "threshold": {
            "type": "integer",
            "minimum": 1,
            "description": "lines in the window that fire the rule"
          },
          "window_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "created_by": {
            "type": "string"
          },
          "last_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "matches at the last evaluation, counted up to the threshold"
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}
