{
  "openapi": "3.1.0",
  "info": {
    "title": "PrintCtrl API",
    "version": "1.2",
    "summary": "Manage customers, computers, printers, drivers and monitoring from your own scripts and integrations.",
    "description": "## Authentication\n\nAn administrator creates an API client in the dashboard under **Company → Integrations → API**. You get a client id (`pck_…`) and a client secret (`pcs_…`). The secret is shown once; if you lose it, rotate it. Send both with **HTTP Basic authentication** on every request. There is no token exchange step.\n\n```\ncurl -u pck_3f9a6c2e8d414b7ea5c02e7f:pcs_… https://api.printctrl.io/api/v1/customers\n```\n\n## Roles\n\nA client belongs to one account and acts with the role it was created with:\n\n- `viewer` (Read only): every `GET` in this reference, except the few marked admin.\n- `editor` (Edit): everything a viewer can, plus printer management: managed printers, assignments and deploys, configurations, test pages, print jobs, groups, driver import and package sharing, floor plans, monitoring watchers and settings.\n- `admin` (Read and write): everything an administrator can do in the dashboard through these endpoints: customers, computers, the team, billing reads, alert settings, monitoring profiles and removing things from machines.\n\nOperations that need more than `viewer` say so in their description. A client with too low a role gets `403`.\n\nA client never has the owner role, and some dashboard features are for signed-in people only: profile, password and two-factor sign-in, the support form, managing API clients, alert setting changes and test sends, resending invites, password and two-factor resets for teammates, canceling or resuming the subscription, closing or renaming the account, and AI assistant (MCP) consent. Those routes return `403` for client credentials and are not listed here.\n\nEvery query is scoped to the client's account. A resource that belongs to another account returns `404`.\n\n## Conventions\n\n* Base URL: `https://api.printctrl.io/api/v1`\n* Request and response bodies are JSON unless an operation says otherwise (file uploads use `multipart/form-data`; images and CSV exports are returned as files).\n* Ids are UUID strings. Times are ISO 8601 in UTC unless a field says otherwise.\n* JSON request bodies are limited to 1 MB. Floor plan uploads allow 6 MB, document printing 26 MB.\n* \"Computer\" in this reference is called an agent in paths and field names.\n\n## Paging\n\nEach list documents its own paging. There are three styles:\n\n* **Offset:** `limit` and `offset`, with a `total` in the response. Used by `GET /agents`, `GET /network-printers`, `GET /alerts`, and `GET /printers` when you pass `offset`.\n* **Keyset by name:** `limit`, plus the `cursor_name` and `cursor_id` of the last row you received. The response is a bare array; you have reached the end when it holds fewer than `limit` rows. Used by `GET /customers/{cid}/agents`, `GET /managed-printers`, `GET /drivers`, and `GET /printers` without `offset`.\n* **Cursor:** `limit` and `cursor`, with the next cursor in the response. Used by `GET /audit/events` and `GET /monitors/{id}/events`.\n\nOther lists return every row, up to the cap given in each operation.\n\n## Rate limits\n\n| | |\n|---|---|\n| Requests per client | 120 at once, then 4 per second |\n| Failed authentications per IP address | 10, then one every 3 seconds |\n\nOver a limit the response is `429` with a `Retry-After` header and a `retry_after` field, both in seconds.\n\n## Errors\n\nErrors are JSON with an `error` message and often a `suggestion`:\n\n```json\n{ \"error\": \"that machine is not connected\", \"suggestion\": \"Try again when the computer is back online.\" }\n```\n\nSome errors add fields, listed on the `Error` schema: `code`, plan fields on `402`, `retry_after` on `429`.\n\n| Status | Meaning |\n|---|---|\n| 400 | The request body or parameters were not valid. |\n| 401 | Missing, wrong or revoked client credentials. |\n| 402 | Billing. A plan limit was reached on a create (`upgrade_required: true` with `limit`, `current`, `maximum`), or the account is read only (`read_only: true`; reads still work, writes are refused) or locked (`locked: true`; every request is refused until billing is fixed). |\n| 403 | Your client's role cannot do this. |\n| 404 | Not found, or it belongs to another account. |\n| 409 | The action conflicts with the current state. |\n| 413 | The upload is too large. |\n| 415 | The upload is not a supported file type. |\n| 429 | Rate limited. |\n| 502 | The computer or an upstream service reported a failure. |\n| 503 | The computer the action needs is not connected, or a service is unavailable. The action is not queued. |\n| 504 | The computer did not answer in time. |"
  },
  "servers": [
    {
      "url": "https://api.printctrl.io/api/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "The calling client."
    },
    {
      "name": "Customers",
      "description": "The clients or offices you manage. Every computer and printer belongs to one."
    },
    {
      "name": "Computers",
      "description": "Windows computers running PrintCtrl, and the agent update channel. Called agents in paths and field names."
    },
    {
      "name": "Groups",
      "description": "Rule-based groups of computers for assigning printers in bulk."
    },
    {
      "name": "Printers",
      "description": "Print queues discovered on computers, failed setups, ports, and printers found on the network."
    },
    {
      "name": "Managed printers",
      "description": "Printers you define once and PrintCtrl installs wherever they are assigned."
    },
    {
      "name": "Drivers",
      "description": "Driver inventory across the estate, your package library and automatic packaging."
    },
    {
      "name": "Configurations",
      "description": "Saved printer settings that can be captured from one queue and applied to another."
    },
    {
      "name": "Monitoring",
      "description": "Printer status, outage history, supplies, page counters and SNMP monitoring profiles."
    },
    {
      "name": "Floor plans",
      "description": "Floor plan images per customer, with managed printers pinned on them."
    },
    {
      "name": "Branding",
      "description": "The name and logo the PrintCtrl tray shows, for the account and per customer."
    },
    {
      "name": "Alerts",
      "description": "Open and resolved alerts, and the alert settings."
    },
    {
      "name": "Team",
      "description": "People with access to your account."
    },
    {
      "name": "Billing",
      "description": "Plans, entitlements, the billing overview and Stripe links."
    },
    {
      "name": "Activity",
      "description": "The audit log and the dashboard: summary, overview and trends."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Account"
        ],
        "summary": "Get the caller and their account",
        "description": "Returns the caller, the account record, trial position and timezones. For an API client the `user` object is the client's principal: its `email` is the client id (`pck_...`), `timezone` is empty, `is_account_owner` is false and `recovery_codes_remaining` is absent.",
        "responses": {
          "200": {
            "description": "The caller and account context.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                },
                "example": {
                  "user": {
                    "id": "8e3b1d6f-2c4a-4f97-a5e0-7d1c9b3a6f28",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "PSA sync",
                    "email": "pck_3f9a6c2e8d414b7ea5c02e7f",
                    "role": "editor",
                    "status": "active",
                    "mfa_enabled": false,
                    "created_at": "2026-09-08T11:20:44Z",
                    "updated_at": "2026-09-08T11:20:44Z"
                  },
                  "tenant": {
                    "id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "Northgate Managed IT",
                    "slug": "northgate-managed-it",
                    "email": "sam.patel@northgate-it.example",
                    "plan": "standard",
                    "status": "active",
                    "trial_ends_at": "2026-03-16T15:04:09Z",
                    "trial_notified": true,
                    "onboarding_step": "done",
                    "stripe_customer_id": "cus_R4kT8vXq2LmN9p",
                    "billing_status": "active",
                    "created_at": "2026-02-14T15:04:09Z",
                    "updated_at": "2026-11-20T09:14:03Z"
                  },
                  "trial": {
                    "plan": "standard",
                    "on_trial": false,
                    "trial_ends_at": "2026-03-16T15:04:09Z",
                    "days_left": 0,
                    "expired": false
                  },
                  "timezone": "",
                  "account_timezone": "Europe/London",
                  "is_account_owner": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers": {
      "get": {
        "operationId": "listCustomers",
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "description": "Returns every customer in your account as a bare JSON array, sorted by name. Each item carries `agent_count`, which is left out when the customer has no computers.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on the customer's name or site.",
            "schema": {
              "type": "string"
            },
            "example": "halden"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only customers with exactly this status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The customers, sorted by name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Customer"
                  }
                },
                "example": [
                  {
                    "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "Halden Manufacturing",
                    "site": "Sheffield",
                    "notes": "Main office and goods-in warehouse.",
                    "status": "active",
                    "created_at": "2026-03-02T10:41:17Z",
                    "updated_at": "2026-11-20T09:14:03Z",
                    "snmp_community_set": true,
                    "network_discovery_enabled": true,
                    "network_discovery_interval": 15,
                    "network_discovery_ranges": "10.40.0.0/24",
                    "alerts_enabled": true,
                    "timezone": "Europe/London",
                    "print_jobs_enabled": true,
                    "tray_mode": "full",
                    "agent_update_channel": "",
                    "monitor_agent_id": "",
                    "snmp_version": "2c",
                    "snmp_v3_user": "",
                    "snmp_v3_auth_proto": "",
                    "snmp_v3_auth_set": false,
                    "snmp_v3_priv_proto": "",
                    "snmp_v3_priv_set": false,
                    "snmp_v3_context": "",
                    "monitoring_enabled": true,
                    "monitoring_profile_id": "",
                    "agent_count": 2
                  },
                  {
                    "id": "b84d2f17-6c3e-4a91-8f5b-0d6e9a2c7b15",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "Redgate Legal",
                    "site": "Leeds",
                    "notes": "",
                    "status": "active",
                    "created_at": "2026-05-14T08:02:51Z",
                    "updated_at": "2026-10-30T16:20:09Z",
                    "snmp_community_set": true,
                    "network_discovery_enabled": true,
                    "network_discovery_interval": 15,
                    "network_discovery_ranges": "",
                    "alerts_enabled": true,
                    "timezone": "",
                    "print_jobs_enabled": false,
                    "tray_mode": "window",
                    "agent_update_channel": "",
                    "monitor_agent_id": "",
                    "snmp_version": "2c",
                    "snmp_v3_user": "",
                    "snmp_v3_auth_proto": "",
                    "snmp_v3_auth_set": false,
                    "snmp_v3_priv_proto": "",
                    "snmp_v3_priv_set": false,
                    "snmp_v3_context": "",
                    "monitoring_enabled": true,
                    "monitoring_profile_id": "",
                    "agent_count": 1
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createCustomer",
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "description": "Requires the admin role. Counts toward your plan's customer limit; a create over the limit returns 402 with the limit details. New customers start active, with alerts and monitoring on, the tray in `full` mode, and SNMP community `public` unless you give one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInput"
              },
              "example": {
                "name": "Halden Manufacturing",
                "notes": "Main office and goods-in warehouse.",
                "snmp_community": "public",
                "network_discovery_enabled": true,
                "network_discovery_interval": 15,
                "network_discovery_ranges": "10.40.0.0/24",
                "timezone": "Europe/London",
                "print_jobs_enabled": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The customer was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                },
                "example": {
                  "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Halden Manufacturing",
                  "site": "",
                  "notes": "Main office and goods-in warehouse.",
                  "status": "active",
                  "created_at": "2026-11-20T09:14:03Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "snmp_community_set": true,
                  "network_discovery_enabled": true,
                  "network_discovery_interval": 15,
                  "network_discovery_ranges": "10.40.0.0/24",
                  "alerts_enabled": true,
                  "timezone": "Europe/London",
                  "print_jobs_enabled": true,
                  "tray_mode": "full",
                  "agent_update_channel": "",
                  "monitor_agent_id": "",
                  "snmp_version": "2c",
                  "snmp_v3_user": "",
                  "snmp_v3_auth_proto": "",
                  "snmp_v3_auth_set": false,
                  "snmp_v3_priv_proto": "",
                  "snmp_v3_priv_set": false,
                  "snmp_v3_context": "",
                  "monitoring_enabled": true,
                  "monitoring_profile_id": ""
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}": {
      "get": {
        "operationId": "getCustomer",
        "tags": [
          "Customers"
        ],
        "summary": "Get a customer",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The customer. `agent_count` is not included here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                },
                "example": {
                  "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Halden Manufacturing",
                  "site": "Sheffield",
                  "notes": "Main office and goods-in warehouse.",
                  "status": "active",
                  "created_at": "2026-03-02T10:41:17Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "snmp_community_set": true,
                  "network_discovery_enabled": true,
                  "network_discovery_interval": 15,
                  "network_discovery_ranges": "10.40.0.0/24",
                  "alerts_enabled": true,
                  "timezone": "Europe/London",
                  "print_jobs_enabled": true,
                  "tray_mode": "full",
                  "agent_update_channel": "",
                  "monitor_agent_id": "",
                  "snmp_version": "2c",
                  "snmp_v3_user": "",
                  "snmp_v3_auth_proto": "",
                  "snmp_v3_auth_set": false,
                  "snmp_v3_priv_proto": "",
                  "snmp_v3_priv_set": false,
                  "snmp_v3_context": "",
                  "monitoring_enabled": true,
                  "monitoring_profile_id": ""
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateCustomer",
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Requires the admin role. Send only the fields you want to change. Changes to discovery, SNMP, tray mode, print job recording or status are pushed to the customer's connected computers straight away; offline computers pick them up when they reconnect. Setting `status` to `inactive` pauses the customer: nothing is pushed to its computers and no new computers can be enrolled until it is active again.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdate"
              },
              "example": {
                "tray_mode": "window",
                "network_discovery_interval": 30,
                "snmp_version": "3",
                "snmp_v3_user": "printctrl",
                "snmp_v3_auth_proto": "sha256",
                "snmp_v3_auth_pass": "halden-snmp-auth-2026",
                "snmp_v3_priv_proto": "aes",
                "snmp_v3_priv_pass": "halden-snmp-priv-2026"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                },
                "example": {
                  "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Halden Manufacturing",
                  "site": "Sheffield",
                  "notes": "Main office and goods-in warehouse.",
                  "status": "active",
                  "created_at": "2026-03-02T10:41:17Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "snmp_community_set": true,
                  "network_discovery_enabled": true,
                  "network_discovery_interval": 30,
                  "network_discovery_ranges": "10.40.0.0/24",
                  "alerts_enabled": true,
                  "timezone": "Europe/London",
                  "print_jobs_enabled": true,
                  "tray_mode": "window",
                  "agent_update_channel": "",
                  "monitor_agent_id": "",
                  "snmp_version": "3",
                  "snmp_v3_user": "printctrl",
                  "snmp_v3_auth_proto": "sha256",
                  "snmp_v3_auth_set": true,
                  "snmp_v3_priv_proto": "aes",
                  "snmp_v3_priv_set": true,
                  "snmp_v3_context": "",
                  "monitoring_enabled": true,
                  "monitoring_profile_id": ""
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomer",
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "description": "Requires the admin role. A customer that still has computers cannot be deleted: uninstall or remove them first. Monitoring profiles that belong only to this customer are deleted with it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "204": {
            "description": "The customer was deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/agents/enroll": {
      "post": {
        "operationId": "createEnrollmentToken",
        "tags": [
          "Customers"
        ],
        "summary": "Create a single-use enrollment token",
        "description": "Requires the admin role. Issues a token that enrolls one computer into the customer and expires after 24 hours by default. Counts toward your plan's device limit; over the limit returns 402. A customer that is inactive returns 409. For most installs the permanent install token is simpler.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "201": {
            "description": "The enrollment token and the command that uses it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enrollment"
                },
                "example": {
                  "token": "dGhpcy1pcy1hbi1leGFtcGxlLWVucm9sbG1lbnQtdG9rZW4",
                  "expires_at": "2026-11-21T09:14:03Z",
                  "server_url": "wss://api.printctrl.io",
                  "download_url": "https://api.printctrl.io/agent/download/windows",
                  "install_command": "msiexec /i PrintCtrl-Agent.msi /qn TOKEN=dGhpcy1pcy1hbi1leGFtcGxlLWVucm9sbG1lbnQtdG9rZW4",
                  "app_url": "https://app.printctrl.io"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/install-token": {
      "get": {
        "operationId": "getInstallToken",
        "tags": [
          "Customers"
        ],
        "summary": "Get the customer's install token",
        "description": "Requires the admin role. Returns the customer's permanent install token, creating it on the first request. Any number of computers can be enrolled into the customer with it until it is rotated. Sent with `Cache-Control: no-store`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The install token and where to download the installer.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallToken"
                },
                "example": {
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "customer_name": "Halden Manufacturing",
                  "token": "pci_Qm9xWl8tY2FzZS1rZXktZXhhbXBsZS0wMDAwMDAwMDA",
                  "created_at": "2026-03-02T10:45:02Z",
                  "last_used_at": "2026-11-18T14:02:37Z",
                  "use_count": 2,
                  "download_url": "https://api.printctrl.io/agent/download/windows?v=1.4.2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/install-token/rotate": {
      "post": {
        "operationId": "rotateInstallToken",
        "tags": [
          "Customers"
        ],
        "summary": "Rotate the customer's install token",
        "description": "Requires the admin role. Replaces the install token with a new one. The previous token stops enrolling computers immediately; computers already enrolled are not affected.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The new install token.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallToken"
                },
                "example": {
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "customer_name": "Halden Manufacturing",
                  "token": "pci_Tm90LWEtcmVhbC10b2tlbi1yb3RhdGVkLTIwMjYxMTIw",
                  "created_at": "2026-11-20T09:14:03Z",
                  "use_count": 0,
                  "download_url": "https://api.printctrl.io/agent/download/windows?v=1.4.2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/printer-setup": {
      "get": {
        "operationId": "getPrinterSetup",
        "tags": [
          "Customers"
        ],
        "summary": "Suggest how to set up a printer",
        "description": "Looks up the device at `host` in what the customer's computers have discovered and suggests a port, protocol, queue name and driver for a new managed printer. When discovery has not seen an IP address, one of the customer's online computers is asked to check it, which can take up to 15 seconds. A device that is not found still returns 200, with `found: false` and a `reason`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          },
          {
            "name": "host",
            "in": "query",
            "required": true,
            "description": "The printer's IP address or host name, up to 253 characters. Only an IP address can be checked live by a computer.",
            "schema": {
              "type": "string",
              "maxLength": 253
            },
            "example": "10.40.0.21"
          }
        ],
        "responses": {
          "200": {
            "description": "The suggestion, or why there is none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterSetup"
                },
                "examples": {
                  "found": {
                    "summary": "A known printer",
                    "value": {
                      "found": true,
                      "source": "discovery",
                      "suggestion": {
                        "port_type": "ipp",
                        "port_number": 631,
                        "protocol": "ipp",
                        "queue_name": "HM-Reception",
                        "driver_name": "HP Universal Printing PCL 6",
                        "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                        "reason": "The printer accepts PCL 6 over IPP, and HP Universal Printing PCL 6 is in your driver library.",
                        "languages": [
                          "PCLXL",
                          "PS",
                          "PDF"
                        ],
                        "model": "HP LaserJet Pro MFP M428fdw"
                      }
                    }
                  },
                  "notFound": {
                    "summary": "Nothing at that address",
                    "value": {
                      "found": false,
                      "reason": "Discovery has not seen this address, and no computer at this customer is online to check it."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/agent-updates": {
      "get": {
        "operationId": "getCustomerAgentUpdates",
        "tags": [
          "Computers"
        ],
        "summary": "Get a customer's agent update channel",
        "description": "The customer's own channel, the account's, and the one its computers are on.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAgentUpdates"
                },
                "example": {
                  "channel": "",
                  "effective_channel": "standard",
                  "account_channel": "standard"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "setCustomerAgentUpdates",
        "tags": [
          "Computers"
        ],
        "summary": "Set a customer's agent update channel",
        "description": "Requires the admin role. Sets the customer's channel, or an empty string to use the account's. Same as `agent_update_channel` on PATCH /customers/{cid}. Recorded in the activity log.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAgentUpdatesInput"
              },
              "example": {
                "channel": "early"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAgentUpdatesSet"
                },
                "example": {
                  "channel": "early",
                  "effective_channel": "early"
                }
              }
            }
          },
          "400": {
            "description": "`channel` is not one of the three or empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "channel must be early, standard, delayed, or empty to use the account's"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-counts": {
      "get": {
        "operationId": "getAgentCounts",
        "tags": [
          "Computers"
        ],
        "summary": "Count computers per customer",
        "description": "How many computers each customer has and how many are online, in one call. Online is the stored status.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCounts"
                },
                "example": {
                  "counts": [
                    {
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "total": 2,
                      "online": 1
                    },
                    {
                      "customer_id": "b84d2f17-6c3e-4a91-8f5b-0d6e9a2c7b15",
                      "total": 1,
                      "online": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-updates": {
      "get": {
        "operationId": "getAgentUpdates",
        "tags": [
          "Computers"
        ],
        "summary": "Get the agent update channel",
        "description": "The account's agent update channel and how the newest agent version's rollout stands. `early` takes a new version as soon as it is published, `standard` as the staged rollout reaches the computer, `delayed` 7 days after it reaches every Standard computer. A customer can have its own channel (GET /customers/{cid}/agent-updates). POST /agents/{aid}/update sends the newest version to one computer whatever its channel.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateSettings"
                },
                "example": {
                  "channel": "standard",
                  "rollout": {
                    "version": "1.4.3",
                    "stage": 1,
                    "percent": 5,
                    "paused": false,
                    "next_stage_at": "2026-11-21T10:05:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "setAgentUpdates",
        "tags": [
          "Computers"
        ],
        "summary": "Set the agent update channel",
        "description": "Requires the admin role. Sets the account's channel. Customers with their own channel keep it. Recorded in the activity log.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentUpdateChannelInput"
              },
              "example": {
                "channel": "delayed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateChannelSet"
                },
                "example": {
                  "channel": "delayed"
                }
              }
            }
          },
          "400": {
            "description": "`channel` is missing or not one of the three.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "channel must be early, standard or delayed"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents": {
      "get": {
        "operationId": "listAgents",
        "tags": [
          "Computers"
        ],
        "summary": "List computers",
        "description": "One page of computers across every customer in the account, or one customer with `customer_id`. The server filters, sorts and counts; page with `limit` and `offset`. Every page carries the total and the status counts.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only this customer's computers. An id from another account matches nothing."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name, hostname, LAN addresses, public address and customer name."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Stored status, for example `online` or `offline`. Note the filter reads the stored status, while each row's `status` reflects the live connection. Repeat the parameter or send one comma-separated value; a device matches any of the values.",
            "style": "form",
            "explode": true
          },
          {
            "name": "os",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Exact `os_caption` values, for example `Microsoft Windows 11 Pro`. Repeat the parameter or send one comma-separated value; a device matches any of the values.",
            "style": "form",
            "explode": true
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Exact agent `version` values, for example `1.4.2`. Repeat the parameter or send one comma-separated value; a device matches any of the values.",
            "style": "form",
            "explode": true
          },
          {
            "name": "offline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "under_24h",
                "over_24h"
              ]
            },
            "description": "Only computers whose stored status is not `online` and that were last seen under 24 hours ago (`under_24h`) or 24 hours or more ago, or never (`over_24h`). Other values are ignored."
          },
          {
            "name": "deployment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "installed",
                  "failed",
                  "user_removed",
                  "waiting",
                  "in_progress"
                ]
              }
            },
            "style": "form",
            "explode": true,
            "description": "Only computers with a managed printer deployment in one of these states. `waiting`: pending, installing, updating or removing on a computer that is offline. `in_progress`: the same on a computer that is online. Repeat the parameter or send one comma-separated value. Unknown values are ignored."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "status",
                "customer_id",
                "os_caption",
                "version",
                "printer_count",
                "last_seen"
              ],
              "default": "name"
            },
            "description": "Sort key. `name` sorts by display name, falling back to hostname, case-insensitive. `customer_id` sorts by customer name. Unknown values sort by name. Ties are broken by id, and empty values sort last in either direction."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            },
            "description": "Sort direction. Anything other than `desc` is ascending."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 100
            },
            "description": "Page size. Missing, zero, negative or non-numeric values use 100; larger values are capped at 5000."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Rows to skip. Negative or non-numeric values use 0."
          },
          {
            "name": "facets",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Send any non-empty value (for example `1`) to add the `os_caption` and `version` filter options to `facets`. Without it, `facets` holds only `status`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPage"
                },
                "example": {
                  "agents": [
                    {
                      "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-204",
                      "hostname": "SHF-WS-204",
                      "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                      "os_version": "10.0.26100",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.124",
                      "wan_ip": "203.0.113.40",
                      "status": "online",
                      "version": "1.4.2",
                      "tags": "reception,ground-floor",
                      "logged_on_users": "HALDEN\\j.morris",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-20T09:14:03Z",
                      "enrolled_at": "2026-03-02T10:21:47Z",
                      "created_at": "2026-03-02T10:21:47Z",
                      "updated_at": "2026-11-20T09:14:03Z",
                      "perf": {
                        "uptime_s": 412380,
                        "mem_mb": 38,
                        "printers": 6,
                        "monitors": 2,
                        "inventory_ms": 1840,
                        "inventory_at": 1795165800,
                        "netscan_ms": 22410,
                        "netscan_at": 1795164900,
                        "monitor_sweep_ms": 960,
                        "monitor_sweep_at": 1795166020,
                        "rtt_ms": 18.42,
                        "reported_at": 1795166043
                      },
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 6
                    },
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-117",
                      "hostname": "SHF-WS-117",
                      "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                      "os_version": "10.0.22631",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.117",
                      "wan_ip": "203.0.113.40",
                      "status": "offline",
                      "version": "1.4.1",
                      "tags": "goods-in",
                      "logged_on_users": "",
                      "update_state": "failed",
                      "update_version": "1.4.2",
                      "update_detail": "service did not start; rolled back to 1.4.1",
                      "update_at": "2026-11-19T22:03:11Z",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-19T17:42:55Z",
                      "enrolled_at": "2026-03-02T10:48:09Z",
                      "created_at": "2026-03-02T10:48:09Z",
                      "updated_at": "2026-11-19T22:03:11Z",
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 3
                    }
                  ],
                  "total": 2,
                  "facets": {
                    "status": [
                      {
                        "value": "offline",
                        "count": 1
                      },
                      {
                        "value": "online",
                        "count": 1
                      }
                    ],
                    "os_caption": [
                      {
                        "value": "Microsoft Windows 11 Pro",
                        "count": 2
                      }
                    ],
                    "version": [
                      {
                        "value": "1.4.1",
                        "count": 1
                      },
                      {
                        "value": "1.4.2",
                        "count": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "getAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Get a computer",
        "description": "One computer with its live connection state and last performance report. `printer_count` is not filled here.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                },
                "example": {
                  "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "SHF-WS-204",
                  "hostname": "SHF-WS-204",
                  "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                  "os_version": "10.0.26100",
                  "os_caption": "Microsoft Windows 11 Pro",
                  "arch": "amd64",
                  "local_ips": "10.40.0.124",
                  "wan_ip": "203.0.113.40",
                  "status": "online",
                  "version": "1.4.2",
                  "tags": "reception,ground-floor",
                  "logged_on_users": "HALDEN\\j.morris",
                  "discovery_interval": 900,
                  "monitor_interval": 60,
                  "log_level": "info",
                  "tray_mode": "",
                  "effective_tray_mode": "full",
                  "last_seen": "2026-11-20T09:14:03Z",
                  "enrolled_at": "2026-03-02T10:21:47Z",
                  "created_at": "2026-03-02T10:21:47Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "perf": {
                    "uptime_s": 412380,
                    "mem_mb": 38,
                    "printers": 6,
                    "monitors": 2,
                    "inventory_ms": 1840,
                    "inventory_at": 1795165800,
                    "netscan_ms": 22410,
                    "netscan_at": 1795164900,
                    "monitor_sweep_ms": 960,
                    "monitor_sweep_at": 1795166020,
                    "rtt_ms": 18.42,
                    "reported_at": 1795166043
                  },
                  "customer_name": "Halden Manufacturing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Update a computer",
        "description": "Requires the admin role. Changes the display name, tags, intervals, log level or tray mode. A connected agent gets the new intervals and log level immediately; a tag change re-evaluates tag-scoped printer assignments in the background.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentUpdate"
              },
              "example": {
                "name": "Reception PC",
                "tags": "reception, Ground-Floor",
                "discovery_interval": 600,
                "log_level": "debug"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                },
                "example": {
                  "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Reception PC",
                  "hostname": "SHF-WS-204",
                  "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                  "os_version": "10.0.26100",
                  "os_caption": "Microsoft Windows 11 Pro",
                  "arch": "amd64",
                  "local_ips": "10.40.0.124",
                  "wan_ip": "203.0.113.40",
                  "status": "online",
                  "version": "1.4.2",
                  "tags": "reception,ground-floor",
                  "logged_on_users": "HALDEN\\j.morris",
                  "discovery_interval": 600,
                  "monitor_interval": 60,
                  "log_level": "debug",
                  "tray_mode": "",
                  "effective_tray_mode": "full",
                  "last_seen": "2026-11-20T09:14:03Z",
                  "enrolled_at": "2026-03-02T10:21:47Z",
                  "created_at": "2026-03-02T10:21:47Z",
                  "updated_at": "2026-11-20T09:20:41Z",
                  "perf": {
                    "uptime_s": 412380,
                    "mem_mb": 38,
                    "printers": 6,
                    "monitors": 2,
                    "inventory_ms": 1840,
                    "inventory_at": 1795165800,
                    "netscan_ms": 22410,
                    "netscan_at": 1795164900,
                    "monitor_sweep_ms": 960,
                    "monitor_sweep_at": 1795166020,
                    "rtt_ms": 18.42,
                    "reported_at": 1795166043
                  },
                  "customer_name": "Halden Manufacturing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Delete a computer",
        "description": "Requires the admin role. Removes the computer and everything discovered on it, and updates the billed seat count. If the machine is connected it is also told to uninstall itself; if it is offline, it fails to authenticate the next time it connects. Use POST /agents/{aid}/uninstall to remove the software but keep the record.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentDeleted"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}/discover": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "post": {
        "operationId": "discoverAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Run discovery now",
        "description": "Asks the computer to re-inventory its printers, ports and drivers now. Available to every role, viewer included. The machine must be connected; the request is not queued. Returns 202 as soon as the command is sent; results arrive as the agent reports them.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCommandAccepted"
                },
                "example": {
                  "status": "discovery requested"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          }
        }
      }
    },
    "/agents/{aid}/drivers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "listAgentDrivers",
        "tags": [
          "Computers"
        ],
        "summary": "List a computer's drivers",
        "description": "A bare array of the printer drivers installed on the computer, ordered by name. Read from stored inventory.",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact environment, for example `Windows x64`."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name, manufacturer and provider."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            },
            "description": "Page size. Missing, zero, negative or non-numeric values use 200; larger values are capped at 500. The handler accepts up to 1000 but the query caps at 500."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentDriver"
                  }
                },
                "example": [
                  {
                    "id": "a81f6d24-3c9e-4b57-9d02-7e5a1c8f3b40",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HP Universal Printing PCL 6",
                    "version": "61.310.1.25919",
                    "driver_date": "2025-04-18",
                    "provider": "HP",
                    "manufacturer": "HP",
                    "environment": "Windows x64",
                    "driver_version_raw": 17231955425607488,
                    "inf_path": "C:\\Windows\\System32\\DriverStore\\FileRepository\\hpcu310u.inf_amd64_5e1c9b2a7d34f8e0\\hpcu310u.inf",
                    "config_file": "hpcui6dn.dll",
                    "data_file": "hpcu310u.gpd",
                    "driver_path": "unidrv.dll",
                    "help_file": "unidrv.hlp",
                    "dependent_files": [
                      "hpcu310u.cfg",
                      "hpcpu310.dll",
                      "hpcsm310.dll"
                    ],
                    "print_processor": "winprint",
                    "monitor_name": "",
                    "is_package_aware": true,
                    "driver_attributes": 1,
                    "oem_url": "http://www.hp.com/go/support",
                    "core_driver_deps": [
                      "{D20EA372-DD35-4950-9ED8-A6335AFE79F0}"
                    ],
                    "synced_at": "2026-11-20T09:00:12Z",
                    "created_at": "2026-03-02T10:23:05Z",
                    "agent_name": "SHF-WS-204",
                    "hostname": "SHF-WS-204",
                    "agent_status": "online",
                    "customer_name": "Halden Manufacturing",
                    "has_package": true
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}/logs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "getAgentLogs",
        "tags": [
          "Computers"
        ],
        "summary": "Read a computer's agent log",
        "description": "Asks the computer for the newest lines of its own agent log. Logs are not stored by PrintCtrl, so the machine must be online; it has 20 seconds to answer.",
        "parameters": [
          {
            "name": "lines",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 200
            },
            "description": "Lines to return. Values outside 1-1000 (or non-numeric) return 200 lines."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentLogs"
                },
                "example": {
                  "lines": [
                    "2026/11/20 09:13:58 discovery: 6 printers, 5 ports, 4 drivers in 1.84s",
                    "2026/11/20 09:14:00 monitor: 10.40.0.21 up, toner black 18%",
                    "2026/11/20 09:14:03 heartbeat sent"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/agents/{aid}/monitoring": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "getAgentMonitoring",
        "tags": [
          "Computers"
        ],
        "summary": "Get a computer's monitoring settings",
        "description": "Whether this computer watches network printers for monitoring, and which monitoring profile it uses.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentMonitoringSettings"
                },
                "example": {
                  "monitoring_off": false,
                  "monitoring_profile_id": ""
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "setAgentMonitoring",
        "tags": [
          "Computers"
        ],
        "summary": "Set a computer's monitoring settings",
        "description": "Requires the editor or admin role. Replaces both settings (an omitted field resets to its default), then reassigns which of the customer's machines watch which printers. The profile must exist in the account and be account-wide or belong to this computer's customer, otherwise 400. Responds with the settings as saved.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentMonitoringSettings"
              },
              "example": {
                "monitoring_off": false,
                "monitoring_profile_id": "e4b7a2d9-1f6c-4e38-8a50-9c3d6f1b7e24"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentMonitoringSettings"
                },
                "example": {
                  "monitoring_off": false,
                  "monitoring_profile_id": "e4b7a2d9-1f6c-4e38-8a50-9c3d6f1b7e24"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}/ports": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "listAgentPorts",
        "tags": [
          "Computers"
        ],
        "summary": "List a computer's ports",
        "description": "A bare array of the print ports last discovered on the computer, ordered by name, each with the queues bound to it. Read from stored inventory.",
        "parameters": [
          {
            "name": "port_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact port type, for example `tcpip`."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name, host address and serial number."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            },
            "description": "Page size. Missing, zero, negative or non-numeric values use 200; larger values are capped at 500. The handler accepts up to 1000 but the query caps at 500."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentPort"
                  }
                },
                "example": [
                  {
                    "id": "d94a1c37-6e2b-4f85-8a0d-3b7e5c1f9a62",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "10.40.0.21",
                    "port_type": "tcpip",
                    "host_address": "10.40.0.21",
                    "port_number": 9100,
                    "protocol": "raw",
                    "queue_name": "",
                    "snmp_enabled": true,
                    "snmp_community_set": true,
                    "snmp_index": 1,
                    "device_id": "",
                    "serial_number": "PHBQK41782",
                    "synced_at": "2026-11-20T09:00:12Z",
                    "created_at": "2026-03-02T10:23:05Z",
                    "printer_names": [
                      "HM-Reception"
                    ]
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}/printers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "get": {
        "operationId": "listAgentPrinters",
        "tags": [
          "Computers"
        ],
        "summary": "List a computer's printers",
        "description": "A bare array of the print queues last discovered on the computer, ordered by name. Read from stored inventory, so the machine does not need to be online. There is no cursor; raise `limit` to get more.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name, location, driver, port, model, manufacturer and user name."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            },
            "description": "Page size. Missing, zero, negative or non-numeric values use 200; larger values are capped at 500. The handler accepts up to 1000 but the query caps at 500."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentPrinter"
                  }
                },
                "example": [
                  {
                    "id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HM-Reception",
                    "scope": "machine",
                    "share_name": "",
                    "port_name": "10.40.0.21",
                    "driver_name": "HP Universal Printing PCL 6",
                    "comment": "",
                    "location": "Sheffield reception",
                    "server_name": "",
                    "is_shared": false,
                    "is_default": true,
                    "is_published": false,
                    "status": 0,
                    "status_text": "Ready",
                    "queued_jobs": 0,
                    "attributes": 576,
                    "priority": 1,
                    "print_processor": "winprint",
                    "datatype": "RAW",
                    "sep_file": "",
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP M428fdw",
                    "model_source": "snmp",
                    "vendor_slug": "hp",
                    "device_class": "mfp",
                    "serial_number": "PHBQK41782",
                    "port_type": "tcpip",
                    "host_address": "10.40.0.21",
                    "port_number": 9100,
                    "protocol": "raw",
                    "synced_at": "2026-11-20T09:00:12Z",
                    "created_at": "2026-03-02T10:23:05Z",
                    "agent_name": "SHF-WS-204",
                    "agent_status": "online",
                    "hostname": "SHF-WS-204",
                    "customer_name": "Halden Manufacturing",
                    "monitoring": {
                      "monitors": 1,
                      "state": "up",
                      "last_seen_at": "2026-11-20T09:13:30Z",
                      "lowest_supply_percent": 18,
                      "alert_count": 0
                    }
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agents/{aid}/restart": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "post": {
        "operationId": "restartAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Restart the agent service",
        "description": "Requires the admin role. Restarts the PrintCtrl Windows service on the computer. The machine must be connected; the request is not queued.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCommandAccepted"
                },
                "example": {
                  "status": "restart requested"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          }
        }
      }
    },
    "/agents/{aid}/uninstall": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "post": {
        "operationId": "uninstallAgent",
        "tags": [
          "Computers"
        ],
        "summary": "Uninstall the agent",
        "description": "Requires the admin role. Tells the computer to remove the agent. The record and its history are kept; use DELETE /agents/{aid} to remove both. The machine must be connected; the request is not queued.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCommandAccepted"
                },
                "example": {
                  "status": "uninstall requested"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          }
        }
      }
    },
    "/agents/{aid}/update": {
      "parameters": [
        {
          "$ref": "#/components/parameters/aid"
        }
      ],
      "post": {
        "operationId": "updateAgentSoftware",
        "tags": [
          "Computers"
        ],
        "summary": "Update the agent software",
        "description": "Requires the admin role. Tells the computer to install the newest published agent build. Progress shows in the computer's `update_state`. Returns 409 when the machine already runs that version or newer, and 503 when the machine is not connected or no build is published.",
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUpdateAccepted"
                },
                "example": {
                  "status": "update requested",
                  "version": "1.4.2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          }
        }
      }
    },
    "/customers/{cid}/agents": {
      "get": {
        "operationId": "listCustomerAgents",
        "tags": [
          "Computers"
        ],
        "summary": "List a customer's computers",
        "description": "A bare array of the customer's computers ordered by name, then id, with keyset paging: pass the last row's `name` and `id` as `cursor_name` and `cursor_id` to get the next page. A shorter page than `limit` is the last one. For sorting, filters and totals use GET /agents?customer_id=.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact stored status, for example `offline`."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name, hostname, LAN addresses and public address."
          },
          {
            "name": "cursor_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `name` of the last row of the previous page. Used only with `cursor_id`."
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The `id` of the last row of the previous page."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "Page size. Missing, zero, negative or non-numeric values use 100; larger values are capped at 500."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Agent"
                  }
                },
                "example": [
                  {
                    "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "SHF-WS-117",
                    "hostname": "SHF-WS-117",
                    "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                    "os_version": "10.0.22631",
                    "os_caption": "Microsoft Windows 11 Pro",
                    "arch": "amd64",
                    "local_ips": "10.40.0.117",
                    "wan_ip": "203.0.113.40",
                    "status": "offline",
                    "version": "1.4.1",
                    "tags": "goods-in",
                    "logged_on_users": "",
                    "update_state": "failed",
                    "update_version": "1.4.2",
                    "update_detail": "service did not start; rolled back to 1.4.1",
                    "update_at": "2026-11-19T22:03:11Z",
                    "discovery_interval": 900,
                    "monitor_interval": 60,
                    "log_level": "info",
                    "tray_mode": "",
                    "effective_tray_mode": "full",
                    "last_seen": "2026-11-19T17:42:55Z",
                    "enrolled_at": "2026-03-02T10:48:09Z",
                    "created_at": "2026-03-02T10:48:09Z",
                    "updated_at": "2026-11-19T22:03:11Z",
                    "customer_name": "Halden Manufacturing",
                    "printer_count": 3
                  },
                  {
                    "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "SHF-WS-204",
                    "hostname": "SHF-WS-204",
                    "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                    "os_version": "10.0.26100",
                    "os_caption": "Microsoft Windows 11 Pro",
                    "arch": "amd64",
                    "local_ips": "10.40.0.124",
                    "wan_ip": "203.0.113.40",
                    "status": "online",
                    "version": "1.4.2",
                    "tags": "reception,ground-floor",
                    "logged_on_users": "HALDEN\\j.morris",
                    "discovery_interval": 900,
                    "monitor_interval": 60,
                    "log_level": "info",
                    "tray_mode": "",
                    "effective_tray_mode": "full",
                    "last_seen": "2026-11-20T09:14:03Z",
                    "enrolled_at": "2026-03-02T10:21:47Z",
                    "created_at": "2026-03-02T10:21:47Z",
                    "updated_at": "2026-11-20T09:14:03Z",
                    "perf": {
                      "uptime_s": 412380,
                      "mem_mb": 38,
                      "printers": 6,
                      "monitors": 2,
                      "inventory_ms": 1840,
                      "inventory_at": 1795165800,
                      "netscan_ms": 22410,
                      "netscan_at": 1795164900,
                      "monitor_sweep_ms": 960,
                      "monitor_sweep_at": 1795166020,
                      "rtt_ms": 18.42,
                      "reported_at": 1795166043
                    },
                    "customer_name": "Halden Manufacturing",
                    "printer_count": 6
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-groups": {
      "get": {
        "operationId": "listGroups",
        "tags": [
          "Groups"
        ],
        "summary": "List groups",
        "description": "A bare array of the account's groups with their rules and live member counts, ordered by name. At most 500 groups are returned; there is no paging.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only groups for this customer plus account-wide groups. Member counts then include only this customer's computers."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring match on name and description."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Group"
                  }
                },
                "example": [
                  {
                    "id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "name": "Sheffield office",
                    "description": "Every machine on the Sheffield site LAN",
                    "created_by": "1b7d3e95-4a2c-4f86-b0e3-8c5a9d2f6e14",
                    "created_at": "2026-06-11T13:05:22Z",
                    "updated_at": "2026-11-18T15:40:09Z",
                    "customer_name": "Halden Manufacturing",
                    "rules": [
                      {
                        "id": "c3e8f1a6-2d7b-4c94-9e05-6a1f3b8d7c29",
                        "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                        "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                        "rule_type": "hostname",
                        "value": "SHF-*",
                        "created_at": "2026-06-11T13:05:22Z"
                      },
                      {
                        "id": "7a2c9e41-5b3d-4f86-a1e7-0d4b8c6f2e95",
                        "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                        "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                        "rule_type": "lan_cidr",
                        "value": "10.40.0.0/24",
                        "created_at": "2026-06-11T13:05:22Z"
                      }
                    ],
                    "member_count": 2
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Create a group",
        "description": "Requires the editor or admin role. Creates a group, optionally with its rules in the same call, as a `rule_tree` or as flat `rules`. Every rule is validated before anything is saved.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupInput"
              },
              "example": {
                "name": "Sheffield office",
                "description": "Every machine on the Sheffield site LAN",
                "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                "rule_tree": {
                  "match": "all",
                  "rules": [
                    {
                      "field": "lan_ip",
                      "operator": "in_range",
                      "value": "10.40.0.0/24"
                    },
                    {
                      "match": "any",
                      "rules": [
                        {
                          "field": "hostname",
                          "operator": "starts_with",
                          "value": "SHF-"
                        },
                        {
                          "field": "wan_ip",
                          "operator": "in_range",
                          "value": "203.0.113.40"
                        }
                      ]
                    },
                    {
                      "field": "os",
                      "operator": "not_contains",
                      "value": "Server"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                },
                "example": {
                  "id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "Sheffield office",
                  "description": "Every machine on the Sheffield site LAN",
                  "created_by": "1b7d3e95-4a2c-4f86-b0e3-8c5a9d2f6e14",
                  "created_at": "2026-06-11T13:05:22Z",
                  "updated_at": "2026-06-11T13:05:22Z",
                  "customer_name": "Halden Manufacturing",
                  "rules": [
                    {
                      "id": "c3e8f1a6-2d7b-4c94-9e05-6a1f3b8d7c29",
                      "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "rule_type": "hostname",
                      "value": "SHF-*",
                      "created_at": "2026-06-11T13:05:22Z"
                    },
                    {
                      "id": "7a2c9e41-5b3d-4f86-a1e7-0d4b8c6f2e95",
                      "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "rule_type": "lan_cidr",
                      "value": "10.40.0.0/24",
                      "created_at": "2026-06-11T13:05:22Z"
                    }
                  ],
                  "member_count": 0
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-groups/{gid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/gid"
        }
      ],
      "get": {
        "operationId": "getGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Get a group",
        "description": "The group with its rules, plus the computers its rules match right now. Wrapped as `{\"group\": ..., \"members\": [...]}`.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDetail"
                },
                "example": {
                  "group": {
                    "id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "name": "Sheffield office",
                    "description": "Every machine on the Sheffield site LAN",
                    "created_by": "1b7d3e95-4a2c-4f86-b0e3-8c5a9d2f6e14",
                    "created_at": "2026-06-11T13:05:22Z",
                    "updated_at": "2026-11-18T15:40:09Z",
                    "customer_name": "Halden Manufacturing",
                    "rules": [
                      {
                        "id": "c3e8f1a6-2d7b-4c94-9e05-6a1f3b8d7c29",
                        "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                        "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                        "rule_type": "hostname",
                        "value": "SHF-*",
                        "created_at": "2026-06-11T13:05:22Z"
                      },
                      {
                        "id": "7a2c9e41-5b3d-4f86-a1e7-0d4b8c6f2e95",
                        "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                        "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                        "rule_type": "lan_cidr",
                        "value": "10.40.0.0/24",
                        "created_at": "2026-06-11T13:05:22Z"
                      }
                    ],
                    "member_count": 2
                  },
                  "members": [
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-117",
                      "hostname": "SHF-WS-117",
                      "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                      "os_version": "10.0.22631",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.117",
                      "wan_ip": "203.0.113.40",
                      "status": "offline",
                      "version": "1.4.1",
                      "tags": "goods-in",
                      "logged_on_users": "",
                      "update_state": "failed",
                      "update_version": "1.4.2",
                      "update_detail": "service did not start; rolled back to 1.4.1",
                      "update_at": "2026-11-19T22:03:11Z",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-19T17:42:55Z",
                      "enrolled_at": "2026-03-02T10:48:09Z",
                      "created_at": "2026-03-02T10:48:09Z",
                      "updated_at": "2026-11-19T22:03:11Z",
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 3
                    },
                    {
                      "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-204",
                      "hostname": "SHF-WS-204",
                      "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                      "os_version": "10.0.26100",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.124",
                      "wan_ip": "203.0.113.40",
                      "status": "online",
                      "version": "1.4.2",
                      "tags": "reception,ground-floor",
                      "logged_on_users": "HALDEN\\j.morris",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-20T09:14:03Z",
                      "enrolled_at": "2026-03-02T10:21:47Z",
                      "created_at": "2026-03-02T10:21:47Z",
                      "updated_at": "2026-11-20T09:14:03Z",
                      "perf": {
                        "uptime_s": 412380,
                        "mem_mb": 38,
                        "printers": 6,
                        "monitors": 2,
                        "inventory_ms": 1840,
                        "inventory_at": 1795165800,
                        "netscan_ms": 22410,
                        "netscan_at": 1795164900,
                        "monitor_sweep_ms": 960,
                        "monitor_sweep_at": 1795166020,
                        "rtt_ms": 18.42,
                        "reported_at": 1795166043
                      },
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 6
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Update a group",
        "description": "Requires the editor or admin role. Renames the group, changes its description, moves it to a customer or to the whole account (empty `customer_id`), or replaces its rules with `rule_tree`. A rules or customer change redeploys printers assigned through the group in the background.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupUpdate"
              },
              "example": {
                "description": "Sheffield site, ground and first floor"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                },
                "example": {
                  "id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "Sheffield office",
                  "description": "Sheffield site, ground and first floor",
                  "created_by": "1b7d3e95-4a2c-4f86-b0e3-8c5a9d2f6e14",
                  "created_at": "2026-06-11T13:05:22Z",
                  "updated_at": "2026-11-20T09:22:17Z",
                  "customer_name": "Halden Manufacturing",
                  "rules": [
                    {
                      "id": "c3e8f1a6-2d7b-4c94-9e05-6a1f3b8d7c29",
                      "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "rule_type": "hostname",
                      "value": "SHF-*",
                      "created_at": "2026-06-11T13:05:22Z"
                    },
                    {
                      "id": "7a2c9e41-5b3d-4f86-a1e7-0d4b8c6f2e95",
                      "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "rule_type": "lan_cidr",
                      "value": "10.40.0.0/24",
                      "created_at": "2026-06-11T13:05:22Z"
                    }
                  ],
                  "member_count": 0
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteGroup",
        "tags": [
          "Groups"
        ],
        "summary": "Delete a group",
        "description": "Requires the editor or admin role. Deletes the group and every managed printer assignment that targeted it. Those printers are then removed, in the background, from machines no longer in scope.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupDeleted"
                },
                "example": {
                  "deleted": true,
                  "printers_reconciled": 2
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-groups/{gid}/rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/gid"
        }
      ],
      "post": {
        "operationId": "addGroupRule",
        "tags": [
          "Groups"
        ],
        "summary": "Add a rule to a group",
        "description": "Requires the editor or admin role. Adds a flat membership rule. A group that has a `rule_tree` ignores flat rules; change its rules with PATCH /agent-groups/{gid} instead. Otherwise printers assigned to the group are deployed to newly matching machines in the background. Adding a rule the group already has returns the existing rule. With `preview: true` nothing is saved and the response is 200 with a GroupPreview, as POST /agent-groups/preview.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupRuleAddInput"
              },
              "example": {
                "rule_type": "hostname",
                "value": "SHF-GI-*"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview only (`preview: true`); nothing saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupPreview"
                },
                "example": {
                  "matched": [
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-117",
                      "hostname": "SHF-WS-117",
                      "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                      "os_version": "10.0.22631",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.117",
                      "wan_ip": "203.0.113.40",
                      "status": "offline",
                      "version": "1.4.1",
                      "tags": "goods-in",
                      "logged_on_users": "",
                      "update_state": "failed",
                      "update_version": "1.4.2",
                      "update_detail": "service did not start; rolled back to 1.4.1",
                      "update_at": "2026-11-19T22:03:11Z",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-19T17:42:55Z",
                      "enrolled_at": "2026-03-02T10:48:09Z",
                      "created_at": "2026-03-02T10:48:09Z",
                      "updated_at": "2026-11-19T22:03:11Z",
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 3
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupRule"
                },
                "example": {
                  "id": "f6a3d8b1-9e2c-4b75-8d14-2c7e5a9f0b63",
                  "group_id": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "rule_type": "tag",
                  "value": "goods-in",
                  "created_at": "2026-11-20T09:24:50Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-groups/{gid}/rules/{rid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/gid"
        },
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "Rule id."
        }
      ],
      "delete": {
        "operationId": "deleteGroupRule",
        "tags": [
          "Groups"
        ],
        "summary": "Remove a rule from a group",
        "description": "Requires the editor or admin role. Removes the rule; printers assigned to the group are uninstalled, in the background, from machines that no longer match.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupRuleDeleted"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/agent-groups/preview": {
      "post": {
        "operationId": "previewGroupRule",
        "tags": [
          "Groups"
        ],
        "summary": "Preview a rule",
        "description": "Shows which computers a single flat rule, or a whole rule tree, would match, without saving anything and without needing a group. Available to every role. The rules are validated the same way as when they are saved.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupPreviewInput"
              },
              "examples": {
                "rule": {
                  "summary": "One flat rule",
                  "value": {
                    "rule_type": "lan_cidr",
                    "value": "10.40.0.0/24"
                  }
                },
                "tree": {
                  "summary": "A rule tree",
                  "value": {
                    "rule_tree": {
                      "match": "all",
                      "rules": [
                        {
                          "field": "lan_ip",
                          "operator": "in_range",
                          "value": "10.40.0.0/24"
                        },
                        {
                          "match": "any",
                          "rules": [
                            {
                              "field": "hostname",
                              "operator": "starts_with",
                              "value": "SHF-"
                            },
                            {
                              "field": "wan_ip",
                              "operator": "in_range",
                              "value": "203.0.113.40"
                            }
                          ]
                        },
                        {
                          "field": "os",
                          "operator": "not_contains",
                          "value": "Server"
                        }
                      ]
                    },
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupPreview"
                },
                "example": {
                  "matched": [
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-117",
                      "hostname": "SHF-WS-117",
                      "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                      "os_version": "10.0.22631",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.117",
                      "wan_ip": "203.0.113.40",
                      "status": "offline",
                      "version": "1.4.1",
                      "tags": "goods-in",
                      "logged_on_users": "",
                      "update_state": "failed",
                      "update_version": "1.4.2",
                      "update_detail": "service did not start; rolled back to 1.4.1",
                      "update_at": "2026-11-19T22:03:11Z",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-19T17:42:55Z",
                      "enrolled_at": "2026-03-02T10:48:09Z",
                      "created_at": "2026-03-02T10:48:09Z",
                      "updated_at": "2026-11-19T22:03:11Z",
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 3
                    },
                    {
                      "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-204",
                      "hostname": "SHF-WS-204",
                      "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                      "os_version": "10.0.26100",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.124",
                      "wan_ip": "203.0.113.40",
                      "status": "online",
                      "version": "1.4.2",
                      "tags": "reception,ground-floor",
                      "logged_on_users": "HALDEN\\j.morris",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-20T09:14:03Z",
                      "enrolled_at": "2026-03-02T10:21:47Z",
                      "created_at": "2026-03-02T10:21:47Z",
                      "updated_at": "2026-11-20T09:14:03Z",
                      "perf": {
                        "uptime_s": 412380,
                        "mem_mb": 38,
                        "printers": 6,
                        "monitors": 2,
                        "inventory_ms": 1840,
                        "inventory_at": 1795165800,
                        "netscan_ms": 22410,
                        "netscan_at": 1795164900,
                        "monitor_sweep_ms": 960,
                        "monitor_sweep_at": 1795166020,
                        "rtt_ms": 18.42,
                        "reported_at": 1795166043
                      },
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 6
                    }
                  ],
                  "count": 2
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/network-printers": {
      "get": {
        "operationId": "listNetworkPrinters",
        "tags": [
          "Printers"
        ],
        "summary": "List printers found on the network",
        "description": "Devices found by agents sweeping the network (SNMP, IPP and port probes), rather than read from a spooler. Each row says whether a managed printer already uses its address and how many discovered queues print to it.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only devices at this customer."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring search over IP address, hostname, model, printer name, serial number, manufacturer and SNMP sysName."
          },
          {
            "name": "unmanaged",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            },
            "description": "Only devices with no managed printer at their address."
          },
          {
            "name": "managed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            },
            "description": "Only devices that already have a managed printer at their address."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000,
              "default": 1000
            },
            "description": "Page size. Missing, non-positive or values above 2000 use 1000."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Rows to skip."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "model",
                "ip_address",
                "last_seen_at"
              ]
            },
            "description": "Sort key. When omitted (or unknown) the order is most recently seen first, then IP address, and dir is ignored."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            },
            "description": "Sort direction for an explicit sort. Note sort=last_seen_at without dir=desc is oldest first."
          }
        ],
        "responses": {
          "200": {
            "description": "An object with the page and the total number of matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPrinterPage"
                },
                "example": {
                  "network_printers": [
                    {
                      "id": "0b7e3d95-8a1f-4c62-b4d7-2e9f6a3c1d58",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "customer_name": "Halden Manufacturing",
                      "ip_address": "10.40.0.22",
                      "mac_address": "00:17:c8:4a:2e:91",
                      "hostname": "KMA4E291",
                      "sys_name": "KMA4E291",
                      "sys_descr": "KYOCERA Document Solutions Printing System",
                      "manufacturer": "Kyocera",
                      "model": "ECOSYS M3655idn",
                      "printer_name": "ECOSYS M3655idn",
                      "serial_number": "VCF9Z07134",
                      "snmp_responded": true,
                      "open_ports": "80,443,515,631,9100",
                      "languages": "PCL6,KPDL,PDF",
                      "pdl": "application/vnd.hp-PCL",
                      "ipp": {
                        "printer-make-and-model": "Kyocera ECOSYS M3655idn",
                        "printer-state": "idle"
                      },
                      "sys_object_id": "1.3.6.1.4.1.1347.41",
                      "last_seen_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "first_seen_at": "2026-10-04T11:22:08Z",
                      "last_seen_at": "2026-11-20T09:00:41Z",
                      "last_seen_agent_name": "SHF-WS-204",
                      "seen_by_agents": 2,
                      "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                      "managed_printer_name": "HM-Goods-In",
                      "queue_count": 6
                    }
                  ],
                  "total": 14
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/network-printers/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Network printer id."
        }
      ],
      "delete": {
        "operationId": "deleteNetworkPrinter",
        "tags": [
          "Printers"
        ],
        "summary": "Forget a network-discovered printer",
        "description": "Requires the admin role. Removes the row only; nothing on the network changes. If the device is still there the next sweep finds it again.",
        "responses": {
          "204": {
            "description": "Removed. No body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/ports/{portid}": {
      "parameters": [
        {
          "name": "portid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Printer port id, as listed by GET /agents/{aid}/ports."
        }
      ],
      "delete": {
        "operationId": "deletePort",
        "tags": [
          "Printers"
        ],
        "summary": "Remove a printer port from its computer",
        "description": "Requires the admin role. Deletes the port on the computer. Windows refuses to delete a port that a queue still uses; that refusal comes back as a 502 with Windows's message. Waits up to 90 seconds.",
        "responses": {
          "200": {
            "description": "The port was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDeleted"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/print-jobs/totals": {
      "get": {
        "operationId": "getPrintJobTotals",
        "tags": [
          "Printers"
        ],
        "summary": "Get print totals per customer",
        "description": "Sums each customer's print jobs submitted in the last `days` days. Page counts include only jobs that printed. Customers with no jobs in the period are absent.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 366,
              "default": 30
            },
            "description": "Length of the period in days, counted back from now."
          }
        ],
        "responses": {
          "200": {
            "description": "Totals per customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterJobTotalsReport"
                },
                "example": {
                  "days": 30,
                  "since": "2026-10-21T09:14:03Z",
                  "customers": [
                    {
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "jobs": 1842,
                      "pages": 6310,
                      "color_pages": 512,
                      "mono_pages": 5644,
                      "failed": 9
                    },
                    {
                      "customer_id": "b84d2f17-6c3e-4a91-8f5b-0d6e9a2c7b15",
                      "jobs": 977,
                      "pages": 4128,
                      "color_pages": 1630,
                      "mono_pages": 2498,
                      "failed": 2
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/printer-problems": {
      "get": {
        "operationId": "listPrinterProblems",
        "tags": [
          "Printers"
        ],
        "summary": "List failed printer setups",
        "description": "Printer devices Windows tried to set up and could not (for example a driver error), as reported by each computer's latest discovery. Newest first, at most 500, no paging.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only problems at this customer."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only problems on this computer."
          }
        ],
        "responses": {
          "200": {
            "description": "An object with a printer_problems array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterProblemList"
                },
                "example": {
                  "printer_problems": [
                    {
                      "id": "f4a1c7e9-2d6b-4e83-9b50-6c8d3a1e7f24",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "customer_name": "Halden Manufacturing",
                      "agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "agent_name": "SHF-WS-117",
                      "agent_status": "online",
                      "instance_id": "SWD\\PRINTENUM\\{8E1F0B3A-6C2D-4B7E-9A15-3D4F8C2B6E71}",
                      "name": "Kyocera ECOSYS M3655idn",
                      "driver_name": "",
                      "problem_code": 28,
                      "problem": "The drivers for this device are not installed.",
                      "host_address": "10.40.0.22",
                      "serial_number": "VCF9Z07134",
                      "model": "ECOSYS M3655idn",
                      "first_seen_at": "2026-11-19T16:20:41Z",
                      "synced_at": "2026-11-20T09:05:12Z",
                      "network_printer_id": "0b7e3d95-8a1f-4c62-b4d7-2e9f6a3c1d58",
                      "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                      "managed_printer_name": "HM-Goods-In"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/printer-problems/{id}/remove": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Printer problem id."
        }
      ],
      "post": {
        "operationId": "removePrinterProblem",
        "tags": [
          "Printers"
        ],
        "summary": "Remove a failed printer device",
        "description": "Requires the admin role. Removes the failed device from its computer. With {\"retry\": true} the agent then asks Windows to detect the printer again, which reruns its setup. The body is optional. Waits up to 90 seconds.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "retry": {
                    "type": "boolean",
                    "default": false,
                    "description": "Rerun Windows device setup after removing the device."
                  }
                }
              },
              "example": {
                "retry": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterProblemRemoved"
                },
                "example": {
                  "removed": true,
                  "retried": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/printers": {
      "get": {
        "operationId": "listPrinters",
        "tags": [
          "Printers"
        ],
        "summary": "List discovered printers",
        "description": "Returns the print queues the agents have discovered across the account, sorted by name. Virtual queues (Microsoft Print to PDF, XPS, OneNote, Fax and similar) are hidden unless include_virtual is set. The response shape depends on the query: without offset it is a bare array; with offset it is {\"printers\": [...], \"total\": n}; with format=csv it is a CSV file of every matching printer.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only printers at this customer."
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only printers on this computer."
          },
          {
            "name": "driver_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact driver name match."
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Vendor slug, for example `hp` or `kyocera` (matches `vendor_slug`)."
          },
          {
            "name": "device_class",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact `device_class` match."
          },
          {
            "name": "port_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tcpip",
                "usb",
                "wsd",
                "local",
                "file",
                "other"
              ]
            },
            "description": "Type of the port the queue prints to."
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "machine",
                "user"
              ]
            },
            "description": "`machine` for queues installed on the computer, `user` for one person's mapped connections. Omit for both."
          },
          {
            "name": "user_sid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the mapped printers of this Windows user SID."
          },
          {
            "name": "health",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "up",
                "down",
                "unmonitored",
                "low",
                "out",
                "supplies_ok"
              ]
            },
            "description": "`up` or `down`: what monitoring reports for the device. `unmonitored`: neither (not watched, or nothing heard yet). `low`: a consumable is below 15%. `out`: a consumable is at 0%. `supplies_ok`: every consumable is at 15% or more. Other values are ignored."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring search over name, location, driver name, port name, model, manufacturer and user name."
          },
          {
            "name": "include_virtual",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Any non-empty value (for example `1`) includes virtual queues. Note that `include_virtual=0` also includes them."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "Page size. Values above 500 are clamped to 500; invalid or non-positive values use 100."
          },
          {
            "name": "cursor_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Keyset cursor: the `name` of the last printer on the previous page. Use with cursor_id."
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Keyset cursor: the `id` of the last printer on the previous page. The cursor is applied only when cursor_id is set. It pages by name only, in either direction: with another `sort` the response is 400."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Switches to numbered paging: skips this many rows and wraps the response as {\"printers\": [...], \"total\": n}. Passing offset=0 still selects the wrapped shape."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "status",
                "scope",
                "agent_id",
                "driver_name",
                "port_name",
                "host_address",
                "queued_jobs",
                "synced_at",
                "manufacturer",
                "model",
                "serial_number"
              ],
              "default": "name"
            },
            "description": "Sort key. `agent_id` sorts by the computer's name; `manufacturer` and `model` are case-insensitive. Unknown values sort by name. Ties are broken by id."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            },
            "description": "Sort direction. Only `desc` changes it."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv"
              ]
            },
            "description": "With `csv`, streams every matching printer (up to 100,000 rows, same filters, limit/cursor/offset ignored) as a CSV attachment named `printers-YYYY-MM-DD.csv`. The export is recorded in the activity log."
          },
          {
            "name": "export_as",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "pdf"
              ]
            },
            "description": "With format=csv, only changes the format recorded in the activity log entry (`pdf` when the console renders the file as a PDF). The response is CSV either way."
          }
        ],
        "responses": {
          "200": {
            "description": "Without offset: a bare array of printers. With offset: a PrinterPage. With format=csv: a CSV file. List rows omit devmode_b64, devmode_public, print_ticket_xml, capabilities and raw; GET /printers/{pid} returns those.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Printer"
                      }
                    },
                    {
                      "$ref": "#/components/schemas/PrinterPage"
                    }
                  ]
                },
                "examples": {
                  "list": {
                    "summary": "Without offset",
                    "value": [
                      {
                        "id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                        "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                        "name": "HM-Reception",
                        "scope": "machine",
                        "share_name": "",
                        "port_name": "IP_10.40.0.21",
                        "driver_name": "HP Universal Printing PCL 6",
                        "comment": "",
                        "location": "Sheffield reception",
                        "server_name": "",
                        "is_shared": false,
                        "is_default": true,
                        "is_published": false,
                        "status": 0,
                        "status_text": "",
                        "queued_jobs": 0,
                        "attributes": 2624,
                        "priority": 1,
                        "print_processor": "winprint",
                        "datatype": "RAW",
                        "sep_file": "",
                        "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                        "manufacturer": "HP",
                        "model": "LaserJet Pro MFP M428fdw",
                        "model_source": "snmp",
                        "vendor_slug": "hp",
                        "device_class": "mfp",
                        "serial_number": "PHBQK41207",
                        "port_type": "tcpip",
                        "host_address": "10.40.0.21",
                        "port_number": 9100,
                        "protocol": "raw",
                        "synced_at": "2026-11-20T09:14:03Z",
                        "created_at": "2026-09-02T13:40:11Z",
                        "agent_name": "SHF-WS-204",
                        "agent_status": "online",
                        "hostname": "SHF-WS-204",
                        "customer_name": "Halden Manufacturing",
                        "monitoring": {
                          "monitors": 1,
                          "state": "up",
                          "last_seen_at": "2026-11-20T09:13:30Z",
                          "lowest_supply_percent": 42,
                          "alert_count": 0
                        }
                      }
                    ]
                  },
                  "page": {
                    "summary": "With offset",
                    "value": {
                      "printers": [
                        {
                          "id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                          "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                          "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                          "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                          "name": "HM-Reception",
                          "scope": "machine",
                          "share_name": "",
                          "port_name": "IP_10.40.0.21",
                          "driver_name": "HP Universal Printing PCL 6",
                          "comment": "",
                          "location": "Sheffield reception",
                          "server_name": "",
                          "is_shared": false,
                          "is_default": true,
                          "is_published": false,
                          "status": 0,
                          "status_text": "",
                          "queued_jobs": 0,
                          "attributes": 2624,
                          "priority": 1,
                          "print_processor": "winprint",
                          "datatype": "RAW",
                          "sep_file": "",
                          "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                          "manufacturer": "HP",
                          "model": "LaserJet Pro MFP M428fdw",
                          "model_source": "snmp",
                          "vendor_slug": "hp",
                          "device_class": "mfp",
                          "serial_number": "PHBQK41207",
                          "port_type": "tcpip",
                          "host_address": "10.40.0.21",
                          "port_number": 9100,
                          "protocol": "raw",
                          "synced_at": "2026-11-20T09:14:03Z",
                          "created_at": "2026-09-02T13:40:11Z",
                          "agent_name": "SHF-WS-204",
                          "agent_status": "online",
                          "hostname": "SHF-WS-204",
                          "customer_name": "Halden Manufacturing",
                          "monitoring": {
                            "monitors": 1,
                            "state": "up",
                            "last_seen_at": "2026-11-20T09:13:30Z",
                            "lowest_supply_percent": 42,
                            "alert_count": 0
                          }
                        }
                      ],
                      "total": 37
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "Printer,Manufacturer,Model,Status,Health,Installed for,User,Device,Customer,Driver,Port,Port type,Host,Shared,Share name,Queued jobs,Synced\nHM-Reception,HP,LaserJet Pro MFP M428fdw,Ready,Online,Everyone,,SHF-WS-204,Halden Manufacturing,HP Universal Printing PCL 6,IP_10.40.0.21,TCPIP,10.40.0.21,No,,0,2026-11-20T09:14:03Z\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/printers/{pid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "get": {
        "operationId": "getPrinter",
        "tags": [
          "Printers"
        ],
        "summary": "Get a discovered printer",
        "description": "Returns one printer with its captured configuration in three tiers: devmode_public (documented, editable fields), capabilities (the driver's PrintCapabilities tree) and devmode_b64 (the opaque vendor blob, replayable only onto the same driver build). The printer's fields are at the top level, with driver_version, environment and config_tiers added.",
        "responses": {
          "200": {
            "description": "The printer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDetail"
                },
                "example": {
                  "id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                  "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HM-Reception",
                  "scope": "machine",
                  "share_name": "",
                  "port_name": "IP_10.40.0.21",
                  "driver_name": "HP Universal Printing PCL 6",
                  "comment": "",
                  "location": "Sheffield reception",
                  "server_name": "",
                  "is_shared": false,
                  "is_default": true,
                  "is_published": false,
                  "status": 0,
                  "status_text": "",
                  "queued_jobs": 0,
                  "attributes": 2624,
                  "priority": 1,
                  "print_processor": "winprint",
                  "datatype": "RAW",
                  "sep_file": "",
                  "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                  "manufacturer": "HP",
                  "model": "LaserJet Pro MFP M428fdw",
                  "model_source": "snmp",
                  "vendor_slug": "hp",
                  "device_class": "mfp",
                  "serial_number": "PHBQK41207",
                  "port_type": "tcpip",
                  "host_address": "10.40.0.21",
                  "port_number": 9100,
                  "protocol": "raw",
                  "synced_at": "2026-11-20T09:14:03Z",
                  "created_at": "2026-09-02T13:40:11Z",
                  "agent_name": "SHF-WS-204",
                  "agent_status": "online",
                  "hostname": "SHF-WS-204",
                  "customer_name": "Halden Manufacturing",
                  "monitoring": {
                    "monitors": 0,
                    "state": "",
                    "alert_count": 0
                  },
                  "devmode_b64": "SABQACAAVQBuAGkAdgBlAHIAcwBhAGwAIABQAHIAaQBuAHQAaQBuAGcAIABQAEMATAAgADYAAAAAAAAAAAABBAAG3ABQAw...",
                  "devmode_public": {
                    "orientation": "portrait",
                    "paper_size": 9,
                    "duplex": "long_edge",
                    "color": "monochrome",
                    "copies": 1,
                    "default_source": "auto"
                  },
                  "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                  "capabilities": {
                    "features": [
                      {
                        "name": "psk:JobDuplexAllDocumentsContiguously",
                        "display_name": "Print on both sides",
                        "options": [
                          {
                            "name": "psk:OneSided",
                            "display_name": "Off"
                          },
                          {
                            "name": "psk:TwoSidedLongEdge",
                            "display_name": "Long edge"
                          }
                        ]
                      }
                    ]
                  },
                  "raw": {
                    "Name": "HM-Reception",
                    "PortName": "IP_10.40.0.21",
                    "DriverName": "HP Universal Printing PCL 6"
                  },
                  "driver_version": "61.310.1.25919",
                  "environment": "Windows x64",
                  "config_tiers": {
                    "public_devmode": true,
                    "print_capabilities": true,
                    "opaque_blob_bytes": 1688
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteDiscoveredPrinter",
        "tags": [
          "Printers"
        ],
        "summary": "Remove a print queue from its computer",
        "description": "Requires the admin role. Deletes the queue on the computer (or the user's mapped connection, for a user-scope printer) and drops it from the list. Refused with 409 for a queue PrintCtrl deployed (managed_printer_id set): remove it from the managed printer instead, or the next reconcile reinstalls it. Waits up to 90 seconds for the computer.",
        "responses": {
          "200": {
            "description": "The queue was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDeleted"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/printers/{pid}/clear-queue": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "post": {
        "operationId": "clearPrinterQueue",
        "tags": [
          "Printers"
        ],
        "summary": "Clear a print queue",
        "description": "Requires the editor or admin role. Removes every job on the queue, stuck ones included; the agent may restart the Print Spooler to do it. Needs agent 1.2.55 or later (409 otherwise). Waits up to 4 minutes. On a partial failure the 502 body also carries `removed`. No request body.",
        "responses": {
          "200": {
            "description": "The queue was cleared.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterClearQueueResult"
                },
                "example": {
                  "ok": true,
                  "removed": 3,
                  "restarted_spooler": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/printers/{pid}/jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "get": {
        "operationId": "listPrinterJobs",
        "tags": [
          "Printers"
        ],
        "summary": "List recent print jobs on a printer",
        "description": "Returns the 500 most recent jobs on this queue, newest first, matched by computer and queue name so history survives the queue being reinstalled. For a user-scope printer only that user's jobs are returned. `tracking` says whether print job tracking is on for the customer, so an empty list can be told apart from tracking being off. No paging.",
        "responses": {
          "200": {
            "description": "Recent jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterJobList"
                },
                "example": {
                  "tracking": true,
                  "jobs": [
                    {
                      "id": 918274,
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "hostname": "SHF-WS-204",
                      "device_name": "SHF-WS-204",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "printer_name": "HM-Reception",
                      "job_id": 41,
                      "user_name": "j.hughes",
                      "machine_name": "\\\\SHF-WS-204",
                      "document_name": "Goods-in checklist.pdf",
                      "pages": 2,
                      "color": false,
                      "size_bytes": 184320,
                      "outcome": "printed",
                      "submitted_at": "2026-11-20T08:52:17Z",
                      "completed_at": "2026-11-20T08:52:29Z"
                    }
                  ],
                  "limit": 500
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/printers/{pid}/print-document": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "post": {
        "operationId": "printDocument",
        "tags": [
          "Printers"
        ],
        "summary": "Print an uploaded document",
        "description": "Requires the editor or admin role. Sends a PDF or image (PNG, JPEG, GIF) to the queue. The type is detected from the file content, not its name. The file may be up to 25 MB (26,214,400 bytes); the request body as a whole is capped at 26 MB. There is no server-side page limit. The document is held only until the computer answers, then deleted. Waits up to 4 minutes.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF, PNG, JPEG or GIF, at most 25 MB. The base file name (up to 200 characters) is used as the spooler document name."
                  }
                }
              },
              "encoding": {
                "file": {
                  "contentType": "application/pdf, image/png, image/jpeg, image/gif"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The document was printed. pages is the page count the computer reported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDocumentResult"
                },
                "example": {
                  "ok": true,
                  "printer": "HM-Reception",
                  "pages": 4
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "description": "The file is not a PDF or a PNG, JPEG or GIF image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/printers/{pid}/test-page": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "post": {
        "operationId": "printTestPage",
        "tags": [
          "Printers"
        ],
        "summary": "Print a test page",
        "description": "Requires the editor or admin role. Renders a test page through the queue's driver on the computer and waits up to 90 seconds for it to be spooled. No request body.",
        "responses": {
          "200": {
            "description": "The test page was spooled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterTestPageResult"
                },
                "example": {
                  "ok": true,
                  "printer": "HM-Reception"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/managed-printers": {
      "get": {
        "operationId": "listManagedPrinters",
        "tags": [
          "Managed printers"
        ],
        "summary": "List managed printers",
        "description": "Returns a bare array, ordered by name then id. To get the next page, pass the last row's `name` as `cursor_name` and its `id` as `cursor_id`; a page shorter than `limit` is the last one. List rows do not include `assignments`.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only this customer's printers.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Exact status, for example `active`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on name, location, driver name or host address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_name",
            "in": "query",
            "required": false,
            "description": "Name of the last row of the previous page. Used only together with `cursor_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "description": "Id of the last row of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Values below 1 or not a number give 100.",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Managed printers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ManagedPrinter"
                  }
                },
                "example": [
                  {
                    "id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "name": "HM-Reception",
                    "comment": "Front desk MFP",
                    "location": "Sheffield, ground floor reception",
                    "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                    "driver_name": "HP Universal Printing PCL 6",
                    "port_type": "tcpip",
                    "host_address": "10.40.0.21",
                    "port_number": 9100,
                    "protocol": "raw",
                    "queue_name": "",
                    "snmp_enabled": true,
                    "snmp_community_set": true,
                    "snmp_community_override_set": false,
                    "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                    "is_shared": false,
                    "share_name": "",
                    "publish": false,
                    "set_default": false,
                    "self_service": false,
                    "prevent_removal": false,
                    "status": "active",
                    "created_by": "1b6e9c3a-7f2d-4a58-b0e4-8c3d5f9a2e61",
                    "created_at": "2026-11-12T08:47:19Z",
                    "updated_at": "2026-11-20T09:14:03Z",
                    "customer_name": "Halden Manufacturing",
                    "deployments": {
                      "total": 2,
                      "installed": 2,
                      "pending": 0,
                      "failed": 0
                    },
                    "monitoring": {
                      "monitors": 2,
                      "state": "up",
                      "last_seen_at": "2026-11-20T09:12:55Z",
                      "lowest_supply_percent": 18,
                      "alert_count": 0
                    },
                    "hardware": {
                      "manufacturer": "HP",
                      "model": "HP LaserJet Pro MFP 4301fdw",
                      "device_class": "printer",
                      "serial_number": "PHBXK12345",
                      "mac_address": "00:1B:A9:4C:22:7E",
                      "firmware": "6.17.1.12",
                      "reporters": 2,
                      "seen_at": "2026-11-20T09:12:40Z"
                    }
                  },
                  {
                    "id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "name": "HM-Goods-In",
                    "comment": "",
                    "location": "Sheffield, warehouse",
                    "driver_package_id": "",
                    "driver_name": "Kyocera Classic Universaldriver PCL6",
                    "port_type": "tcpip",
                    "host_address": "10.40.0.22",
                    "port_number": 9100,
                    "protocol": "raw",
                    "queue_name": "",
                    "snmp_enabled": true,
                    "snmp_community_set": true,
                    "snmp_community_override_set": false,
                    "config_id": "",
                    "is_shared": false,
                    "share_name": "",
                    "publish": false,
                    "set_default": false,
                    "self_service": true,
                    "prevent_removal": false,
                    "status": "active",
                    "created_by": "1b6e9c3a-7f2d-4a58-b0e4-8c3d5f9a2e61",
                    "created_at": "2026-11-12T09:03:52Z",
                    "updated_at": "2026-11-17T16:20:11Z",
                    "customer_name": "Halden Manufacturing",
                    "deployments": {
                      "total": 1,
                      "installed": 0,
                      "pending": 0,
                      "failed": 1
                    },
                    "monitoring": {
                      "monitors": 1,
                      "state": "up",
                      "last_seen_at": "2026-11-20T09:13:40Z",
                      "lowest_supply_percent": 64,
                      "alert_count": 1,
                      "alert_label": "Paper jam",
                      "alert_severity": "warning"
                    },
                    "hardware": {
                      "manufacturer": "Kyocera",
                      "model": "ECOSYS M3655idn",
                      "serial_number": "VCF8Z04712",
                      "mac_address": "00:17:C8:3A:91:0D",
                      "firmware": "2S0_2F00.002.205",
                      "reporters": 0,
                      "seen_at": "2026-11-20T08:46:12Z"
                    }
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createManagedPrinter",
        "tags": [
          "Managed printers"
        ],
        "summary": "Create a managed printer",
        "description": "Requires the editor or admin role. Defines a printer that should exist on assigned computers. Nothing is installed until you add an assignment. Counts toward the plan's managed printer limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedPrinterInput"
              },
              "example": {
                "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                "name": "HM-Reception",
                "comment": "Front desk MFP",
                "location": "Sheffield, ground floor reception",
                "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                "driver_name": "HP Universal Printing PCL 6",
                "port_type": "tcpip",
                "host_address": "10.40.0.21",
                "port_number": 9100,
                "protocol": "raw",
                "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. Returns the stored printer with server defaults applied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedPrinter"
                },
                "example": {
                  "id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "HM-Reception",
                  "comment": "Front desk MFP",
                  "location": "Sheffield, ground floor reception",
                  "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                  "driver_name": "HP Universal Printing PCL 6",
                  "port_type": "tcpip",
                  "host_address": "10.40.0.21",
                  "port_number": 9100,
                  "protocol": "raw",
                  "queue_name": "",
                  "snmp_enabled": true,
                  "snmp_community_set": true,
                  "snmp_community_override_set": false,
                  "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "is_shared": false,
                  "share_name": "",
                  "publish": false,
                  "set_default": false,
                  "self_service": false,
                  "prevent_removal": false,
                  "status": "active",
                  "created_by": "1b6e9c3a-7f2d-4a58-b0e4-8c3d5f9a2e61",
                  "created_at": "2026-11-20T09:14:03Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "customer_name": "Halden Manufacturing",
                  "deployments": {
                    "total": 0,
                    "installed": 0,
                    "pending": 0,
                    "failed": 0
                  },
                  "monitoring": {
                    "monitors": 2,
                    "state": "up",
                    "last_seen_at": "2026-11-20T09:12:55Z",
                    "lowest_supply_percent": 18,
                    "alert_count": 0
                  },
                  "hardware": {
                    "reporters": 0
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "The customer does not exist in your account."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}": {
      "get": {
        "operationId": "getManagedPrinter",
        "tags": [
          "Managed printers"
        ],
        "summary": "Get a managed printer",
        "description": "Includes `assignments` when the printer has any.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "200": {
            "description": "The managed printer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedPrinter"
                },
                "example": {
                  "id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "HM-Reception",
                  "comment": "Front desk MFP",
                  "location": "Sheffield, ground floor reception",
                  "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                  "driver_name": "HP Universal Printing PCL 6",
                  "port_type": "tcpip",
                  "host_address": "10.40.0.21",
                  "port_number": 9100,
                  "protocol": "raw",
                  "queue_name": "",
                  "snmp_enabled": true,
                  "snmp_community_set": true,
                  "snmp_community_override_set": false,
                  "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "is_shared": false,
                  "share_name": "",
                  "publish": false,
                  "set_default": false,
                  "self_service": false,
                  "prevent_removal": false,
                  "status": "active",
                  "created_by": "1b6e9c3a-7f2d-4a58-b0e4-8c3d5f9a2e61",
                  "created_at": "2026-11-12T08:47:19Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "customer_name": "Halden Manufacturing",
                  "assignments": [
                    {
                      "id": "7a2d5f81-4c9e-4b36-8e10-2f6c9b3d5a74",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "scope_type": "group",
                      "scope_value": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "mode": "deploy",
                      "created_at": "2026-11-18T14:02:41Z"
                    },
                    {
                      "id": "d3c8e1b5-9a4f-4e27-b6d0-5f1a8c2e9b63",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "scope_type": "hostname",
                      "scope_value": "SHF-WS-*",
                      "mode": "offer",
                      "created_at": "2026-11-19T10:31:07Z"
                    }
                  ],
                  "deployments": {
                    "total": 2,
                    "installed": 2,
                    "pending": 0,
                    "failed": 0
                  },
                  "monitoring": {
                    "monitors": 2,
                    "state": "up",
                    "last_seen_at": "2026-11-20T09:12:55Z",
                    "lowest_supply_percent": 18,
                    "alert_count": 0
                  },
                  "hardware": {
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP 4301fdw",
                    "device_class": "printer",
                    "serial_number": "PHBXK12345",
                    "mac_address": "00:1B:A9:4C:22:7E",
                    "firmware": "6.17.1.12",
                    "reporters": 2,
                    "seen_at": "2026-11-20T09:12:40Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateManagedPrinter",
        "tags": [
          "Managed printers"
        ],
        "summary": "Update a managed printer",
        "description": "Requires the editor or admin role. Only the fields you send change. The change is pushed to every computer in scope, including ones that already have the printer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedPrinterInput"
              },
              "example": {
                "host_address": "10.40.0.31",
                "config_id": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated printer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedPrinter"
                },
                "example": {
                  "id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "HM-Reception",
                  "comment": "Front desk MFP",
                  "location": "Sheffield, ground floor reception",
                  "driver_package_id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                  "driver_name": "HP Universal Printing PCL 6",
                  "port_type": "tcpip",
                  "host_address": "10.40.0.31",
                  "port_number": 9100,
                  "protocol": "raw",
                  "queue_name": "",
                  "snmp_enabled": true,
                  "snmp_community_set": true,
                  "snmp_community_override_set": false,
                  "config_id": "",
                  "is_shared": false,
                  "share_name": "",
                  "publish": false,
                  "set_default": false,
                  "self_service": false,
                  "prevent_removal": false,
                  "status": "active",
                  "created_by": "1b6e9c3a-7f2d-4a58-b0e4-8c3d5f9a2e61",
                  "created_at": "2026-11-12T08:47:19Z",
                  "updated_at": "2026-11-20T09:14:03Z",
                  "customer_name": "Halden Manufacturing",
                  "assignments": [
                    {
                      "id": "7a2d5f81-4c9e-4b36-8e10-2f6c9b3d5a74",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "scope_type": "group",
                      "scope_value": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                      "mode": "deploy",
                      "created_at": "2026-11-18T14:02:41Z"
                    },
                    {
                      "id": "d3c8e1b5-9a4f-4e27-b6d0-5f1a8c2e9b63",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "scope_type": "hostname",
                      "scope_value": "SHF-WS-*",
                      "mode": "offer",
                      "created_at": "2026-11-19T10:31:07Z"
                    }
                  ],
                  "deployments": {
                    "total": 2,
                    "installed": 2,
                    "pending": 0,
                    "failed": 0
                  },
                  "monitoring": {
                    "monitors": 2,
                    "state": "up",
                    "last_seen_at": "2026-11-20T09:12:55Z",
                    "lowest_supply_percent": 18,
                    "alert_count": 0
                  },
                  "hardware": {
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP 4301fdw",
                    "device_class": "printer",
                    "serial_number": "PHBXK12345",
                    "mac_address": "00:1B:A9:4C:22:7E",
                    "firmware": "6.17.1.12",
                    "reporters": 2,
                    "seen_at": "2026-11-20T09:12:40Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteManagedPrinter",
        "tags": [
          "Managed printers"
        ],
        "summary": "Delete a managed printer",
        "description": "Requires the editor or admin role. Connected computers that have the queue (installed, installing or updating) are told to remove it, then the definition, its assignments and deployments are deleted. Offline computers are not told.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/assignments": {
      "post": {
        "operationId": "createAssignment",
        "tags": [
          "Managed printers"
        ],
        "summary": "Add an assignment",
        "description": "Requires the editor or admin role. Attaches a scope and deploys at once. Adding a scope the printer already has (same type and value) changes its mode instead and returns the existing assignment. With `preview: true` nothing is saved and the response is the list of matching computers.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignmentInput"
              },
              "example": {
                "scope_type": "group",
                "scope_value": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                "mode": "deploy"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview only (`preview: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedScopePreview"
                },
                "example": {
                  "matched": [
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-117",
                      "hostname": "SHF-WS-117",
                      "agent_uuid": "0c6e2b94-7d1a-4f35-9b8e-5a3d1f7c2e60",
                      "os_version": "10.0.22631",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.117",
                      "wan_ip": "203.0.113.40",
                      "status": "offline",
                      "version": "1.4.1",
                      "tags": "goods-in",
                      "logged_on_users": "",
                      "update_state": "failed",
                      "update_version": "1.4.2",
                      "update_detail": "service did not start; rolled back to 1.4.1",
                      "update_at": "2026-11-19T22:03:11Z",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-19T17:42:55Z",
                      "enrolled_at": "2026-03-02T10:48:09Z",
                      "created_at": "2026-03-02T10:48:09Z",
                      "updated_at": "2026-11-19T22:03:11Z",
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 3
                    },
                    {
                      "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "SHF-WS-204",
                      "hostname": "SHF-WS-204",
                      "agent_uuid": "f3a1c7e2-58b4-4d9a-a0e6-2c9b7d4f1e83",
                      "os_version": "10.0.26100",
                      "os_caption": "Microsoft Windows 11 Pro",
                      "arch": "amd64",
                      "local_ips": "10.40.0.124",
                      "wan_ip": "203.0.113.40",
                      "status": "online",
                      "version": "1.4.2",
                      "tags": "reception,ground-floor",
                      "logged_on_users": "HALDEN\\j.morris",
                      "discovery_interval": 900,
                      "monitor_interval": 60,
                      "log_level": "info",
                      "tray_mode": "",
                      "effective_tray_mode": "full",
                      "last_seen": "2026-11-20T09:14:03Z",
                      "enrolled_at": "2026-03-02T10:21:47Z",
                      "created_at": "2026-03-02T10:21:47Z",
                      "updated_at": "2026-11-20T09:14:03Z",
                      "perf": {
                        "uptime_s": 412380,
                        "mem_mb": 38,
                        "printers": 6,
                        "monitors": 2,
                        "inventory_ms": 1840,
                        "inventory_at": 1795165800,
                        "netscan_ms": 22410,
                        "netscan_at": 1795164900,
                        "monitor_sweep_ms": 960,
                        "monitor_sweep_at": 1795166020,
                        "rtt_ms": 18.42,
                        "reported_at": 1795166043
                      },
                      "customer_name": "Halden Manufacturing",
                      "printer_count": 6
                    }
                  ],
                  "count": 2
                }
              }
            }
          },
          "201": {
            "description": "Assignment saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Assignment"
                },
                "example": {
                  "id": "7a2d5f81-4c9e-4b36-8e10-2f6c9b3d5a74",
                  "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "scope_type": "group",
                  "scope_value": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36",
                  "mode": "deploy",
                  "created_at": "2026-11-18T14:02:41Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/assignments/{aid}": {
      "delete": {
        "operationId": "deleteAssignment",
        "tags": [
          "Managed printers"
        ],
        "summary": "Remove an assignment",
        "description": "Requires the editor or admin role. Computers no longer covered by any deploy assignment are told to remove the printer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          },
          {
            "name": "aid",
            "in": "path",
            "required": true,
            "description": "Assignment id (not a computer id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/deploy": {
      "post": {
        "operationId": "deployManagedPrinter",
        "tags": [
          "Managed printers"
        ],
        "summary": "Deploy now",
        "description": "Requires the editor or admin role. Runs a reconcile pass immediately: resets the retry count of failed deployments, puts back printers people removed (`user_removed`), re-sends the printer to every computer in scope (including ones that already have it) and removes it from computers out of scope. Offline computers get it when they connect.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "202": {
            "description": "Pass started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedDeployResult"
                },
                "example": {
                  "targeted": 3,
                  "pushed": 0,
                  "queued": 1,
                  "removing": 0,
                  "offered": 0,
                  "unchanged": 0,
                  "updated": 2,
                  "exhausted": 0
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/deployments": {
      "get": {
        "operationId": "listDeployments",
        "tags": [
          "Managed printers"
        ],
        "summary": "List deployments",
        "description": "One row per computer the printer has been sent to, as a bare array ordered by hostname.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployments.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Deployment"
                  }
                },
                "example": [
                  {
                    "id": "8f1c3e6a-2d9b-4a57-b4e0-6c2a9d5f1b38",
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "state": "installed",
                    "detail": "",
                    "printer_name": "HM-Reception",
                    "attempts": 1,
                    "last_attempt_at": "2026-11-18T14:02:44Z",
                    "installed_at": "2026-11-18T14:03:29Z",
                    "created_at": "2026-11-18T14:02:44Z",
                    "updated_at": "2026-11-18T14:03:29Z",
                    "agent_hostname": "SHF-WS-117",
                    "managed_printer_name": "HM-Reception",
                    "agent_online": true
                  },
                  {
                    "id": "2b7e4a19-5c3d-4f86-a0b2-9e1d6c8f3a57",
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "state": "failed",
                    "detail": "driver package staging failed: the catalog signature could not be verified",
                    "printer_name": "HM-Reception",
                    "attempts": 3,
                    "last_attempt_at": "2026-11-20T08:55:10Z",
                    "created_at": "2026-11-18T14:02:44Z",
                    "updated_at": "2026-11-20T08:55:10Z",
                    "agent_hostname": "SHF-WS-204",
                    "managed_printer_name": "HM-Reception",
                    "agent_online": true
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/jobs": {
      "get": {
        "operationId": "listManagedPrinterJobs",
        "tags": [
          "Managed printers"
        ],
        "summary": "List print jobs",
        "description": "The 500 most recent jobs on any computer's queue for this printer, newest first. Same shape as the jobs of a discovered printer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "200": {
            "description": "Jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedPrinterJobs"
                },
                "example": {
                  "tracking": true,
                  "jobs": [
                    {
                      "id": 482113,
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "hostname": "SHF-WS-204",
                      "device_name": "SHF-WS-204",
                      "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "printer_name": "HM-Reception",
                      "job_id": 37,
                      "user_name": "j.okafor",
                      "machine_name": "\\\\SHF-WS-204",
                      "document_name": "Goods-in checklist.pdf",
                      "pages": 2,
                      "color": false,
                      "size_bytes": 184320,
                      "outcome": "printed",
                      "submitted_at": "2026-11-20T09:02:11Z",
                      "completed_at": "2026-11-20T09:02:19Z"
                    }
                  ],
                  "limit": 500
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/location": {
      "get": {
        "operationId": "getPrinterLocation",
        "tags": [
          "Managed printers"
        ],
        "summary": "Get floor plan location",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "responses": {
          "200": {
            "description": "The pin. `map_id` is empty and x, y are null when the printer is not placed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterLocation"
                },
                "example": {
                  "map_id": "0e5b9d27-6a3c-4f81-9d42-7c1e3b8a5f60",
                  "x": 0.42,
                  "y": 0.18
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "setPrinterLocation",
        "tags": [
          "Managed printers"
        ],
        "summary": "Set floor plan location",
        "description": "Requires the editor or admin role. Places or moves the printer on a floor plan of its own customer. Send `map_id` \"\" (or omit it) to take it off the plan; x and y are then ignored. Connected computers of the customer get the updated plans.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterLocation"
              },
              "example": {
                "map_id": "0e5b9d27-6a3c-4f81-9d42-7c1e3b8a5f60",
                "x": 0.42,
                "y": 0.18
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved pin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterLocation"
                },
                "example": {
                  "map_id": "0e5b9d27-6a3c-4f81-9d42-7c1e3b8a5f60",
                  "x": 0.42,
                  "y": 0.18
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest",
            "description": "The floor plan is not this printer's customer's, or x/y is missing or outside 0 to 1."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/managed-printers/{mid}/test-page": {
      "post": {
        "operationId": "printManagedTestPage",
        "tags": [
          "Managed printers"
        ],
        "summary": "Print a test page on one computer",
        "description": "Requires the editor or admin role. Prints a test page on one computer's copy of the managed printer, addressed by the queue name the agent reported when it installed it, so it works before the computer's next discovery run. Waits up to 90 seconds for the computer to confirm. The deployment on that computer must be `installed` (409 otherwise), and the computer must be connected.",
        "parameters": [
          {
            "$ref": "#/components/parameters/mid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterTestPageOnComputerInput"
              },
              "example": {
                "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The test page was spooled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedPrinterTestPageResult"
                },
                "example": {
                  "ok": true,
                  "printer": "HM-Reception",
                  "hostname": "SHF-WS-204"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The printer is not deployed to that computer, or either belongs to another account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "that printer is not deployed to that device"
                }
              }
            }
          },
          "409": {
            "description": "The printer is not installed on that computer yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "the printer is not installed on SHF-WS-204 yet"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/driver-packages": {
      "get": {
        "operationId": "listDriverPackages",
        "tags": [
          "Drivers"
        ],
        "summary": "List driver packages",
        "description": "Bare array, ordered by name then version (newest first), at most 500 rows, not paged. With `customer_id`, only packages that customer may deploy (shared packages, and packages whose driver one of its computers has); `q` is ignored then.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only packages this customer may deploy.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on name, manufacturer or driver names.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Packages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DriverPackage"
                  }
                },
                "example": [
                  {
                    "id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HP Universal Printing PCL 6",
                    "version": "61.310.1.25919",
                    "manufacturer": "HP",
                    "environment": "Windows x64",
                    "architecture": "x64",
                    "inf_name": "hpcu310u.inf",
                    "driver_names": "HP Universal Printing PCL 6,HP Universal Printing PCL 6 (v7.3.0)",
                    "sha256": "9c1f4e7a2b8d3c6e5f0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6a",
                    "size_bytes": 31457280,
                    "signed": true,
                    "signature_subject": "CN=HP Inc., O=HP Inc., L=Palo Alto, S=California, C=US",
                    "signature_thumbprint": "3A7F1C9E5B2D8A4F6C0E1B3D5F7A9C2E4B6D8F01",
                    "catalog_verified": true,
                    "visibility": "private",
                    "shared": true,
                    "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "source_hostname": "SHF-WS-204",
                    "download_count": 2,
                    "created_by": "",
                    "created_at": "2026-11-11T15:40:22Z",
                    "updated_at": "2026-11-19T11:05:48Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/driver-packages/{id}": {
      "get": {
        "operationId": "getDriverPackage",
        "tags": [
          "Drivers"
        ],
        "summary": "Get a driver package",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Driver package id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The package.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriverPackage"
                },
                "example": {
                  "id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HP Universal Printing PCL 6",
                  "version": "61.310.1.25919",
                  "manufacturer": "HP",
                  "environment": "Windows x64",
                  "architecture": "x64",
                  "inf_name": "hpcu310u.inf",
                  "driver_names": "HP Universal Printing PCL 6,HP Universal Printing PCL 6 (v7.3.0)",
                  "sha256": "9c1f4e7a2b8d3c6e5f0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6a",
                  "size_bytes": 31457280,
                  "signed": true,
                  "signature_subject": "CN=HP Inc., O=HP Inc., L=Palo Alto, S=California, C=US",
                  "signature_thumbprint": "3A7F1C9E5B2D8A4F6C0E1B3D5F7A9C2E4B6D8F01",
                  "catalog_verified": true,
                  "visibility": "private",
                  "shared": true,
                  "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "source_hostname": "SHF-WS-204",
                  "download_count": 2,
                  "created_by": "",
                  "created_at": "2026-11-11T15:40:22Z",
                  "updated_at": "2026-11-19T11:05:48Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateDriverPackage",
        "tags": [
          "Drivers"
        ],
        "summary": "Share or unshare a driver package",
        "description": "Requires the editor or admin role. Sharing makes the package deployable at every customer in your account. Turning sharing off is refused (409) while a managed printer at a customer whose computers do not have the driver uses it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Driver package id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DriverPackageUpdate"
              },
              "example": {
                "shared": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated package.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriverPackage"
                },
                "example": {
                  "id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HP Universal Printing PCL 6",
                  "version": "61.310.1.25919",
                  "manufacturer": "HP",
                  "environment": "Windows x64",
                  "architecture": "x64",
                  "inf_name": "hpcu310u.inf",
                  "driver_names": "HP Universal Printing PCL 6,HP Universal Printing PCL 6 (v7.3.0)",
                  "sha256": "9c1f4e7a2b8d3c6e5f0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6a",
                  "size_bytes": 31457280,
                  "signed": true,
                  "signature_subject": "CN=HP Inc., O=HP Inc., L=Palo Alto, S=California, C=US",
                  "signature_thumbprint": "3A7F1C9E5B2D8A4F6C0E1B3D5F7A9C2E4B6D8F01",
                  "catalog_verified": true,
                  "visibility": "private",
                  "shared": true,
                  "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "source_hostname": "SHF-WS-204",
                  "download_count": 2,
                  "created_by": "",
                  "created_at": "2026-11-11T15:40:22Z",
                  "updated_at": "2026-11-19T11:05:48Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteDriverPackage",
        "tags": [
          "Drivers"
        ],
        "summary": "Delete a driver package",
        "description": "Requires the admin role. Refused (409) while any managed printer uses the package. The stored archive is removed when no other package refers to it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Driver package id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted",
                    "blob_removed"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "blob_removed": {
                      "type": "boolean",
                      "description": "Whether the stored archive was removed too."
                    }
                  }
                },
                "example": {
                  "deleted": true,
                  "blob_removed": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/drivers": {
      "get": {
        "operationId": "listDrivers",
        "tags": [
          "Drivers"
        ],
        "summary": "List discovered drivers",
        "description": "Drivers installed on your computers, one row per driver per computer, as a bare array ordered by name then id. To page, pass the last row's `name` as `cursor_name` and `id` as `cursor_id`. A discovered driver can only be deployed elsewhere once it has a package.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only this customer's computers.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "Only this computer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Exact environment, for example `Windows x64`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on name, manufacturer or provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_name",
            "in": "query",
            "required": false,
            "description": "Name of the last row of the previous page. Used only together with `cursor_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor_id",
            "in": "query",
            "required": false,
            "description": "Id of the last row of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Values below 1 or not a number give 100.",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Drivers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Driver"
                  }
                },
                "example": [
                  {
                    "id": "b6d2f9a4-3e7c-4a18-9c05-1f8e4b7d2a63",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HP Universal Printing PCL 6",
                    "version": "61.310.1.25919",
                    "driver_date": "2025-06-12",
                    "provider": "HP",
                    "manufacturer": "HP",
                    "environment": "Windows x64",
                    "driver_version_raw": 17451448574255104,
                    "inf_path": "C:\\Windows\\System32\\DriverStore\\FileRepository\\hpcu310u.inf_amd64_5b1e0c3f2a9d7e46\\hpcu310u.inf",
                    "config_file": "PrintConfig.dll",
                    "data_file": "hpcu310u.gpd",
                    "driver_path": "unidrv.dll",
                    "help_file": "unidrv.hlp",
                    "dependent_files": [
                      "hpcu310u.ini",
                      "hpmux310.dll"
                    ],
                    "print_processor": "winprint",
                    "monitor_name": "",
                    "is_package_aware": true,
                    "driver_attributes": 1,
                    "oem_url": "https://support.hp.example",
                    "core_driver_deps": [
                      "{D20EA372-DD35-4950-9ED8-A6335AFE79F0}"
                    ],
                    "synced_at": "2026-11-20T08:58:30Z",
                    "created_at": "2026-11-04T10:12:44Z",
                    "agent_name": "SHF-WS-204",
                    "hostname": "SHF-WS-204",
                    "agent_status": "online",
                    "customer_name": "Halden Manufacturing",
                    "has_package": true
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/drivers/auto-pull/queue": {
      "get": {
        "operationId": "listAutoPulls",
        "tags": [
          "Drivers"
        ],
        "summary": "List the automatic packaging queue",
        "description": "Bare array, most recently updated first, including finished entries.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows. Values below 1 or not a number give 200.",
            "schema": {
              "type": "integer",
              "default": 200,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue entries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AutoPull"
                  }
                },
                "example": [
                  {
                    "id": "5d9a2c7e-1b4f-4e63-8a05-3c7e9b1d4f82",
                    "name": "Kyocera Classic Universaldriver PCL6",
                    "version": "8.4.1716",
                    "environment": "Windows x64",
                    "state": "failed",
                    "attempts": 3,
                    "last_error": "upload timed out after 2h",
                    "updated_at": "2026-11-20T07:41:16Z"
                  },
                  {
                    "id": "a8e3f1c6-7d2b-4c95-b1e0-4f6a9d3c2e17",
                    "name": "HP Universal Printing PCL 6",
                    "version": "61.310.1.25919",
                    "environment": "Windows x64",
                    "state": "done",
                    "attempts": 1,
                    "updated_at": "2026-11-11T15:40:22Z"
                  },
                  {
                    "id": "c1f7b3e9-4a6d-4e28-9b50-8d2c5f1a7e36",
                    "name": "Kyocera TASKalfa 3253ci KX",
                    "version": "",
                    "environment": "Windows x64",
                    "state": "pending",
                    "attempts": 0,
                    "next_attempt_at": "2026-11-20T09:20:00Z",
                    "updated_at": "2026-11-20T09:14:03Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/drivers/auto-pull/queue/{id}/retry": {
      "post": {
        "operationId": "retryAutoPull",
        "tags": [
          "Drivers"
        ],
        "summary": "Retry an automatic packaging entry",
        "description": "Requires the admin role. Puts the entry back to `pending` with its attempts reset. The export runs the next time a computer that has the driver reports in. An id the account does not have returns 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Queue entry id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requeued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "suggestion"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "suggestion": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "suggestion": "It will be exported the next time a machine that has this driver reports in."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/drivers/import": {
      "post": {
        "operationId": "importDriver",
        "tags": [
          "Drivers"
        ],
        "summary": "Import a driver from a computer",
        "description": "Requires the editor or admin role. Asks a connected computer that has the driver to export it and upload it as a package. Name the driver by its discovered `driver_id`, or by `agent_id` plus `driver_name` (and optionally `environment`). The computer must be online. The response only acknowledges the request; large packages can take several minutes to appear in GET /driver-packages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "driver_id": {
                    "type": "string",
                    "description": "Discovered driver id from GET /drivers. When set, the other fields are taken from it."
                  },
                  "agent_id": {
                    "type": "string",
                    "description": "Computer to export from. Required without `driver_id`."
                  },
                  "driver_name": {
                    "type": "string",
                    "description": "Required without `driver_id`."
                  },
                  "environment": {
                    "type": "string",
                    "description": "For example `Windows x64`."
                  }
                }
              },
              "example": {
                "driver_id": "b6d2f9a4-3e7c-4a18-9c05-1f8e4b7d2a63"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Export requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriverImportStarted"
                },
                "example": {
                  "status": "import started",
                  "driver_name": "HP Universal Printing PCL 6",
                  "note": "Large driver packages can take several minutes to upload."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound",
            "description": "The driver or the computer does not exist in your account."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          }
        }
      }
    },
    "/drivers/overview": {
      "get": {
        "operationId": "getDriversOverview",
        "tags": [
          "Drivers"
        ],
        "summary": "Drivers overview",
        "description": "Every package and every discovered driver no package covers, with the computers and customers that have each. A bare array, not paged, sorted by number of computers (most first) then name.",
        "responses": {
          "200": {
            "description": "Overview rows.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DriversOverview"
                  }
                },
                "example": [
                  {
                    "key": "pkg:c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                    "name": "HP Universal Printing PCL 6",
                    "version": "61.310.1.25919",
                    "environment": "x64",
                    "manufacturer": "HP",
                    "driver_names": [
                      "HP Universal Printing PCL 6",
                      "HP Universal Printing PCL 6 (v7.3.0)"
                    ],
                    "package": {
                      "id": "c5e8a1f4-6b2d-4c93-a7e0-9d3f1b5c8e26",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "name": "HP Universal Printing PCL 6",
                      "version": "61.310.1.25919",
                      "manufacturer": "HP",
                      "environment": "Windows x64",
                      "architecture": "x64",
                      "inf_name": "hpcu310u.inf",
                      "driver_names": "HP Universal Printing PCL 6,HP Universal Printing PCL 6 (v7.3.0)",
                      "sha256": "9c1f4e7a2b8d3c6e5f0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6a",
                      "size_bytes": 31457280,
                      "signed": true,
                      "signature_subject": "CN=HP Inc., O=HP Inc., L=Palo Alto, S=California, C=US",
                      "signature_thumbprint": "3A7F1C9E5B2D8A4F6C0E1B3D5F7A9C2E4B6D8F01",
                      "catalog_verified": true,
                      "visibility": "private",
                      "shared": true,
                      "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "source_hostname": "SHF-WS-204",
                      "download_count": 2,
                      "created_by": "",
                      "created_at": "2026-11-11T15:40:22Z",
                      "updated_at": "2026-11-19T11:05:48Z"
                    },
                    "machines": [
                      {
                        "agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                        "hostname": "SHF-WS-117",
                        "status": "online",
                        "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "customer_name": "Halden Manufacturing",
                        "version": "61.310.1.25919"
                      },
                      {
                        "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "hostname": "SHF-WS-204",
                        "status": "online",
                        "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "customer_name": "Halden Manufacturing",
                        "version": "61.310.1.25919"
                      }
                    ],
                    "customers": [
                      {
                        "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "name": "Halden Manufacturing",
                        "machines": 2
                      }
                    ]
                  },
                  {
                    "key": "drv:Kyocera Classic Universaldriver PCL6|8.4.1716|Windows x64",
                    "name": "Kyocera Classic Universaldriver PCL6",
                    "version": "8.4.1716",
                    "environment": "Windows x64",
                    "manufacturer": "Kyocera",
                    "driver_names": [
                      "Kyocera Classic Universaldriver PCL6"
                    ],
                    "packaging": {
                      "id": "5d9a2c7e-1b4f-4e63-8a05-3c7e9b1d4f82",
                      "name": "Kyocera Classic Universaldriver PCL6",
                      "version": "8.4.1716",
                      "environment": "Windows x64",
                      "state": "failed",
                      "attempts": 3,
                      "last_error": "upload timed out after 2h",
                      "updated_at": "2026-11-20T07:41:16Z"
                    },
                    "machines": [
                      {
                        "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "hostname": "SHF-WS-204",
                        "status": "online",
                        "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "customer_name": "Halden Manufacturing",
                        "version": "8.4.1716"
                      }
                    ],
                    "customers": [
                      {
                        "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                        "name": "Halden Manufacturing",
                        "machines": 1
                      }
                    ]
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/configs": {
      "get": {
        "operationId": "listConfigs",
        "tags": [
          "Configurations"
        ],
        "summary": "List saved configurations",
        "description": "Returns a bare array of configurations sorted by name, at most 500, no paging. List rows omit devmode_b64, devmode_public, print_ticket_xml, registry_data and capabilities; GET /configs/{id} returns them.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only configurations this customer may use: shared ones, and ones captured from this customer's computers."
          },
          {
            "name": "driver_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact driver name match."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring search over name and driver name."
          }
        ],
        "responses": {
          "200": {
            "description": "A bare array of configurations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Config"
                  }
                },
                "example": [
                  {
                    "id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HP duplex mono",
                    "driver_name": "HP Universal Printing PCL 6",
                    "driver_version": "61.310.1.25919",
                    "environment": "Windows x64",
                    "visibility": "private",
                    "shared": false,
                    "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "source_printer": "HM-Reception",
                    "created_by": "d2b7e4a1-5c8f-4a39-b6e0-1f3c9a7d5e48",
                    "created_at": "2026-11-18T15:02:44Z",
                    "updated_at": "2026-11-18T15:02:44Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createConfig",
        "tags": [
          "Configurations"
        ],
        "summary": "Create a configuration",
        "description": "Requires the editor or admin role. Saves a configuration from settings you supply (to save one straight from a queue, use POST /printers/{pid}/capture-config with save=true). driver_name is required. Choices staged on the capabilities tree are folded into print_ticket_xml. New configurations are always private (not shared).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigInput"
              },
              "example": {
                "name": "HP duplex mono",
                "driver_name": "HP Universal Printing PCL 6",
                "driver_version": "61.310.1.25919",
                "environment": "Windows x64",
                "devmode_public": {
                  "orientation": "portrait",
                  "paper_size": 9,
                  "duplex": "long_edge",
                  "color": "monochrome",
                  "copies": 1,
                  "default_source": "auto"
                },
                "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                "source_printer": "HM-Reception"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The saved configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                },
                "example": {
                  "id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HP duplex mono",
                  "driver_name": "HP Universal Printing PCL 6",
                  "driver_version": "61.310.1.25919",
                  "environment": "Windows x64",
                  "devmode_b64": "SABQACAAVQBuAGkAdgBlAHIAcwBhAGwAIABQAHIAaQBuAHQAaQBuAGcAIABQAEMATAAgADYAAAAAAAAAAAABBAAG3ABQAw...",
                  "devmode_public": {
                    "orientation": "portrait",
                    "paper_size": 9,
                    "duplex": "long_edge",
                    "color": "monochrome",
                    "copies": 1,
                    "default_source": "auto"
                  },
                  "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                  "visibility": "private",
                  "shared": false,
                  "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "source_printer": "HM-Reception",
                  "created_by": "d2b7e4a1-5c8f-4a39-b6e0-1f3c9a7d5e48",
                  "created_at": "2026-11-18T15:02:44Z",
                  "updated_at": "2026-11-18T15:02:44Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/configs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Configuration id."
        }
      ],
      "get": {
        "operationId": "getConfig",
        "tags": [
          "Configurations"
        ],
        "summary": "Get a configuration",
        "description": "Returns one configuration including its stored settings.",
        "responses": {
          "200": {
            "description": "The configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                },
                "example": {
                  "id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HP duplex mono",
                  "driver_name": "HP Universal Printing PCL 6",
                  "driver_version": "61.310.1.25919",
                  "environment": "Windows x64",
                  "devmode_b64": "SABQACAAVQBuAGkAdgBlAHIAcwBhAGwAIABQAHIAaQBuAHQAaQBuAGcAIABQAEMATAAgADYAAAAAAAAAAAABBAAG3ABQAw...",
                  "devmode_public": {
                    "orientation": "portrait",
                    "paper_size": 9,
                    "duplex": "long_edge",
                    "color": "monochrome",
                    "copies": 1,
                    "default_source": "auto"
                  },
                  "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                  "visibility": "private",
                  "shared": false,
                  "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "source_printer": "HM-Reception",
                  "created_by": "d2b7e4a1-5c8f-4a39-b6e0-1f3c9a7d5e48",
                  "created_at": "2026-11-18T15:02:44Z",
                  "updated_at": "2026-11-18T15:02:44Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateConfig",
        "tags": [
          "Configurations"
        ],
        "summary": "Rename or share a configuration",
        "description": "Requires the editor or admin role. Send name, shared, or both. The change applies whole or not at all. shared=true makes the configuration usable by every customer in the account (never other accounts). Turning sharing off is refused with 409 while a managed printer at another customer uses it; the 409 body lists them in `in_use_by`. Sharing changes are recorded in the activity log.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigUpdate"
              },
              "example": {
                "shared": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Config"
                },
                "example": {
                  "id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "HP duplex mono",
                  "driver_name": "HP Universal Printing PCL 6",
                  "driver_version": "61.310.1.25919",
                  "environment": "Windows x64",
                  "devmode_b64": "SABQACAAVQBuAGkAdgBlAHIAcwBhAGwAIABQAHIAaQBuAHQAaQBuAGcAIABQAEMATAAgADYAAAAAAAAAAAABBAAG3ABQAw...",
                  "devmode_public": {
                    "orientation": "portrait",
                    "paper_size": 9,
                    "duplex": "long_edge",
                    "color": "monochrome",
                    "copies": 1,
                    "default_source": "auto"
                  },
                  "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                  "visibility": "shared",
                  "shared": true,
                  "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                  "source_printer": "HM-Reception",
                  "created_by": "d2b7e4a1-5c8f-4a39-b6e0-1f3c9a7d5e48",
                  "created_at": "2026-11-18T15:02:44Z",
                  "updated_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteConfig",
        "tags": [
          "Configurations"
        ],
        "summary": "Delete a configuration",
        "description": "Requires the editor or admin role. Refused with 409 while any managed printer uses the configuration; the 409 body carries `in_use_by` (sample names) and `in_use_count`.",
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDeleted"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/printers/{pid}/apply-config": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "post": {
        "operationId": "applyConfigToPrinter",
        "tags": [
          "Configurations"
        ],
        "summary": "Apply settings to a printer",
        "description": "Requires the editor or admin role. Pushes a saved configuration (config_id) or inline settings onto an existing queue and waits up to 60 seconds. The documented fields and the PrintTicket always go; the vendor blob is included only when driver name, version and environment match exactly (vendor_blob_applied says which). A saved configuration must be usable by the printer's customer (shared, or captured there), else 400. Not available for user-scope (mapped) printers (409).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigApplyInput"
              },
              "examples": {
                "saved": {
                  "summary": "Saved configuration",
                  "value": {
                    "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61"
                  }
                },
                "inline": {
                  "summary": "Inline settings",
                  "value": {
                    "devmode_public": {
                      "duplex": "long_edge",
                      "color": "monochrome"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings were applied. config_id is empty for inline settings; note explains anything not applied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigApplyResult"
                },
                "example": {
                  "ok": true,
                  "printer": "HM-Reception",
                  "config_id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                  "vendor_blob_applied": true,
                  "note": ""
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/printers/{pid}/capture-config": {
      "parameters": [
        {
          "$ref": "#/components/parameters/pid"
        }
      ],
      "post": {
        "operationId": "captureConfig",
        "tags": [
          "Configurations"
        ],
        "summary": "Capture a printer's configuration",
        "description": "Requires the editor or admin role. Reads the queue's current settings off the computer. With interactive=true the vendor's printing-preferences dialog opens on the console session and the settings are captured once someone completes it (waits up to 120 seconds, otherwise 30). With save=true the capture is also stored as a configuration and returned under `config`. Not available for user-scope (mapped) printers (409). The body is optional.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigCaptureInput"
              },
              "example": {
                "interactive": false,
                "save": true,
                "name": "HP duplex mono"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The captured settings, plus the saved configuration when save was true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigCaptureResult"
                },
                "example": {
                  "printer": "HM-Reception",
                  "driver_name": "HP Universal Printing PCL 6",
                  "driver_version": "61.310.1.25919",
                  "environment": "Windows x64",
                  "devmode_public": {
                    "orientation": "portrait",
                    "paper_size": 9,
                    "duplex": "long_edge",
                    "color": "monochrome",
                    "copies": 1,
                    "default_source": "auto"
                  },
                  "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                  "blob_bytes": 1688,
                  "config": {
                    "id": "a3f6d9c2-1e8b-4b57-8d40-5c9e2a7f3b61",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "HP duplex mono",
                    "driver_name": "HP Universal Printing PCL 6",
                    "driver_version": "61.310.1.25919",
                    "environment": "Windows x64",
                    "devmode_b64": "SABQACAAVQBuAGkAdgBlAHIAcwBhAGwAIABQAHIAaQBuAHQAaQBuAGcAIABQAEMATAAgADYAAAAAAAAAAAABBAAG3ABQAw...",
                    "devmode_public": {
                      "orientation": "portrait",
                      "paper_size": 9,
                      "duplex": "long_edge",
                      "color": "monochrome",
                      "copies": 1,
                      "default_source": "auto"
                    },
                    "print_ticket_xml": "<?xml version=\"1.0\"?><psf:PrintTicket xmlns:psf=\"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework\" version=\"1\">...</psf:PrintTicket>",
                    "visibility": "private",
                    "shared": false,
                    "source_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "source_printer": "HM-Reception",
                    "created_by": "d2b7e4a1-5c8f-4a39-b6e0-1f3c9a7d5e48",
                    "created_at": "2026-11-18T15:02:44Z",
                    "updated_at": "2026-11-18T15:02:44Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/MachineError"
          },
          "503": {
            "$ref": "#/components/responses/Offline"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/device-images/{sha}": {
      "get": {
        "operationId": "getDeviceImage",
        "tags": [
          "Monitoring"
        ],
        "summary": "Get a printer model picture",
        "description": "Returns a printer model's stock picture, taken from the Windows device metadata on a computer that had it. Requires authentication but is not limited to your account: the picture identifies only a model. The response is immutable and cached for a year.",
        "parameters": [
          {
            "name": "sha",
            "in": "path",
            "required": true,
            "description": "SHA-256 of the image, 64 hex characters, case-insensitive. A file extension such as `.png` may be appended and is ignored.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{64}(\\.[A-Za-z0-9]+)?$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image bytes. Sent with `Cache-Control: public, max-age=31536000, immutable`.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "public, max-age=31536000, immutable"
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/x-icon": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/device": {
      "get": {
        "operationId": "getDeviceMonitoring",
        "tags": [
          "Monitoring"
        ],
        "summary": "Get one printer's monitoring",
        "description": "Returns the current state of the printer at `host` for a customer: identity, status, trays, consumables with forecasts, counters, open alerts, which computer watches it and how monitoring is configured. An address monitoring has not reached yet still returns 200 with `known: false`.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": true,
            "description": "Customer the printer belongs to.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "host",
            "in": "query",
            "required": true,
            "description": "Printer IP address or host name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The printer's monitoring view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringDeviceResponse"
                },
                "example": {
                  "device": {
                    "id": "d2a8f4c1-6b3e-4f95-8c07-3e9b1a5d6f28",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "host": "10.40.0.21",
                    "known": true,
                    "source": "snmp",
                    "snmp": {
                      "status": "ok",
                      "version": "2c"
                    },
                    "ipp": {
                      "status": "ok"
                    },
                    "reading_at": "2026-11-20T09:10:00Z",
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP M428fdw",
                    "serial_number": "PHBQK41827",
                    "firmware": "002.2348A",
                    "vendor_slug": "hp",
                    "identity": {
                      "sys_descr": "HP ETHERNET MULTI-ENVIRONMENT",
                      "sys_name": "NPI8F2C41",
                      "sys_location": "Reception",
                      "manufacturer": "HP",
                      "model": "HP LaserJet Pro MFP M428fdw",
                      "serial_number": "PHBQK41827",
                      "firmware": "002.2348A",
                      "uptime_s": 1814402
                    },
                    "status": {
                      "printer": "idle",
                      "device": "running",
                      "message": "Ready"
                    },
                    "covers": [
                      {
                        "name": "Front door",
                        "open": false
                      }
                    ],
                    "trays": [
                      {
                        "index": 1,
                        "name": "Tray 1",
                        "kind": "Manual feed",
                        "media": "A4",
                        "level": -2,
                        "max": 100,
                        "percent": -1,
                        "unit": "sheets",
                        "state": "ok"
                      },
                      {
                        "index": 2,
                        "name": "Tray 2",
                        "kind": "Cassette",
                        "media": "A4",
                        "level": 200,
                        "max": 250,
                        "percent": 80,
                        "unit": "sheets",
                        "state": "ok"
                      }
                    ],
                    "outputs": [
                      {
                        "index": 1,
                        "name": "Output bin",
                        "percent_free": 100,
                        "remaining": 150,
                        "max": 150,
                        "state": "ok"
                      }
                    ],
                    "supplies": [
                      {
                        "name": "Black Cartridge HP CF259A",
                        "colorant": "black",
                        "percent": 10,
                        "level": 1020,
                        "max_level": 10000,
                        "unit": "impressions",
                        "type": "tonerCartridge",
                        "kind": "toner",
                        "receptacle": false,
                        "forecast": {
                          "days_left": 6.5,
                          "per_day": 1.54,
                          "empty_at": "2026-11-26T21:00:00Z",
                          "basis_days": 42
                        },
                        "last_replaced": "2026-08-11T10:02:00Z"
                      }
                    ],
                    "counters": {
                      "total": 48213,
                      "mono": 48213,
                      "print": 39107,
                      "copy": 9106,
                      "duplex": 17250,
                      "unit": "impressions"
                    },
                    "capabilities": {
                      "status": true,
                      "alerts": true,
                      "supplies": true,
                      "supply_levels": true,
                      "trays": true,
                      "tray_levels": true,
                      "outputs": true,
                      "covers": true,
                      "console": false,
                      "counter_total": true,
                      "counter_color": true,
                      "counter_function": true,
                      "counter_duplex": true,
                      "serial": true,
                      "firmware": true
                    },
                    "alerts": [
                      {
                        "id": "5d3f8a1c-9e2b-4b67-a4c0-1f7e3d9b5a82",
                        "severity": "warning",
                        "code": 1104,
                        "label": "Toner low",
                        "description": "Black cartridge low",
                        "opened_at": "2026-11-17T13:20:00Z",
                        "last_seen_at": "2026-11-20T09:10:00Z"
                      }
                    ],
                    "monitor": {
                      "state": "up",
                      "latency_ms": 3,
                      "last_seen_at": "2026-11-20T09:13:41Z",
                      "last_change_at": "2026-11-18T07:42:19Z",
                      "consecutive_failures": 0
                    },
                    "last_sample_at": "2026-11-20T09:10:00Z",
                    "watcher": {
                      "mode": "inherit",
                      "assigned_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "assigned_agent_name": "SHF-WS-204",
                      "assigned_agent_status": "online",
                      "reason": "auto",
                      "assigned_at": "2026-11-02T08:01:44Z"
                    },
                    "candidates": [
                      {
                        "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "name": "SHF-WS-204",
                        "status": "online",
                        "has_queue": true,
                        "last_up_at": "2026-11-20T09:13:41Z",
                        "latency_ms": 3,
                        "has_battery": false,
                        "os_caption": "Microsoft Windows 11 Pro"
                      },
                      {
                        "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                        "name": "SHF-WS-117",
                        "status": "online",
                        "has_queue": false,
                        "last_up_at": "2026-11-19T16:40:02Z",
                        "latency_ms": 5,
                        "has_battery": true,
                        "os_caption": "Microsoft Windows 11 Pro"
                      }
                    ],
                    "settings": {
                      "off": false,
                      "customer_off": false,
                      "profile_id": "",
                      "effective_profile_id": "c9b1e5a7-2f4d-4e68-8a13-6d0f3b7c9e52",
                      "effective_profile_name": "Office printers (v2c)",
                      "source": "customer",
                      "inherited_profile_name": "Office printers (v2c)"
                    },
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "snmp_enabled": true,
                    "snmp_version": "2c",
                    "community_set": true
                  },
                  "low_threshold": 15,
                  "grace_seconds": 180,
                  "retention_days": {
                    "samples": 14,
                    "daily": 400
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/device/settings": {
      "put": {
        "operationId": "setDeviceMonitoringSettings",
        "tags": [
          "Monitoring"
        ],
        "summary": "Set a printer's monitoring switch and profile",
        "description": "Requires the editor or admin role. Sets both the printer's on/off switch and its profile in one call; an omitted `off` turns monitoring on. Works for addresses monitoring has not reached yet. The customer's computers get the new targets immediately.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer_id": {
                    "type": "string",
                    "description": "Customer the printer belongs to.",
                    "format": "uuid"
                  },
                  "host": {
                    "type": "string",
                    "description": "Printer IP address or host name. Required."
                  },
                  "off": {
                    "type": "boolean",
                    "default": false,
                    "description": "True stops monitoring this printer."
                  },
                  "profile_id": {
                    "type": "string",
                    "description": "Monitoring profile for this printer: the customer's own or a shared one. Empty string or omitted to follow the computer and customer."
                  }
                },
                "required": [
                  "customer_id",
                  "host"
                ]
              },
              "example": {
                "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                "host": "10.40.0.21",
                "off": false,
                "profile_id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The printer's updated view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringDeviceUpdateResult"
                },
                "example": {
                  "device": {
                    "id": "d2a8f4c1-6b3e-4f95-8c07-3e9b1a5d6f28",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "host": "10.40.0.21",
                    "known": true,
                    "source": "snmp",
                    "snmp": {
                      "status": "ok",
                      "version": "2c"
                    },
                    "ipp": {
                      "status": "ok"
                    },
                    "reading_at": "2026-11-20T09:10:00Z",
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP M428fdw",
                    "serial_number": "PHBQK41827",
                    "firmware": "002.2348A",
                    "vendor_slug": "hp",
                    "identity": {
                      "sys_descr": "HP ETHERNET MULTI-ENVIRONMENT",
                      "sys_name": "NPI8F2C41",
                      "sys_location": "Reception",
                      "manufacturer": "HP",
                      "model": "HP LaserJet Pro MFP M428fdw",
                      "serial_number": "PHBQK41827",
                      "firmware": "002.2348A",
                      "uptime_s": 1814402
                    },
                    "status": {
                      "printer": "idle",
                      "device": "running",
                      "message": "Ready"
                    },
                    "covers": [
                      {
                        "name": "Front door",
                        "open": false
                      }
                    ],
                    "trays": [
                      {
                        "index": 1,
                        "name": "Tray 1",
                        "kind": "Manual feed",
                        "media": "A4",
                        "level": -2,
                        "max": 100,
                        "percent": -1,
                        "unit": "sheets",
                        "state": "ok"
                      },
                      {
                        "index": 2,
                        "name": "Tray 2",
                        "kind": "Cassette",
                        "media": "A4",
                        "level": 200,
                        "max": 250,
                        "percent": 80,
                        "unit": "sheets",
                        "state": "ok"
                      }
                    ],
                    "outputs": [
                      {
                        "index": 1,
                        "name": "Output bin",
                        "percent_free": 100,
                        "remaining": 150,
                        "max": 150,
                        "state": "ok"
                      }
                    ],
                    "supplies": [
                      {
                        "name": "Black Cartridge HP CF259A",
                        "colorant": "black",
                        "percent": 10,
                        "level": 1020,
                        "max_level": 10000,
                        "unit": "impressions",
                        "type": "tonerCartridge",
                        "kind": "toner",
                        "receptacle": false,
                        "forecast": {
                          "days_left": 6.5,
                          "per_day": 1.54,
                          "empty_at": "2026-11-26T21:00:00Z",
                          "basis_days": 42
                        },
                        "last_replaced": "2026-08-11T10:02:00Z"
                      }
                    ],
                    "counters": {
                      "total": 48213,
                      "mono": 48213,
                      "print": 39107,
                      "copy": 9106,
                      "duplex": 17250,
                      "unit": "impressions"
                    },
                    "capabilities": {
                      "status": true,
                      "alerts": true,
                      "supplies": true,
                      "supply_levels": true,
                      "trays": true,
                      "tray_levels": true,
                      "outputs": true,
                      "covers": true,
                      "console": false,
                      "counter_total": true,
                      "counter_color": true,
                      "counter_function": true,
                      "counter_duplex": true,
                      "serial": true,
                      "firmware": true
                    },
                    "alerts": [
                      {
                        "id": "5d3f8a1c-9e2b-4b67-a4c0-1f7e3d9b5a82",
                        "severity": "warning",
                        "code": 1104,
                        "label": "Toner low",
                        "description": "Black cartridge low",
                        "opened_at": "2026-11-17T13:20:00Z",
                        "last_seen_at": "2026-11-20T09:10:00Z"
                      }
                    ],
                    "monitor": {
                      "state": "up",
                      "latency_ms": 3,
                      "last_seen_at": "2026-11-20T09:13:41Z",
                      "last_change_at": "2026-11-18T07:42:19Z",
                      "consecutive_failures": 0
                    },
                    "last_sample_at": "2026-11-20T09:10:00Z",
                    "watcher": {
                      "mode": "inherit",
                      "assigned_agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "assigned_agent_name": "SHF-WS-204",
                      "assigned_agent_status": "online",
                      "reason": "auto",
                      "assigned_at": "2026-11-02T08:01:44Z"
                    },
                    "candidates": [
                      {
                        "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "name": "SHF-WS-204",
                        "status": "online",
                        "has_queue": true,
                        "last_up_at": "2026-11-20T09:13:41Z",
                        "latency_ms": 3,
                        "has_battery": false,
                        "os_caption": "Microsoft Windows 11 Pro"
                      },
                      {
                        "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                        "name": "SHF-WS-117",
                        "status": "online",
                        "has_queue": false,
                        "last_up_at": "2026-11-19T16:40:02Z",
                        "latency_ms": 5,
                        "has_battery": true,
                        "os_caption": "Microsoft Windows 11 Pro"
                      }
                    ],
                    "settings": {
                      "off": false,
                      "customer_off": false,
                      "profile_id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                      "effective_profile_id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                      "effective_profile_name": "Halden SNMPv3",
                      "source": "printer",
                      "inherited_profile_name": "Office printers (v2c)"
                    },
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "snmp_enabled": true,
                    "snmp_version": "3",
                    "community_set": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/device/watcher": {
      "put": {
        "operationId": "setDeviceWatcher",
        "tags": [
          "Monitoring"
        ],
        "summary": "Choose which computer watches a printer",
        "description": "Requires the editor or admin role. Sets the printer's watcher mode: inherit follows the customer's setting, auto lets PrintCtrl pick, agent pins it to one of the customer's computers. Works for addresses monitoring has not reached yet. Watchers are reassigned immediately and the updated view is returned.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer_id": {
                    "type": "string",
                    "description": "Customer the printer belongs to.",
                    "format": "uuid"
                  },
                  "host": {
                    "type": "string",
                    "description": "Printer IP address or host name. Required."
                  },
                  "mode": {
                    "type": "string",
                    "description": "Watcher mode.",
                    "enum": [
                      "inherit",
                      "auto",
                      "agent"
                    ]
                  },
                  "agent_id": {
                    "type": "string",
                    "description": "Required when `mode` is agent: one of this customer's computers. Ignored otherwise.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "customer_id",
                  "host",
                  "mode"
                ]
              },
              "example": {
                "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                "host": "10.40.0.21",
                "mode": "agent",
                "agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The printer's updated view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringDeviceUpdateResult"
                },
                "example": {
                  "device": {
                    "id": "d2a8f4c1-6b3e-4f95-8c07-3e9b1a5d6f28",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "host": "10.40.0.21",
                    "known": true,
                    "source": "snmp",
                    "snmp": {
                      "status": "ok",
                      "version": "2c"
                    },
                    "ipp": {
                      "status": "ok"
                    },
                    "reading_at": "2026-11-20T09:10:00Z",
                    "manufacturer": "HP",
                    "model": "HP LaserJet Pro MFP M428fdw",
                    "serial_number": "PHBQK41827",
                    "firmware": "002.2348A",
                    "vendor_slug": "hp",
                    "identity": {
                      "sys_descr": "HP ETHERNET MULTI-ENVIRONMENT",
                      "sys_name": "NPI8F2C41",
                      "sys_location": "Reception",
                      "manufacturer": "HP",
                      "model": "HP LaserJet Pro MFP M428fdw",
                      "serial_number": "PHBQK41827",
                      "firmware": "002.2348A",
                      "uptime_s": 1814402
                    },
                    "status": {
                      "printer": "idle",
                      "device": "running",
                      "message": "Ready"
                    },
                    "covers": [
                      {
                        "name": "Front door",
                        "open": false
                      }
                    ],
                    "trays": [
                      {
                        "index": 1,
                        "name": "Tray 1",
                        "kind": "Manual feed",
                        "media": "A4",
                        "level": -2,
                        "max": 100,
                        "percent": -1,
                        "unit": "sheets",
                        "state": "ok"
                      },
                      {
                        "index": 2,
                        "name": "Tray 2",
                        "kind": "Cassette",
                        "media": "A4",
                        "level": 200,
                        "max": 250,
                        "percent": 80,
                        "unit": "sheets",
                        "state": "ok"
                      }
                    ],
                    "outputs": [
                      {
                        "index": 1,
                        "name": "Output bin",
                        "percent_free": 100,
                        "remaining": 150,
                        "max": 150,
                        "state": "ok"
                      }
                    ],
                    "supplies": [
                      {
                        "name": "Black Cartridge HP CF259A",
                        "colorant": "black",
                        "percent": 10,
                        "level": 1020,
                        "max_level": 10000,
                        "unit": "impressions",
                        "type": "tonerCartridge",
                        "kind": "toner",
                        "receptacle": false,
                        "forecast": {
                          "days_left": 6.5,
                          "per_day": 1.54,
                          "empty_at": "2026-11-26T21:00:00Z",
                          "basis_days": 42
                        },
                        "last_replaced": "2026-08-11T10:02:00Z"
                      }
                    ],
                    "counters": {
                      "total": 48213,
                      "mono": 48213,
                      "print": 39107,
                      "copy": 9106,
                      "duplex": 17250,
                      "unit": "impressions"
                    },
                    "capabilities": {
                      "status": true,
                      "alerts": true,
                      "supplies": true,
                      "supply_levels": true,
                      "trays": true,
                      "tray_levels": true,
                      "outputs": true,
                      "covers": true,
                      "console": false,
                      "counter_total": true,
                      "counter_color": true,
                      "counter_function": true,
                      "counter_duplex": true,
                      "serial": true,
                      "firmware": true
                    },
                    "alerts": [
                      {
                        "id": "5d3f8a1c-9e2b-4b67-a4c0-1f7e3d9b5a82",
                        "severity": "warning",
                        "code": 1104,
                        "label": "Toner low",
                        "description": "Black cartridge low",
                        "opened_at": "2026-11-17T13:20:00Z",
                        "last_seen_at": "2026-11-20T09:10:00Z"
                      }
                    ],
                    "monitor": {
                      "state": "up",
                      "latency_ms": 3,
                      "last_seen_at": "2026-11-20T09:13:41Z",
                      "last_change_at": "2026-11-18T07:42:19Z",
                      "consecutive_failures": 0
                    },
                    "last_sample_at": "2026-11-20T09:10:00Z",
                    "watcher": {
                      "mode": "agent",
                      "chosen_agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "assigned_agent_id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "assigned_agent_name": "SHF-WS-117",
                      "assigned_agent_status": "online",
                      "reason": "chosen",
                      "assigned_at": "2026-11-20T09:14:03Z"
                    },
                    "candidates": [
                      {
                        "id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                        "name": "SHF-WS-204",
                        "status": "online",
                        "has_queue": true,
                        "last_up_at": "2026-11-20T09:13:41Z",
                        "latency_ms": 3,
                        "has_battery": false,
                        "os_caption": "Microsoft Windows 11 Pro"
                      },
                      {
                        "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                        "name": "SHF-WS-117",
                        "status": "online",
                        "has_queue": false,
                        "last_up_at": "2026-11-19T16:40:02Z",
                        "latency_ms": 5,
                        "has_battery": true,
                        "os_caption": "Microsoft Windows 11 Pro"
                      }
                    ],
                    "settings": {
                      "off": false,
                      "customer_off": false,
                      "profile_id": "",
                      "effective_profile_id": "c9b1e5a7-2f4d-4e68-8a13-6d0f3b7c9e52",
                      "effective_profile_name": "Office printers (v2c)",
                      "source": "customer",
                      "inherited_profile_name": "Office printers (v2c)"
                    },
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "snmp_enabled": true,
                    "snmp_version": "2c",
                    "community_set": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/devices/{id}/history": {
      "get": {
        "operationId": "getDeviceHistory",
        "tags": [
          "Monitoring"
        ],
        "summary": "Get one printer's history",
        "description": "Returns chart data for one printer: response time and availability, daily page counts, consumable levels, uptime, an outage summary, recent state changes and printer alerts. The id is `device.id` from GET /monitoring/device.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Device id (`device.id` from GET /monitoring/device).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Time range. Unknown values fall back to 24h.",
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d",
                "365d"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History for the range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceHistory"
                },
                "example": {
                  "range": "7d",
                  "points": [
                    {
                      "t": "2026-11-20T08:00:00Z",
                      "latency_ms": 3.2,
                      "max_ms": 9,
                      "up_pct": 100
                    },
                    {
                      "t": "2026-11-20T09:00:00Z",
                      "latency_ms": 2.9,
                      "max_ms": 7,
                      "up_pct": 100
                    }
                  ],
                  "daily": [
                    {
                      "day": "2026-11-19",
                      "total": 214,
                      "mono": 214,
                      "color": 0,
                      "print": 171,
                      "copy": 43,
                      "scan": 12,
                      "fax": 0,
                      "duplex": 88,
                      "up_pct": 99.65,
                      "latency_ms": 3.1,
                      "max_ms": 14
                    },
                    {
                      "day": "2026-11-20",
                      "total": 37,
                      "mono": 37,
                      "color": 0,
                      "print": 30,
                      "copy": 7,
                      "scan": 2,
                      "fax": 0,
                      "duplex": 15,
                      "up_pct": 100,
                      "latency_ms": 3,
                      "max_ms": 9
                    }
                  ],
                  "supplies": {
                    "Black Cartridge HP CF259A": [
                      {
                        "t": "2026-11-14T09:10:00Z",
                        "pct": 19
                      },
                      {
                        "t": "2026-11-20T09:10:00Z",
                        "pct": 10
                      }
                    ]
                  },
                  "uptime": {
                    "day": 100,
                    "week": 99.82,
                    "month": 99.71
                  },
                  "outages": {
                    "count": 1,
                    "longest_s": 1130,
                    "total_s": 1130,
                    "window_days": 30
                  },
                  "events": [
                    {
                      "id": "9a2c5e7f-1b4d-4c86-a3f0-7e5b2d9c1a64",
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "occurred_at": "2026-11-18T07:42:19Z",
                      "state": "up",
                      "latency_ms": 3
                    },
                    {
                      "id": "e5c7a2f9-4d1b-4e36-9b80-3f6d1a8c5e27",
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "occurred_at": "2026-11-18T07:23:29Z",
                      "state": "down",
                      "detail": "no reply to ping"
                    }
                  ],
                  "alerts_log": [
                    {
                      "id": "5d3f8a1c-9e2b-4b67-a4c0-1f7e3d9b5a82",
                      "severity": "warning",
                      "code": 1104,
                      "label": "Toner low",
                      "description": "Black cartridge low",
                      "opened_at": "2026-11-17T13:20:00Z",
                      "last_seen_at": "2026-11-20T09:10:00Z"
                    }
                  ],
                  "first_sample_at": "2026-09-02T14:25:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/profiles": {
      "get": {
        "operationId": "listMonitoringProfiles",
        "tags": [
          "Monitoring"
        ],
        "summary": "List monitoring profiles",
        "description": "Returns a bare array of profiles, sorted by name. SNMPv3 passphrases are never returned, only whether each is set.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only profiles this customer can use: its own and the shared ones.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MonitoringProfile"
                  }
                },
                "example": [
                  {
                    "id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                    "name": "Halden SNMPv3",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "customer_name": "Halden Manufacturing",
                    "description": "SNMPv3 with SHA-256 and AES for the Sheffield site printers",
                    "icmp_enabled": true,
                    "snmp_enabled": true,
                    "ipp_enabled": true,
                    "snmp_version": "3",
                    "snmp_community_set": true,
                    "snmp_v3_user": "printctrl-mon",
                    "snmp_v3_auth_proto": "sha256",
                    "snmp_v3_auth_set": true,
                    "snmp_v3_priv_proto": "aes",
                    "snmp_v3_priv_set": true,
                    "snmp_v3_context": "",
                    "used_by_customers": 1,
                    "used_by_agents": 0,
                    "used_by_printers": 2,
                    "created_at": "2026-10-14T11:05:22Z",
                    "updated_at": "2026-11-20T09:14:03Z"
                  },
                  {
                    "id": "c9b1e5a7-2f4d-4e68-8a13-6d0f3b7c9e52",
                    "name": "Office printers (v2c)",
                    "customer_id": "",
                    "customer_name": "",
                    "description": "Ping, SNMP v2c and IPP with the default community",
                    "icmp_enabled": true,
                    "snmp_enabled": true,
                    "ipp_enabled": true,
                    "snmp_version": "2c",
                    "snmp_community_set": true,
                    "snmp_v3_user": "",
                    "snmp_v3_auth_proto": "",
                    "snmp_v3_auth_set": false,
                    "snmp_v3_priv_proto": "",
                    "snmp_v3_priv_set": false,
                    "snmp_v3_context": "",
                    "used_by_customers": 4,
                    "used_by_agents": 1,
                    "used_by_printers": 0,
                    "created_at": "2026-09-01T08:30:00Z",
                    "updated_at": "2026-09-01T08:30:00Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createMonitoringProfile",
        "tags": [
          "Monitoring"
        ],
        "summary": "Create a monitoring profile",
        "description": "Requires the admin role. Passphrases are stored encrypted and never returned. Fails with 400 when the name is missing or too long, all three checks are off, the SNMP version or a protocol is unknown, a passphrase is under 8 or over 128 characters, or SNMPv3 is on without a user or a needed passphrase.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitoringProfileInput"
              },
              "example": {
                "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                "name": "Halden SNMPv3",
                "description": "SNMPv3 with SHA-256 and AES for the Sheffield site printers",
                "icmp_enabled": true,
                "snmp_enabled": true,
                "ipp_enabled": true,
                "snmp_version": "3",
                "snmp_v3_user": "printctrl-mon",
                "snmp_v3_auth_proto": "sha256",
                "snmp_v3_auth_pass": "r7Vq-2mLx-9TfP",
                "snmp_v3_priv_proto": "aes",
                "snmp_v3_priv_pass": "Kd4w-8zNe-3HsJ",
                "snmp_v3_context": ""
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringProfile"
                },
                "example": {
                  "id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                  "name": "Halden SNMPv3",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "customer_name": "Halden Manufacturing",
                  "description": "SNMPv3 with SHA-256 and AES for the Sheffield site printers",
                  "icmp_enabled": true,
                  "snmp_enabled": true,
                  "ipp_enabled": true,
                  "snmp_version": "3",
                  "snmp_community_set": true,
                  "snmp_v3_user": "printctrl-mon",
                  "snmp_v3_auth_proto": "sha256",
                  "snmp_v3_auth_set": true,
                  "snmp_v3_priv_proto": "aes",
                  "snmp_v3_priv_set": true,
                  "snmp_v3_context": "",
                  "used_by_customers": 0,
                  "used_by_agents": 0,
                  "used_by_printers": 0,
                  "created_at": "2026-11-20T09:14:03Z",
                  "updated_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitoring/profiles/{id}": {
      "get": {
        "operationId": "getMonitoringProfile",
        "tags": [
          "Monitoring"
        ],
        "summary": "Get a monitoring profile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringProfile"
                },
                "example": {
                  "id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                  "name": "Halden SNMPv3",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "customer_name": "Halden Manufacturing",
                  "description": "SNMPv3 with SHA-256 and AES for the Sheffield site printers",
                  "icmp_enabled": true,
                  "snmp_enabled": true,
                  "ipp_enabled": true,
                  "snmp_version": "3",
                  "snmp_community_set": true,
                  "snmp_v3_user": "printctrl-mon",
                  "snmp_v3_auth_proto": "sha256",
                  "snmp_v3_auth_set": true,
                  "snmp_v3_priv_proto": "aes",
                  "snmp_v3_priv_set": true,
                  "snmp_v3_context": "",
                  "used_by_customers": 1,
                  "used_by_agents": 0,
                  "used_by_printers": 2,
                  "created_at": "2026-10-14T11:05:22Z",
                  "updated_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "updateMonitoringProfile",
        "tags": [
          "Monitoring"
        ],
        "summary": "Replace a monitoring profile",
        "description": "Requires the admin role. Replaces every field, so send the whole profile. Omit a passphrase to keep the stored one, or send an empty string to clear it. The owning customer cannot change. Affected computers get new targets right away. Fails with 400 when the name is missing or too long, all three checks are off, the SNMP version or a protocol is unknown, a passphrase is under 8 or over 128 characters, or SNMPv3 is on without a user or a needed passphrase.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitoringProfileInput"
              },
              "example": {
                "name": "Halden SNMPv3",
                "description": "SNMPv3 with SHA-256 and AES-256 for the Sheffield site printers",
                "icmp_enabled": true,
                "snmp_enabled": true,
                "ipp_enabled": true,
                "snmp_version": "3",
                "snmp_v3_user": "printctrl-mon",
                "snmp_v3_auth_proto": "sha256",
                "snmp_v3_priv_proto": "aes256",
                "snmp_v3_priv_pass": "Wq6t-1bVr-7MzC",
                "snmp_v3_context": ""
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitoringProfile"
                },
                "example": {
                  "id": "7a4e2c9b-5d1f-4b83-9e60-2f8c4a1d7b35",
                  "name": "Halden SNMPv3",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "customer_name": "Halden Manufacturing",
                  "description": "SNMPv3 with SHA-256 and AES-256 for the Sheffield site printers",
                  "icmp_enabled": true,
                  "snmp_enabled": true,
                  "ipp_enabled": true,
                  "snmp_version": "3",
                  "snmp_community_set": true,
                  "snmp_v3_user": "printctrl-mon",
                  "snmp_v3_auth_proto": "sha256",
                  "snmp_v3_auth_set": true,
                  "snmp_v3_priv_proto": "aes256",
                  "snmp_v3_priv_set": true,
                  "snmp_v3_context": "",
                  "used_by_customers": 1,
                  "used_by_agents": 0,
                  "used_by_printers": 2,
                  "created_at": "2026-10-14T11:05:22Z",
                  "updated_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteMonitoringProfile",
        "tags": [
          "Monitoring"
        ],
        "summary": "Delete a monitoring profile",
        "description": "Requires the admin role. Customers, computers and printers using the profile fall back to the next level down (printer, then computer, then customer).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitors": {
      "get": {
        "operationId": "listMonitors",
        "tags": [
          "Monitoring"
        ],
        "summary": "List monitors",
        "description": "Returns monitored printer addresses with their current state, latest consumable levels and latest page count. The list is not paged; use `limit` to cap it.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only monitors for this customer.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "Only monitors run by this computer.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "host",
            "in": "query",
            "required": false,
            "description": "Exact printer address match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Only monitors in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "up",
                "down",
                "unknown"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on the address, linked queue name or the watching computer's host name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "low_supply",
            "in": "query",
            "required": false,
            "description": "true or 1: only monitors with a consumable below 15%.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum monitors returned. Values outside 1-1000 fall back to 500.",
            "schema": {
              "type": "integer",
              "default": 500,
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Monitors and counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorList"
                },
                "example": {
                  "monitors": [
                    {
                      "id": "6e9d2b47-3a1c-4f85-b0e7-5c4a8d1f2e63",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "printer_id": "0c6f3e81-4b2a-4d97-a5e8-9f1c7b3d2a40",
                      "host_address": "10.40.0.22",
                      "icmp_enabled": true,
                      "snmp_enabled": true,
                      "snmp_community_set": true,
                      "state": "down",
                      "last_change_at": "2026-11-20T08:57:30Z",
                      "last_seen_at": "2026-11-20T08:52:12Z",
                      "consecutive_failures": 4,
                      "created_at": "2026-09-02T14:21:07Z",
                      "updated_at": "2026-11-20T09:13:41Z",
                      "agent_name": "SHF-WS-204",
                      "agent_hostname": "SHF-WS-204",
                      "agent_status": "online",
                      "customer_name": "Halden Manufacturing",
                      "printer_name": "HM-Goods-In",
                      "supplies": [
                        {
                          "name": "TK-3200 Toner Kit",
                          "colorant": "black",
                          "level": 41,
                          "max_level": 100,
                          "percent": 41,
                          "unit": "percent",
                          "sampled_at": "2026-11-20T08:50:00Z"
                        }
                      ],
                      "lowest_supply_percent": 41,
                      "page_count": 215904,
                      "counter_sampled_at": "2026-11-20T08:50:00Z"
                    },
                    {
                      "id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "printer_id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                      "host_address": "10.40.0.21",
                      "icmp_enabled": true,
                      "snmp_enabled": true,
                      "snmp_community_set": true,
                      "state": "up",
                      "latency_ms": 3,
                      "last_change_at": "2026-11-18T07:42:19Z",
                      "last_seen_at": "2026-11-20T09:13:41Z",
                      "consecutive_failures": 0,
                      "created_at": "2026-09-02T14:21:07Z",
                      "updated_at": "2026-11-20T09:13:41Z",
                      "agent_name": "SHF-WS-204",
                      "agent_hostname": "SHF-WS-204",
                      "agent_status": "online",
                      "customer_name": "Halden Manufacturing",
                      "printer_name": "HM-Reception",
                      "supplies": [
                        {
                          "name": "Black Cartridge HP CF259A",
                          "colorant": "black",
                          "level": 1020,
                          "max_level": 10000,
                          "percent": 10,
                          "unit": "impressions",
                          "sampled_at": "2026-11-20T09:10:00Z"
                        }
                      ],
                      "lowest_supply_percent": 10,
                      "page_count": 48213,
                      "counter_sampled_at": "2026-11-20T09:10:00Z"
                    }
                  ],
                  "counts": {
                    "total": 2,
                    "up": 1,
                    "down": 1,
                    "unknown": 0
                  },
                  "low_supply": 1,
                  "low_supply_threshold": 15
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitors/{id}/counters": {
      "get": {
        "operationId": "listMonitorCounters",
        "tags": [
          "Monitoring"
        ],
        "summary": "Get a monitor's page-count history",
        "description": "Returns the monitor and its page-count readings over the last `days` days, with the number of pages printed in that window. Counters are kept for 400 days.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Monitor id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Window in days. Values outside 1-400 fall back to 30.",
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 1,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor and its counter series.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorCounters"
                },
                "example": {
                  "monitor": {
                    "id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "printer_id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                    "host_address": "10.40.0.21",
                    "icmp_enabled": true,
                    "snmp_enabled": true,
                    "snmp_community_set": true,
                    "state": "up",
                    "latency_ms": 3,
                    "last_change_at": "2026-11-18T07:42:19Z",
                    "last_seen_at": "2026-11-20T09:13:41Z",
                    "consecutive_failures": 0,
                    "created_at": "2026-09-02T14:21:07Z",
                    "updated_at": "2026-11-20T09:13:41Z",
                    "agent_name": "SHF-WS-204",
                    "agent_hostname": "SHF-WS-204",
                    "agent_status": "online",
                    "customer_name": "Halden Manufacturing",
                    "printer_name": "HM-Reception",
                    "supplies": [
                      {
                        "name": "Black Cartridge HP CF259A",
                        "colorant": "black",
                        "level": 1020,
                        "max_level": 10000,
                        "percent": 10,
                        "unit": "impressions",
                        "sampled_at": "2026-11-20T09:10:00Z"
                      }
                    ],
                    "lowest_supply_percent": 10,
                    "page_count": 48213,
                    "counter_sampled_at": "2026-11-20T09:10:00Z"
                  },
                  "series": {
                    "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                    "host_address": "10.40.0.21",
                    "printer_name": "HM-Reception",
                    "agent_name": "SHF-WS-204",
                    "latest": {
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "sampled_at": "2026-11-20T09:10:00Z",
                      "page_count": 48213
                    },
                    "first": {
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "sampled_at": "2026-10-21T09:05:00Z",
                      "page_count": 45102
                    },
                    "pages_in_range": 3111,
                    "history": [
                      {
                        "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                        "sampled_at": "2026-10-21T09:05:00Z",
                        "page_count": 45102
                      },
                      {
                        "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                        "sampled_at": "2026-11-05T09:05:00Z",
                        "page_count": 46690
                      },
                      {
                        "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                        "sampled_at": "2026-11-20T09:10:00Z",
                        "page_count": 48213
                      }
                    ]
                  },
                  "days": 30
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitors/{id}/events": {
      "get": {
        "operationId": "listMonitorEvents",
        "tags": [
          "Monitoring"
        ],
        "summary": "List a monitor's state changes",
        "description": "Returns recorded up/down transitions for one monitor, newest first, with cursor paging. Pass `next_cursor` back as `cursor` until `has_more` is false. An invalid or stale cursor returns the first page.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Monitor id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Only changes to this state.",
            "schema": {
              "type": "string",
              "enum": [
                "up",
                "down",
                "unknown"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Only changes in the last N days. Events are kept for 90 days.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Extra filter on the event's customer.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "Extra filter on the monitor's computer.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Values above 500 use 500; missing, zero or negative values use 100.",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque `next_cursor` from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorEventPage"
                },
                "example": {
                  "events": [
                    {
                      "id": "3b8e1f6a-7c2d-4a95-b04e-1d9f5c3a7e28",
                      "monitor_id": "6e9d2b47-3a1c-4f85-b0e7-5c4a8d1f2e63",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "occurred_at": "2026-11-20T08:57:30Z",
                      "state": "down",
                      "detail": "no reply to ping or SNMP after 4 checks",
                      "host_address": "10.40.0.22",
                      "printer_name": "HM-Goods-In",
                      "agent_name": "SHF-WS-204",
                      "customer_name": "Halden Manufacturing"
                    },
                    {
                      "id": "7d1b4e9c-3f6a-4b28-8e05-2c9a6f1d3b74",
                      "monitor_id": "6e9d2b47-3a1c-4f85-b0e7-5c4a8d1f2e63",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "occurred_at": "2026-11-19T15:02:11Z",
                      "state": "up",
                      "latency_ms": 4,
                      "host_address": "10.40.0.22",
                      "printer_name": "HM-Goods-In",
                      "agent_name": "SHF-WS-204",
                      "customer_name": "Halden Manufacturing"
                    }
                  ],
                  "next_cursor": "MjAyNi0xMS0xOVQxNTowMjoxMVoAN2QxYjRlOWMtM2Y2YS00YjI4LThlMDUtMmM5YTZmMWQzYjc0",
                  "has_more": true,
                  "limit": 2,
                  "retention_days": 90
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/monitors/{id}/supplies": {
      "get": {
        "operationId": "listMonitorSupplies",
        "tags": [
          "Monitoring"
        ],
        "summary": "List a monitor's consumables",
        "description": "Returns the monitor and the current level of each consumable it reports.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Monitor id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "low",
            "in": "query",
            "required": false,
            "description": "true or 1: only consumables below 15%.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The monitor and its consumables.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorSupplies"
                },
                "example": {
                  "monitor": {
                    "id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                    "printer_id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17",
                    "host_address": "10.40.0.21",
                    "icmp_enabled": true,
                    "snmp_enabled": true,
                    "snmp_community_set": true,
                    "state": "up",
                    "latency_ms": 3,
                    "last_change_at": "2026-11-18T07:42:19Z",
                    "last_seen_at": "2026-11-20T09:13:41Z",
                    "consecutive_failures": 0,
                    "created_at": "2026-09-02T14:21:07Z",
                    "updated_at": "2026-11-20T09:13:41Z",
                    "agent_name": "SHF-WS-204",
                    "agent_hostname": "SHF-WS-204",
                    "agent_status": "online",
                    "customer_name": "Halden Manufacturing",
                    "printer_name": "HM-Reception",
                    "supplies": [
                      {
                        "name": "Black Cartridge HP CF259A",
                        "colorant": "black",
                        "level": 1020,
                        "max_level": 10000,
                        "percent": 10,
                        "unit": "impressions",
                        "sampled_at": "2026-11-20T09:10:00Z"
                      }
                    ],
                    "lowest_supply_percent": 10,
                    "page_count": 48213,
                    "counter_sampled_at": "2026-11-20T09:10:00Z"
                  },
                  "supplies": [
                    {
                      "id": "f4a1c8e3-2d7b-4e59-9c06-8b3f5a1d7e92",
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "name": "Black Cartridge HP CF259A",
                      "colorant": "black",
                      "level": 1020,
                      "max_level": 10000,
                      "percent": 10,
                      "unit": "impressions",
                      "sampled_at": "2026-11-20T09:10:00Z",
                      "host_address": "10.40.0.21",
                      "printer_name": "HM-Reception",
                      "agent_name": "SHF-WS-204",
                      "low": true
                    }
                  ],
                  "threshold": 15
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/supplies": {
      "get": {
        "operationId": "listSupplies",
        "tags": [
          "Monitoring"
        ],
        "summary": "List all consumables",
        "description": "Returns every consumable in the account with its printer, plus the latest page count for each monitor, in one request.",
        "parameters": [
          {
            "name": "low",
            "in": "query",
            "required": false,
            "description": "true or 1: only consumables below 15%.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consumables and latest counters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorAllSupplies"
                },
                "example": {
                  "supplies": [
                    {
                      "id": "f4a1c8e3-2d7b-4e59-9c06-8b3f5a1d7e92",
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "name": "Black Cartridge HP CF259A",
                      "colorant": "black",
                      "level": 1020,
                      "max_level": 10000,
                      "percent": 10,
                      "unit": "impressions",
                      "sampled_at": "2026-11-20T09:10:00Z",
                      "host_address": "10.40.0.21",
                      "printer_name": "HM-Reception",
                      "agent_name": "SHF-WS-204",
                      "low": true
                    },
                    {
                      "id": "2e6b9d14-8a3f-4c71-b5e2-0d7c4f9a3b18",
                      "monitor_id": "6e9d2b47-3a1c-4f85-b0e7-5c4a8d1f2e63",
                      "name": "TK-3200 Toner Kit",
                      "colorant": "black",
                      "level": 41,
                      "max_level": 100,
                      "percent": 41,
                      "unit": "percent",
                      "sampled_at": "2026-11-20T08:50:00Z",
                      "host_address": "10.40.0.22",
                      "printer_name": "HM-Goods-In",
                      "agent_name": "SHF-WS-204",
                      "low": false
                    }
                  ],
                  "counters": [
                    {
                      "monitor_id": "1f7c3a52-9e4b-4d18-a6c3-8b2e5f0d7a94",
                      "sampled_at": "2026-11-20T09:10:00Z",
                      "page_count": 48213,
                      "host_address": "10.40.0.21",
                      "printer_name": "HM-Reception",
                      "agent_name": "SHF-WS-204"
                    },
                    {
                      "monitor_id": "6e9d2b47-3a1c-4f85-b0e7-5c4a8d1f2e63",
                      "sampled_at": "2026-11-20T08:50:00Z",
                      "page_count": 215904,
                      "host_address": "10.40.0.22",
                      "printer_name": "HM-Goods-In",
                      "agent_name": "SHF-WS-204"
                    }
                  ],
                  "low": 1,
                  "threshold": 15
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/floor-plans": {
      "get": {
        "operationId": "listFloorPlans",
        "tags": [
          "Floor plans"
        ],
        "summary": "List a customer's floor plans",
        "description": "Returns the customer's floor plans as a bare JSON array, sorted by name.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The floor plans.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FloorPlan"
                  }
                },
                "example": [
                  {
                    "id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                    "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                    "name": "Ground floor",
                    "image": "7d3a9c1e5b8f2d6a4c0e9b3f7a1d5c8e2b6f0a4d9c3e7b1f5a8d2c6e0b4f9a3d",
                    "image_type": "image/png",
                    "width": 2400,
                    "height": 1600,
                    "pins": 1,
                    "image_url": "/api/v1/floor-plans/f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42/image"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createFloorPlan",
        "tags": [
          "Floor plans"
        ],
        "summary": "Upload a floor plan",
        "description": "Requires the editor or admin role. Upload a PNG or JPEG of up to 5 MB, at least 16 pixels in each direction. The whole request may be at most 6 MB. The customer's connected computers receive the new plan straight away.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "image"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "The plan's name, up to 80 characters."
                  },
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG or JPEG, up to 5 MB."
                  }
                }
              },
              "example": {
                "name": "Ground floor",
                "image": "(binary PNG file)"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The floor plan was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                },
                "example": {
                  "id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "Ground floor",
                  "image": "7d3a9c1e5b8f2d6a4c0e9b3f7a1d5c8e2b6f0a4d9c3e7b1f5a8d2c6e0b4f9a3d",
                  "image_type": "image/png",
                  "width": 2400,
                  "height": 1600,
                  "pins": 0,
                  "image_url": "/api/v1/floor-plans/f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42/image"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "description": "The image is not a PNG or JPEG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "the floor plan must be a PNG or JPEG image"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/printer-placements": {
      "get": {
        "operationId": "listPrinterPlacements",
        "tags": [
          "Floor plans"
        ],
        "summary": "List printer placements",
        "description": "Returns the customer's active managed printers as a bare JSON array, sorted by name, with the floor plan each is pinned to (if any) and its network state.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The customer's managed printers and their pins.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterPlacement"
                  }
                },
                "example": [
                  {
                    "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                    "name": "HM-Goods-In",
                    "location": "Warehouse, loading bay",
                    "host_address": "10.40.0.22",
                    "map_id": "",
                    "x": null,
                    "y": null,
                    "state": "down"
                  },
                  {
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "name": "HM-Reception",
                    "location": "Ground floor reception",
                    "host_address": "10.40.0.21",
                    "map_id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                    "x": 0.237,
                    "y": 0.612,
                    "state": "up"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/floor-plans/{id}": {
      "patch": {
        "operationId": "renameFloorPlan",
        "tags": [
          "Floor plans"
        ],
        "summary": "Rename a floor plan",
        "description": "Requires the editor or admin role.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The floor plan's id.",
            "schema": {
              "type": "string"
            },
            "example": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                }
              },
              "example": {
                "name": "Ground floor and reception"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The renamed floor plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                },
                "example": {
                  "id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "Ground floor and reception",
                  "image": "7d3a9c1e5b8f2d6a4c0e9b3f7a1d5c8e2b6f0a4d9c3e7b1f5a8d2c6e0b4f9a3d",
                  "image_type": "image/png",
                  "width": 2400,
                  "height": 1600,
                  "pins": 1,
                  "image_url": "/api/v1/floor-plans/f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42/image"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteFloorPlan",
        "tags": [
          "Floor plans"
        ],
        "summary": "Delete a floor plan",
        "description": "Requires the editor or admin role. Printers pinned to the plan lose their pins.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The floor plan's id.",
            "schema": {
              "type": "string"
            },
            "example": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42"
          }
        ],
        "responses": {
          "200": {
            "description": "The floor plan was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/floor-plans/{id}/image": {
      "get": {
        "operationId": "getFloorPlanImage",
        "tags": [
          "Floor plans"
        ],
        "summary": "Download a floor plan image",
        "description": "Returns the plan's image, as given by `image_url`. A 404 here has an empty body.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The floor plan's id.",
            "schema": {
              "type": "string"
            },
            "example": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42"
          }
        ],
        "responses": {
          "200": {
            "description": "The image, with the content type it was uploaded as. Sent with `Cache-Control: private, max-age=86400`.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No floor plan with that id in your account, or its image is missing. The body is empty."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "replaceFloorPlanImage",
        "tags": [
          "Floor plans"
        ],
        "summary": "Replace a floor plan image",
        "description": "Requires the editor or admin role. Same image rules as the upload: PNG or JPEG, up to 5 MB, request at most 6 MB. Pins keep their positions as fractions of the new image's width and height.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The floor plan's id.",
            "schema": {
              "type": "string"
            },
            "example": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG or JPEG, up to 5 MB."
                  }
                }
              },
              "example": {
                "image": "(binary PNG file)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The floor plan with its new image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                },
                "example": {
                  "id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                  "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                  "name": "Ground floor",
                  "image": "1c5e9a3d7b2f6e0a4d8c2b6f9e3a7d1c5b9f3e7a2d6c0b4e8f1a5d9c3b7e2f6a",
                  "image_type": "image/jpeg",
                  "width": 3000,
                  "height": 2000,
                  "pins": 1,
                  "image_url": "/api/v1/floor-plans/f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42/image"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "description": "The image is not a PNG or JPEG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "the floor plan must be a PNG or JPEG image"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/floor-plans/{id}/pins": {
      "put": {
        "operationId": "setFloorPlanPins",
        "tags": [
          "Floor plans"
        ],
        "summary": "Set the printers on a floor plan",
        "description": "Requires the editor or admin role. `pins` is the complete set for this plan: listed printers are placed here (and moved off any other plan), and printers on this plan that are not listed are taken off. Send an empty array to clear the plan. Only the plan's customer's managed printers can be placed. Returns the customer's placements after the change.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The floor plan's id.",
            "schema": {
              "type": "string"
            },
            "example": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanPinsInput"
              },
              "example": {
                "pins": [
                  {
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "x": 0.237,
                    "y": 0.612
                  },
                  {
                    "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                    "x": 0.884,
                    "y": 0.145
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All of the customer's printer placements, as a bare JSON array.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterPlacement"
                  }
                },
                "example": [
                  {
                    "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                    "name": "HM-Goods-In",
                    "location": "Warehouse, loading bay",
                    "host_address": "10.40.0.22",
                    "map_id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                    "x": 0.884,
                    "y": 0.145,
                    "state": "down"
                  },
                  {
                    "managed_printer_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                    "name": "HM-Reception",
                    "location": "Ground floor reception",
                    "host_address": "10.40.0.21",
                    "map_id": "f2a8c6d1-4b9e-4e37-8a05-6d1c3b7e9f42",
                    "x": 0.237,
                    "y": 0.612,
                    "state": "up"
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/branding": {
      "get": {
        "operationId": "getAccountBranding",
        "tags": [
          "Branding"
        ],
        "summary": "Get the account branding",
        "description": "Returns the name and logo every customer's tray shows, unless the customer has its own. `enabled: false` means PrintCtrl's own branding.",
        "responses": {
          "200": {
            "description": "The account branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                },
                "example": {
                  "enabled": true,
                  "name": "Northgate Managed IT",
                  "logo": "4e7a1c9d2b6f3e8a5c0d7b4e1f9a2c6d3b8e5f0a7c4d1e9b6f3a8c5d2e7b0f4a",
                  "logo_type": "image/svg+xml",
                  "logo_url": "/api/v1/branding/logo/4e7a1c9d2b6f3e8a5c0d7b4e1f9a2c6d3b8e5f0a7c4d1e9b6f3a8c5d2e7b0f4a"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "setAccountBranding",
        "tags": [
          "Branding"
        ],
        "summary": "Set the account branding",
        "description": "Requires the admin role. Fields you leave out keep their current value. The change is pushed to connected computers of every customer that uses the account branding.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BrandingForm"
              },
              "example": {
                "enabled": "true",
                "name": "Northgate Managed IT",
                "logo": "(binary SVG file)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                },
                "example": {
                  "enabled": true,
                  "name": "Northgate Managed IT",
                  "logo": "4e7a1c9d2b6f3e8a5c0d7b4e1f9a2c6d3b8e5f0a7c4d1e9b6f3a8c5d2e7b0f4a",
                  "logo_type": "image/svg+xml",
                  "logo_url": "/api/v1/branding/logo/4e7a1c9d2b6f3e8a5c0d7b4e1f9a2c6d3b8e5f0a7c4d1e9b6f3a8c5d2e7b0f4a"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "description": "The logo is not a PNG, JPEG or SVG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "the logo must be a PNG, JPEG or SVG"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/branding/logo/{sha}": {
      "get": {
        "operationId": "getBrandingLogo",
        "tags": [
          "Branding"
        ],
        "summary": "Download a logo",
        "description": "Returns a logo used by your account's or one of your customers' branding, as given by `logo_url`. A 404 here has an empty body.",
        "parameters": [
          {
            "name": "sha",
            "in": "path",
            "required": true,
            "description": "The logo's SHA-256, as in the branding's `logo` field.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "example": "4e7a1c9d2b6f3e8a5c0d7b4e1f9a2c6d3b8e5f0a7c4d1e9b6f3a8c5d2e7b0f4a"
          }
        ],
        "responses": {
          "200": {
            "description": "The logo. Sent with `Cache-Control: private, max-age=86400, immutable` and a sandboxing Content-Security-Policy.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No logo with that hash belongs to your account. The body is empty."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/customers/{cid}/branding": {
      "get": {
        "operationId": "getCustomerBranding",
        "tags": [
          "Branding"
        ],
        "summary": "Get a customer's branding",
        "description": "Returns the name and logo this customer's tray shows instead of the account's. `enabled: false` means the customer uses the account branding.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "responses": {
          "200": {
            "description": "The customer's own branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                },
                "example": {
                  "enabled": true,
                  "name": "Halden IT Help",
                  "logo": "9b2f6e1d4c8a7b3e5f0d2c6a9e1b4f7d3c8a5e2b6f9d1c4a7e0b3f6d9c2a5e8b",
                  "logo_type": "image/png",
                  "logo_url": "/api/v1/branding/logo/9b2f6e1d4c8a7b3e5f0d2c6a9e1b4f7d3c8a5e2b6f9d1c4a7e0b3f6d9c2a5e8b"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "setCustomerBranding",
        "tags": [
          "Branding"
        ],
        "summary": "Set a customer's branding",
        "description": "Requires the admin role. Fields you leave out keep their current value. Set `enabled` to `true` to show this name and logo in the customer's tray instead of the account's; the change is pushed to the customer's connected computers.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BrandingForm"
              },
              "example": {
                "enabled": "true",
                "name": "Halden IT Help"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                },
                "example": {
                  "enabled": true,
                  "name": "Halden IT Help",
                  "logo": "9b2f6e1d4c8a7b3e5f0d2c6a9e1b4f7d3c8a5e2b6f9d1c4a7e0b3f6d9c2a5e8b",
                  "logo_type": "image/png",
                  "logo_url": "/api/v1/branding/logo/9b2f6e1d4c8a7b3e5f0d2c6a9e1b4f7d3c8a5e2b6f9d1c4a7e0b3f6d9c2a5e8b"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "description": "The logo is not a PNG, JPEG or SVG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "the logo must be a PNG, JPEG or SVG"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/alerts": {
      "get": {
        "operationId": "listAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "List alerts",
        "description": "Open alerts come newest first; with `state=resolved`, most recently resolved first.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved"
              ]
            },
            "description": "Other values return both."
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only this customer's alerts."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive match on title, subject, summary or customer name."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "minimum": 1,
              "maximum": 500
            },
            "description": "Out of range or unparseable values use 200."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertList"
                },
                "example": {
                  "alerts": [
                    {
                      "id": "0c7e4b29-8f1a-4d63-b5e2-9a3d6c1f8e47",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "customer_name": "Halden Manufacturing",
                      "kind": "printer_down",
                      "subject_id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
                      "subject_label": "HM-Goods-In",
                      "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                      "severity": "critical",
                      "state": "open",
                      "title": "HM-Goods-In is not responding",
                      "summary": "No reply to ICMP or SNMP from 10.40.0.22 for 12 minutes.",
                      "facts": [
                        {
                          "label": "Address",
                          "value": "10.40.0.22"
                        },
                        {
                          "label": "Watched from",
                          "value": "SHF-WS-204"
                        }
                      ],
                      "link": "https://app.printctrl.io/monitoring?printer=e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
                      "opened_at": "2026-11-20T08:58:41Z",
                      "notified_at": "2026-11-20T08:58:44Z",
                      "last_delivery_ok": true
                    }
                  ],
                  "total": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/alerts/settings": {
      "get": {
        "operationId": "getAlertSettings",
        "tags": [
          "Alerts"
        ],
        "summary": "Get alert settings",
        "description": "Requires the admin role. Returns the settings (defaults if never saved), who emails would go to, and the latest 50 delivery attempts.",
        "responses": {
          "200": {
            "description": "Alert settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSettingsView"
                },
                "example": {
                  "settings": {
                    "enabled": true,
                    "email_admins": true,
                    "extra_recipients": "helpdesk@northgate-it.example",
                    "printer_down_enabled": true,
                    "printer_down_minutes": 10,
                    "supply_low_enabled": true,
                    "supply_low_percent": 15,
                    "deployment_failed_enabled": true,
                    "printer_error_enabled": true,
                    "notify_resolved": true,
                    "webhook_url": "https://psa.northgate-it.example/hooks/printctrl",
                    "has_webhook_secret": true,
                    "updated_at": "2026-10-03T13:22:10Z"
                  },
                  "recipients": [
                    "sam.patel@northgate-it.example",
                    "helpdesk@northgate-it.example"
                  ],
                  "deliveries": [
                    {
                      "alert_id": "0c7e4b29-8f1a-4d63-b5e2-9a3d6c1f8e47",
                      "channel": "email",
                      "target": "sam.patel@northgate-it.example",
                      "event": "opened",
                      "ok": true,
                      "at": "2026-11-20T08:58:44Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/app-users": {
      "get": {
        "operationId": "listAppUsers",
        "tags": [
          "Team"
        ],
        "summary": "List team members",
        "description": "Requires the admin role. Returns a bare array of the account's users, ordered by name.",
        "parameters": [
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "super_admin",
                "admin",
                "editor",
                "viewer"
              ]
            },
            "description": "Only users with this exact role."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive match on name or email."
          }
        ],
        "responses": {
          "200": {
            "description": "Team members.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                },
                "example": [
                  {
                    "id": "1b6d9f42-7a3e-4c85-b0d2-6e8a4f1c3b97",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "Sam Patel",
                    "email": "sam.patel@northgate-it.example",
                    "role": "admin",
                    "status": "active",
                    "mfa_enabled": true,
                    "mfa_enrolled_at": "2026-03-02T10:41:17Z",
                    "password_changed_at": "2026-03-02T10:38:55Z",
                    "last_login_at": "2026-11-20T08:52:40Z",
                    "email_verified_at": "2026-02-14T15:06:21Z",
                    "created_at": "2026-02-14T15:04:09Z",
                    "updated_at": "2026-11-20T08:52:40Z"
                  },
                  {
                    "id": "d2a7c5e1-4f9b-4e36-8a1d-3c6b9e2f7a40",
                    "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "name": "Jordan Reyes",
                    "email": "jordan.reyes@northgate-it.example",
                    "role": "editor",
                    "status": "invited",
                    "mfa_enabled": false,
                    "invite_expires_at": "2026-11-27T09:14:03Z",
                    "created_at": "2026-11-20T09:14:03Z",
                    "updated_at": "2026-11-20T09:14:03Z"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createAppUser",
        "tags": [
          "Team"
        ],
        "summary": "Invite a team member",
        "description": "Requires the admin role. Creates the user as `invited` and emails an invite; the person sets their own password. The role cannot be above the caller's.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserInput"
              },
              "example": {
                "name": "Jordan Reyes",
                "email": "jordan.reyes@northgate-it.example",
                "role": "editor"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `invite_expires_at` is absent if the invite email failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": "d2a7c5e1-4f9b-4e36-8a1d-3c6b9e2f7a40",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Jordan Reyes",
                  "email": "jordan.reyes@northgate-it.example",
                  "role": "editor",
                  "status": "invited",
                  "mfa_enabled": false,
                  "invite_expires_at": "2026-11-27T09:14:03Z",
                  "created_at": "2026-11-20T09:14:03Z",
                  "updated_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/app-users/{id}": {
      "get": {
        "operationId": "getAppUser",
        "tags": [
          "Team"
        ],
        "summary": "Get a team member",
        "description": "Requires the admin role.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team member (user) id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The team member.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": "1b6d9f42-7a3e-4c85-b0d2-6e8a4f1c3b97",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Sam Patel",
                  "email": "sam.patel@northgate-it.example",
                  "role": "admin",
                  "status": "active",
                  "mfa_enabled": true,
                  "mfa_enrolled_at": "2026-03-02T10:41:17Z",
                  "password_changed_at": "2026-03-02T10:38:55Z",
                  "last_login_at": "2026-11-20T08:52:40Z",
                  "email_verified_at": "2026-02-14T15:06:21Z",
                  "created_at": "2026-02-14T15:04:09Z",
                  "updated_at": "2026-11-20T08:52:40Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateAppUser",
        "tags": [
          "Team"
        ],
        "summary": "Update a team member",
        "description": "Requires the admin role. Changes name, role or status. A more privileged member cannot be changed; the last super_admin cannot be demoted (409); an invited member cannot be suspended or activated (409).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team member (user) id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              },
              "example": {
                "role": "admin"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": "d2a7c5e1-4f9b-4e36-8a1d-3c6b9e2f7a40",
                  "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "name": "Jordan Reyes",
                  "email": "jordan.reyes@northgate-it.example",
                  "role": "admin",
                  "status": "active",
                  "mfa_enabled": false,
                  "created_at": "2026-11-20T09:14:03Z",
                  "updated_at": "2026-11-20T09:20:31Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteAppUser",
        "tags": [
          "Team"
        ],
        "summary": "Remove a team member",
        "description": "Requires the admin role. Revokes the member's sessions and deletes them; for an invited member this revokes the invite. Callers cannot delete themselves or a more privileged member, and the last super_admin cannot be removed (409).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team member (user) id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/billing/checkout": {
      "post": {
        "operationId": "createBillingCheckout",
        "tags": [
          "Billing"
        ],
        "summary": "Start a Stripe Checkout session",
        "description": "Requires the admin role. Opens Checkout for the subscription. Any trial time left carries into it. Return paths must be relative app paths; anything else falls back to the billing page.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "success_path": {
                    "type": "string",
                    "description": "App path to return to after paying. Default `/settings/billing?checkout=success`."
                  },
                  "cancel_path": {
                    "type": "string",
                    "description": "App path if the buyer backs out. Default `/settings/billing?checkout=cancelled`."
                  }
                }
              },
              "example": {
                "success_path": "/settings/billing?checkout=success",
                "cancel_path": "/settings/billing"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingCheckoutSession"
                },
                "example": {
                  "url": "https://checkout.stripe.com/c/pay/cs_test_a1B2c3D4e5F6g7H8",
                  "session_id": "cs_test_a1B2c3D4e5F6g7H8",
                  "quantity": 42
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "description": "Stripe did not accept the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing is not configured on this deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/details": {
      "get": {
        "operationId": "getBillingDetails",
        "tags": [
          "Billing"
        ],
        "summary": "Get card and invoices",
        "description": "Requires the admin role. Reads the payment method, recent invoices and next invoice from Stripe (cached briefly).",
        "responses": {
          "200": {
            "description": "Stripe-held details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingDetails"
                },
                "example": {
                  "card": {
                    "brand": "visa",
                    "last4": "4242",
                    "exp_month": 8,
                    "exp_year": 2028,
                    "kind": "card"
                  },
                  "invoices": [
                    {
                      "id": "in_1QhT7sK2mN4pL8vX",
                      "number": "NMIT-0009",
                      "status": "paid",
                      "total": 6600,
                      "amount_due": 6600,
                      "amount_paid": 6600,
                      "currency": "usd",
                      "created": 1763132652,
                      "period_start": 1760454249,
                      "period_end": 1763132649,
                      "hosted_invoice_url": "https://invoice.stripe.com/i/acct_example/test_example",
                      "invoice_pdf": "https://pay.stripe.com/invoice/acct_example/test_example/pdf",
                      "billing_reason": "subscription_cycle"
                    }
                  ],
                  "upcoming": {
                    "total": 6700,
                    "subtotal": 6700,
                    "tax": 0,
                    "amount_due": 6700,
                    "currency": "usd",
                    "next_payment_attempt": 1765724649,
                    "period_end": 1765724649,
                    "lines": [
                      {
                        "description": "PrintCtrl account",
                        "amount": 2500,
                        "quantity": 1,
                        "proration": false
                      },
                      {
                        "description": "42 x Active device",
                        "amount": 4200,
                        "quantity": 42,
                        "proration": false
                      }
                    ]
                  },
                  "billing_email": "accounts@northgate-it.example",
                  "fetched_at": "2026-11-20T09:14:03Z",
                  "partial": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "description": "Stripe did not answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/billing/overview": {
      "get": {
        "operationId": "getBillingOverview",
        "tags": [
          "Billing"
        ],
        "summary": "Get the billing overview",
        "description": "Plan, subscription mirror and projected monthly cost, from local data only. Available to every role.",
        "responses": {
          "200": {
            "description": "Billing overview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOverview"
                },
                "example": {
                  "entitlements": {
                    "tenant_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                    "plan_id": "standard",
                    "plan_name": "PrintCtrl",
                    "status": "active",
                    "seats": 42,
                    "agent_count": 47,
                    "enrolled_agents": 47,
                    "active_agents": 42,
                    "active_window_days": 60,
                    "base_amount": 2500,
                    "unit_amount": 100,
                    "currency": "USD",
                    "monthly_total": 6700,
                    "limits": {
                      "agents": -1,
                      "customers": -1,
                      "users": -1,
                      "managed_printers": -1
                    },
                    "usage": {
                      "agents": 47,
                      "customers": 2,
                      "users": 4,
                      "managed_printers": 3
                    },
                    "trial": false,
                    "subscribed": true,
                    "cancel_at_period_end": false,
                    "current_period_end": "2026-12-14T15:04:09Z",
                    "read_only": false,
                    "locked": false,
                    "billing_enabled": true,
                    "resolved_at": "2026-11-20T09:14:03Z"
                  },
                  "plan": {
                    "id": "standard",
                    "name": "PrintCtrl",
                    "description": "$25.00 a month, plus $1.00 per active device up to 500, $0.90 each from 501 to 2,000, and $0.80 each from 2,001.",
                    "per_seat": true,
                    "seat_label": "device",
                    "base_amount": 2500,
                    "unit_amount": 100,
                    "currency": "USD",
                    "interval": "month",
                    "limits": {
                      "agents": -1,
                      "customers": -1,
                      "users": -1,
                      "managed_printers": -1
                    },
                    "features": [
                      "Unlimited managed clients, printers and drivers",
                      "Printer and driver discovery on every agent",
                      "Managed printer deployment with driver packages",
                      "ICMP and SNMP monitoring with supply levels",
                      "Automatic driver packaging, shared across your customers",
                      "Full audit trail",
                      "Only devices seen in the last 60 days are billed",
                      "Cancel at any time"
                    ]
                  },
                  "currency": "USD",
                  "billing_enabled": true,
                  "active_window_days": 60,
                  "trial": {
                    "days": 30,
                    "max_agents": 20
                  },
                  "account": {
                    "name": "Northgate Managed IT",
                    "email": "sam.patel@northgate-it.example",
                    "plan": "standard",
                    "billing_status": "active",
                    "trial_ends_at": "2026-03-16T15:04:09Z",
                    "has_payment_setup": true,
                    "agent_count": 47,
                    "active_agent_count": 42
                  },
                  "subscription": {
                    "status": "active",
                    "quantity": 42,
                    "unit_amount": 100,
                    "base_amount": 2500,
                    "has_agent_item": true,
                    "has_base_item": true,
                    "currency": "usd",
                    "current_period_end": "2026-12-14T15:04:09Z",
                    "cancel_at_period_end": false,
                    "trial_end": null,
                    "ended_reason": "",
                    "updated_at": "2026-11-14T15:04:12Z"
                  },
                  "projected": {
                    "base_amount": 2500,
                    "unit_amount": 100,
                    "active_agents": 42,
                    "enrolled_agents": 47,
                    "active_window_days": 60,
                    "seats": 42,
                    "monthly_total": 6700,
                    "display": "$67.00"
                  },
                  "pending_device_removals": 0
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/billing/portal": {
      "post": {
        "operationId": "createBillingPortalSession",
        "tags": [
          "Billing"
        ],
        "summary": "Open the Stripe billing portal",
        "description": "Requires the admin role. Returns a link into Stripe's portal for payment methods and invoices. 409 until the account has a Stripe customer.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "return_path": {
                    "type": "string",
                    "description": "App path to return to. Default `/settings/billing`."
                  },
                  "flow": {
                    "type": "string",
                    "description": "`payment_method_update` opens the card form; other values are ignored.",
                    "enum": [
                      "payment_method_update"
                    ]
                  }
                }
              },
              "example": {
                "return_path": "/settings/billing",
                "flow": "payment_method_update"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Portal session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPortalSession"
                },
                "example": {
                  "url": "https://billing.stripe.com/p/session/test_YWNjdF9leGFtcGxl"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "description": "Stripe did not accept the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing is not configured on this deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/entitlements": {
      "get": {
        "operationId": "getEntitlements",
        "tags": [
          "Billing"
        ],
        "summary": "Get plan limits and usage",
        "description": "The plan, limits and status the API enforces, with usage counts refreshed live.",
        "responses": {
          "200": {
            "description": "Resolved entitlements.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entitlements"
                },
                "example": {
                  "tenant_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                  "plan_id": "standard",
                  "plan_name": "PrintCtrl",
                  "status": "active",
                  "seats": 42,
                  "agent_count": 47,
                  "enrolled_agents": 47,
                  "active_agents": 42,
                  "active_window_days": 60,
                  "base_amount": 2500,
                  "unit_amount": 100,
                  "currency": "USD",
                  "monthly_total": 6700,
                  "limits": {
                    "agents": -1,
                    "customers": -1,
                    "users": -1,
                    "managed_printers": -1
                  },
                  "usage": {
                    "agents": 47,
                    "customers": 2,
                    "users": 4,
                    "managed_printers": 3
                  },
                  "trial": false,
                  "subscribed": true,
                  "cancel_at_period_end": false,
                  "current_period_end": "2026-12-14T15:04:09Z",
                  "read_only": false,
                  "locked": false,
                  "billing_enabled": true,
                  "resolved_at": "2026-11-20T09:14:03Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": [
          "Billing"
        ],
        "summary": "List public plans",
        "security": [],
        "description": "The public pricing table. No authentication.",
        "responses": {
          "200": {
            "description": "Plans and trial terms.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPlanList"
                },
                "example": {
                  "plans": [
                    {
                      "id": "standard",
                      "name": "PrintCtrl",
                      "description": "$25.00 a month, plus $1.00 per active device up to 500, $0.90 each from 501 to 2,000, and $0.80 each from 2,001.",
                      "per_seat": true,
                      "seat_label": "device",
                      "base_amount": 2500,
                      "unit_amount": 100,
                      "currency": "USD",
                      "interval": "month",
                      "limits": {
                        "agents": -1,
                        "customers": -1,
                        "users": -1,
                        "managed_printers": -1
                      },
                      "features": [
                        "Unlimited managed clients, printers and drivers",
                        "Printer and driver discovery on every agent",
                        "Managed printer deployment with driver packages",
                        "ICMP and SNMP monitoring with supply levels",
                        "Automatic driver packaging, shared across your customers",
                        "Full audit trail",
                        "Only devices seen in the last 60 days are billed",
                        "Cancel at any time"
                      ],
                      "display_price": "$25.00",
                      "price_suffix": "per month + $1.00 per active device up to 500, $0.90 each from 501 to 2,000, and $0.80 each from 2,001"
                    }
                  ],
                  "currency": "USD",
                  "trial": {
                    "days": 30,
                    "max_agents": 20,
                    "card_required": false,
                    "description": "30 days, up to 20 devices, no card required.",
                    "features": [
                      "Full product for 30 days",
                      "Up to 20 devices",
                      "Unlimited managed clients, printers and drivers",
                      "Printer and driver discovery on every agent",
                      "Managed printer deployment with driver packages",
                      "ICMP and SNMP monitoring with supply levels",
                      "Automatic driver packaging, shared across your customers"
                    ]
                  },
                  "active_window_days": 60,
                  "billing_enabled": true
                }
              }
            }
          }
        }
      }
    },
    "/audit/events": {
      "get": {
        "operationId": "listAuditEvents",
        "tags": [
          "Activity"
        ],
        "summary": "List audit events",
        "description": "Newest first, keyset-paginated with `cursor`. Any role can read the JSON list; `format=csv` requires the admin role and streams every matching event (up to 100,000) as a CSV attachment.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "actor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "user",
                "agent",
                "system"
              ]
            }
          },
          {
            "name": "actor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact match, or a prefix when it ends in a dot (e.g. `printer.`)."
          },
          {
            "name": "object_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "object_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive match on object label, detail or actor label."
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only the last N days."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339. Overrides `days`. Unparseable values are ignored."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339. Unparseable values are ignored."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`next_cursor` from the previous page. Ignored for CSV."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            },
            "description": "Values above 500 use 500; missing, zero or negative values use 100. Ignored for CSV."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv"
              ]
            },
            "description": "`csv` returns a CSV download (admin only)."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events, or a CSV file when `format=csv`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEventPage"
                },
                "example": {
                  "events": [
                    {
                      "id": "f4a1c8e3-6b2d-4d95-8e07-2c9b5a1f3d68",
                      "occurred_at": "2026-11-20T09:14:03Z",
                      "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
                      "actor_type": "user",
                      "actor_id": "1b6d9f42-7a3e-4c85-b0d2-6e8a4f1c3b97",
                      "actor_label": "Sam Patel",
                      "event_type": "printer.assigned",
                      "object_type": "managed_printer",
                      "object_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "object_label": "HM-Reception",
                      "changes": {
                        "group": {
                          "old": null,
                          "new": "Sheffield office"
                        }
                      },
                      "detail": "Assigned to group Sheffield office",
                      "customer_name": "Halden Manufacturing",
                      "agent_name": "SHF-WS-204"
                    }
                  ],
                  "next_cursor": "MjAyNi0xMS0yMFQwOToxNDowM1p8ZjRhMWM4ZTM",
                  "has_more": true,
                  "limit": 50,
                  "event_types": [
                    "billing.checkout.started",
                    "printer.assigned",
                    "support.requested",
                    "user.invited"
                  ]
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string",
                  "description": "UTF-8 with a byte-order mark; served as an attachment named `audit-YYYY-MM-DD.csv`. Columns: When, Event, Performed by, Actor type, Object, Object type, Customer, Detail. Cells starting with = + - @ are prefixed with an apostrophe."
                },
                "example": "When,Event,Performed by,Actor type,Object,Object type,Customer,Detail\n2026-11-20T09:14:03Z,printer.assigned,Sam Patel,user,HM-Reception,managed_printer,Halden Manufacturing,Assigned to group Sheffield office\n"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/dashboard/summary": {
      "get": {
        "operationId": "getDashboardSummary",
        "tags": [
          "Activity"
        ],
        "summary": "Get the dashboard summary",
        "description": "Counts, a 30-day deployment trend and short lists of what needs attention, in one call.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Narrow to one customer (driver package counts stay account-wide)."
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone for the trend's calendar days. Invalid values use UTC."
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummary"
                },
                "example": {
                  "agents": {
                    "total": 47,
                    "online": 44,
                    "offline": 3,
                    "seen_today": 45
                  },
                  "customers": {
                    "total": 2
                  },
                  "printers": {
                    "total": 96,
                    "managed": 71,
                    "shared": 12,
                    "distinct_drivers": 5
                  },
                  "managed_printers": {
                    "total": 3,
                    "active": 3,
                    "self_service": 1
                  },
                  "deployments": {
                    "total": 74,
                    "pending": 1,
                    "installing": 0,
                    "installed": 71,
                    "failed": 2,
                    "removing": 0,
                    "removed": 0
                  },
                  "monitors": {
                    "total": 3,
                    "up": 2,
                    "down": 1,
                    "unknown": 0
                  },
                  "supplies": {
                    "tracked": 14,
                    "low": 2,
                    "critical": 0,
                    "threshold": 15
                  },
                  "driver_packages": {
                    "total": 2,
                    "published": 1,
                    "verified": 2
                  },
                  "deployment_trend": [
                    {
                      "day": "2026-11-19",
                      "installed": 3,
                      "failed": 0,
                      "total_installed": 69
                    },
                    {
                      "day": "2026-11-20",
                      "installed": 2,
                      "failed": 1,
                      "total_installed": 71
                    }
                  ],
                  "recent_events": [
                    {
                      "id": "f4a1c8e3-6b2d-4d95-8e07-2c9b5a1f3d68",
                      "occurred_at": "2026-11-20T09:14:03Z",
                      "event_type": "printer.assigned",
                      "actor_type": "user",
                      "actor_label": "Sam Patel",
                      "object_type": "managed_printer",
                      "object_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
                      "object_label": "HM-Reception",
                      "detail": "Assigned to group Sheffield office",
                      "customer_name": "Halden Manufacturing"
                    }
                  ],
                  "offline_agents": [
                    {
                      "id": "2a7f5c98-4e1b-4d3a-9c62-7b0e8d1f6a45",
                      "hostname": "RGL-LT-031",
                      "customer_name": "Redgate Legal",
                      "last_seen": "2026-11-19T17:42:08Z",
                      "version": "1.14.2"
                    }
                  ],
                  "down_monitors": [
                    {
                      "id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
                      "host_address": "10.40.0.22",
                      "printer_name": "HM-Goods-In",
                      "agent_hostname": "SHF-WS-204",
                      "last_change_at": "2026-11-20T08:46:12Z",
                      "consecutive_failures": 24
                    }
                  ],
                  "attention": [
                    {
                      "kind": "monitor_down",
                      "id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
                      "label": "HM-Goods-In",
                      "detail": "10.40.0.22",
                      "since": "2026-11-20T08:46:12Z"
                    }
                  ],
                  "slowest_agents": [
                    {
                      "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
                      "name": "SHF-WS-117",
                      "customer_name": "Halden Manufacturing",
                      "status": "online",
                      "perf": {
                        "scan_ms": 4120
                      }
                    }
                  ],
                  "agents_online_now": 44
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/dashboard/overview": {
      "get": {
        "operationId": "getDashboardOverview",
        "tags": [
          "Activity"
        ],
        "summary": "Get the dashboard overview",
        "description": "What needs attention, fleet health counts, per-customer issues and agent versions, in one call.",
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Narrow to one customer. `customers` and `healthy_customers` are then empty; `customer_total` stays account-wide."
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard overview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardOverview"
                },
                "example": {
                  "devices": {
                    "total": 47,
                    "online": 44,
                    "offline_recent": 2,
                    "offline_stale": 1
                  },
                  "printers": {
                    "up": 31,
                    "down": 1,
                    "unmonitored": 6
                  },
                  "supplies": {
                    "ok": 52,
                    "low": 2,
                    "out": 0
                  },
                  "deployments": {
                    "installed": 71,
                    "waiting": 1,
                    "in_progress": 0,
                    "failed": 2,
                    "user_removed": 0
                  },
                  "attention": [
                    {
                      "kind": "printer_down",
                      "rank": 1,
                      "id": "e2c7a9f4-5b1d-4e83-a6f0-9d3b7c1e5a28",
                      "label": "HM-Goods-In",
                      "detail": "10.40.0.22",
                      "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "customer_name": "Halden Manufacturing",
                      "since": "2026-11-20T08:46:12Z",
                      "printer_id": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17"
                    },
                    {
                      "kind": "device_offline",
                      "rank": 5,
                      "id": "2a7f5c98-4e1b-4d3a-9c62-7b0e8d1f6a45",
                      "label": "RGL-LT-031",
                      "detail": "RGL-LT-031",
                      "customer_id": "b84d2f17-6c3e-4a91-8f5b-0d6e9a2c7b15",
                      "customer_name": "Redgate Legal",
                      "since": "2026-11-18T17:42:08Z",
                      "agent_id": "2a7f5c98-4e1b-4d3a-9c62-7b0e8d1f6a45"
                    }
                  ],
                  "attention_counts": {
                    "printer_down": 1,
                    "deploy_failed": 2,
                    "device_offline": 1
                  },
                  "attention_total": 4,
                  "customers": [
                    {
                      "id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
                      "name": "Halden Manufacturing",
                      "printers_down": 1,
                      "deploy_failed": 2,
                      "devices_offline": 0,
                      "supplies_low": 2,
                      "issues": 5
                    }
                  ],
                  "healthy_customers": [],
                  "customer_total": 2,
                  "versions": [
                    {
                      "version": "1.4.2",
                      "count": 45
                    },
                    {
                      "version": "1.4.1",
                      "count": 2
                    }
                  ],
                  "latest_version": "1.4.2",
                  "older_versions": [
                    "1.4.1"
                  ],
                  "older_devices": 2,
                  "generated_at": "2026-11-20T09:15:00Z",
                  "low_threshold": 15,
                  "forecast_horizon_days": 14
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/dashboard/trends": {
      "get": {
        "operationId": "getDashboardTrends",
        "tags": [
          "Activity"
        ],
        "summary": "Get the dashboard trends",
        "description": "Pages printed, deployment outcomes and alerts per day over the last 7, 30 or 90 days, with the period before for comparison.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                90
              ],
              "default": 30
            },
            "description": "Period length. Other values use 30."
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone for the calendar days. Invalid values use UTC."
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Narrow to one customer."
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard trends.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardTrends"
                },
                "example": {
                  "days": 7,
                  "pages_source": "counters",
                  "current": [
                    {
                      "day": "2026-11-14",
                      "pages": 812,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 1
                    },
                    {
                      "day": "2026-11-15",
                      "pages": 0,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-16",
                      "pages": 0,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-17",
                      "pages": 1904,
                      "installed": 2,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-18",
                      "pages": 2210,
                      "installed": 1,
                      "failed": 1,
                      "alerts": 2
                    },
                    {
                      "day": "2026-11-19",
                      "pages": 1987,
                      "installed": 3,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-20",
                      "pages": 640,
                      "installed": 2,
                      "failed": 1,
                      "alerts": 1
                    }
                  ],
                  "previous": [
                    {
                      "day": "2026-11-07",
                      "pages": 1712,
                      "installed": 1,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-08",
                      "pages": 0,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-09",
                      "pages": 0,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-10",
                      "pages": 2045,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 1
                    },
                    {
                      "day": "2026-11-11",
                      "pages": 1876,
                      "installed": 4,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-12",
                      "pages": 2120,
                      "installed": 0,
                      "failed": 0,
                      "alerts": 0
                    },
                    {
                      "day": "2026-11-13",
                      "pages": 1958,
                      "installed": 1,
                      "failed": 0,
                      "alerts": 1
                    }
                  ],
                  "pages": {
                    "current": 7553,
                    "previous": 9711
                  },
                  "alerts": {
                    "current": 4,
                    "previous": 2
                  },
                  "success": {
                    "current": 0.8,
                    "previous": 1
                  },
                  "installed": {
                    "current": 8,
                    "previous": 6
                  },
                  "failed": {
                    "current": 2,
                    "previous": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "API client id (`pck_…`) as the username and client secret (`pcs_…`) as the password."
      }
    },
    "parameters": {
      "cid": {
        "name": "cid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Customer id.",
        "example": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68"
      },
      "aid": {
        "name": "aid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Computer (agent) id.",
        "example": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37"
      },
      "gid": {
        "name": "gid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Group id.",
        "example": "4d8e1b6a-3c5f-4e72-9a10-7b2c5e8f1d36"
      },
      "pid": {
        "name": "pid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Discovered printer (queue) id.",
        "example": "8b5e2f64-1c7a-4d93-9e05-4a6b3c8d2f17"
      },
      "mid": {
        "name": "mid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Managed printer id.",
        "example": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request body or parameters were not valid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "name is required"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, wrong or revoked client credentials.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "invalid client credentials",
              "suggestion": "Send the client id and secret with HTTP Basic authentication."
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "A plan limit was reached, or the account is read only or locked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "The free trial is limited to 20 devices.",
              "suggestion": "Add a card in Settings → Billing to remove the limit.",
              "limit": "agents",
              "current": 20,
              "maximum": 20,
              "upgrade_required": true,
              "current_plan": "Trial",
              "plan_id": "trial",
              "status": "trialing"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Your client's role cannot do this.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "insufficient permissions",
              "suggestion": "This action requires a higher role. Ask an administrator of your organization."
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found, or it belongs to another account.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "customer not found"
            }
          }
        }
      },
      "Conflict": {
        "description": "The action conflicts with the current state.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "that customer is inactive"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The upload is too large.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "the file is larger than 25 MB"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limited. Wait for the number of seconds in `Retry-After`.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "rate limit exceeded",
              "retry_after": 1
            }
          }
        }
      },
      "MachineError": {
        "description": "The computer, or an upstream service, reported a failure.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "the machine could not complete the request"
            }
          }
        }
      },
      "Offline": {
        "description": "The computer the action needs is not connected. The action is not queued; try again when it is back.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "that machine is not connected"
            }
          }
        }
      },
      "Timeout": {
        "description": "The computer did not answer in time.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "the machine did not answer in time"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong."
          },
          "suggestion": {
            "type": "string",
            "description": "What to do about it."
          },
          "code": {
            "type": "string",
            "description": "A stable machine-readable code, on some errors."
          },
          "upgrade_required": {
            "type": "boolean",
            "description": "On 402: the plan or billing state blocks this."
          },
          "read_only": {
            "type": "boolean",
            "description": "On 402: the account is read only; writes are refused."
          },
          "locked": {
            "type": "boolean",
            "description": "On 402: the account is locked; every request is refused."
          },
          "limit": {
            "type": "string",
            "description": "On 402 from a create: which limit was reached."
          },
          "current": {
            "type": "integer",
            "description": "On 402 from a create: how many you have."
          },
          "maximum": {
            "type": "integer",
            "description": "On 402 from a create: how many your plan allows."
          },
          "current_plan": {
            "type": "string",
            "description": "On 402: your plan's name."
          },
          "plan_id": {
            "type": "string",
            "description": "On 402: your plan's id."
          },
          "status": {
            "type": "string",
            "description": "On 402: the subscription status."
          },
          "retry_after": {
            "type": "integer",
            "description": "On 429: seconds to wait."
          }
        }
      },
      "User": {
        "type": "object",
        "description": "A person on the team (a platform user). When the caller is an API client, GET /me returns the client's principal in this shape: `id` is the API client row id, `email` holds the client id (`pck_...`), `status` is always `active`, `mfa_enabled` is false and the optional timestamps are absent.",
        "required": [
          "id",
          "platform_customer_id",
          "name",
          "email",
          "role",
          "status",
          "mfa_enabled",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "description": "Account (tenant) id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "Email address. For an API client principal this is the client id."
          },
          "role": {
            "type": "string",
            "enum": [
              "super_admin",
              "admin",
              "editor",
              "viewer"
            ]
          },
          "status": {
            "type": "string",
            "description": "`invited` until the invite is accepted.",
            "enum": [
              "active",
              "invited",
              "suspended"
            ]
          },
          "mfa_enabled": {
            "type": "boolean"
          },
          "mfa_enrolled_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once two-factor authentication is set up."
          },
          "password_changed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once a password has been set."
          },
          "last_login_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present after the first sign-in."
          },
          "email_verified_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once the address is verified."
          },
          "invite_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present on list and read responses (and on create) while an invite is pending."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "id": "1b6d9f42-7a3e-4c85-b0d2-6e8a4f1c3b97",
          "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
          "name": "Sam Patel",
          "email": "sam.patel@northgate-it.example",
          "role": "admin",
          "status": "active",
          "mfa_enabled": true,
          "mfa_enrolled_at": "2026-03-02T10:41:17Z",
          "password_changed_at": "2026-03-02T10:38:55Z",
          "last_login_at": "2026-11-20T08:52:40Z",
          "email_verified_at": "2026-02-14T15:06:21Z",
          "created_at": "2026-02-14T15:04:09Z",
          "updated_at": "2026-11-20T08:52:40Z"
        }
      },
      "UserInput": {
        "type": "object",
        "required": [
          "name",
          "email"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name. Trimmed."
          },
          "email": {
            "type": "string",
            "description": "Lowercased and trimmed; must look like an email address.",
            "format": "email"
          },
          "role": {
            "type": "string",
            "description": "Defaults to `viewer`. Cannot be above the caller's own role.",
            "enum": [
              "super_admin",
              "admin",
              "editor",
              "viewer"
            ],
            "default": "viewer"
          }
        },
        "example": {
          "name": "Jordan Reyes",
          "email": "jordan.reyes@northgate-it.example",
          "role": "editor"
        }
      },
      "UserUpdate": {
        "type": "object",
        "description": "Every field is optional; send only what changes.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Cannot be blank."
          },
          "role": {
            "type": "string",
            "description": "Cannot be above the caller's own role. Callers cannot change their own role.",
            "enum": [
              "super_admin",
              "admin",
              "editor",
              "viewer"
            ]
          },
          "status": {
            "type": "string",
            "description": "Suspending revokes the member's sessions at once. Not allowed while the member is still `invited`.",
            "enum": [
              "active",
              "suspended"
            ]
          }
        },
        "example": {
          "role": "admin"
        }
      },
      "AccountTenant": {
        "type": "object",
        "description": "The account (MSP tenant) record.",
        "required": [
          "id",
          "name",
          "slug",
          "email",
          "plan",
          "status",
          "trial_notified",
          "onboarding_step",
          "billing_status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "Account contact email."
          },
          "plan": {
            "type": "string",
            "examples": [
              "trial",
              "standard"
            ]
          },
          "status": {
            "type": "string"
          },
          "trial_ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absent when there is no trial end date."
          },
          "trial_notified": {
            "type": "boolean"
          },
          "onboarding_step": {
            "type": "string"
          },
          "stripe_customer_id": {
            "type": "string",
            "description": "Stripe customer id. Absent until checkout has run."
          },
          "billing_status": {
            "type": "string"
          },
          "entitlement_overrides": {
            "type": "object",
            "description": "Operator-set overrides. Absent when none.",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountTrial": {
        "type": "object",
        "required": [
          "plan",
          "on_trial"
        ],
        "properties": {
          "plan": {
            "type": "string"
          },
          "on_trial": {
            "type": "boolean",
            "description": "True when the plan is `trial`."
          },
          "trial_ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "Only present when the account has a trial end date."
          },
          "days_left": {
            "type": "integer",
            "description": "Whole days left, never below 0. Only present with `trial_ends_at`."
          },
          "expired": {
            "type": "boolean",
            "description": "Only present with `trial_ends_at`."
          }
        }
      },
      "Me": {
        "type": "object",
        "required": [
          "user",
          "timezone",
          "account_timezone"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "tenant": {
            "$ref": "#/components/schemas/AccountTenant",
            "description": "Omitted if the account record could not be read."
          },
          "trial": {
            "$ref": "#/components/schemas/AccountTrial",
            "description": "Omitted with `tenant`."
          },
          "timezone": {
            "type": "string",
            "description": "The caller's own IANA timezone, empty when unset. Always empty for an API client."
          },
          "account_timezone": {
            "type": "string",
            "description": "Account default timezone: the first owner's, or UTC."
          },
          "is_account_owner": {
            "type": "boolean",
            "description": "Whether the caller is the first owner. Always false for an API client."
          },
          "recovery_codes_remaining": {
            "type": "integer",
            "description": "Unused MFA recovery codes. Only present when `user.mfa_enabled` is true, so never for an API client."
          }
        }
      },
      "Entitlements": {
        "type": "object",
        "description": "Resolved plan, limits and usage. A limit of -1 means unlimited.",
        "required": [
          "tenant_id",
          "plan_id",
          "plan_name",
          "status",
          "seats",
          "agent_count",
          "enrolled_agents",
          "active_agents",
          "active_window_days",
          "base_amount",
          "unit_amount",
          "currency",
          "monthly_total",
          "limits",
          "usage",
          "trial",
          "subscribed",
          "cancel_at_period_end",
          "read_only",
          "locked",
          "billing_enabled",
          "resolved_at"
        ],
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "plan_id": {
            "type": "string",
            "examples": [
              "trial",
              "standard"
            ]
          },
          "plan_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "trialing",
              "active",
              "past_due",
              "cancelled",
              "suspended",
              "expired",
              "pending",
              "unbilled"
            ]
          },
          "seats": {
            "type": "integer",
            "description": "Agent quantity Stripe is billing for."
          },
          "agent_count": {
            "type": "integer",
            "description": "Every enrolled (non-deleted) agent."
          },
          "enrolled_agents": {
            "type": "integer",
            "description": "Same as `agent_count`."
          },
          "active_agents": {
            "type": "integer",
            "description": "Agents seen within `active_window_days`."
          },
          "active_window_days": {
            "type": "integer"
          },
          "base_amount": {
            "type": "integer",
            "description": "Flat fee per interval, minor units."
          },
          "unit_amount": {
            "type": "integer",
            "description": "The price per device at the account's current active count, in minor units."
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceTier"
            },
            "description": "The per-device price by band.",
            "example": [
              {
                "up_to": 500,
                "unit_amount": 100
              },
              {
                "up_to": 2000,
                "unit_amount": 90
              },
              {
                "up_to": 0,
                "unit_amount": 80
              }
            ]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217, upper case."
          },
          "monthly_total": {
            "type": "integer",
            "description": "base_amount + unit_amount x active_agents, minor units."
          },
          "limits": {
            "type": "object",
            "description": "Ceilings by kind; -1 is unlimited.",
            "properties": {
              "agents": {
                "type": "integer"
              },
              "customers": {
                "type": "integer"
              },
              "users": {
                "type": "integer"
              },
              "managed_printers": {
                "type": "integer"
              }
            },
            "additionalProperties": {
              "type": "integer"
            }
          },
          "usage": {
            "type": "object",
            "description": "Current counts by kind. GET /entitlements refreshes these live.",
            "properties": {
              "agents": {
                "type": "integer"
              },
              "customers": {
                "type": "integer"
              },
              "users": {
                "type": "integer"
              },
              "managed_printers": {
                "type": "integer"
              }
            },
            "additionalProperties": {
              "type": "integer"
            }
          },
          "trial": {
            "type": "boolean"
          },
          "trial_ends_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted when not set."
          },
          "trial_days_left": {
            "type": "integer",
            "description": "Omitted when not set."
          },
          "subscribed": {
            "type": "boolean"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted when not set."
          },
          "read_only": {
            "type": "boolean",
            "description": "Writes are refused (402)."
          },
          "read_only_reason": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "locked": {
            "type": "boolean",
            "description": "Everything but billing is refused (402)."
          },
          "locked_reason": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "first_charge_at": {
            "type": "string",
            "format": "date-time",
            "description": "Set while a subscription is in its Stripe trial."
          },
          "billing_enabled": {
            "type": "boolean",
            "description": "False on a deployment without Stripe; nothing is gated then."
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "tenant_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
          "plan_id": "standard",
          "plan_name": "PrintCtrl",
          "status": "active",
          "seats": 42,
          "agent_count": 47,
          "enrolled_agents": 47,
          "active_agents": 42,
          "active_window_days": 60,
          "base_amount": 2500,
          "unit_amount": 100,
          "currency": "USD",
          "monthly_total": 6700,
          "limits": {
            "agents": -1,
            "customers": -1,
            "users": -1,
            "managed_printers": -1
          },
          "usage": {
            "agents": 47,
            "customers": 2,
            "users": 4,
            "managed_printers": 3
          },
          "trial": false,
          "subscribed": true,
          "cancel_at_period_end": false,
          "current_period_end": "2026-12-14T15:04:09Z",
          "read_only": false,
          "locked": false,
          "billing_enabled": true,
          "resolved_at": "2026-11-20T09:14:03Z"
        }
      },
      "Plan": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "per_seat",
          "seat_label",
          "base_amount",
          "unit_amount",
          "currency",
          "interval",
          "limits",
          "features"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "standard",
              "trial"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "per_seat": {
            "type": "boolean"
          },
          "seat_label": {
            "type": "string"
          },
          "base_amount": {
            "type": "integer",
            "description": "Flat fee per interval, minor units."
          },
          "unit_amount": {
            "type": "integer",
            "description": "The first band's price per device per month, in minor units."
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceTier"
            },
            "description": "The per-device price by band.",
            "example": [
              {
                "up_to": 500,
                "unit_amount": 100
              },
              {
                "up_to": 2000,
                "unit_amount": 90
              },
              {
                "up_to": 0,
                "unit_amount": 80
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "examples": [
              "month"
            ]
          },
          "limits": {
            "type": "object",
            "description": "-1 is unlimited.",
            "properties": {
              "agents": {
                "type": "integer"
              },
              "customers": {
                "type": "integer"
              },
              "users": {
                "type": "integer"
              },
              "managed_printers": {
                "type": "integer"
              }
            },
            "additionalProperties": {
              "type": "integer"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "display_price": {
            "type": "string",
            "description": "Formatted base price. Only in GET /plans."
          },
          "price_suffix": {
            "type": "string",
            "description": "Only in GET /plans."
          }
        },
        "example": {
          "id": "standard",
          "name": "PrintCtrl",
          "description": "$25.00 a month, plus $1.00 per active device up to 500, $0.90 each from 501 to 2,000, and $0.80 each from 2,001.",
          "per_seat": true,
          "seat_label": "device",
          "base_amount": 2500,
          "unit_amount": 100,
          "currency": "USD",
          "interval": "month",
          "limits": {
            "agents": -1,
            "customers": -1,
            "users": -1,
            "managed_printers": -1
          },
          "features": [
            "Unlimited managed clients, printers and drivers",
            "Printer and driver discovery on every agent",
            "Managed printer deployment with driver packages",
            "ICMP and SNMP monitoring with supply levels",
            "Automatic driver packaging, shared across your customers",
            "Full audit trail",
            "Only devices seen in the last 60 days are billed",
            "Cancel at any time"
          ]
        }
      },
      "BillingPlanList": {
        "type": "object",
        "required": [
          "plans",
          "currency",
          "trial",
          "active_window_days",
          "billing_enabled"
        ],
        "properties": {
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "currency": {
            "type": "string"
          },
          "trial": {
            "type": "object",
            "required": [
              "days",
              "max_agents",
              "card_required",
              "description",
              "features"
            ],
            "properties": {
              "days": {
                "type": "integer"
              },
              "max_agents": {
                "type": "integer"
              },
              "card_required": {
                "type": "boolean",
                "description": "Always false."
              },
              "description": {
                "type": "string"
              },
              "features": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "active_window_days": {
            "type": "integer"
          },
          "billing_enabled": {
            "type": "boolean"
          }
        }
      },
      "BillingSubscription": {
        "type": "object",
        "required": [
          "status",
          "quantity",
          "unit_amount",
          "base_amount",
          "has_agent_item",
          "has_base_item",
          "currency",
          "current_period_end",
          "cancel_at_period_end",
          "trial_end",
          "ended_reason",
          "updated_at"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "unit_amount": {
            "type": "integer",
            "description": "The mirrored per-device amount of a flat Stripe price, in minor units; 0 for a tiered price, where the bands apply."
          },
          "base_amount": {
            "type": "integer"
          },
          "has_agent_item": {
            "type": "boolean"
          },
          "has_base_item": {
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "trial_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_reason": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingOverview": {
        "type": "object",
        "required": [
          "entitlements",
          "plan",
          "currency",
          "billing_enabled",
          "active_window_days",
          "trial",
          "account",
          "subscription",
          "projected"
        ],
        "properties": {
          "entitlements": {
            "$ref": "#/components/schemas/Entitlements"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "currency": {
            "type": "string"
          },
          "billing_enabled": {
            "type": "boolean"
          },
          "active_window_days": {
            "type": "integer"
          },
          "trial": {
            "type": "object",
            "required": [
              "days",
              "max_agents"
            ],
            "properties": {
              "days": {
                "type": "integer"
              },
              "max_agents": {
                "type": "integer"
              }
            }
          },
          "account": {
            "type": "object",
            "required": [
              "name",
              "email",
              "plan",
              "billing_status",
              "trial_ends_at",
              "has_payment_setup",
              "agent_count",
              "active_agent_count"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "plan": {
                "type": "string"
              },
              "billing_status": {
                "type": "string"
              },
              "trial_ends_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "has_payment_setup": {
                "type": "boolean"
              },
              "agent_count": {
                "type": "integer"
              },
              "active_agent_count": {
                "type": "integer"
              }
            }
          },
          "subscription": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BillingSubscription"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when there is no subscription."
          },
          "projected": {
            "type": "object",
            "required": [
              "base_amount",
              "unit_amount",
              "active_agents",
              "enrolled_agents",
              "active_window_days",
              "seats",
              "monthly_total",
              "display"
            ],
            "properties": {
              "base_amount": {
                "type": "integer"
              },
              "unit_amount": {
                "type": "integer",
                "description": "The price per device at the account's current active count, in minor units."
              },
              "tiers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceTier"
                },
                "description": "The per-device price by band.",
                "example": [
                  {
                    "up_to": 500,
                    "unit_amount": 100
                  },
                  {
                    "up_to": 2000,
                    "unit_amount": 90
                  },
                  {
                    "up_to": 0,
                    "unit_amount": 80
                  }
                ]
              },
              "active_agents": {
                "type": "integer"
              },
              "enrolled_agents": {
                "type": "integer"
              },
              "active_window_days": {
                "type": "integer"
              },
              "seats": {
                "type": "integer"
              },
              "monthly_total": {
                "type": "integer",
                "description": "Minor units."
              },
              "display": {
                "type": "string",
                "description": "Formatted total."
              }
            }
          },
          "pending_device_removals": {
            "type": "integer",
            "description": "Devices told to remove PrintCtrl that have not been back since. Omitted if the count failed."
          }
        }
      },
      "BillingCard": {
        "type": "object",
        "required": [
          "brand",
          "last4",
          "kind"
        ],
        "properties": {
          "brand": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "exp_month": {
            "type": "integer",
            "description": "Omitted for non-card methods."
          },
          "exp_year": {
            "type": "integer",
            "description": "Omitted for non-card methods."
          },
          "kind": {
            "type": "string",
            "description": "Stripe payment method type.",
            "examples": [
              "card",
              "us_bank_account",
              "link"
            ]
          }
        }
      },
      "BillingInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "amount_due": {
            "type": "integer"
          },
          "amount_paid": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "period_start": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "period_end": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "hosted_invoice_url": {
            "type": "string"
          },
          "invoice_pdf": {
            "type": "string"
          },
          "billing_reason": {
            "type": "string"
          }
        }
      },
      "BillingUpcomingInvoice": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "subtotal": {
            "type": "integer"
          },
          "tax": {
            "type": "integer"
          },
          "amount_due": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "next_payment_attempt": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "period_end": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer"
                },
                "proration": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "BillingDetails": {
        "type": "object",
        "description": "What Stripe holds for the account. On a deployment without Stripe the body is only `{card: null, invoices: [], upcoming: null, billing_enabled: false}`.",
        "required": [
          "card",
          "invoices",
          "upcoming"
        ],
        "properties": {
          "card": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BillingCard"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillingInvoice"
            }
          },
          "upcoming": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BillingUpcomingInvoice"
              },
              {
                "type": "null"
              }
            ]
          },
          "billing_email": {
            "type": "string",
            "description": "Absent when billing is disabled."
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absent when billing is disabled."
          },
          "partial": {
            "type": "boolean",
            "description": "True when one of the Stripe reads failed. Absent when billing is disabled."
          },
          "billing_enabled": {
            "type": "boolean",
            "description": "Only present (as false) when billing is disabled."
          }
        }
      },
      "BillingCheckoutSession": {
        "type": "object",
        "required": [
          "url",
          "session_id",
          "quantity"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Stripe Checkout URL to send the buyer to.",
            "format": "uri"
          },
          "session_id": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "description": "Active agents billed from day one (may be 0)."
          }
        }
      },
      "BillingPortalSession": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Stripe billing portal URL.",
            "format": "uri"
          }
        }
      },
      "AlertFact": {
        "type": "object",
        "required": [
          "label",
          "value"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "Alert": {
        "type": "object",
        "required": [
          "id",
          "customer_id",
          "kind",
          "subject_id",
          "subject_label",
          "severity",
          "state",
          "title",
          "summary",
          "facts",
          "link",
          "opened_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string"
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "kind": {
            "type": "string",
            "enum": [
              "printer_down",
              "supply_low",
              "deployment_failed",
              "printer_error"
            ]
          },
          "subject_id": {
            "type": "string",
            "description": "Id of the thing alerting (monitor, supply, deployment...)."
          },
          "subject_label": {
            "type": "string"
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "severity": {
            "type": "string",
            "examples": [
              "critical",
              "warning"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "facts": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AlertFact"
            }
          },
          "link": {
            "type": "string",
            "description": "Deep link into the app."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once resolved."
          },
          "notified_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once someone was told."
          },
          "resolve_notified_at": {
            "type": "string",
            "format": "date-time",
            "description": "Present once the resolution was sent."
          },
          "last_delivery_ok": {
            "type": "boolean",
            "description": "Result of the latest delivery attempt. Omitted when there was none."
          },
          "last_delivery_error": {
            "type": "string",
            "description": "Omitted when empty."
          }
        },
        "example": {
          "id": "0c7e4b29-8f1a-4d63-b5e2-9a3d6c1f8e47",
          "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
          "customer_name": "Halden Manufacturing",
          "kind": "printer_down",
          "subject_id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
          "subject_label": "HM-Goods-In",
          "managed_printer_id": "e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
          "severity": "critical",
          "state": "open",
          "title": "HM-Goods-In is not responding",
          "summary": "No reply to ICMP or SNMP from 10.40.0.22 for 12 minutes.",
          "facts": [
            {
              "label": "Address",
              "value": "10.40.0.22"
            },
            {
              "label": "Watched from",
              "value": "SHF-WS-204"
            }
          ],
          "link": "https://app.printctrl.io/monitoring?printer=e17b4d82-5a9c-4f30-b6e8-1c2d7a9f3b54",
          "opened_at": "2026-11-20T08:58:41Z",
          "notified_at": "2026-11-20T08:58:44Z",
          "last_delivery_ok": true
        }
      },
      "AlertList": {
        "type": "object",
        "required": [
          "alerts",
          "total"
        ],
        "properties": {
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "total": {
            "type": "integer",
            "description": "Alerts matching the filters in all, ignoring limit/offset."
          }
        }
      },
      "AlertSettings": {
        "type": "object",
        "description": "The webhook secret itself is never returned.",
        "required": [
          "enabled",
          "email_admins",
          "extra_recipients",
          "printer_down_enabled",
          "printer_down_minutes",
          "supply_low_enabled",
          "supply_low_percent",
          "deployment_failed_enabled",
          "printer_error_enabled",
          "notify_resolved",
          "webhook_url",
          "has_webhook_secret",
          "updated_at"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch. Off for an account that never saved settings."
          },
          "email_admins": {
            "type": "boolean"
          },
          "extra_recipients": {
            "type": "string",
            "description": "Extra addresses, separated by commas, semicolons, spaces or newlines."
          },
          "printer_down_enabled": {
            "type": "boolean"
          },
          "printer_down_minutes": {
            "type": "integer"
          },
          "supply_low_enabled": {
            "type": "boolean"
          },
          "supply_low_percent": {
            "type": "integer"
          },
          "deployment_failed_enabled": {
            "type": "boolean"
          },
          "printer_error_enabled": {
            "type": "boolean"
          },
          "notify_resolved": {
            "type": "boolean"
          },
          "webhook_url": {
            "type": "string",
            "description": "Empty when no webhook is set."
          },
          "has_webhook_secret": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zero time (0001-01-01T00:00:00Z) when the account still has the defaults."
          }
        },
        "example": {
          "enabled": true,
          "email_admins": true,
          "extra_recipients": "helpdesk@northgate-it.example",
          "printer_down_enabled": true,
          "printer_down_minutes": 10,
          "supply_low_enabled": true,
          "supply_low_percent": 15,
          "deployment_failed_enabled": true,
          "printer_error_enabled": true,
          "notify_resolved": true,
          "webhook_url": "https://psa.northgate-it.example/hooks/printctrl",
          "has_webhook_secret": true,
          "updated_at": "2026-10-03T13:22:10Z"
        }
      },
      "AlertDelivery": {
        "type": "object",
        "required": [
          "channel",
          "target",
          "event",
          "ok",
          "at"
        ],
        "properties": {
          "alert_id": {
            "type": "string",
            "description": "Omitted for test sends."
          },
          "channel": {
            "type": "string",
            "examples": [
              "email",
              "webhook"
            ]
          },
          "target": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AlertSettingsView": {
        "type": "object",
        "required": [
          "settings",
          "recipients",
          "deliveries"
        ],
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/AlertSettings"
          },
          "recipients": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Who alert emails would go to now. Null when there are none."
          },
          "deliveries": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AlertDelivery"
            },
            "description": "Up to 50 most recent delivery attempts."
          }
        }
      },
      "AuditEvent": {
        "type": "object",
        "required": [
          "id",
          "occurred_at",
          "platform_customer_id",
          "actor_type",
          "event_type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "platform_customer_id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_id": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "actor_type": {
            "type": "string",
            "description": "API clients are recorded as `user`.",
            "enum": [
              "user",
              "agent",
              "system"
            ]
          },
          "actor_id": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "actor_label": {
            "type": "string",
            "description": "Name (or email/client id) at the time. Omitted when empty."
          },
          "event_type": {
            "type": "string",
            "examples": [
              "user.invited",
              "billing.checkout.started",
              "support.requested"
            ]
          },
          "object_type": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "object_id": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "object_label": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "changes": {
            "description": "Free-form JSON, conventionally {\"field\": {\"old\": ..., \"new\": ...}}. Omitted when empty."
          },
          "detail": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "customer_name": {
            "type": "string",
            "description": "Current customer name. Omitted when empty."
          },
          "agent_name": {
            "type": "string",
            "description": "Current computer name. Omitted when empty."
          }
        },
        "example": {
          "id": "f4a1c8e3-6b2d-4d95-8e07-2c9b5a1f3d68",
          "occurred_at": "2026-11-20T09:14:03Z",
          "platform_customer_id": "7c1e2a90-3b4d-4f6a-9e21-5d8c0b7a1f33",
          "customer_id": "3f9a6c2e-8d41-4b7e-a5c0-2e7f1d9b4a68",
          "agent_id": "5e2b8d41-9f3a-4c67-b1d0-8a4e6f2c9d37",
          "actor_type": "user",
          "actor_id": "1b6d9f42-7a3e-4c85-b0d2-6e8a4f1c3b97",
          "actor_label": "Sam Patel",
          "event_type": "printer.assigned",
          "object_type": "managed_printer",
          "object_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
          "object_label": "HM-Reception",
          "changes": {
            "group": {
              "old": null,
              "new": "Sheffield office"
            }
          },
          "detail": "Assigned to group Sheffield office",
          "customer_name": "Halden Manufacturing",
          "agent_name": "SHF-WS-204"
        }
      },
      "AuditEventPage": {
        "type": "object",
        "required": [
          "events",
          "next_cursor",
          "has_more",
          "limit"
        ],
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as `cursor` for the next page; empty on the last page."
          },
          "has_more": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer",
            "description": "The page size used."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event types the account produced in the last 90 days. Only on the first page (no cursor)."
          }
        }
      },
      "DashboardSummary": {
        "type": "object",
        "description": "Landing-page aggregates, account-wide or for one customer. Driver package counts are always account-wide.",
        "required": [
          "agents",
          "customers",
          "printers",
          "managed_printers",
          "deployments",
          "monitors",
          "supplies",
          "driver_packages",
          "deployment_trend",
          "recent_events",
          "offline_agents",
          "down_monitors",
          "attention",
          "slowest_agents",
          "agents_online_now"
        ],
        "properties": {
          "agents": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "online": {
                "type": "integer",
                "description": "Live connections."
              },
              "offline": {
                "type": "integer"
              },
              "seen_today": {
                "type": "integer",
                "description": "Seen in the last 24 hours."
              }
            }
          },
          "customers": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              }
            }
          },
          "printers": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "managed": {
                "type": "integer"
              },
              "shared": {
                "type": "integer"
              },
              "distinct_drivers": {
                "type": "integer"
              }
            }
          },
          "managed_printers": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "active": {
                "type": "integer"
              },
              "self_service": {
                "type": "integer"
              }
            }
          },
          "deployments": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "installing": {
                "type": "integer"
              },
              "installed": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "removing": {
                "type": "integer"
              },
              "removed": {
                "type": "integer"
              }
            }
          },
          "monitors": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "up": {
                "type": "integer"
              },
              "down": {
                "type": "integer"
              },
              "unknown": {
                "type": "integer"
              }
            }
          },
          "supplies": {
            "type": "object",
            "properties": {
              "tracked": {
                "type": "integer"
              },
              "low": {
                "type": "integer",
                "description": "Below `threshold` percent."
              },
              "critical": {
                "type": "integer",
                "description": "Below 5 percent."
              },
              "threshold": {
                "type": "integer"
              }
            }
          },
          "driver_packages": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "published": {
                "type": "integer"
              },
              "verified": {
                "type": "integer"
              }
            }
          },
          "deployment_trend": {
            "type": "array",
            "description": "30 calendar days in `tz`, oldest first; quiet days are zeros.",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "installed": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "total_installed": {
                  "type": "integer",
                  "description": "Running total."
                }
              }
            }
          },
          "recent_events": {
            "type": "array",
            "description": "Latest 10 audit events.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "event_type": {
                  "type": "string"
                },
                "actor_type": {
                  "type": "string"
                },
                "actor_label": {
                  "type": "string"
                },
                "object_type": {
                  "type": "string"
                },
                "object_id": {
                  "type": "string"
                },
                "object_label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "customer_name": {
                  "type": "string"
                }
              }
            }
          },
          "offline_agents": {
            "type": "array",
            "description": "Up to 10 computers not connected now.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "customer_name": {
                  "type": "string"
                },
                "last_seen": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "version": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "down_monitors": {
            "type": "array",
            "description": "Up to 10.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "host_address": {
                  "type": "string"
                },
                "printer_name": {
                  "type": "string"
                },
                "agent_hostname": {
                  "type": "string"
                },
                "last_change_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "consecutive_failures": {
                  "type": "integer"
                }
              }
            }
          },
          "attention": {
            "type": "array",
            "description": "Up to 10 items to look at first.",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "monitor_down"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "since": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          },
          "slowest_agents": {
            "type": "array",
            "description": "Up to 5 computers whose last inventory scan took longest.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "customer_name": {
                  "type": "string",
                  "description": "Omitted when empty."
                },
                "status": {
                  "type": "string"
                },
                "perf": {
                  "description": "Timing document the agent reports."
                }
              }
            }
          },
          "agents_online_now": {
            "type": "integer",
            "description": "Computers connected right now."
          }
        },
        "example": {
          "agents": {
            "total": 47,
            "online": 44,
            "offline": 3,
            "seen_today": 45
          },
          "customers": {
            "total": 2
          },
          "printers": {
            "total": 96,
            "managed": 71,
            "shared": 12,
            "distinct_drivers": 5
          },
          "managed_printers": {
            "total": 3,
            "active": 3,
            "self_service": 1
          },
          "deployments": {
            "total": 74,
            "pending": 1,
            "installing": 0,
            "installed": 71,
            "failed": 2,
            "removing": 0,
            "removed": 0
          },
          "monitors": {
            "total": 3,
            "up": 2,
            "down": 1,
            "unknown": 0
          },
          "supplies": {
            "tracked": 14,
            "low": 2,
            "critical": 0,
            "threshold": 15
          },
          "driver_packages": {
            "total": 2,
            "published": 1,
            "verified": 2
          },
          "deployment_trend": [
            {
              "day": "2026-11-19",
              "installed": 3,
              "failed": 0,
              "total_installed": 69
            },
            {
              "day": "2026-11-20",
              "installed": 2,
              "failed": 1,
              "total_installed": 71
            }
          ],
          "recent_events": [
            {
              "id": "f4a1c8e3-6b2d-4d95-8e07-2c9b5a1f3d68",
              "occurred_at": "2026-11-20T09:14:03Z",
              "event_type": "printer.assigned",
              "actor_type": "user",
              "actor_label": "Sam Patel",
              "object_type": "managed_printer",
              "object_id": "6c3a9e15-7d2f-4b84-a0e1-3f5d8b2c6e79",
              "object_label": "HM-Reception",
              "detail": "Assigned to group Sheffield office",
              "customer_name": "Halden Manufacturing"
            }
          ],
          "offline_agents": [
            {
              "id": "2a7f5c98-4e1b-4d3a-9c62-7b0e8d1f6a45",
              "hostname": "RGL-LT-031",
              "customer_name": "Redgate Legal",
              "last_seen": "2026-11-19T17:42:08Z",
              "version": "1.14.2"
            }
          ],
          "down_monitors": [
            {
              "id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
              "host_address": "10.40.0.22",
              "printer_name": "HM-Goods-In",
              "agent_hostname": "SHF-WS-204",
              "last_change_at": "2026-11-20T08:46:12Z",
              "consecutive_failures": 24
            }
          ],
          "attention": [
            {
              "kind": "monitor_down",
              "id": "a91f3c6e-2d8b-4a57-9e40-6b1d7c3f5a82",
              "label": "HM-Goods-In",
              "detail": "10.40.0.22",
              "since": "2026-11-20T08:46:12Z"
            }
          ],
          "slowest_agents": [
            {
              "id": "9d4c1e73-2b8f-4a56-8e0d-6f1a3c7b5e92",
              "name": "SHF-WS-117",
              "customer_name": "Halden Manufacturing",
              "status": "online",
              "perf": {
                "scan_ms": 4120
              }
            }
          ],
          "agents_online_now": 44
        }
      },
      "AgentPerf": {
        "type": "object",
        "description": "What the agent last reported about its own work, stored with each heartbeat. Durations are milliseconds; `*_at` and `reported_at` are Unix timestamps in seconds. Optional figures are left out when the agent has not run that work yet or reported an implausible value.",
        "required": [
          "uptime_s",
          "mem_mb",
          "printers",
          "monitors",
          "reported_at"
        ],
        "properties": {
          "uptime_s": {
            "type": "integer",
            "description": "Seconds since the agent service started."
          },
          "mem_mb": {
            "type": "integer",
            "description": "Agent process memory in MB (0 when the reported value was out of range)."
          },
          "printers": {
            "type": "integer",
            "description": "Print queues the agent currently sees."
          },
          "monitors": {
            "type": "integer",
            "description": "Network devices this agent is watching for monitoring."
          },
          "inventory_ms": {
            "type": "integer",
            "description": "Duration of the last inventory (discovery) run."
          },
          "inventory_at": {
            "type": "integer",
            "description": "When the last inventory run finished (Unix seconds)."
          },
          "netscan_ms": {
            "type": "integer",
            "description": "Duration of the last network sweep."
          },
          "netscan_at": {
            "type": "integer",
            "description": "When the last network sweep finished (Unix seconds)."
          },
          "monitor_sweep_ms": {
            "type": "integer",
            "description": "Duration of the last monitoring sweep."
          },
          "monitor_sweep_at": {
            "type": "integer",
            "description": "When the last monitoring sweep finished (Unix seconds)."
          },
          "rtt_ms": {
            "type": "number",
            "description": "WebSocket round trip measured by the server, in milliseconds."
          },
          "reported_at": {
            "type": "integer",
            "description": "When the server stored this report (Unix seconds)."
          }
        }
      },
      "Agent": {
        "type": "object",
        "description": "A computer running the PrintCtrl agent. `status` is overridden to `online` when the machine holds a live connection, even if the stored row still says `offline`.",
        "required": [
          "id",
          "customer_id",
          "platform_customer_id",
          "name",
          "hostname",
          "agent_uuid",
          "os_version",
          "os_caption",
          "arch",
          "local_ips",
          "wan_ip",
          "status",
          "version",
          "tags",
          "logged_on_users",
          "discovery_interval",
          "monitor_interval",
          "log_level",
          "tray_mode",
          "effective_tray_mode",
          "last_seen",
          "enrolled_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "The MSP account (tenant) id."
          },
          "name": {
            "type": "string",
            "description": "Display name. Defaults to the hostname; can be changed with PATCH."
          },
          "hostname": {
            "type": "string"
          },
          "agent_uuid": {
            "type": "string",
            "description": "Identifier the agent generated for itself at install."
          },
          "os_version": {
            "type": "string",
            "example": "10.0.26100"
          },
          "os_caption": {
            "type": "string",
            "example": "Microsoft Windows 11 Pro"
          },
          "arch": {
            "type": "string",
            "example": "amd64"
          },
          "local_ips": {
            "type": "string",
            "description": "LAN addresses, comma-separated."
          },
          "wan_ip": {
            "type": "string",
            "description": "Public address the agent connects from."
          },
          "status": {
            "type": "string",
            "enum": [
              "online",
              "offline"
            ],
            "description": "Live connection state."
          },
          "version": {
            "type": "string",
            "description": "Agent version, without a leading \"v\". Empty before the first report."
          },
          "tags": {
            "type": "string",
            "description": "Lowercase tags, comma-separated, de-duplicated."
          },
          "logged_on_users": {
            "type": "string",
            "description": "Accounts signed in right now, as DOMAIN\\name, comma-separated."
          },
          "update_state": {
            "type": "string",
            "description": "Last self-update state the agent reported. Omitted when there has been none.",
            "enum": [
              "downloading",
              "switching",
              "healthy",
              "rolled_back",
              "failed"
            ]
          },
          "update_version": {
            "type": "string",
            "description": "Version the last self-update targeted. Omitted when empty."
          },
          "update_detail": {
            "type": "string",
            "description": "Agent-supplied detail for the last self-update. Omitted when empty."
          },
          "update_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the last self-update state was reported. Omitted when there has been none."
          },
          "discovery_interval": {
            "type": "integer",
            "description": "Seconds between discovery runs (default 900, minimum 60)."
          },
          "monitor_interval": {
            "type": "integer",
            "description": "Seconds between monitoring polls (default 60, minimum 30)."
          },
          "log_level": {
            "type": "string",
            "enum": [
              "info",
              "debug"
            ]
          },
          "tray_mode": {
            "type": "string",
            "enum": [
              "",
              "full",
              "window",
              "off"
            ],
            "description": "This computer's own tray setting. Empty string uses the customer's."
          },
          "effective_tray_mode": {
            "type": "string",
            "enum": [
              "full",
              "window",
              "off"
            ],
            "description": "The tray setting the computer gets: its own, else the customer's, else `full`."
          },
          "hardware_id": {
            "type": "string",
            "description": "Identifier of the machine from its firmware. A reinstalled agent with the same id is merged into the existing computer. Omitted when unknown."
          },
          "hw_manufacturer": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "hw_model": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "hw_serial": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enrolled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "perf": {
            "$ref": "#/components/schemas/AgentPerf",
            "description": "Omitted until the agent (1.2.41 or later) has sent a heartbeat with performance figures."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when the customer has no name."
          },
          "printer_count": {
            "type": "integer",
            "description": "Print queues discovered on this machine. Only filled in list responses (GET /agents, GET /customers/{cid}/agents, group members, previews), and omitted when zero."
          }
        }
      },
      "AgentFacet": {
        "type": "object",
        "required": [
          "value",
          "count"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AgentPage": {
        "type": "object",
        "required": [
          "agents",
          "total"
        ],
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          },
          "total": {
            "type": "integer",
            "description": "Devices matching the filters, across all pages."
          },
          "facets": {
            "type": "object",
            "description": "Filter options for the whole scope (tenant, or the `customer_id` customer), ignoring the other filters. `status` is always present; `os_caption` and `version` only when `facets` is passed. Counts use the stored status, so a machine that just connected may still count as offline. Omitted if the counts could not be read.",
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AgentFacet"
                }
              },
              "os_caption": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AgentFacet"
                }
              },
              "version": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AgentFacet"
                }
              }
            }
          }
        }
      },
      "AgentCounts": {
        "type": "object",
        "required": [
          "counts"
        ],
        "properties": {
          "counts": {
            "type": "array",
            "description": "One entry per customer that has at least one device. Customers with none are absent.",
            "items": {
              "type": "object",
              "required": [
                "customer_id",
                "total",
                "online"
              ],
              "properties": {
                "customer_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "total": {
                  "type": "integer"
                },
                "online": {
                  "type": "integer",
                  "description": "Devices whose stored status is online."
                }
              }
            }
          }
        }
      },
      "AgentUpdate": {
        "type": "object",
        "description": "Every field is optional; only the ones supplied change.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name (trimmed)."
          },
          "tags": {
            "type": "string",
            "description": "Comma-separated tags. Stored trimmed, lowercased and de-duplicated. Changing tags re-evaluates tag-scoped printer assignments."
          },
          "discovery_interval": {
            "type": "integer",
            "description": "Seconds. Values below 60 are raised to 60."
          },
          "monitor_interval": {
            "type": "integer",
            "description": "Seconds. Values below 30 are raised to 30."
          },
          "log_level": {
            "type": "string",
            "enum": [
              "info",
              "debug"
            ],
            "description": "Case-insensitive."
          },
          "tray_mode": {
            "type": "string",
            "enum": [
              "",
              "full",
              "window",
              "off"
            ],
            "description": "This computer's tray setting, over the customer's. Case-insensitive. An empty string goes back to the customer's. Sent to a connected agent immediately."
          }
        }
      },
      "AgentCommandAccepted": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "discovery requested",
              "restart requested",
              "uninstall requested"
            ]
          }
        }
      },
      "AgentUpdateAccepted": {
        "type": "object",
        "required": [
          "status",
          "version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "update requested"
            ]
          },
          "version": {
            "type": "string",
            "description": "The published version the agent was told to install."
          }
        }
      },
      "AgentDeleted": {
        "type": "object",
        "required": [
          "deleted"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "AgentPrinter": {
        "type": "object",
        "description": "A print queue discovered on one computer (summary row; the full row with DEVMODE, print ticket and capabilities is GET /printers/{pid}).",
        "required": [
          "id",
          "agent_id",
          "customer_id",
          "platform_customer_id",
          "name",
          "scope",
          "share_name",
          "port_name",
          "driver_name",
          "comment",
          "location",
          "server_name",
          "is_shared",
          "is_default",
          "is_published",
          "status",
          "status_text",
          "queued_jobs",
          "attributes",
          "priority",
          "print_processor",
          "datatype",
          "sep_file",
          "synced_at",
          "created_at",
          "monitoring"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "machine",
              "user"
            ],
            "description": "`user` is one signed-in person's mapped connection, not a queue the machine owns."
          },
          "user_sid": {
            "type": "string",
            "description": "For user-scope rows. Omitted when empty."
          },
          "user_name": {
            "type": "string",
            "description": "For user-scope rows. Omitted when empty."
          },
          "share_name": {
            "type": "string"
          },
          "port_name": {
            "type": "string"
          },
          "driver_name": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "server_name": {
            "type": "string"
          },
          "is_shared": {
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean"
          },
          "is_published": {
            "type": "boolean"
          },
          "status": {
            "type": "integer",
            "description": "Windows PRINTER_STATUS bit field."
          },
          "status_text": {
            "type": "string"
          },
          "queued_jobs": {
            "type": "integer"
          },
          "attributes": {
            "type": "integer",
            "description": "Windows PRINTER_ATTRIBUTE bit field."
          },
          "priority": {
            "type": "integer"
          },
          "print_processor": {
            "type": "string"
          },
          "datatype": {
            "type": "string"
          },
          "sep_file": {
            "type": "string"
          },
          "managed_printer_id": {
            "type": "string",
            "format": "uuid",
            "description": "Set when PrintCtrl deployed this queue. Omitted otherwise."
          },
          "manufacturer": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "model": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "model_source": {
            "type": "string",
            "description": "How the model was established. Omitted when unknown."
          },
          "vendor_slug": {
            "type": "string",
            "description": "Stable vendor grouping key. Omitted when unknown."
          },
          "device_class": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "serial_number": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "device_image_sha256": {
            "type": "string",
            "description": "Omitted when there is no device image."
          },
          "port_type": {
            "type": "string",
            "description": "From the port the queue names. Omitted when the port is not known."
          },
          "host_address": {
            "type": "string",
            "description": "Omitted when the port has no address."
          },
          "port_number": {
            "type": "integer",
            "description": "Omitted when zero."
          },
          "protocol": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_name": {
            "type": "string"
          },
          "agent_status": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "customer_name": {
            "type": "string"
          },
          "monitoring": {
            "type": "object",
            "description": "Health of the network device this queue prints to, as the customer's agents see it.",
            "required": [
              "monitors",
              "state",
              "alert_count"
            ],
            "properties": {
              "monitors": {
                "type": "integer",
                "description": "Monitors watching the queue's host address."
              },
              "state": {
                "type": "string",
                "enum": [
                  "up",
                  "down",
                  "unknown"
                ]
              },
              "last_seen_at": {
                "type": "string",
                "format": "date-time",
                "description": "Omitted when never seen."
              },
              "lowest_supply_percent": {
                "type": "integer",
                "description": "Lowest known supply level. Omitted when unknown."
              },
              "alert_count": {
                "type": "integer",
                "description": "Always 0 on this endpoint."
              }
            }
          }
        }
      },
      "AgentPort": {
        "type": "object",
        "description": "A print port discovered on one computer.",
        "required": [
          "id",
          "agent_id",
          "customer_id",
          "platform_customer_id",
          "name",
          "port_type",
          "host_address",
          "port_number",
          "protocol",
          "queue_name",
          "snmp_enabled",
          "snmp_community_set",
          "snmp_index",
          "device_id",
          "serial_number",
          "synced_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "port_type": {
            "type": "string",
            "description": "Port kind as discovered, for example `tcpip` or `wsd`."
          },
          "host_address": {
            "type": "string"
          },
          "port_number": {
            "type": "integer"
          },
          "protocol": {
            "type": "string"
          },
          "queue_name": {
            "type": "string",
            "description": "LPR queue name, when the port uses LPR."
          },
          "snmp_enabled": {
            "type": "boolean"
          },
          "snmp_community_set": {
            "type": "boolean",
            "description": "Whether the Windows port has an SNMP community. The community itself is never returned."
          },
          "snmp_index": {
            "type": "integer"
          },
          "device_id": {
            "type": "string"
          },
          "serial_number": {
            "type": "string"
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "printer_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Queues on this machine bound to the port. Omitted when none."
          }
        }
      },
      "AgentDriver": {
        "type": "object",
        "description": "A printer driver installed on one computer.",
        "required": [
          "id",
          "agent_id",
          "customer_id",
          "platform_customer_id",
          "name",
          "version",
          "driver_date",
          "provider",
          "manufacturer",
          "environment",
          "driver_version_raw",
          "inf_path",
          "config_file",
          "data_file",
          "driver_path",
          "help_file",
          "dependent_files",
          "print_processor",
          "monitor_name",
          "is_package_aware",
          "driver_attributes",
          "oem_url",
          "core_driver_deps",
          "synced_at",
          "created_at",
          "has_package"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "driver_date": {
            "type": "string",
            "description": "As stored, for example `2025-04-18`."
          },
          "provider": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "example": "Windows x64"
          },
          "driver_version_raw": {
            "type": "integer",
            "format": "int64"
          },
          "inf_path": {
            "type": "string"
          },
          "config_file": {
            "type": "string"
          },
          "data_file": {
            "type": "string"
          },
          "driver_path": {
            "type": "string"
          },
          "help_file": {
            "type": "string"
          },
          "dependent_files": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "print_processor": {
            "type": "string"
          },
          "monitor_name": {
            "type": "string"
          },
          "is_package_aware": {
            "type": "boolean"
          },
          "driver_attributes": {
            "type": "integer"
          },
          "oem_url": {
            "type": "string"
          },
          "core_driver_deps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "hostname": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_status": {
            "type": "string",
            "description": "Stored status. Omitted when empty."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "has_package": {
            "type": "boolean",
            "description": "The account already holds an installable driver package whose driver names include this driver."
          }
        }
      },
      "AgentLogs": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Newest lines of the agent's own log file, oldest first."
          }
        }
      },
      "AgentMonitoringSettings": {
        "type": "object",
        "properties": {
          "monitoring_off": {
            "type": "boolean",
            "description": "True when this machine does not watch printers. Defaults to false when omitted on PUT."
          },
          "monitoring_profile_id": {
            "type": "string",
            "description": "Monitoring profile for the printers this machine watches. Empty string means the default. Defaults to empty when omitted on PUT."
          }
        },
        "required": [
          "monitoring_off",
          "monitoring_profile_id"
        ]
      },
      "GroupRule": {
        "type": "object",
        "required": [
          "id",
          "group_id",
          "platform_customer_id",
          "rule_type",
          "value",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "group_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "rule_type": {
            "type": "string",
            "enum": [
              "agent",
              "customer",
              "hostname",
              "lan_cidr",
              "wan_ip",
              "tag",
              "user"
            ]
          },
          "value": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GroupRuleInput": {
        "type": "object",
        "description": "One membership clause. A flat rule. A computer is in a group without a `rule_tree` when it matches any of the group's flat rules. `value` is trimmed and must not be empty. Values by `rule_type`:\n- `agent`: a computer id. Not checked for existence.\n- `customer`: a customer id. Not checked for existence.\n- `hostname`: a case-insensitive glob on the hostname (`*`, `?`, `[a-z]`), for example `SHF-*`.\n- `lan_cidr`: a CIDR range (for example `10.40.0.0/24`); matches when any of the computer's LAN addresses is inside it. Rejected with 400 if it does not parse.\n- `wan_ip`: a single public IP address or a CIDR range; rejected with 400 if it does not parse.\n- `tag`: accepted, but tag rules no longer count toward group membership.\n- `user`: a signed-in account pattern: `DOMAIN\\name`, `name@domain.tld` (matched on the name and the domain's first label), or a bare `name` (any domain). Globs work in either part, for example `HALDEN\\*`.",
        "required": [
          "rule_type",
          "value"
        ],
        "properties": {
          "rule_type": {
            "type": "string",
            "enum": [
              "agent",
              "customer",
              "hostname",
              "lan_cidr",
              "wan_ip",
              "tag",
              "user"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "Group": {
        "type": "object",
        "description": "A named set of computers defined by rules, so a machine enrolled later joins on its own.",
        "required": [
          "id",
          "platform_customer_id",
          "name",
          "description",
          "created_by",
          "created_at",
          "updated_at",
          "member_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "The customer the group belongs to. Omitted for an account-wide group."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "created_by": {
            "type": "string",
            "description": "Id of the user or API client that created the group."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted for an account-wide group."
          },
          "rule_tree": {
            "$ref": "#/components/schemas/RuleNode",
            "description": "The group's rules as a tree. Omitted for a group saved before rule trees, whose flat `rules` apply as \"any of them\"."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupRule"
            },
            "description": "Flat rules of a group without a `rule_tree`. Omitted when there are none."
          },
          "member_count": {
            "type": "integer",
            "description": "Computers currently matching the rules. Computed on GET /agent-groups and GET /agent-groups/{gid}; always 0 in create and update responses."
          }
        }
      },
      "GroupInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Required, trimmed, unique in the account."
          },
          "description": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "Scope the group to one customer. Omit or send an empty string for an account-wide group."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupRuleInput"
            },
            "description": "Initial flat rules, matched as \"any of them\". Duplicates are dropped. Ignored when `rule_tree` is sent."
          },
          "rule_tree": {
            "$ref": "#/components/schemas/RuleNode",
            "description": "The whole rule set as a tree. When sent, `rules` is ignored. Validated before anything is saved."
          }
        }
      },
      "GroupUpdate": {
        "type": "object",
        "description": "Every field is optional; only the ones supplied change.",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "description": "A customer id, or an empty string to make the group account-wide."
          },
          "rule_tree": {
            "$ref": "#/components/schemas/RuleNode",
            "description": "Replaces the group's rules, flat ones included. Printers assigned through the group are then deployed to computers that joined and removed from ones that left, in the background."
          }
        }
      },
      "GroupDetail": {
        "type": "object",
        "required": [
          "group",
          "members"
        ],
        "properties": {
          "group": {
            "$ref": "#/components/schemas/Group"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            },
            "description": "Computers the rules currently match."
          }
        }
      },
      "GroupPreview": {
        "type": "object",
        "required": [
          "matched",
          "count"
        ],
        "properties": {
          "matched": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "GroupRuleAddInput": {
        "type": "object",
        "description": "A GroupRuleInput (same rule types and value formats) with an optional `preview` flag.",
        "required": [
          "rule_type",
          "value"
        ],
        "properties": {
          "rule_type": {
            "type": "string",
            "enum": [
              "agent",
              "customer",
              "hostname",
              "lan_cidr",
              "wan_ip",
              "tag",
              "user"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1
          },
          "preview": {
            "type": "boolean",
            "default": false,
            "description": "When true, nothing is saved and the response is a GroupPreview (200) of the computers this rule alone would match."
          }
        }
      },
      "GroupDeleted": {
        "type": "object",
        "required": [
          "deleted",
          "printers_reconciled"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "printers_reconciled": {
            "type": "integer",
            "description": "Managed printer assignments that targeted this group and were removed. Those printers are uninstalled from machines no longer in scope, in the background."
          }
        }
      },
      "GroupRuleDeleted": {
        "type": "object",
        "required": [
          "deleted"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Customer": {
        "type": "object",
        "description": "A managed client of your account.",
        "required": [
          "id",
          "platform_customer_id",
          "name",
          "site",
          "notes",
          "status",
          "created_at",
          "updated_at",
          "snmp_community_set",
          "network_discovery_enabled",
          "network_discovery_interval",
          "network_discovery_ranges",
          "alerts_enabled",
          "timezone",
          "print_jobs_enabled",
          "tray_mode",
          "agent_update_channel",
          "monitor_agent_id",
          "snmp_version",
          "snmp_v3_user",
          "snmp_v3_auth_proto",
          "snmp_v3_auth_set",
          "snmp_v3_priv_proto",
          "snmp_v3_priv_set",
          "snmp_v3_context",
          "monitoring_enabled",
          "monitoring_profile_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The customer's id."
          },
          "platform_customer_id": {
            "type": "string",
            "description": "Your account (tenant) id."
          },
          "name": {
            "type": "string"
          },
          "site": {
            "type": "string",
            "description": "Site label, at most 120 characters. Empty string when not set."
          },
          "notes": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "description": "An inactive customer is paused: nothing is pushed to its computers and no new computers can be enrolled."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "snmp_community_set": {
            "type": "boolean",
            "description": "Whether an SNMP v2c community is stored. The community itself is never returned."
          },
          "network_discovery_enabled": {
            "type": "boolean",
            "description": "Whether the customer's computers sweep their local subnets for printers."
          },
          "network_discovery_interval": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440,
            "description": "Minutes between network discovery sweeps. 15 by default."
          },
          "network_discovery_ranges": {
            "type": "string",
            "description": "Extra private IPv4 ranges to sweep, comma-separated in CIDR form (for example `10.40.0.0/24,10.40.2.0/23`). Empty string for none."
          },
          "alerts_enabled": {
            "type": "boolean",
            "description": "False mutes alerts for this customer while the account has alerting on."
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone name. Empty string uses the account default."
          },
          "print_jobs_enabled": {
            "type": "boolean",
            "description": "Whether print jobs are recorded on this customer's computers. Off by default."
          },
          "tray_mode": {
            "type": "string",
            "enum": [
              "full",
              "window",
              "off"
            ],
            "description": "What users see of PrintCtrl: `full` (tray icon and panel), `window` (panel from the shortcut only) or `off`."
          },
          "agent_update_channel": {
            "type": "string",
            "enum": [
              "",
              "early",
              "standard",
              "delayed"
            ],
            "description": "When this customer's computers take a new agent version. Empty string uses the account's channel (GET /agent-updates)."
          },
          "monitor_agent_id": {
            "type": "string",
            "description": "The computer that watches this customer's printers. Empty string for automatic choice."
          },
          "snmp_version": {
            "type": "string",
            "enum": [
              "2c",
              "3"
            ],
            "description": "`2c` (community) or `3` (user-based security)."
          },
          "snmp_v3_user": {
            "type": "string"
          },
          "snmp_v3_auth_proto": {
            "type": "string",
            "enum": [
              "",
              "md5",
              "sha",
              "sha224",
              "sha256",
              "sha384",
              "sha512"
            ]
          },
          "snmp_v3_auth_set": {
            "type": "boolean",
            "description": "Whether an SNMPv3 authentication passphrase is stored. The passphrase itself is never returned."
          },
          "snmp_v3_priv_proto": {
            "type": "string",
            "enum": [
              "",
              "des",
              "aes",
              "aes192",
              "aes256",
              "aes192c",
              "aes256c"
            ]
          },
          "snmp_v3_priv_set": {
            "type": "boolean",
            "description": "Whether an SNMPv3 privacy passphrase is stored. The passphrase itself is never returned."
          },
          "snmp_v3_context": {
            "type": "string"
          },
          "monitoring_enabled": {
            "type": "boolean",
            "description": "False turns printer monitoring off for the whole customer."
          },
          "monitoring_profile_id": {
            "type": "string",
            "description": "The monitoring profile applied instead of the SNMP settings above. Empty string for none."
          },
          "agent_count": {
            "type": "integer",
            "description": "Number of computers at the customer. Only in the list response, and left out when zero."
          }
        }
      },
      "CustomerInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Trimmed; must not be blank."
          },
          "site": {
            "type": "string",
            "maxLength": 120,
            "description": "Site label. Trimmed."
          },
          "notes": {
            "type": "string"
          },
          "snmp_community": {
            "type": "string",
            "maxLength": 32,
            "description": "Defaults to `public`. Write-only: responses never return it, only whether one is set.",
            "writeOnly": true
          },
          "network_discovery_enabled": {
            "type": "boolean",
            "default": true
          },
          "network_discovery_interval": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440,
            "default": 15,
            "description": "Minutes between sweeps. 0 or omitted uses 15."
          },
          "network_discovery_ranges": {
            "type": "string",
            "description": "Extra private IPv4 ranges, separated by commas, spaces, semicolons or new lines. A bare address is read as /32. Each range must be private and no larger than /20; at most 8 ranges. Stored normalized and comma-separated."
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone name, such as `Europe/London`. Empty uses the account default."
          },
          "print_jobs_enabled": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CustomerUpdate": {
        "type": "object",
        "description": "Every field is optional; send only what you change.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "site": {
            "type": "string",
            "maxLength": 120,
            "description": "Trimmed. Empty string clears it."
          },
          "notes": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "snmp_community": {
            "type": "string",
            "maxLength": 32,
            "description": "Blank keeps the stored community. Write-only: responses never return it, only whether one is set.",
            "writeOnly": true
          },
          "network_discovery_enabled": {
            "type": "boolean"
          },
          "network_discovery_interval": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "network_discovery_ranges": {
            "type": "string",
            "description": "Same rules as on create. An empty string removes all extra ranges."
          },
          "alerts_enabled": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone name, or empty for the account default."
          },
          "print_jobs_enabled": {
            "type": "boolean"
          },
          "tray_mode": {
            "type": "string",
            "enum": [
              "full",
              "window",
              "off"
            ]
          },
          "agent_update_channel": {
            "type": "string",
            "enum": [
              "",
              "early",
              "standard",
              "delayed"
            ],
            "description": "`early`, `standard` or `delayed`, or an empty string to use the account's channel. Same as PATCH /customers/{cid}/agent-updates."
          },
          "monitor_agent_id": {
            "type": "string",
            "description": "A computer of this customer, or an empty string for automatic choice."
          },
          "snmp_version": {
            "type": "string",
            "enum": [
              "2c",
              "3"
            ]
          },
          "snmp_v3_user": {
            "type": "string",
            "maxLength": 64,
            "description": "Required when `snmp_version` is `3`."
          },
          "snmp_v3_auth_proto": {
            "type": "string",
            "enum": [
              "",
              "md5",
              "sha",
              "sha224",
              "sha256",
              "sha384",
              "sha512"
            ],
            "description": "Case-insensitive."
          },
          "snmp_v3_auth_pass": {
            "type": "string",
            "maxLength": 128,
            "writeOnly": true,
            "description": "At least 8 characters, or empty to clear. Omit to keep the stored one. Required with an authentication protocol."
          },
          "snmp_v3_priv_proto": {
            "type": "string",
            "enum": [
              "",
              "des",
              "aes",
              "aes192",
              "aes256",
              "aes192c",
              "aes256c"
            ],
            "description": "Case-insensitive. Needs an authentication protocol as well."
          },
          "snmp_v3_priv_pass": {
            "type": "string",
            "maxLength": 128,
            "writeOnly": true,
            "description": "At least 8 characters, or empty to clear. Omit to keep the stored one. Required with a privacy protocol."
          },
          "snmp_v3_context": {
            "type": "string",
            "maxLength": 64
          },
          "monitoring_enabled": {
            "type": "boolean"
          },
          "monitoring_profile_id": {
            "type": "string",
            "description": "A monitoring profile that is shared or belongs to this customer, or an empty string for none."
          }
        }
      },
      "InstallToken": {
        "type": "object",
        "required": [
          "customer_id",
          "customer_name",
          "token",
          "created_at",
          "use_count",
          "download_url"
        ],
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "customer_name": {
            "type": "string"
          },
          "token": {
            "type": "string",
            "description": "The permanent install token, starting `pci_`. Treat it as a secret."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "description": "When a computer last enrolled with it. Left out until it has been used."
          },
          "use_count": {
            "type": "integer",
            "description": "How many computers have enrolled with it."
          },
          "download_url": {
            "type": "string",
            "format": "uri",
            "description": "The Windows agent installer, versioned so caches never hand back an older build."
          },
          "install_script_url": {
            "type": "string",
            "format": "uri",
            "description": "One-line PowerShell installer published beside the agent build, for `irm <url> | iex`. Omitted when agent builds are not published to a CDN."
          }
        }
      },
      "Enrollment": {
        "type": "object",
        "required": [
          "token",
          "expires_at",
          "server_url",
          "download_url",
          "install_command",
          "app_url"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "A single-use enrollment token. Treat it as a secret."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "24 hours after issue by default."
          },
          "server_url": {
            "type": "string",
            "description": "The WebSocket base the agent connects to."
          },
          "download_url": {
            "type": "string",
            "format": "uri",
            "description": "The Windows agent installer."
          },
          "install_command": {
            "type": "string",
            "description": "A silent install command that uses the token."
          },
          "app_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PrinterSetup": {
        "type": "object",
        "required": [
          "found"
        ],
        "properties": {
          "found": {
            "type": "boolean",
            "description": "False when nothing at the address is known to be a printer."
          },
          "source": {
            "type": "string",
            "enum": [
              "discovery",
              "probe"
            ],
            "description": "Where the device details came from: earlier discovery, or a live check by one of the customer's computers. Only when `found` is true."
          },
          "suggestion": {
            "$ref": "#/components/schemas/PrinterSetupSuggestion"
          },
          "reason": {
            "type": "string",
            "description": "Why nothing was found. Only when `found` is false."
          }
        }
      },
      "PrinterSetupSuggestion": {
        "type": "object",
        "description": "The settings to pre-fill for a new managed printer. Fields without a suggestion are left out.",
        "required": [
          "reason"
        ],
        "properties": {
          "port_type": {
            "type": "string",
            "enum": [
              "ipp",
              "tcpip"
            ]
          },
          "port_number": {
            "type": "integer"
          },
          "protocol": {
            "type": "string",
            "enum": [
              "ipp",
              "ipps",
              "raw",
              "lpr"
            ]
          },
          "queue_name": {
            "type": "string"
          },
          "driver_name": {
            "type": "string"
          },
          "driver_package_id": {
            "type": "string",
            "description": "A driver package available to this customer that provides `driver_name`."
          },
          "reason": {
            "type": "string",
            "description": "One line saying what was chosen and why, or why nothing was."
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Page languages the device accepts, as tokens such as `PCLXL` (PCL 6), `PCL` (PCL 5), `PS`, `PDF`, `PWG`, `PCLM`, `URF`, `XPS`."
          },
          "model": {
            "type": "string",
            "description": "The device's model as it reports itself."
          }
        }
      },
      "Branding": {
        "type": "object",
        "required": [
          "enabled",
          "name",
          "logo",
          "logo_type"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Account branding: whether it replaces PrintCtrl's. Customer branding: whether it replaces the account's."
          },
          "name": {
            "type": "string",
            "maxLength": 60,
            "description": "Name shown in the tray. Empty string when not set."
          },
          "logo": {
            "type": "string",
            "description": "SHA-256 of the logo, or empty string for none."
          },
          "logo_type": {
            "type": "string",
            "enum": [
              "",
              "image/png",
              "image/jpeg",
              "image/svg+xml"
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "Path to download the logo, relative to the API host. Left out when there is no logo."
          }
        }
      },
      "BrandingForm": {
        "type": "object",
        "description": "Multipart form for setting branding. Omitted fields keep their current value. With `enabled` true, a name or a logo is required.",
        "properties": {
          "enabled": {
            "type": "string",
            "enum": [
              "true",
              "1",
              "false",
              "0"
            ],
            "description": "`true` or `1` turns it on; any other value turns it off."
          },
          "name": {
            "type": "string",
            "maxLength": 60
          },
          "clear_logo": {
            "type": "string",
            "enum": [
              "true"
            ],
            "description": "`true` removes the current logo."
          },
          "logo": {
            "type": "string",
            "format": "binary",
            "description": "PNG, JPEG or SVG, up to 512 KB. Replaces the current logo."
          }
        }
      },
      "FloorPlan": {
        "type": "object",
        "required": [
          "id",
          "customer_id",
          "name",
          "image",
          "image_type",
          "width",
          "height",
          "pins",
          "image_url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "image": {
            "type": "string",
            "description": "SHA-256 of the image."
          },
          "image_type": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg"
            ]
          },
          "width": {
            "type": "integer",
            "description": "Image width in pixels."
          },
          "height": {
            "type": "integer",
            "description": "Image height in pixels."
          },
          "pins": {
            "type": "integer",
            "description": "Number of active managed printers pinned to this plan."
          },
          "image_url": {
            "type": "string",
            "description": "Path to download the image, relative to the API host."
          }
        }
      },
      "FloorPlanPinsInput": {
        "type": "object",
        "properties": {
          "pins": {
            "type": "array",
            "description": "The complete set of printers on the plan. Each managed printer at most once.",
            "items": {
              "type": "object",
              "required": [
                "managed_printer_id",
                "x",
                "y"
              ],
              "properties": {
                "managed_printer_id": {
                  "type": "string",
                  "minLength": 1
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Fraction of the image width from the left edge."
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Fraction of the image height from the top edge."
                }
              }
            }
          }
        }
      },
      "PrinterPlacement": {
        "type": "object",
        "required": [
          "managed_printer_id",
          "name",
          "location",
          "host_address",
          "map_id",
          "x",
          "y",
          "state"
        ],
        "properties": {
          "managed_printer_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "host_address": {
            "type": "string"
          },
          "map_id": {
            "type": "string",
            "description": "The floor plan the printer is pinned to, or empty string when it is not placed."
          },
          "x": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "Fraction of the image width, or null when not placed."
          },
          "y": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "Fraction of the image height, or null when not placed."
          },
          "state": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "unknown"
            ],
            "description": "Network state from monitoring; `unknown` when nothing watches it."
          }
        }
      },
      "ManagedPrinter": {
        "type": "object",
        "description": "Desired state for one printer queue: what should exist on the machines its assignments cover.",
        "required": [
          "id",
          "platform_customer_id",
          "customer_id",
          "name",
          "comment",
          "location",
          "driver_package_id",
          "driver_name",
          "port_type",
          "host_address",
          "port_number",
          "protocol",
          "queue_name",
          "snmp_enabled",
          "snmp_community_set",
          "snmp_community_override_set",
          "config_id",
          "is_shared",
          "share_name",
          "publish",
          "set_default",
          "self_service",
          "prevent_removal",
          "status",
          "created_by",
          "created_at",
          "updated_at",
          "deployments",
          "monitoring",
          "hardware"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "platform_customer_id": {
            "type": "string",
            "description": "Your MSP account (tenant) id."
          },
          "customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Queue name Windows shows."
          },
          "comment": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "driver_package_id": {
            "type": "string",
            "description": "Driver package staged before install. Empty when the driver must already be on the machine."
          },
          "driver_name": {
            "type": "string",
            "description": "Driver name exactly as Windows reports it. \"Microsoft IPP Class Driver\" for `ipp` printers."
          },
          "port_type": {
            "type": "string",
            "enum": [
              "tcpip",
              "ipp",
              "wsd",
              "local",
              "usb",
              "file"
            ],
            "description": "How the queue reaches the device. `tcpip` (default): the agent creates a Standard TCP/IP port to `host_address`:`port_number`; `protocol` is `raw` (default) or `lpr`, and `queue_name` is the LPR queue. `ipp`: Windows creates the port and queue from `ipp(s)://host_address:port_number/queue_name` with its inbox Microsoft IPP Class Driver; the server forces `driver_name` to \"Microsoft IPP Class Driver\", clears `driver_package_id`, sets `protocol` to `ipps` if you sent `ipps` and `ipp` otherwise, and defaults `port_number` to 631 and `queue_name` to `ipp/print`. `wsd`, `local`, `usb`, `file`: the port must already exist on the machine; put the port name (for example `USB001`, `LPT1:`, `FILE:`) in `host_address`. The agent never creates these ports, and a machine without the named port reports the deployment as failed."
          },
          "host_address": {
            "type": "string",
            "description": "IP address or hostname for `tcpip` and `ipp`; the existing port name for `wsd`, `local`, `usb` and `file`."
          },
          "port_number": {
            "type": "integer"
          },
          "protocol": {
            "type": "string",
            "description": "`raw` or `lpr` for `tcpip`; `ipp` or `ipps` for `ipp`."
          },
          "queue_name": {
            "type": "string",
            "description": "LPR queue (`lpr`) or IPP path (`ipp`, default `ipp/print`)."
          },
          "snmp_enabled": {
            "type": "boolean"
          },
          "snmp_community_set": {
            "type": "boolean",
            "description": "Whether a community is in effect for this printer (its override or the customer's). The community itself is never returned."
          },
          "snmp_community_override_set": {
            "type": "boolean",
            "description": "Whether this printer has its own community. False means it inherits the customer's."
          },
          "config_id": {
            "type": "string",
            "description": "Saved configuration replayed onto the queue after install. Empty when none."
          },
          "is_shared": {
            "type": "boolean",
            "description": "Share the queue from the machine."
          },
          "share_name": {
            "type": "string"
          },
          "publish": {
            "type": "boolean",
            "description": "Publish the shared queue in Active Directory."
          },
          "set_default": {
            "type": "boolean",
            "description": "Make it the default printer on the machine."
          },
          "self_service": {
            "type": "boolean"
          },
          "prevent_removal": {
            "type": "boolean",
            "description": "People cannot remove this printer from their computer through the PrintCtrl tray."
          },
          "status": {
            "type": "string",
            "description": "`active` printers are deployed. Any other value retires the printer: it targets no machines and existing queues are removed."
          },
          "created_by": {
            "type": "string",
            "description": "User id of the creator."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Bumped by every change. Machines holding an older definition are re-sent the printer."
          },
          "customer_name": {
            "type": "string",
            "description": "Present when the customer has a name."
          },
          "assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Assignment"
            },
            "description": "Included on single-printer responses when the printer has assignments; never in the list."
          },
          "deployments": {
            "$ref": "#/components/schemas/ManagedDeploymentTally"
          },
          "monitoring": {
            "$ref": "#/components/schemas/ManagedMonitoringTally"
          },
          "hardware": {
            "$ref": "#/components/schemas/ManagedHardware"
          }
        }
      },
      "ManagedDeploymentTally": {
        "type": "object",
        "description": "Counts of this printer's per-machine deployments.",
        "required": [
          "total",
          "installed",
          "pending",
          "failed"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "installed": {
            "type": "integer"
          },
          "pending": {
            "type": "integer",
            "description": "States pending, installing and updating."
          },
          "failed": {
            "type": "integer"
          }
        }
      },
      "ManagedMonitoringTally": {
        "type": "object",
        "description": "Device health as the computers watching `host_address` see it. Up if any watcher can reach it.",
        "required": [
          "monitors",
          "state",
          "alert_count"
        ],
        "properties": {
          "monitors": {
            "type": "integer",
            "description": "Number of computers watching the address."
          },
          "state": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "unknown"
            ]
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted when never seen."
          },
          "lowest_supply_percent": {
            "type": "integer",
            "description": "Lowest known supply level. Omitted when unknown."
          },
          "alert_count": {
            "type": "integer",
            "description": "Open device alerts (jams, open doors, empty trays)."
          },
          "alert_label": {
            "type": "string",
            "description": "Most severe open alert. Omitted when there is none."
          },
          "alert_severity": {
            "type": "string",
            "description": "Severity of `alert_label`. Omitted when there is none."
          },
          "off": {
            "type": "boolean",
            "description": "Present and true when monitoring is turned off for the printer or its customer."
          }
        }
      },
      "ManagedPrinterInput": {
        "type": "object",
        "description": "Body for create and update. On create, `customer_id`, `name` and `driver_name` are required (`driver_name` is ignored for `ipp`). On update every field is optional: fields you leave out are unchanged, and sending a string field as \"\" or null clears it (that is how you detach `config_id` or `driver_package_id`). `customer_id` is ignored on update. `name`, `driver_name`, `port_type` and `status` cannot be blanked. `port_number` 0 or absent means \"unchanged\" on update and the default on create.",
        "properties": {
          "customer_id": {
            "type": "string",
            "description": "Create only."
          },
          "name": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "driver_package_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Must be shared, or be a driver one of the customer's machines has; otherwise 400."
          },
          "driver_name": {
            "type": "string"
          },
          "port_type": {
            "type": "string",
            "enum": [
              "tcpip",
              "ipp",
              "wsd",
              "local",
              "usb",
              "file"
            ],
            "default": "tcpip",
            "description": "How the queue reaches the device. `tcpip` (default): the agent creates a Standard TCP/IP port to `host_address`:`port_number`; `protocol` is `raw` (default) or `lpr`, and `queue_name` is the LPR queue. `ipp`: Windows creates the port and queue from `ipp(s)://host_address:port_number/queue_name` with its inbox Microsoft IPP Class Driver; the server forces `driver_name` to \"Microsoft IPP Class Driver\", clears `driver_package_id`, sets `protocol` to `ipps` if you sent `ipps` and `ipp` otherwise, and defaults `port_number` to 631 and `queue_name` to `ipp/print`. `wsd`, `local`, `usb`, `file`: the port must already exist on the machine; put the port name (for example `USB001`, `LPT1:`, `FILE:`) in `host_address`. The agent never creates these ports, and a machine without the named port reports the deployment as failed."
          },
          "host_address": {
            "type": "string",
            "description": "Required for `tcpip` and `ipp`."
          },
          "port_number": {
            "type": "integer",
            "description": "Default 9100 (631 for `ipp`)."
          },
          "protocol": {
            "type": "string",
            "default": "raw",
            "description": "`raw` or `lpr` for `tcpip`; `ipp` or `ipps` for `ipp`. Not validated for other port types."
          },
          "queue_name": {
            "type": "string"
          },
          "snmp_enabled": {
            "type": "boolean",
            "default": true
          },
          "snmp_community": {
            "type": "string",
            "default": "public",
            "writeOnly": true,
            "description": "Write-only."
          },
          "snmp_community_override": {
            "type": "string",
            "description": "Community for this printer only. Empty means inherit the customer's. Write-only.",
            "writeOnly": true
          },
          "config_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Must be shared, or captured at this customer; otherwise 400."
          },
          "is_shared": {
            "type": "boolean",
            "default": false
          },
          "share_name": {
            "type": "string"
          },
          "publish": {
            "type": "boolean",
            "default": false
          },
          "set_default": {
            "type": "boolean",
            "default": false
          },
          "self_service": {
            "type": "boolean",
            "default": false
          },
          "prevent_removal": {
            "type": "boolean",
            "default": false,
            "description": "Stop people removing the printer through the tray. Changing only this field does not re-send the printer to computers."
          },
          "status": {
            "type": "string",
            "default": "active"
          }
        }
      },
      "Assignment": {
        "type": "object",
        "required": [
          "id",
          "managed_printer_id",
          "platform_customer_id",
          "scope_type",
          "scope_value",
          "mode",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "managed_printer_id": {
            "type": "string"
          },
          "platform_customer_id": {
            "type": "string"
          },
          "scope_type": {
            "type": "string",
            "enum": [
              "group",
              "agent",
              "customer",
              "hostname",
              "local_ip_cidr",
              "lan_cidr",
              "wan_ip",
              "tag",
              "user"
            ],
            "description": "Which machines the assignment covers, with `scope_value` meaning: `group` a group id (expanded to that group's rules at match time); `agent` a computer id; `customer` a customer id (every computer of that customer); `hostname` a case-insensitive glob such as `SHF-WS-*`; `local_ip_cidr` or `lan_cidr` (same thing, two spellings) a CIDR matched against the computer's LAN addresses, for example `10.40.0.0/24`; `wan_ip` a public address or CIDR; `tag` a computer tag (case-insensitive). `user` can appear on assignments created by other means; this API does not accept it."
          },
          "scope_value": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "deploy",
              "offer"
            ],
            "description": "`deploy` installs the printer. `offer` lists it in the tray for the user to install on demand."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AssignmentInput": {
        "type": "object",
        "required": [
          "scope_type",
          "scope_value"
        ],
        "properties": {
          "scope_type": {
            "type": "string",
            "enum": [
              "group",
              "agent",
              "customer",
              "hostname",
              "local_ip_cidr",
              "lan_cidr",
              "wan_ip",
              "tag"
            ],
            "description": "Which machines the assignment covers, with `scope_value` meaning: `group` a group id (expanded to that group's rules at match time); `agent` a computer id; `customer` a customer id (every computer of that customer); `hostname` a case-insensitive glob such as `SHF-WS-*`; `local_ip_cidr` or `lan_cidr` (same thing, two spellings) a CIDR matched against the computer's LAN addresses, for example `10.40.0.0/24`; `wan_ip` a public address or CIDR; `tag` a computer tag (case-insensitive). Must be lower case."
          },
          "scope_value": {
            "type": "string",
            "minLength": 1
          },
          "mode": {
            "type": "string",
            "enum": [
              "deploy",
              "offer"
            ],
            "default": "deploy"
          },
          "preview": {
            "type": "boolean",
            "default": false,
            "description": "When true, nothing is saved and the response lists the computers the scope would match."
          }
        }
      },
      "ManagedScopePreview": {
        "type": "object",
        "required": [
          "matched",
          "count"
        ],
        "properties": {
          "matched": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "ManagedDeployResult": {
        "type": "object",
        "description": "Summary of one reconcile pass.",
        "required": [
          "targeted",
          "pushed",
          "queued",
          "removing",
          "offered",
          "unchanged",
          "updated",
          "exhausted"
        ],
        "properties": {
          "targeted": {
            "type": "integer",
            "description": "Computers covered by deploy-mode assignments."
          },
          "pushed": {
            "type": "integer",
            "description": "New installs sent to online computers."
          },
          "queued": {
            "type": "integer",
            "description": "Installs waiting for the computer to connect (or for its customer to be reactivated)."
          },
          "removing": {
            "type": "integer",
            "description": "Computers no longer in scope that were told to remove the queue."
          },
          "offered": {
            "type": "integer",
            "description": "Computers covered by offer-mode assignments."
          },
          "unchanged": {
            "type": "integer",
            "description": "Always 0 for an explicit deploy, which re-sends to computers that already have the printer."
          },
          "updated": {
            "type": "integer",
            "description": "Computers that had the printer and were sent its current definition again."
          },
          "exhausted": {
            "type": "integer",
            "description": "Deployments that used up their retry budget. Always 0 right after an explicit deploy, which resets it."
          }
        }
      },
      "Deployment": {
        "type": "object",
        "description": "Observed state of one managed printer on one computer.",
        "required": [
          "id",
          "managed_printer_id",
          "agent_id",
          "platform_customer_id",
          "customer_id",
          "state",
          "detail",
          "printer_name",
          "attempts",
          "created_at",
          "updated_at",
          "agent_online"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "managed_printer_id": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "platform_customer_id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "installing",
              "updating",
              "installed",
              "failed",
              "removing",
              "removed",
              "user_removed"
            ],
            "description": "`user_removed`: a person removed the printer from the computer. It stays off that computer until POST /managed-printers/{mid}/deploy."
          },
          "detail": {
            "type": "string",
            "description": "Failure text or progress note from the computer."
          },
          "printer_name": {
            "type": "string",
            "description": "Queue name on the computer."
          },
          "attempts": {
            "type": "integer"
          },
          "last_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted before the first attempt."
          },
          "installed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted until installed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_hostname": {
            "type": "string",
            "description": "Omitted when the computer has no hostname or name on record."
          },
          "managed_printer_name": {
            "type": "string"
          },
          "agent_online": {
            "type": "boolean",
            "description": "Whether the computer is connected right now."
          }
        }
      },
      "ManagedPrinterJobs": {
        "type": "object",
        "required": [
          "tracking",
          "jobs",
          "limit"
        ],
        "properties": {
          "tracking": {
            "type": "boolean",
            "description": "Whether print job tracking is on for the printer's customer. When false an empty list means tracking is off, not that nothing printed."
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintJob"
            },
            "description": "Newest first."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of jobs returned (500)."
          }
        }
      },
      "PrinterLocation": {
        "type": "object",
        "description": "Where a managed printer sits on one of its customer's floor plans. x and y are fractions of the image width and height.",
        "required": [
          "map_id",
          "x",
          "y"
        ],
        "properties": {
          "map_id": {
            "type": "string",
            "description": "Floor plan id. Empty when the printer is not placed."
          },
          "x": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "Driver": {
        "type": "object",
        "description": "A printer driver installed on one computer, as the computer reported it.",
        "required": [
          "id",
          "agent_id",
          "customer_id",
          "platform_customer_id",
          "name",
          "version",
          "driver_date",
          "provider",
          "manufacturer",
          "environment",
          "driver_version_raw",
          "inf_path",
          "config_file",
          "data_file",
          "driver_path",
          "help_file",
          "dependent_files",
          "print_processor",
          "monitor_name",
          "is_package_aware",
          "driver_attributes",
          "oem_url",
          "core_driver_deps",
          "synced_at",
          "created_at",
          "has_package"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "platform_customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "driver_date": {
            "type": "string",
            "description": "As stored, for example `2025-06-12`."
          },
          "provider": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "description": "Windows environment, for example `Windows x64`."
          },
          "driver_version_raw": {
            "type": "integer",
            "format": "int64"
          },
          "inf_path": {
            "type": "string"
          },
          "config_file": {
            "type": "string"
          },
          "data_file": {
            "type": "string"
          },
          "driver_path": {
            "type": "string"
          },
          "help_file": {
            "type": "string"
          },
          "dependent_files": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "print_processor": {
            "type": "string"
          },
          "monitor_name": {
            "type": "string"
          },
          "is_package_aware": {
            "type": "boolean"
          },
          "driver_attributes": {
            "type": "integer"
          },
          "oem_url": {
            "type": "string"
          },
          "core_driver_deps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "hostname": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_status": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "has_package": {
            "type": "boolean",
            "description": "The account already holds a package that declares this driver name, so it can be deployed without importing it."
          }
        }
      },
      "DriversOverview": {
        "type": "object",
        "description": "One row of the drivers overview: either a package (`key` starts with `pkg:`) or a discovered driver no package covers (`key` starts with `drv:`). Inbox and virtual drivers are left out.",
        "required": [
          "key",
          "name",
          "version",
          "environment",
          "manufacturer",
          "driver_names",
          "machines",
          "customers"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "`pkg:<package id>` or `drv:<name>|<version>|<environment>`."
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "description": "Package architecture (or environment), or the discovered driver's environment."
          },
          "manufacturer": {
            "type": "string"
          },
          "driver_names": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Driver names the package declares, or the discovered driver's name."
          },
          "package": {
            "$ref": "#/components/schemas/DriverPackage",
            "description": "Present on package rows."
          },
          "packaging": {
            "$ref": "#/components/schemas/AutoPull",
            "description": "Present on unpackaged rows that have an automatic packaging queue entry."
          },
          "machines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DriverMachine"
            }
          },
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DriverCustomer"
            }
          }
        }
      },
      "DriverMachine": {
        "type": "object",
        "required": [
          "agent_id",
          "hostname",
          "status",
          "customer_id",
          "customer_name",
          "version"
        ],
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Computer status."
          },
          "customer_id": {
            "type": "string"
          },
          "customer_name": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "description": "Driver version installed on this computer."
          }
        }
      },
      "DriverCustomer": {
        "type": "object",
        "required": [
          "id",
          "name",
          "machines"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "machines": {
            "type": "integer",
            "description": "Computers of this customer with the driver."
          }
        }
      },
      "DriverPackage": {
        "type": "object",
        "description": "A driver payload PrintCtrl holds and can install. One per account per content hash.",
        "required": [
          "id",
          "platform_customer_id",
          "name",
          "version",
          "manufacturer",
          "environment",
          "architecture",
          "inf_name",
          "driver_names",
          "sha256",
          "size_bytes",
          "signed",
          "signature_subject",
          "signature_thumbprint",
          "catalog_verified",
          "visibility",
          "shared",
          "download_count",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "platform_customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "architecture": {
            "type": "string"
          },
          "inf_name": {
            "type": "string"
          },
          "driver_names": {
            "type": "string",
            "description": "Comma-separated driver names the INF declares."
          },
          "sha256": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "signed": {
            "type": "boolean"
          },
          "signature_subject": {
            "type": "string"
          },
          "signature_thumbprint": {
            "type": "string"
          },
          "catalog_verified": {
            "type": "boolean",
            "description": "The catalog signature was verified server side. Unverified packages are never installed."
          },
          "visibility": {
            "type": "string",
            "description": "Always `private` for packages; sharing is `shared`."
          },
          "shared": {
            "type": "boolean",
            "description": "Usable by every customer in the account, not only customers whose computers already have the driver."
          },
          "source_agent_id": {
            "type": "string",
            "description": "Computer the package was exported from. Omitted when unknown."
          },
          "source_hostname": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "download_count": {
            "type": "integer"
          },
          "created_by": {
            "type": "string"
          },
          "directory_build_id": {
            "type": "string",
            "description": "Set when the package was imported from the PrintCtrl driver catalog. Omitted otherwise."
          },
          "directory_revoked": {
            "type": "boolean",
            "description": "The catalog build was revoked; new deployments of it are blocked. Omitted when false."
          },
          "directory_legacy": {
            "type": "boolean",
            "description": "The catalog build is signed only under Microsoft's retired SHA-1 roots. It still installs. Omitted when false."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AutoPull": {
        "type": "object",
        "description": "An entry in the automatic packaging queue, which turns each driver discovered on a computer into a package once per account.",
        "required": [
          "id",
          "name",
          "version",
          "environment",
          "state",
          "attempts",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Driver name."
          },
          "version": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "done",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "last_error": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted when not scheduled."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DriverImportStarted": {
        "type": "object",
        "required": [
          "status",
          "driver_name",
          "note"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "import started"
            ]
          },
          "driver_name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "DriverPackageUpdate": {
        "type": "object",
        "required": [
          "shared"
        ],
        "properties": {
          "shared": {
            "type": "boolean"
          }
        }
      },
      "MonitorSupplyLevel": {
        "type": "object",
        "description": "One consumable inside a monitor listing. Built by the database, so every key is present and missing values are null rather than omitted.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Consumable name as the printer reports it."
          },
          "colorant": {
            "type": [
              "string",
              "null"
            ],
            "description": "Colorant, for example black or cyan. Null when not reported."
          },
          "level": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Current level in `unit`. Null when not reported."
          },
          "max_level": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Capacity in `unit`. Null when not reported."
          },
          "percent": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Level as a percentage of capacity. Null when the printer does not report a measurable level."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unit of `level` and `max_level`."
          },
          "sampled_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When this level was read.",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "colorant",
          "level",
          "max_level",
          "percent",
          "unit",
          "sampled_at"
        ]
      },
      "Monitor": {
        "type": "object",
        "description": "One monitored printer address with its current state, latest consumable levels and latest page count.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Monitor id.",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "description": "Your account (tenant) id.",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "description": "Customer the printer belongs to. Omitted when empty.",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "description": "Computer that runs this monitor. Omitted when empty.",
            "format": "uuid"
          },
          "printer_id": {
            "type": "string",
            "description": "Discovered printer (queue) this monitor is linked to. Omitted when not linked.",
            "format": "uuid"
          },
          "host_address": {
            "type": "string",
            "description": "Printer IP address or host name."
          },
          "icmp_enabled": {
            "type": "boolean",
            "description": "Ping checks are on."
          },
          "snmp_enabled": {
            "type": "boolean",
            "description": "SNMP checks are on."
          },
          "snmp_community_set": {
            "type": "boolean",
            "description": "Whether this monitor has an SNMP v2c community. The community itself is never returned."
          },
          "state": {
            "type": "string",
            "description": "Current reachability.",
            "enum": [
              "up",
              "down",
              "unknown"
            ]
          },
          "latency_ms": {
            "type": "integer",
            "description": "Last measured response time in milliseconds. Omitted when unknown."
          },
          "last_change_at": {
            "type": "string",
            "description": "When `state` last changed. Omitted when never.",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "description": "When the printer last answered. Omitted when never.",
            "format": "date-time"
          },
          "consecutive_failures": {
            "type": "integer",
            "description": "Checks failed in a row."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_name": {
            "type": "string",
            "description": "Name of the watching computer. Omitted when empty."
          },
          "agent_hostname": {
            "type": "string",
            "description": "Host name of the watching computer. Omitted when empty."
          },
          "agent_status": {
            "type": "string",
            "description": "Connection status of the watching computer, for example online or offline. Omitted when empty."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "printer_name": {
            "type": "string",
            "description": "Queue name of the linked printer. Omitted when not linked."
          },
          "supplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorSupplyLevel"
            },
            "description": "Latest level of every consumable, lowest percentage first. Empty array when none are reported."
          },
          "lowest_supply_percent": {
            "type": "integer",
            "description": "Lowest consumable percentage. Omitted when no consumable reports a percentage."
          },
          "page_count": {
            "type": "integer",
            "description": "Latest lifetime page count. Omitted when no count has been read.",
            "format": "int64"
          },
          "counter_sampled_at": {
            "type": "string",
            "description": "When `page_count` was read. Omitted with `page_count`.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "platform_customer_id",
          "host_address",
          "icmp_enabled",
          "snmp_enabled",
          "state",
          "consecutive_failures",
          "created_at",
          "updated_at",
          "supplies"
        ]
      },
      "MonitorCounts": {
        "type": "object",
        "description": "State counts over the returned list only, not the whole account.",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Monitors in the returned list."
          },
          "up": {
            "type": "integer"
          },
          "down": {
            "type": "integer"
          },
          "unknown": {
            "type": "integer",
            "description": "Monitors whose state is neither up nor down."
          }
        },
        "required": [
          "total",
          "up",
          "down",
          "unknown"
        ]
      },
      "MonitorList": {
        "type": "object",
        "properties": {
          "monitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Monitor"
            },
            "description": "Down monitors first, then by lowest consumable, then by address."
          },
          "counts": {
            "$ref": "#/components/schemas/MonitorCounts"
          },
          "low_supply": {
            "type": "integer",
            "description": "How many returned monitors have a consumable below `low_supply_threshold`."
          },
          "low_supply_threshold": {
            "type": "integer",
            "description": "Percentage below which a consumable counts as low (15)."
          }
        },
        "required": [
          "monitors",
          "counts",
          "low_supply",
          "low_supply_threshold"
        ]
      },
      "MonitorEvent": {
        "type": "object",
        "description": "One recorded state change (up, down or unknown). Monitoring stores transitions, not every check.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Event id.",
            "format": "uuid"
          },
          "monitor_id": {
            "type": "string",
            "description": "Monitor that recorded the change."
          },
          "platform_customer_id": {
            "type": "string",
            "description": "Your account (tenant) id.",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "description": "Omitted when empty.",
            "format": "uuid"
          },
          "occurred_at": {
            "type": "string",
            "description": "When the state changed.",
            "format": "date-time"
          },
          "state": {
            "type": "string",
            "description": "State the printer changed to.",
            "enum": [
              "up",
              "down",
              "unknown"
            ]
          },
          "latency_ms": {
            "type": "integer",
            "description": "Response time at the change, in milliseconds. Omitted when unknown."
          },
          "detail": {
            "type": "string",
            "description": "Reason text from the agent. Omitted when empty."
          },
          "host_address": {
            "type": "string",
            "description": "Omitted when empty. Not included in device history events."
          },
          "printer_name": {
            "type": "string",
            "description": "Omitted when empty. Not included in device history events."
          },
          "agent_name": {
            "type": "string",
            "description": "Omitted when empty. Not included in device history events."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty. Not included in device history events."
          }
        },
        "required": [
          "id",
          "monitor_id",
          "platform_customer_id",
          "occurred_at",
          "state"
        ]
      },
      "MonitorEventPage": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorEvent"
            },
            "description": "Newest first."
          },
          "next_cursor": {
            "type": "string",
            "description": "Opaque cursor for the next page. Empty string (not null) when there are no more events."
          },
          "has_more": {
            "type": "boolean",
            "description": "True when `next_cursor` is not empty."
          },
          "limit": {
            "type": "integer",
            "description": "The page size used."
          },
          "retention_days": {
            "type": "integer",
            "description": "How long events are kept (90)."
          }
        },
        "required": [
          "events",
          "next_cursor",
          "has_more",
          "limit",
          "retention_days"
        ]
      },
      "Supply": {
        "type": "object",
        "description": "Current level of one consumable. Each row is the latest reading; there is no per-supply history here.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Supply row id.",
            "format": "uuid"
          },
          "monitor_id": {
            "type": "string",
            "description": "Monitor that reported it."
          },
          "name": {
            "type": "string",
            "description": "Consumable name as the printer reports it."
          },
          "colorant": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "level": {
            "type": "integer",
            "description": "Current level in `unit`. Omitted when not reported."
          },
          "max_level": {
            "type": "integer",
            "description": "Capacity in `unit`. Omitted when not reported."
          },
          "percent": {
            "type": "integer",
            "description": "Level as a percentage. Omitted when not measurable."
          },
          "unit": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "sampled_at": {
            "type": "string",
            "description": "Omitted when unknown.",
            "format": "date-time"
          },
          "host_address": {
            "type": "string",
            "description": "Printer address. Omitted when empty."
          },
          "printer_name": {
            "type": "string",
            "description": "Linked queue name. Omitted when empty."
          },
          "agent_name": {
            "type": "string",
            "description": "Watching computer. Omitted when empty."
          },
          "low": {
            "type": "boolean",
            "description": "True when `percent` is below the low threshold (15)."
          }
        },
        "required": [
          "id",
          "monitor_id",
          "name",
          "low"
        ]
      },
      "MonitorSupplies": {
        "type": "object",
        "properties": {
          "monitor": {
            "$ref": "#/components/schemas/Monitor"
          },
          "supplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Supply"
            },
            "description": "Lowest percentage first; consumables without a percentage last."
          },
          "threshold": {
            "type": "integer",
            "description": "Low threshold percentage (15)."
          }
        },
        "required": [
          "monitor",
          "supplies",
          "threshold"
        ]
      },
      "MonitorAllSupplies": {
        "type": "object",
        "properties": {
          "supplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Supply"
            },
            "description": "Every consumable in the account, lowest percentage first."
          },
          "counters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Counter"
            },
            "description": "Latest page count per monitor. Null if the counters could not be read (the supplies are still returned)."
          },
          "low": {
            "type": "integer",
            "description": "How many returned supplies are low."
          },
          "threshold": {
            "type": "integer",
            "description": "Low threshold percentage (15)."
          }
        },
        "required": [
          "supplies",
          "counters",
          "low",
          "threshold"
        ]
      },
      "Counter": {
        "type": "object",
        "description": "One page-count reading.",
        "properties": {
          "monitor_id": {
            "type": "string"
          },
          "sampled_at": {
            "type": "string",
            "description": "When the count was read.",
            "format": "date-time"
          },
          "page_count": {
            "type": "integer",
            "description": "Lifetime page count.",
            "format": "int64"
          },
          "host_address": {
            "type": "string",
            "description": "Omitted when empty. Not set on history samples."
          },
          "printer_name": {
            "type": "string",
            "description": "Omitted when empty. Not set on history samples."
          },
          "agent_name": {
            "type": "string",
            "description": "Computer that took the reading. Omitted when empty. Not set on history samples."
          }
        },
        "required": [
          "monitor_id",
          "sampled_at",
          "page_count"
        ]
      },
      "MonitorCounterSeries": {
        "type": "object",
        "description": "`latest` and `first` are omitted when the window has no readings.",
        "properties": {
          "monitor_id": {
            "type": "string"
          },
          "host_address": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "printer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "latest": {
            "$ref": "#/components/schemas/Counter"
          },
          "first": {
            "$ref": "#/components/schemas/Counter"
          },
          "pages_in_range": {
            "type": "integer",
            "description": "Latest minus first page count across the window. 0 when the count went down (counter reset or printer replaced) or there are fewer than two readings.",
            "format": "int64"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Counter"
            },
            "description": "Readings in the window, oldest first, at most 2,000."
          }
        },
        "required": [
          "monitor_id",
          "pages_in_range",
          "history"
        ]
      },
      "MonitorCounters": {
        "type": "object",
        "properties": {
          "monitor": {
            "$ref": "#/components/schemas/Monitor"
          },
          "series": {
            "$ref": "#/components/schemas/MonitorCounterSeries"
          },
          "days": {
            "type": "integer",
            "description": "Window actually used, in days."
          }
        },
        "required": [
          "monitor",
          "series",
          "days"
        ]
      },
      "MonitoringProbeResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "How the protocol fared on the last reading, as the agent reports it (for example ok). Empty string when not tried."
          },
          "version": {
            "type": "string",
            "description": "Protocol version that answered. Omitted when empty."
          },
          "detail": {
            "type": "string",
            "description": "Error or detail text. Omitted when empty."
          }
        },
        "required": [
          "status"
        ]
      },
      "MonitoringIdentity": {
        "type": "object",
        "description": "What the printer says about itself over SNMP or IPP. Every field is omitted when empty.",
        "properties": {
          "sys_descr": {
            "type": "string"
          },
          "sys_name": {
            "type": "string"
          },
          "sys_location": {
            "type": "string"
          },
          "sys_contact": {
            "type": "string"
          },
          "sys_object_id": {
            "type": "string"
          },
          "printer_name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "serial_number": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "firmware": {
            "type": "string"
          },
          "device_id": {
            "type": "string",
            "description": "IEEE 1284 device id string."
          },
          "uptime_s": {
            "type": "integer",
            "description": "Printer uptime in seconds.",
            "format": "int64"
          },
          "profile": {
            "type": "string",
            "description": "Vendor profile the agent used to read the printer."
          }
        }
      },
      "MonitoringLight": {
        "type": "object",
        "description": "A control-panel light and its blink pattern.",
        "properties": {
          "name": {
            "type": "string"
          },
          "on_ms": {
            "type": "integer"
          },
          "off_ms": {
            "type": "integer"
          },
          "color": {
            "type": "integer",
            "description": "Printer MIB color code. Omitted when 0."
          }
        },
        "required": [
          "name",
          "on_ms",
          "off_ms"
        ]
      },
      "MonitoringRawCover": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "description": "Printer MIB cover status code."
          }
        },
        "required": [
          "name",
          "status"
        ]
      },
      "MonitoringStatus": {
        "type": "object",
        "description": "Printer status as last read. Every field is omitted when empty.",
        "properties": {
          "printer": {
            "type": "string",
            "description": "Printer status, for example idle or printing."
          },
          "device": {
            "type": "string",
            "description": "Device status, for example running or warning."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Error conditions reported."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IPP printer-state-reasons."
          },
          "message": {
            "type": "string",
            "description": "Status message."
          },
          "console": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Control-panel display lines."
          },
          "lights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringLight"
            }
          },
          "covers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringRawCover"
            }
          }
        }
      },
      "MonitoringCover": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "open": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "open"
        ]
      },
      "MonitoringTray": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "description": "Tray name, or its description when it has no name."
          },
          "description": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "kind": {
            "type": "string",
            "description": "Input type label. Omitted when empty."
          },
          "media": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "media_type": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "level": {
            "type": "integer",
            "description": "Sheets loaded. Negative values are Printer MIB special values (-2 unknown, -3 at least one)."
          },
          "max": {
            "type": "integer",
            "description": "Capacity."
          },
          "percent": {
            "type": "integer",
            "description": "Fill percentage, -1 when unknown."
          },
          "unit": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "state": {
            "type": "string",
            "description": "Tray state.",
            "enum": [
              "ok",
              "low",
              "empty",
              "missing",
              "error",
              "unknown"
            ]
          }
        },
        "required": [
          "index",
          "name",
          "level",
          "max",
          "percent",
          "state"
        ]
      },
      "MonitoringOutput": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "percent_free": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "max": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "description": "Output bin state.",
            "enum": [
              "ok",
              "nearly_full",
              "full",
              "missing",
              "error",
              "unknown"
            ]
          }
        },
        "required": [
          "index",
          "name",
          "percent_free",
          "remaining",
          "max",
          "state"
        ]
      },
      "MonitoringForecast": {
        "type": "object",
        "properties": {
          "days_left": {
            "type": "number",
            "description": "Days until empty. Omitted when there is not enough history or the level is not falling."
          },
          "per_day": {
            "type": "number",
            "description": "Percentage points used per day."
          },
          "empty_at": {
            "type": "string",
            "description": "When the supply reaches zero at that rate. Omitted with `days_left`.",
            "format": "date-time"
          },
          "basis_days": {
            "type": "number",
            "description": "Days of readings the rate is drawn from."
          }
        },
        "required": [
          "per_day",
          "basis_days"
        ]
      },
      "MonitoringSupplyLevel": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "colorant": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "percent": {
            "type": "integer",
            "description": "Level percentage; negative when not measurable."
          },
          "level": {
            "type": "integer"
          },
          "max_level": {
            "type": "integer"
          },
          "unit": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "type": {
            "type": "string",
            "description": "Supply type as the printer reports it. Omitted when empty."
          },
          "kind": {
            "type": "string",
            "description": "Normalized kind.",
            "enum": [
              "toner",
              "ink",
              "drum",
              "fuser",
              "waste",
              "other"
            ]
          },
          "receptacle": {
            "type": "boolean",
            "description": "True for something that fills up (waste toner, maintenance box) rather than runs out."
          },
          "forecast": {
            "$ref": "#/components/schemas/MonitoringForecast"
          },
          "last_replaced": {
            "type": "string",
            "description": "When the level last jumped up (a new cartridge). Omitted when never seen.",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "percent",
          "level",
          "max_level",
          "kind",
          "receptacle",
          "forecast"
        ]
      },
      "MonitoringPageCounters": {
        "type": "object",
        "description": "Lifetime counters from the last reading. Each field is omitted when the printer does not report it.",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "mono": {
            "type": "integer",
            "format": "int64"
          },
          "color": {
            "type": "integer",
            "format": "int64"
          },
          "print": {
            "type": "integer",
            "format": "int64"
          },
          "copy": {
            "type": "integer",
            "format": "int64"
          },
          "scan": {
            "type": "integer",
            "format": "int64"
          },
          "fax": {
            "type": "integer",
            "format": "int64"
          },
          "duplex": {
            "type": "integer",
            "format": "int64"
          },
          "print_mono": {
            "type": "integer",
            "format": "int64"
          },
          "print_color": {
            "type": "integer",
            "format": "int64"
          },
          "copy_mono": {
            "type": "integer",
            "format": "int64"
          },
          "copy_color": {
            "type": "integer",
            "format": "int64"
          },
          "unit": {
            "type": "string"
          },
          "power_on": {
            "type": "integer",
            "description": "Power-on counter.",
            "format": "int64"
          },
          "source": {
            "type": "string",
            "description": "Where the counters were read from."
          }
        }
      },
      "MonitoringCapabilities": {
        "type": "object",
        "description": "What this printer has been seen to report. All false until a reading arrives.",
        "properties": {
          "status": {
            "type": "boolean"
          },
          "alerts": {
            "type": "boolean"
          },
          "supplies": {
            "type": "boolean"
          },
          "supply_levels": {
            "type": "boolean"
          },
          "trays": {
            "type": "boolean"
          },
          "tray_levels": {
            "type": "boolean"
          },
          "outputs": {
            "type": "boolean"
          },
          "covers": {
            "type": "boolean"
          },
          "console": {
            "type": "boolean"
          },
          "counter_total": {
            "type": "boolean"
          },
          "counter_color": {
            "type": "boolean"
          },
          "counter_function": {
            "type": "boolean",
            "description": "Counters split by print, copy, scan and fax."
          },
          "counter_duplex": {
            "type": "boolean"
          },
          "serial": {
            "type": "boolean"
          },
          "firmware": {
            "type": "boolean"
          }
        },
        "required": [
          "status",
          "alerts",
          "supplies",
          "supply_levels",
          "trays",
          "tray_levels",
          "outputs",
          "covers",
          "console",
          "counter_total",
          "counter_color",
          "counter_function",
          "counter_duplex",
          "serial",
          "firmware"
        ]
      },
      "MonitoringPrinterAlert": {
        "type": "object",
        "description": "An alert the printer raised (paper jam, toner low, and so on).",
        "properties": {
          "id": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "description": "For example critical, warning or info."
          },
          "code": {
            "type": "integer",
            "description": "Printer MIB alert code."
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "closed_at": {
            "type": "string",
            "description": "When it cleared. Omitted while open.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "severity",
          "code",
          "label",
          "opened_at",
          "last_seen_at"
        ]
      },
      "MonitoringState": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "unknown"
            ]
          },
          "latency_ms": {
            "type": "integer",
            "description": "0 when unknown."
          },
          "last_seen_at": {
            "type": "string",
            "description": "Omitted when never.",
            "format": "date-time"
          },
          "last_change_at": {
            "type": "string",
            "description": "Omitted when never.",
            "format": "date-time"
          },
          "consecutive_failures": {
            "type": "integer"
          }
        },
        "required": [
          "state",
          "latency_ms",
          "consecutive_failures"
        ]
      },
      "MonitoringWatcher": {
        "type": "object",
        "description": "Which computer watches this printer and why.",
        "properties": {
          "mode": {
            "type": "string",
            "description": "The printer's own watcher setting.",
            "enum": [
              "inherit",
              "auto",
              "agent"
            ]
          },
          "chosen_agent_id": {
            "type": "string",
            "description": "Computer picked for this printer when `mode` is agent. Omitted when empty."
          },
          "customer_agent_id": {
            "type": "string",
            "description": "Customer-wide watcher, used when `mode` is inherit. Omitted when the customer is on automatic."
          },
          "assigned_agent_id": {
            "type": "string",
            "description": "Computer currently watching the printer. Omitted when none."
          },
          "assigned_agent_name": {
            "type": "string",
            "description": "Omitted when none."
          },
          "assigned_agent_status": {
            "type": "string",
            "description": "Omitted when none."
          },
          "reason": {
            "type": "string",
            "description": "Why that computer was assigned: chosen, auto, standin (filling in for a chosen computer that is offline), none, or off (monitoring is turned off)."
          },
          "assigned_at": {
            "type": "string",
            "description": "Omitted when none.",
            "format": "date-time"
          }
        },
        "required": [
          "mode",
          "reason"
        ]
      },
      "MonitoringCandidate": {
        "type": "object",
        "description": "One of the customer's computers as a possible watcher.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Computer id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "For example online or offline."
          },
          "has_queue": {
            "type": "boolean",
            "description": "The computer has a print queue for this address."
          },
          "last_up_at": {
            "type": "string",
            "description": "When this computer last reached the printer. Omitted when never.",
            "format": "date-time"
          },
          "latency_ms": {
            "type": "integer",
            "description": "Its last response time to the printer. Omitted when 0."
          },
          "has_battery": {
            "type": "boolean",
            "description": "Laptop hint. Omitted when unknown."
          },
          "os_caption": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "monitoring_off": {
            "type": "boolean",
            "description": "The computer is set never to watch printers. Omitted when false."
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "has_queue"
        ]
      },
      "MonitoringSettings": {
        "type": "object",
        "properties": {
          "off": {
            "type": "boolean",
            "description": "The printer's own monitoring switch is off."
          },
          "customer_off": {
            "type": "boolean",
            "description": "Monitoring is turned off for the whole customer. Monitoring runs only when `off` and `customer_off` are both false."
          },
          "profile_id": {
            "type": "string",
            "description": "The printer's own profile choice. Empty string to follow the computer and customer."
          },
          "effective_profile_id": {
            "type": "string",
            "description": "Profile that actually applies. Omitted when none."
          },
          "effective_profile_name": {
            "type": "string",
            "description": "Omitted when none."
          },
          "source": {
            "type": "string",
            "description": "Level that supplied the effective profile.",
            "enum": [
              "printer",
              "machine",
              "customer",
              "none"
            ]
          },
          "inherited_profile_name": {
            "type": "string",
            "description": "Profile the printer would get with no choice of its own. Omitted when none."
          },
          "watcher_off": {
            "type": "boolean",
            "description": "The assigned computer has monitoring turned off. Omitted when false."
          }
        },
        "required": [
          "off",
          "customer_off",
          "profile_id",
          "source"
        ]
      },
      "DeviceMonitoring": {
        "type": "object",
        "description": "Everything monitoring knows about one printer address at one customer. `counters` and `monitor` are omitted when there is nothing to show. Arrays are always present, empty when there is nothing.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Device id, used by GET /monitoring/devices/{id}/history. Empty string while `known` is false."
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "host": {
            "type": "string",
            "description": "Printer address."
          },
          "known": {
            "type": "boolean",
            "description": "False when monitoring has not reached this address yet. The reading fields are then empty, but watcher, candidates and settings are filled."
          },
          "source": {
            "type": "string",
            "description": "Protocol of the last reading. Empty string when unknown."
          },
          "snmp": {
            "$ref": "#/components/schemas/MonitoringProbeResult"
          },
          "ipp": {
            "$ref": "#/components/schemas/MonitoringProbeResult"
          },
          "reading_at": {
            "type": "string",
            "description": "When the last reading arrived. Omitted when never.",
            "format": "date-time"
          },
          "manufacturer": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "model": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "serial_number": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "firmware": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "vendor_slug": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "profile": {
            "type": "string",
            "description": "Vendor read profile. Omitted when empty."
          },
          "identity": {
            "$ref": "#/components/schemas/MonitoringIdentity"
          },
          "status": {
            "$ref": "#/components/schemas/MonitoringStatus"
          },
          "covers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringCover"
            }
          },
          "trays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringTray"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringOutput"
            }
          },
          "supplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringSupplyLevel"
            },
            "description": "Consumables with a depletion forecast."
          },
          "counters": {
            "$ref": "#/components/schemas/MonitoringPageCounters"
          },
          "capabilities": {
            "$ref": "#/components/schemas/MonitoringCapabilities"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringPrinterAlert"
            },
            "description": "Open alerts, critical first."
          },
          "monitor": {
            "$ref": "#/components/schemas/MonitoringState"
          },
          "last_sample_at": {
            "type": "string",
            "description": "Omitted when never.",
            "format": "date-time"
          },
          "watcher": {
            "$ref": "#/components/schemas/MonitoringWatcher"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringCandidate"
            },
            "description": "The customer's computers that could watch this printer, online and queue-holding first."
          },
          "settings": {
            "$ref": "#/components/schemas/MonitoringSettings"
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Managed printer at this address, if any. Omitted when none."
          },
          "snmp_enabled": {
            "type": "boolean",
            "description": "SNMP is on after the managed printer and profile settings are applied."
          },
          "snmp_version": {
            "type": "string",
            "description": "SNMP version in force: the profile's when one applies, otherwise the customer's.",
            "enum": [
              "2c",
              "3"
            ]
          },
          "community_set": {
            "type": "boolean",
            "description": "Whether an SNMP v2c community is in force (a managed printer override, the profile or the customer). The community itself is never returned."
          }
        },
        "required": [
          "id",
          "customer_id",
          "host",
          "known",
          "source",
          "snmp",
          "ipp",
          "identity",
          "status",
          "covers",
          "trays",
          "outputs",
          "supplies",
          "capabilities",
          "alerts",
          "watcher",
          "candidates",
          "settings",
          "snmp_enabled",
          "snmp_version",
          "community_set"
        ]
      },
      "MonitoringDeviceResponse": {
        "type": "object",
        "properties": {
          "device": {
            "$ref": "#/components/schemas/DeviceMonitoring"
          },
          "low_threshold": {
            "type": "integer",
            "description": "Low consumable threshold percentage (15)."
          },
          "grace_seconds": {
            "type": "integer",
            "description": "How long a watching computer may be disconnected before its printers move to another computer (180)."
          },
          "retention_days": {
            "type": "object",
            "properties": {
              "samples": {
                "type": "integer",
                "description": "Five-minute samples (14)."
              },
              "daily": {
                "type": "integer",
                "description": "Daily rollups (400)."
              }
            },
            "required": [
              "samples",
              "daily"
            ]
          }
        },
        "required": [
          "device",
          "low_threshold",
          "grace_seconds",
          "retention_days"
        ]
      },
      "MonitoringDeviceUpdateResult": {
        "type": "object",
        "description": "Normally `{\"device\": {...}}`; `{\"ok\": true}` if the change saved but re-reading the printer failed.",
        "properties": {
          "device": {
            "$ref": "#/components/schemas/DeviceMonitoring"
          },
          "ok": {
            "type": "boolean",
            "const": true,
            "description": "Sent instead of `device` when the change was saved but the updated view could not be read back."
          }
        }
      },
      "MonitoringHistoryPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "description": "Start of the bucket (5-minute sample for 24h, hour for 7d, local day for longer ranges).",
            "format": "date-time"
          },
          "latency_ms": {
            "type": [
              "number",
              "null"
            ],
            "description": "Average response time. Null when the printer did not answer in that bucket."
          },
          "max_ms": {
            "type": "integer",
            "description": "Highest response time."
          },
          "up_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Share of checks answered, 0-100. Null when there were no checks."
          }
        },
        "required": [
          "t",
          "latency_ms",
          "max_ms",
          "up_pct"
        ]
      },
      "MonitoringDailyPoint": {
        "type": "object",
        "description": "One day. Every day in the range is present; days with no data have nulls, not zeros.",
        "properties": {
          "day": {
            "type": "string",
            "description": "Day in the customer's time zone.",
            "format": "date"
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Pages that day. Null when no data."
          },
          "mono": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "color": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "print": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "copy": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "scan": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "fax": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "duplex": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "up_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Availability that day, 0-100. Null when no data."
          },
          "latency_ms": {
            "type": [
              "number",
              "null"
            ],
            "description": "Average response time. Null when no data."
          },
          "max_ms": {
            "type": "integer",
            "description": "Highest response time (0 when no data)."
          }
        },
        "required": [
          "day",
          "total",
          "mono",
          "color",
          "print",
          "copy",
          "scan",
          "fax",
          "duplex",
          "up_pct",
          "latency_ms",
          "max_ms"
        ]
      },
      "MonitoringSupplyHistoryPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time"
          },
          "pct": {
            "type": "integer",
            "description": "Level percentage."
          },
          "replaced": {
            "type": "boolean",
            "description": "A new cartridge was detected at this point. Omitted when false."
          }
        },
        "required": [
          "t",
          "pct"
        ]
      },
      "DeviceHistory": {
        "type": "object",
        "description": "Chart data for one printer over one range.",
        "properties": {
          "range": {
            "type": "string",
            "description": "Range actually used.",
            "enum": [
              "24h",
              "7d",
              "30d",
              "90d",
              "365d"
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringHistoryPoint"
            },
            "description": "Response time and availability chart, oldest first."
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringDailyPoint"
            },
            "description": "One row per day: 7 days for 24h and 7d, otherwise the range length."
          },
          "supplies": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/MonitoringSupplyHistoryPoint"
              }
            },
            "description": "Level history keyed by consumable name, oldest first, covering the range (at least 7, at most 90 days)."
          },
          "uptime": {
            "type": "object",
            "properties": {
              "day": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Last 24 hours, percent. Null when no data."
              },
              "week": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Last 7 days, percent. Null when no data."
              },
              "month": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Last 30 days, percent. Null when no data."
              }
            },
            "required": [
              "day",
              "week",
              "month"
            ]
          },
          "outages": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "description": "Down periods in the window."
              },
              "longest_s": {
                "type": "integer",
                "description": "Longest down period in seconds."
              },
              "total_s": {
                "type": "integer",
                "description": "Total down time in seconds."
              },
              "ongoing_s": {
                "type": "integer",
                "description": "Length of the current outage in seconds. Omitted when the printer is not down."
              },
              "window_days": {
                "type": "integer",
                "description": "Window the summary covers (30)."
              }
            },
            "required": [
              "count",
              "longest_s",
              "total_s",
              "window_days"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorEvent"
            },
            "description": "Up to 100 most recent state changes in the last 90 days, newest first. Names (host_address, printer_name, agent_name, customer_name) are not included."
          },
          "alerts_log": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitoringPrinterAlert"
            },
            "description": "Up to 50 most recent printer alerts, open and closed, newest first."
          },
          "first_sample_at": {
            "type": "string",
            "description": "When samples for this printer begin. Omitted when there are none.",
            "format": "date-time"
          }
        },
        "required": [
          "range",
          "points",
          "daily",
          "supplies",
          "uptime",
          "outages",
          "events",
          "alerts_log"
        ]
      },
      "MonitoringProfile": {
        "type": "object",
        "description": "A named set of polling settings and SNMP credentials. SNMPv3 passphrases are write-only: responses carry only `snmp_v3_auth_set` and `snmp_v3_priv_set`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "customer_id": {
            "type": "string",
            "description": "Customer that owns the profile. Empty string for a shared profile any customer can use. Fixed at creation."
          },
          "customer_name": {
            "type": "string",
            "description": "Empty string for a shared profile."
          },
          "description": {
            "type": "string"
          },
          "icmp_enabled": {
            "type": "boolean",
            "description": "Ping checks."
          },
          "snmp_enabled": {
            "type": "boolean",
            "description": "SNMP reads."
          },
          "ipp_enabled": {
            "type": "boolean",
            "description": "IPP reads."
          },
          "snmp_version": {
            "type": "string",
            "enum": [
              "2c",
              "3"
            ]
          },
          "snmp_community_set": {
            "type": "boolean",
            "description": "Whether an SNMP v2c community is stored. The community itself is never returned."
          },
          "snmp_v3_user": {
            "type": "string"
          },
          "snmp_v3_auth_proto": {
            "type": "string",
            "description": "Empty string for no authentication.",
            "enum": [
              "",
              "md5",
              "sha",
              "sha224",
              "sha256",
              "sha384",
              "sha512"
            ]
          },
          "snmp_v3_auth_set": {
            "type": "boolean",
            "description": "An SNMPv3 authentication passphrase is stored. The passphrase itself is never returned."
          },
          "snmp_v3_priv_proto": {
            "type": "string",
            "description": "Empty string for no privacy (encryption).",
            "enum": [
              "",
              "des",
              "aes",
              "aes192",
              "aes256",
              "aes192c",
              "aes256c"
            ]
          },
          "snmp_v3_priv_set": {
            "type": "boolean",
            "description": "An SNMPv3 privacy passphrase is stored. The passphrase itself is never returned."
          },
          "snmp_v3_context": {
            "type": "string"
          },
          "used_by_customers": {
            "type": "integer",
            "description": "Customers using this profile as their default."
          },
          "used_by_agents": {
            "type": "integer",
            "description": "Computers using this profile for the printers they watch."
          },
          "used_by_printers": {
            "type": "integer",
            "description": "Printers set to this profile directly."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "customer_id",
          "customer_name",
          "description",
          "icmp_enabled",
          "snmp_enabled",
          "ipp_enabled",
          "snmp_version",
          "snmp_community_set",
          "snmp_v3_user",
          "snmp_v3_auth_proto",
          "snmp_v3_auth_set",
          "snmp_v3_priv_proto",
          "snmp_v3_priv_set",
          "snmp_v3_context",
          "used_by_customers",
          "used_by_agents",
          "used_by_printers",
          "created_at",
          "updated_at"
        ]
      },
      "MonitoringProfileInput": {
        "type": "object",
        "description": "Body for creating or replacing a profile. On update every field except the passphrases is replaced: an omitted check switch becomes true and an omitted community becomes public, so send the full profile.",
        "properties": {
          "customer_id": {
            "type": "string",
            "description": "Customer that will own the profile; omit or send an empty string for a shared profile. Read on create only and ignored on update."
          },
          "name": {
            "type": "string",
            "description": "Required. Trimmed, 1-80 characters, unique within the owning customer (or among shared profiles).",
            "minLength": 1,
            "maxLength": 80
          },
          "description": {
            "type": "string",
            "description": "At most 300 characters after trimming.",
            "maxLength": 300
          },
          "icmp_enabled": {
            "type": "boolean",
            "default": true,
            "description": "Omitted means true. At least one of the three checks must be on."
          },
          "snmp_enabled": {
            "type": "boolean",
            "default": true,
            "description": "Omitted means true."
          },
          "ipp_enabled": {
            "type": "boolean",
            "default": true,
            "description": "Omitted means true."
          },
          "snmp_version": {
            "type": "string",
            "description": "Omitted or empty means 2c.",
            "enum": [
              "2c",
              "3"
            ],
            "default": "2c"
          },
          "snmp_community": {
            "type": "string",
            "description": "At most 32 characters. On create, omitted or empty means public. On update, omitted or empty keeps the stored one. Write-only: responses never return it, only whether one is set.",
            "maxLength": 32,
            "default": "public",
            "writeOnly": true
          },
          "snmp_v3_user": {
            "type": "string",
            "description": "At most 64 characters. Required when SNMP is on and `snmp_version` is 3.",
            "maxLength": 64
          },
          "snmp_v3_auth_proto": {
            "type": "string",
            "description": "Case-insensitive. Empty for no authentication.",
            "enum": [
              "",
              "md5",
              "sha",
              "sha224",
              "sha256",
              "sha384",
              "sha512"
            ]
          },
          "snmp_v3_auth_pass": {
            "type": [
              "string",
              "null"
            ],
            "writeOnly": true,
            "maxLength": 128,
            "description": "Write-only, never returned. 8-128 characters. Omit (or send null) to keep the stored passphrase; send an empty string to clear it. Required (stored or sent) when SNMPv3 is used with an authentication protocol."
          },
          "snmp_v3_priv_proto": {
            "type": "string",
            "description": "Case-insensitive. Empty for no privacy. Needs an authentication protocol too.",
            "enum": [
              "",
              "des",
              "aes",
              "aes192",
              "aes256",
              "aes192c",
              "aes256c"
            ]
          },
          "snmp_v3_priv_pass": {
            "type": [
              "string",
              "null"
            ],
            "writeOnly": true,
            "maxLength": 128,
            "description": "Write-only, never returned. 8-128 characters. Omit (or send null) to keep the stored passphrase; send an empty string to clear it. Required (stored or sent) when SNMPv3 is used with a privacy protocol."
          },
          "snmp_v3_context": {
            "type": "string",
            "description": "At most 64 characters.",
            "maxLength": 64
          }
        },
        "required": [
          "name"
        ]
      },
      "PrinterMonitoringTally": {
        "type": "object",
        "description": "Health of the device the queue prints to, from the monitors watching its address at the same customer. On GET /printers/{pid} this is not filled in: it is always {\"monitors\": 0, \"state\": \"\", \"alert_count\": 0}.",
        "required": [
          "monitors",
          "state",
          "alert_count"
        ],
        "properties": {
          "monitors": {
            "type": "integer",
            "description": "Number of monitors watching the address."
          },
          "state": {
            "type": "string",
            "description": "`up` if any monitor sees the device up, `down` if any sees it down, else `unknown`.",
            "enum": [
              "up",
              "down",
              "unknown",
              ""
            ]
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Omitted when never seen."
          },
          "lowest_supply_percent": {
            "type": "integer",
            "description": "Lowest consumable level reported. Omitted when none."
          },
          "alert_count": {
            "type": "integer",
            "description": "Open device alerts. Not filled in for discovered printers (always 0)."
          },
          "alert_label": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "alert_severity": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "off": {
            "type": "boolean",
            "description": "Monitoring is turned off. Omitted when false."
          }
        }
      },
      "Printer": {
        "type": "object",
        "description": "A print queue an agent discovered on a computer, as returned by GET /printers.",
        "required": [
          "id",
          "agent_id",
          "customer_id",
          "platform_customer_id",
          "name",
          "scope",
          "share_name",
          "port_name",
          "driver_name",
          "comment",
          "location",
          "server_name",
          "is_shared",
          "is_default",
          "is_published",
          "status",
          "status_text",
          "queued_jobs",
          "attributes",
          "priority",
          "print_processor",
          "datatype",
          "sep_file",
          "synced_at",
          "created_at",
          "monitoring"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Discovered printer id.",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "description": "Computer the queue is on.",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "description": "MSP account (tenant) id.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Queue name as Windows shows it."
          },
          "scope": {
            "type": "string",
            "description": "`machine`: a queue installed on the computer. `user`: one person's mapped connection, which most actions do not apply to.",
            "enum": [
              "machine",
              "user"
            ]
          },
          "user_sid": {
            "type": "string",
            "description": "Windows SID of the user, for scope `user`. Omitted when empty."
          },
          "user_name": {
            "type": "string",
            "description": "DOMAIN\\user of the user, for scope `user`. Omitted when empty."
          },
          "share_name": {
            "type": "string"
          },
          "port_name": {
            "type": "string"
          },
          "driver_name": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "server_name": {
            "type": "string",
            "description": "Print server, for a connection to a shared queue."
          },
          "is_shared": {
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean"
          },
          "is_published": {
            "type": "boolean",
            "description": "Published in Active Directory."
          },
          "status": {
            "type": "integer",
            "description": "Win32 PRINTER_STATUS_* bit field; 0 is ready."
          },
          "status_text": {
            "type": "string",
            "description": "Status as text; empty when ready."
          },
          "queued_jobs": {
            "type": "integer"
          },
          "attributes": {
            "type": "integer",
            "description": "Win32 PRINTER_ATTRIBUTE_* bit field."
          },
          "priority": {
            "type": "integer"
          },
          "print_processor": {
            "type": "string"
          },
          "datatype": {
            "type": "string"
          },
          "sep_file": {
            "type": "string",
            "description": "Separator page file."
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Set when PrintCtrl deployed this queue. Omitted otherwise.",
            "format": "uuid"
          },
          "manufacturer": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "model": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "model_source": {
            "type": "string",
            "description": "How the model was established. Omitted when unknown."
          },
          "vendor_slug": {
            "type": "string",
            "description": "Stable vendor key, for example `hp`. Omitted when unknown."
          },
          "device_class": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "serial_number": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "device_image_sha256": {
            "type": "string",
            "description": "Device picture hash. Omitted when none."
          },
          "mac_address": {
            "type": "string",
            "description": "The device's MAC address, from monitoring at the same address. Omitted when unknown."
          },
          "port_type": {
            "type": "string",
            "description": "Type of the port the queue names. Omitted when the port is not known.",
            "enum": [
              "tcpip",
              "usb",
              "wsd",
              "local",
              "file",
              "other"
            ]
          },
          "host_address": {
            "type": "string",
            "description": "Device address from the port, or for a managed printer's queue without one, the managed printer's address. Omitted when none."
          },
          "port_number": {
            "type": "integer",
            "description": "Omitted when 0."
          },
          "protocol": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last time discovery reported this queue."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "agent_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_status": {
            "type": "string",
            "description": "The computer's connection status. Omitted when empty."
          },
          "hostname": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "monitoring": {
            "$ref": "#/components/schemas/PrinterMonitoringTally"
          }
        }
      },
      "PrinterDetail": {
        "description": "A printer with its full configuration, as returned by GET /printers/{pid}.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Printer"
          },
          {
            "type": "object",
            "required": [
              "driver_version",
              "environment",
              "config_tiers"
            ],
            "properties": {
              "devmode_b64": {
                "type": "string",
                "description": "Tier 3: opaque vendor DEVMODE, base64. Omitted when not captured.",
                "contentEncoding": "base64"
              },
              "devmode_public": {
                "description": "Tier 1: documented DEVMODE fields (JSON object). Omitted when not captured."
              },
              "print_ticket_xml": {
                "type": "string",
                "description": "Omitted when empty."
              },
              "capabilities": {
                "description": "Tier 2: the driver's PrintCapabilities feature tree (JSON). Omitted when not captured."
              },
              "raw": {
                "description": "The spooler record as the agent reported it (JSON). Omitted when absent."
              },
              "driver_version": {
                "type": "string",
                "description": "Version of the driver on this computer; empty if unknown."
              },
              "environment": {
                "type": "string",
                "description": "Driver environment on this computer; empty if unknown."
              },
              "config_tiers": {
                "type": "object",
                "required": [
                  "public_devmode",
                  "print_capabilities",
                  "opaque_blob_bytes"
                ],
                "properties": {
                  "public_devmode": {
                    "type": "boolean",
                    "description": "Tier 1 fields were captured."
                  },
                  "print_capabilities": {
                    "type": "boolean",
                    "description": "A PrintCapabilities tree was captured."
                  },
                  "opaque_blob_bytes": {
                    "type": "integer",
                    "description": "Approximate size of the vendor blob in bytes; 0 when none."
                  }
                }
              }
            }
          }
        ]
      },
      "PrinterPage": {
        "type": "object",
        "description": "GET /printers when offset is passed.",
        "required": [
          "printers",
          "total"
        ],
        "properties": {
          "printers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Printer"
            }
          },
          "total": {
            "type": "integer",
            "description": "Printers matching the filters, ignoring paging."
          }
        }
      },
      "PrinterDeleted": {
        "type": "object",
        "required": [
          "deleted"
        ],
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "PrinterTestPageResult": {
        "type": "object",
        "required": [
          "ok",
          "printer"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "printer": {
            "type": "string",
            "description": "Queue name."
          }
        }
      },
      "PrinterClearQueueResult": {
        "type": "object",
        "required": [
          "ok",
          "removed",
          "restarted_spooler"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "removed": {
            "type": "integer",
            "description": "Jobs removed."
          },
          "restarted_spooler": {
            "type": "boolean",
            "description": "The Print Spooler was restarted to clear stuck jobs."
          }
        }
      },
      "PrinterDocumentResult": {
        "type": "object",
        "required": [
          "ok",
          "printer",
          "pages"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "printer": {
            "type": "string",
            "description": "Queue name."
          },
          "pages": {
            "type": "integer",
            "description": "Pages the computer reported printing."
          }
        }
      },
      "PrintJob": {
        "type": "object",
        "description": "One print job reported by an agent (when print job tracking is on for the customer).",
        "required": [
          "id",
          "customer_id",
          "agent_id",
          "hostname",
          "device_name",
          "printer_name",
          "job_id",
          "user_name",
          "machine_name",
          "document_name",
          "pages",
          "color",
          "size_bytes",
          "outcome",
          "submitted_at",
          "completed_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "PrintCtrl job record id."
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "hostname": {
            "type": "string",
            "description": "Computer hostname when the job was recorded."
          },
          "device_name": {
            "type": "string",
            "description": "The computer's current name in PrintCtrl, or its hostname if it has since been removed."
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Managed printer the job was stamped with. Omitted when none.",
            "format": "uuid"
          },
          "printer_name": {
            "type": "string",
            "description": "Queue name."
          },
          "job_id": {
            "type": "integer",
            "description": "Windows spooler job id."
          },
          "user_name": {
            "type": "string"
          },
          "machine_name": {
            "type": "string",
            "description": "Submitting machine as the spooler recorded it."
          },
          "document_name": {
            "type": "string"
          },
          "pages": {
            "type": "integer"
          },
          "color": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Null when the driver did not say."
          },
          "size_bytes": {
            "type": "integer"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "printed",
              "failed",
              "cancelled",
              "unknown"
            ]
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PrinterJobList": {
        "type": "object",
        "required": [
          "tracking",
          "jobs",
          "limit"
        ],
        "properties": {
          "tracking": {
            "type": "boolean",
            "description": "Print job tracking is on for the printer's customer."
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintJob"
            },
            "description": "Newest first."
          },
          "limit": {
            "type": "integer",
            "const": 500,
            "description": "Maximum number of jobs returned."
          }
        }
      },
      "PrintJobTotals": {
        "type": "object",
        "description": "One customer's print activity over the period.",
        "required": [
          "customer_id",
          "jobs",
          "pages",
          "color_pages",
          "mono_pages",
          "failed"
        ],
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "jobs": {
            "type": "integer",
            "description": "All jobs submitted, any outcome."
          },
          "pages": {
            "type": "integer",
            "description": "Pages of jobs that printed."
          },
          "color_pages": {
            "type": "integer",
            "description": "Pages of printed jobs reported as color."
          },
          "mono_pages": {
            "type": "integer",
            "description": "Pages of printed jobs reported as monochrome. Jobs with unknown color count in pages only."
          },
          "failed": {
            "type": "integer",
            "description": "Jobs that failed."
          }
        }
      },
      "PrinterJobTotalsReport": {
        "type": "object",
        "required": [
          "days",
          "since",
          "customers"
        ],
        "properties": {
          "days": {
            "type": "integer"
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the period."
          },
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrintJobTotals"
            }
          }
        }
      },
      "PrinterProblem": {
        "type": "object",
        "description": "A printer device Windows failed to set up on a computer.",
        "required": [
          "id",
          "customer_id",
          "agent_id",
          "agent_name",
          "agent_status",
          "instance_id",
          "name",
          "driver_name",
          "problem_code",
          "problem",
          "host_address",
          "serial_number",
          "model",
          "first_seen_at",
          "synced_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_name": {
            "type": "string",
            "description": "Computer name, or hostname."
          },
          "agent_status": {
            "type": "string",
            "description": "Computer connection status (`offline` when unknown)."
          },
          "instance_id": {
            "type": "string",
            "description": "Windows device instance id."
          },
          "name": {
            "type": "string",
            "description": "Device name."
          },
          "driver_name": {
            "type": "string"
          },
          "problem_code": {
            "type": "integer",
            "description": "Windows Device Manager problem code (CM_PROB_*)."
          },
          "problem": {
            "type": "string",
            "description": "Problem description."
          },
          "host_address": {
            "type": "string"
          },
          "serial_number": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "synced_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last discovery that reported it."
          },
          "network_printer_id": {
            "type": "string",
            "description": "Matching network-discovered device (by serial number or address). Omitted when none.",
            "format": "uuid"
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Managed printer at the same address. Omitted when none.",
            "format": "uuid"
          },
          "managed_printer_name": {
            "type": "string",
            "description": "Omitted when none."
          }
        }
      },
      "PrinterProblemList": {
        "type": "object",
        "required": [
          "printer_problems"
        ],
        "properties": {
          "printer_problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrinterProblem"
            },
            "description": "Newest first, at most 500."
          }
        }
      },
      "PrinterProblemRemoved": {
        "type": "object",
        "required": [
          "removed",
          "retried"
        ],
        "properties": {
          "removed": {
            "type": "boolean",
            "const": true
          },
          "retried": {
            "type": "boolean",
            "description": "Setup was rerun."
          }
        }
      },
      "NetworkPrinter": {
        "type": "object",
        "description": "A device found by an agent's network sweep.",
        "required": [
          "id",
          "customer_id",
          "ip_address",
          "snmp_responded",
          "first_seen_at",
          "last_seen_at",
          "seen_by_agents",
          "queue_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "customer_name": {
            "type": "string",
            "description": "Omitted when empty."
          },
          "ip_address": {
            "type": "string"
          },
          "mac_address": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "hostname": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "sys_name": {
            "type": "string",
            "description": "SNMP sysName. Omitted when unknown."
          },
          "sys_descr": {
            "type": "string",
            "description": "SNMP sysDescr. Omitted when unknown."
          },
          "manufacturer": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "model": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "printer_name": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "serial_number": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "snmp_responded": {
            "type": "boolean"
          },
          "open_ports": {
            "type": "string",
            "description": "Comma-separated open TCP ports. Omitted when none."
          },
          "languages": {
            "type": "string",
            "description": "Printer languages reported. Omitted when unknown."
          },
          "pdl": {
            "type": "string",
            "description": "Page description language. Omitted when unknown."
          },
          "ipp": {
            "description": "IPP attributes the device reported (JSON object). Omitted when it did not answer IPP."
          },
          "sys_object_id": {
            "type": "string",
            "description": "SNMP sysObjectID. Omitted when unknown."
          },
          "last_seen_agent_id": {
            "type": "string",
            "description": "Computer whose sweep last saw it. Omitted when unknown.",
            "format": "uuid"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_agent_name": {
            "type": "string",
            "description": "Omitted when unknown."
          },
          "seen_by_agents": {
            "type": "integer",
            "description": "Number of sightings recorded (one per agent that has seen it)."
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Managed printer at this address and customer. Omitted when none.",
            "format": "uuid"
          },
          "managed_printer_name": {
            "type": "string",
            "description": "Omitted when none."
          },
          "queue_count": {
            "type": "integer",
            "description": "Discovered queues at the customer printing to this address."
          }
        }
      },
      "NetworkPrinterPage": {
        "type": "object",
        "required": [
          "network_printers",
          "total"
        ],
        "properties": {
          "network_printers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetworkPrinter"
            }
          },
          "total": {
            "type": "integer",
            "description": "Devices matching the filters, ignoring limit and offset."
          }
        }
      },
      "Config": {
        "type": "object",
        "description": "A saved printer configuration. Belongs to the MSP account; usable by the customer it was captured from, or by every customer once shared.",
        "required": [
          "id",
          "platform_customer_id",
          "name",
          "driver_name",
          "driver_version",
          "environment",
          "visibility",
          "shared",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform_customer_id": {
            "type": "string",
            "description": "MSP account (tenant) id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "driver_name": {
            "type": "string"
          },
          "driver_version": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "description": "Driver environment, for example `Windows x64`."
          },
          "devmode_b64": {
            "type": "string",
            "description": "Tier 3: the opaque vendor DEVMODE, base64. Only replayed onto the same driver name, version and environment. Omitted in lists and when empty.",
            "contentEncoding": "base64"
          },
          "devmode_public": {
            "description": "Tier 1: documented DEVMODE fields as a JSON object. Omitted in lists and when not captured."
          },
          "print_ticket_xml": {
            "type": "string",
            "description": "PrintTicket XML. Omitted in lists and when empty."
          },
          "registry_data": {
            "description": "Driver registry settings captured with the configuration (JSON). Omitted in lists and when not captured."
          },
          "capabilities": {
            "description": "Tier 2: the PrintCapabilities tree the configuration was edited against (JSON). Omitted in lists and when not stored."
          },
          "visibility": {
            "type": "string",
            "description": "`shared` when usable by every customer in the account, otherwise `private`.",
            "enum": [
              "private",
              "shared",
              "curated"
            ]
          },
          "shared": {
            "type": "boolean",
            "description": "True when visibility is `shared`."
          },
          "source_agent_id": {
            "type": "string",
            "description": "Computer it was captured from. Decides which customer can use it while not shared. Omitted when empty.",
            "format": "uuid"
          },
          "source_printer": {
            "type": "string",
            "description": "Queue it was captured from. Omitted when empty."
          },
          "created_by": {
            "type": "string",
            "description": "User or API client id that saved it."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConfigInput": {
        "type": "object",
        "description": "Body of POST /configs.",
        "required": [
          "driver_name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "driver_name": {
            "type": "string",
            "description": "Required, non-empty."
          },
          "driver_version": {
            "type": "string",
            "description": "Needed, with environment, for the vendor blob to be replayed."
          },
          "environment": {
            "type": "string",
            "description": "For example `Windows x64`."
          },
          "devmode_b64": {
            "type": "string",
            "description": "Opaque vendor DEVMODE, base64.",
            "contentEncoding": "base64"
          },
          "devmode_public": {
            "description": "Documented DEVMODE fields (JSON object)."
          },
          "print_ticket_xml": {
            "type": "string",
            "description": "PrintTicket XML. Choices staged on capabilities are merged into it."
          },
          "registry_data": {
            "description": "Driver registry settings (JSON)."
          },
          "capabilities": {
            "description": "PrintCapabilities tree, optionally with staged option choices; the choices are moved into print_ticket_xml (400 if they cannot be)."
          },
          "source_agent_id": {
            "type": "string",
            "description": "Computer the settings came from. Must be a computer in this account; otherwise 400. While the configuration is not shared, only that computer's customer can use it.",
            "format": "uuid"
          },
          "source_printer": {
            "type": "string",
            "description": "Queue the settings came from."
          }
        }
      },
      "ConfigUpdate": {
        "type": "object",
        "description": "Body of PATCH /configs/{id}. At least one field is required.",
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "description": "New name."
          },
          "shared": {
            "type": "boolean",
            "description": "Share with every customer in the account, or stop sharing."
          }
        }
      },
      "ConfigCaptureInput": {
        "type": "object",
        "properties": {
          "interactive": {
            "type": "boolean",
            "default": false,
            "description": "Open the vendor preferences dialog on the computer for someone to complete."
          },
          "save": {
            "type": "boolean",
            "default": false,
            "description": "Also save the capture as a configuration."
          },
          "name": {
            "type": "string",
            "description": "Name for the saved configuration. Default: the queue name and today's date, for example \"HM-Reception 20 Nov 2026\"."
          }
        }
      },
      "ConfigCaptureResult": {
        "type": "object",
        "required": [
          "printer",
          "driver_name",
          "driver_version",
          "environment",
          "devmode_public",
          "print_ticket_xml",
          "blob_bytes"
        ],
        "properties": {
          "printer": {
            "type": "string",
            "description": "Queue name."
          },
          "driver_name": {
            "type": "string"
          },
          "driver_version": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "devmode_public": {
            "description": "Documented DEVMODE fields (JSON object, or null when none)."
          },
          "print_ticket_xml": {
            "type": "string"
          },
          "blob_bytes": {
            "type": "integer",
            "description": "Approximate size of the captured vendor blob."
          },
          "config": {
            "$ref": "#/components/schemas/Config",
            "description": "Present only when save was true."
          }
        }
      },
      "ConfigApplyInput": {
        "type": "object",
        "description": "Either config_id, or inline settings (devmode_public and/or print_ticket_xml). config_id wins when both are sent.",
        "properties": {
          "config_id": {
            "type": "string",
            "description": "Saved configuration to apply.",
            "format": "uuid"
          },
          "devmode_public": {
            "description": "Inline documented DEVMODE fields (JSON object)."
          },
          "print_ticket_xml": {
            "type": "string",
            "description": "Inline PrintTicket XML."
          },
          "capabilities": {
            "description": "Capabilities tree with staged choices, merged into print_ticket_xml when that is also sent. Not enough on its own."
          }
        }
      },
      "ConfigApplyResult": {
        "type": "object",
        "required": [
          "ok",
          "printer",
          "config_id",
          "vendor_blob_applied",
          "note"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "printer": {
            "type": "string",
            "description": "Queue name."
          },
          "config_id": {
            "type": "string",
            "description": "Applied configuration; empty for inline settings."
          },
          "vendor_blob_applied": {
            "type": "boolean",
            "description": "The vendor-private blob was sent (driver identity matched)."
          },
          "note": {
            "type": "string",
            "description": "Explains what was not applied; empty when everything was."
          }
        }
      },
      "ManagedHardware": {
        "type": "object",
        "description": "The device behind the printer, as its monitoring readings and the queues installed for it report. The device's own answer is used first. Empty fields are omitted.",
        "required": [
          "reporters"
        ],
        "properties": {
          "manufacturer": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "device_class": {
            "type": "string",
            "description": "From an installed queue."
          },
          "serial_number": {
            "type": "string"
          },
          "mac_address": {
            "type": "string",
            "description": "From monitoring."
          },
          "firmware": {
            "type": "string",
            "description": "From monitoring."
          },
          "reporters": {
            "type": "integer",
            "description": "Installed queues of this managed printer."
          },
          "seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Latest monitoring reading or queue sync."
          }
        }
      },
      "RuleNode": {
        "type": "object",
        "description": "A node of a group's rule tree: a group of nodes (`match` and `rules`) or a condition (`field`, `operator`, `value`). The root must be a group. Groups nest one level deep, a nested group needs at least one condition, and a tree holds at most 50 conditions. A tree with no conditions matches no computers.\n\nFields and their operators:\n- `hostname`, `os` (the OS caption), `version` (agent version), `user` (signed-in accounts): `is`, `is_not`, `contains`, `not_contains`, `starts_with`, `ends_with`, `matches`, `not_matches`. Case-insensitive. `matches` takes a glob (`*`, `?`, `[a-z]`). For `user`, `is` and `matches` take the same patterns as a `user` rule (`DOMAIN\\name`, `name@domain.tld` or a bare `name`, with globs).\n- `lan_ip`, `wan_ip`: `in_range`, `not_in_range`. The value is an address, a CIDR range, or several separated by commas.\n- `device`, `customer`: `is`, `is_not`, with a computer or customer id.\n\nA negated operator holds when none of the field's values matches: `user is_not HALDEN\\j.morris` means nobody signed in is that account. Values are trimmed and must not be empty or longer than 500 characters.",
        "properties": {
          "match": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ],
            "description": "Group only. `all`: every node must match. `any`: at least one."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleNode"
            },
            "description": "Group only. The nodes it joins."
          },
          "field": {
            "type": "string",
            "enum": [
              "hostname",
              "os",
              "version",
              "user",
              "lan_ip",
              "wan_ip",
              "device",
              "customer"
            ],
            "description": "Condition only."
          },
          "operator": {
            "type": "string",
            "enum": [
              "is",
              "is_not",
              "contains",
              "not_contains",
              "starts_with",
              "ends_with",
              "matches",
              "not_matches",
              "in_range",
              "not_in_range"
            ],
            "description": "Condition only. Must suit the field."
          },
          "value": {
            "type": "string",
            "description": "Condition only."
          }
        },
        "example": {
          "match": "all",
          "rules": [
            {
              "field": "lan_ip",
              "operator": "in_range",
              "value": "10.40.0.0/24"
            },
            {
              "match": "any",
              "rules": [
                {
                  "field": "hostname",
                  "operator": "starts_with",
                  "value": "SHF-"
                },
                {
                  "field": "wan_ip",
                  "operator": "in_range",
                  "value": "203.0.113.40"
                }
              ]
            },
            {
              "field": "os",
              "operator": "not_contains",
              "value": "Server"
            }
          ]
        }
      },
      "GroupPreviewInput": {
        "type": "object",
        "description": "Either a single flat rule (`rule_type` and `value`) or a whole rule tree (`rule_tree`, optionally with `customer_id`). When `rule_tree` is sent the other rule fields are ignored.",
        "properties": {
          "rule_type": {
            "type": "string",
            "enum": [
              "agent",
              "customer",
              "hostname",
              "lan_cidr",
              "wan_ip",
              "tag",
              "user"
            ]
          },
          "value": {
            "type": "string",
            "description": "Same formats as GroupRuleInput."
          },
          "rule_tree": {
            "$ref": "#/components/schemas/RuleNode",
            "description": "An unsaved rule tree, validated as on save."
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "With `rule_tree`: only this customer's computers."
          }
        }
      },
      "PrinterTestPageOnComputerInput": {
        "type": "object",
        "required": [
          "agent_id"
        ],
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "The computer to print on."
          }
        }
      },
      "ManagedPrinterTestPageResult": {
        "type": "object",
        "required": [
          "ok",
          "printer",
          "hostname"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "printer": {
            "type": "string",
            "description": "Queue name on the computer."
          },
          "hostname": {
            "type": "string",
            "description": "The computer's hostname."
          }
        }
      },
      "AgentRollout": {
        "type": "object",
        "description": "How the current agent version's staged rollout stands. Stage 0 reaches the Early channel only, stage 1 adds 5% of Standard computers, stage 2 25%, stage 3 every Standard computer; Delayed computers get the version 7 days after stage 3. Which computers go first is fixed per computer. A stage is held for a soak time and promoted only while computers that took the version are healthy; too many failed or rolled back updates pause the rollout.",
        "required": [
          "version",
          "stage",
          "percent",
          "paused"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "The newest published agent version."
          },
          "stage": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "percent": {
            "type": "integer",
            "enum": [
              0,
              5,
              25,
              100
            ],
            "description": "Share of Standard computers the current stage reaches."
          },
          "paused": {
            "type": "boolean",
            "description": "The rollout of this version is paused."
          },
          "paused_reason": {
            "type": "string",
            "description": "Omitted when not paused."
          },
          "next_stage_at": {
            "type": "string",
            "format": "date-time",
            "description": "Earliest time the next stage can start. Omitted at stage 3 or while paused."
          },
          "all_paused": {
            "type": "boolean",
            "description": "PrintCtrl has paused every agent update. Omitted when false."
          }
        }
      },
      "AgentUpdateSettings": {
        "type": "object",
        "required": [
          "channel",
          "rollout"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ],
            "description": "The account's channel. `standard` by default."
          },
          "rollout": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AgentRollout"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when no agent build is published."
          }
        }
      },
      "AgentUpdateChannelInput": {
        "type": "object",
        "required": [
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ]
          }
        }
      },
      "AgentUpdateChannelSet": {
        "type": "object",
        "required": [
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ]
          }
        }
      },
      "CustomerAgentUpdates": {
        "type": "object",
        "required": [
          "channel",
          "effective_channel",
          "account_channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "",
              "early",
              "standard",
              "delayed"
            ],
            "description": "The customer's own channel. Empty string uses the account's."
          },
          "effective_channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ],
            "description": "The channel the customer's computers are on."
          },
          "account_channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ]
          }
        }
      },
      "CustomerAgentUpdatesInput": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "",
              "early",
              "standard",
              "delayed"
            ],
            "description": "Empty string, or a missing or unreadable body, uses the account's channel."
          }
        }
      },
      "CustomerAgentUpdatesSet": {
        "type": "object",
        "required": [
          "channel",
          "effective_channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "",
              "early",
              "standard",
              "delayed"
            ]
          },
          "effective_channel": {
            "type": "string",
            "enum": [
              "early",
              "standard",
              "delayed"
            ]
          }
        }
      },
      "DashboardAttentionItem": {
        "type": "object",
        "required": [
          "kind",
          "rank",
          "id",
          "label",
          "detail",
          "customer_id",
          "customer_name",
          "since"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "printer_down",
              "deploy_failed",
              "problem",
              "deploy_stuck",
              "supply_forecast",
              "device_offline"
            ],
            "description": "`printer_down`: monitoring reports the printer down. `deploy_failed`: a managed printer deployment failed. `problem`: the printer reports a critical alert. `deploy_stuck`: a deployment has been pending, installing or updating for over 10 minutes on a connected computer. `supply_forecast`: a consumable is forecast to run out within 14 days. `device_offline`: a computer has been offline for 24 hours or more."
          },
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "description": "Urgency, 1 first. The list is sorted by rank."
          },
          "id": {
            "type": "string",
            "description": "Printer device id, deployment id, alert id, computer id, or `<device id>/<supply name>` for a forecast."
          },
          "label": {
            "type": "string",
            "description": "Printer, queue or computer name."
          },
          "detail": {
            "type": "string",
            "description": "Address, computer name, alert text, supply name or hostname, depending on `kind`."
          },
          "customer_id": {
            "type": "string"
          },
          "customer_name": {
            "type": "string"
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it started, or the computer was last seen. Null for a forecast."
          },
          "printer_id": {
            "type": "string",
            "description": "A discovered printer (queue) at the device. Omitted when empty."
          },
          "managed_printer_id": {
            "type": "string",
            "description": "Deployment kinds. Omitted when empty."
          },
          "agent_id": {
            "type": "string",
            "description": "Deployment kinds and `device_offline`. Omitted when empty."
          },
          "days_left": {
            "type": "number",
            "description": "`supply_forecast` only."
          }
        }
      },
      "DashboardCustomerHealth": {
        "type": "object",
        "required": [
          "id",
          "name",
          "printers_down",
          "deploy_failed",
          "devices_offline",
          "supplies_low",
          "issues"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "printers_down": {
            "type": "integer"
          },
          "deploy_failed": {
            "type": "integer"
          },
          "devices_offline": {
            "type": "integer",
            "description": "Offline for 24 hours or more."
          },
          "supplies_low": {
            "type": "integer",
            "description": "Consumables below `low_threshold`."
          },
          "issues": {
            "type": "integer",
            "description": "Sum of the four counts."
          }
        }
      },
      "DashboardOverview": {
        "type": "object",
        "description": "What needs attention and the fleet's health now. Online counts come from live connections.",
        "required": [
          "devices",
          "printers",
          "supplies",
          "deployments",
          "attention",
          "attention_counts",
          "attention_total",
          "customers",
          "healthy_customers",
          "customer_total",
          "versions",
          "latest_version",
          "older_versions",
          "older_devices",
          "generated_at",
          "low_threshold",
          "forecast_horizon_days"
        ],
        "properties": {
          "devices": {
            "type": "object",
            "required": [
              "total",
              "online",
              "offline_recent",
              "offline_stale"
            ],
            "properties": {
              "total": {
                "type": "integer"
              },
              "online": {
                "type": "integer"
              },
              "offline_recent": {
                "type": "integer",
                "description": "Offline, last seen under 24 hours ago."
              },
              "offline_stale": {
                "type": "integer",
                "description": "Offline for 24 hours or more, or never seen."
              }
            }
          },
          "printers": {
            "type": "object",
            "description": "Printer devices (a customer's device at an address) that a computer has a queue for or that are monitored.",
            "required": [
              "up",
              "down",
              "unmonitored"
            ],
            "properties": {
              "up": {
                "type": "integer"
              },
              "down": {
                "type": "integer"
              },
              "unmonitored": {
                "type": "integer",
                "description": "Neither up nor down."
              }
            }
          },
          "supplies": {
            "type": "object",
            "description": "Consumables by level, lowest reading per supply.",
            "required": [
              "ok",
              "low",
              "out"
            ],
            "properties": {
              "ok": {
                "type": "integer",
                "description": "At or above `low_threshold`."
              },
              "low": {
                "type": "integer",
                "description": "Above 0 and below `low_threshold`."
              },
              "out": {
                "type": "integer",
                "description": "At 0%."
              }
            }
          },
          "deployments": {
            "type": "object",
            "required": [
              "installed",
              "waiting",
              "in_progress",
              "failed",
              "user_removed"
            ],
            "properties": {
              "installed": {
                "type": "integer"
              },
              "waiting": {
                "type": "integer",
                "description": "Pending, installing, updating or removing on an offline computer."
              },
              "in_progress": {
                "type": "integer",
                "description": "The same on a connected computer."
              },
              "failed": {
                "type": "integer"
              },
              "user_removed": {
                "type": "integer",
                "description": "Removed from the computer by a person."
              }
            }
          },
          "attention": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardAttentionItem"
            },
            "description": "Most urgent first, at most 200 rows. `attention_counts` is always complete."
          },
          "attention_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Rows per `kind`, before the 200-row cap. Kinds with none are left out."
          },
          "attention_total": {
            "type": "integer"
          },
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardCustomerHealth"
            },
            "description": "Customers with at least one issue, most issues first. Empty when `customer_id` is given."
          },
          "healthy_customers": {
            "type": "array",
            "description": "Customers with no issues, by name, at most 500. Empty when `customer_id` is given.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "customer_total": {
            "type": "integer",
            "description": "Customers in the account."
          },
          "versions": {
            "type": "array",
            "description": "Computers per agent version, most common first. An empty `version` is computers that have not reported one.",
            "items": {
              "type": "object",
              "required": [
                "version",
                "count"
              ],
              "properties": {
                "version": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "latest_version": {
            "type": "string",
            "description": "The newest agent version: the published one, or the newest the fleet runs if that is newer or unknown."
          },
          "older_versions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Versions behind `latest_version`, newest first."
          },
          "older_devices": {
            "type": "integer",
            "description": "Computers on `older_versions`."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "low_threshold": {
            "type": "integer",
            "description": "Percent below which a consumable is low (15)."
          },
          "forecast_horizon_days": {
            "type": "integer",
            "description": "Days ahead a supply forecast is flagged (14)."
          }
        }
      },
      "DashboardTrendDay": {
        "type": "object",
        "required": [
          "day",
          "pages",
          "installed",
          "failed",
          "alerts"
        ],
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "Calendar day in `tz`."
          },
          "pages": {
            "type": "integer",
            "description": "Pages printed, from `pages_source`."
          },
          "installed": {
            "type": "integer",
            "description": "Deployments installed that day."
          },
          "failed": {
            "type": "integer",
            "description": "Deployments that failed with their last attempt that day."
          },
          "alerts": {
            "type": "integer",
            "description": "Alerts opened that day."
          }
        }
      },
      "DashboardTrends": {
        "type": "object",
        "description": "Pages, deployment outcomes and alerts per day over a period, and the period before it. Days with no data are zeros, not gaps.",
        "required": [
          "days",
          "pages_source",
          "current",
          "previous",
          "pages",
          "alerts",
          "success",
          "installed",
          "failed"
        ],
        "properties": {
          "days": {
            "type": "integer",
            "enum": [
              7,
              30,
              90
            ]
          },
          "pages_source": {
            "type": "string",
            "enum": [
              "counters",
              "jobs",
              "none"
            ],
            "description": "`counters`: the printers' own page counters. `jobs`: no counters in either period, so page counts of recorded print jobs. `none`: neither."
          },
          "current": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardTrendDay"
            },
            "description": "The last `days` days, oldest first, ending today."
          },
          "previous": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardTrendDay"
            },
            "description": "The `days` days before that."
          },
          "pages": {
            "type": "object",
            "required": [
              "current",
              "previous"
            ],
            "description": "Totals for each period.",
            "properties": {
              "current": {
                "type": "number"
              },
              "previous": {
                "type": "number"
              }
            }
          },
          "alerts": {
            "type": "object",
            "required": [
              "current",
              "previous"
            ],
            "description": "Totals for each period.",
            "properties": {
              "current": {
                "type": "number"
              },
              "previous": {
                "type": "number"
              }
            }
          },
          "success": {
            "type": "object",
            "required": [
              "current",
              "previous"
            ],
            "description": "installed / (installed + failed) for each period, 0 to 1. Null for a period with neither.",
            "properties": {
              "current": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "previous": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "installed": {
            "type": "object",
            "required": [
              "current",
              "previous"
            ],
            "description": "Totals for each period.",
            "properties": {
              "current": {
                "type": "number"
              },
              "previous": {
                "type": "number"
              }
            }
          },
          "failed": {
            "type": "object",
            "required": [
              "current",
              "previous"
            ],
            "description": "Totals for each period.",
            "properties": {
              "current": {
                "type": "number"
              },
              "previous": {
                "type": "number"
              }
            }
          }
        }
      },
      "PriceTier": {
        "type": "object",
        "description": "One band of the per-device price. Volume tiers: every active device is billed at the rate of the band the account total falls in.",
        "properties": {
          "up_to": {
            "type": "integer",
            "description": "The last device count in the band; 0 means no upper limit.",
            "example": 500
          },
          "unit_amount": {
            "type": "integer",
            "description": "Price per device per month in minor units (cents).",
            "example": 100
          }
        }
      }
    }
  }
}
