{
  "components": {
    "schemas": {
      "CandidateEntry": {
        "description": "A candidate pubkey offered when a neighbor edge is ambiguous.",
        "properties": {
          "name": {
            "description": "Candidate node display name.",
            "type": "string"
          },
          "pubkey": {
            "description": "Candidate node public key (hex).",
            "type": "string"
          },
          "role": {
            "description": "Candidate node role (e.g. repeater, room).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConfigAreaPolygonsResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "description": "Area configuration map key, preserved verbatim."
            },
            "label": {
              "type": "string",
              "description": "Configured display label; may be empty."
            },
            "latMax": {
              "type": "number",
              "description": "Configured maximum latitude in degrees. Omitted when unset; included when set to zero."
            },
            "latMin": {
              "type": "number",
              "description": "Configured minimum latitude in degrees. Omitted when unset; included when set to zero."
            },
            "lonMax": {
              "type": "number",
              "description": "Configured maximum longitude in degrees. Omitted when unset; included when set to zero."
            },
            "lonMin": {
              "type": "number",
              "description": "Configured minimum longitude in degrees. Omitted when unset; included when set to zero."
            },
            "polygon": {
              "type": "array",
              "description": "Vertices in configuration order. The endpoint omits empty polygons and returns nonempty polygons without validating their geometry.",
              "items": {
                "type": "array",
                "description": "The configuration decoder reads each vertex as a fixed [latitude, longitude] pair in degrees. It fills missing positions with zero and discards elements after the second.",
                "items": {
                  "type": "number"
                },
                "minItems": 2,
                "maxItems": 2
              },
              "minItems": 1
            }
          },
          "required": [
            "key",
            "label"
          ]
        }
      },
      "ConfigAreasResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "description": "Area configuration map key, preserved verbatim."
            },
            "label": {
              "type": "string",
              "description": "Non-empty configured display label, preserved verbatim."
            }
          },
          "required": [
            "key",
            "label"
          ]
        }
      },
      "FleetClockSkewResponse": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "KnownChannelsResponse": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "description": "Catalogue entries for the selected region, or all entries without a filter. An empty catalogue, unavailable cache or unmatched region yields an empty array.",
            "items": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "description": "Upstream channel name with surrounding whitespace trimmed. Empty names are skipped; a # prefix is preserved when supplied."
                },
                "description": {
                  "type": "string",
                  "description": "Upstream description, copied verbatim; omitted when empty."
                },
                "key": {
                  "type": "string",
                  "description": "Upstream channel key, copied verbatim without format validation; omitted when empty."
                },
                "region": {
                  "type": "string",
                  "description": "Upstream region label, trimmed and lowercased. May be empty or an arbitrary label; no country-code validation is applied."
                },
                "regionName": {
                  "type": "string",
                  "description": "Upstream display name for the region, copied verbatim; omitted when empty."
                }
              },
              "required": [
                "channel",
                "region"
              ]
            }
          },
          "fetchedAt": {
            "type": "string",
            "description": "Server fetch timestamp in RFC3339 form; 0001-01-01T00:00:00Z when no snapshot is available."
          },
          "generatedAt": {
            "type": "string",
            "description": "Upstream generation value, copied verbatim without timestamp validation; omitted when empty."
          },
          "license": {
            "type": "string",
            "description": "Upstream license text, copied verbatim; omitted when empty."
          },
          "source": {
            "type": "string",
            "description": "Catalogue source URL; empty when no snapshot is available."
          }
        },
        "required": [
          "fetchedAt",
          "source",
          "entries"
        ]
      },
      "NeighborEntry": {
        "description": "One neighbor of the queried node, with affinity score and observation metadata.",
        "properties": {
          "ambiguous": {
            "type": "boolean"
          },
          "avg_snr": {
            "nullable": true,
            "type": "number"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/CandidateEntry"
            },
            "type": "array"
          },
          "count": {
            "description": "Total observations supporting this neighborship.",
            "type": "integer"
          },
          "counts_by_mode": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "#1638: observation counts keyed by hash-prefix mode in bytes (1/2/3; 0 = legacy/unknown).",
            "type": "object"
          },
          "distance_km": {
            "nullable": true,
            "type": "number"
          },
          "first_seen": {
            "type": "string"
          },
          "last_seen": {
            "type": "string"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "observers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "prefix": {
            "description": "Raw hop hash prefix that established this edge.",
            "type": "string"
          },
          "pubkey": {
            "description": "Resolved neighbor public key, or null when only a hop prefix is known.",
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          },
          "score": {
            "description": "Affinity score: count saturation × recency decay × observer-diversity confidence.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "unresolved": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Node": {
        "additionalProperties": true,
        "description": "A mesh node. Repeater and room nodes additionally carry the issue #672 usefulness metrics and relay-activity fields below; those fields are absent on other roles. NOTE: coverage_score, redundancy_score and usefulness_grade ship only with the #672 4-axis scorer (PR #1762) and are absent on every build without it; until that lands usefulness_score is aliased to traffic_share_score. Only traffic_share_score and bridge_score ship today.",
        "properties": {
          "advert_count": {
            "type": "integer"
          },
          "battery_mv": {
            "nullable": true,
            "type": "integer"
          },
          "bridge_score": {
            "description": "#672 Bridge axis: normalized betweenness centrality (chokepoint importance). Repeater/room only.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "coverage_score": {
            "description": "#672 Coverage axis: normalized harmonic reach centrality (how much of the mesh the node can reach). Repeater/room only.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "declared_regions": {
            "description": "Repeater/room only (#1862): named regions from this node's newest declared-regions answer, spelled as GET /api/scope-audit declaredRegions spells them (leading '#' stripped, '*' wildcard excluded). Empty array: it answered and named no region. Absent: it never answered, this database has no declared-regions source, or the declared-regions lookup failed. Absence is not evidence the node lacks a region.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "declared_regions_truncated": {
            "description": "Repeater/room only (#1862): present, and true, only when the answer behind declared_regions was flagged as truncated, so that list is partial. GET /api/scope-audit shows the same flag as truncated. Absent otherwise, including for a source that does not record truncation, so absence does not mean the list is complete.",
            "type": "boolean"
          },
          "first_seen": {
            "description": "RFC3339 timestamp of the first observation.",
            "type": "string"
          },
          "flood_advert_count_7d": {
            "description": "Distinct FLOOD adverts originated in the last 7 days (zero-hop adverts excluded). Present on the node detail endpoint.",
            "type": "integer"
          },
          "last_certain_relay": {
            "description": "Repeater/room only: UTC RFC3339 timestamp of the newest valid transmission first_seen accepted as a certain relay. Requires a matching hop in that observation's eligible FLOOD/TRANSPORT_FLOOD frame, a unique prefix at that width and no retired namesake; excludes direct/TRACE paths and failed advert signatures. An originated advert alone does not count; forwarding another node's advert can count even when non-advert relay counts are zero. Uses first_seen, not a late observation's timestamp; uniqueness is checked when evidence is ingested. State is omitted when absent and cleared when the node's packet-store membership is evicted. Does not change relay_active or attributed relay counts.",
            "type": "string"
          },
          "last_relayed": {
            "description": "Repeater/room only: RFC3339 time this node last appeared as a relay hop.",
            "type": "string"
          },
          "last_seen": {
            "description": "RFC3339 timestamp of the most recent observation.",
            "type": "string"
          },
          "lat": {
            "nullable": true,
            "type": "number"
          },
          "lon": {
            "nullable": true,
            "type": "number"
          },
          "name": {
            "description": "Node display name (most recent advert name).",
            "type": "string"
          },
          "public_key": {
            "description": "Node public key (hex).",
            "type": "string"
          },
          "redundancy_score": {
            "description": "#672 Redundancy axis: normalized articulation-point criticality — 1 means removing the node fragments the mesh, 0 means alternate paths exist. Repeater/room only.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "region_placement": {
            "$ref": "#/components/schemas/NodeRegionPlacement"
          },
          "relay_active": {
            "description": "Repeater/room only: attributed non-advert relay-hop appearance within the active window; may include shared prefixes. Unchanged legacy field, not certain liveness evidence.",
            "type": "boolean"
          },
          "relay_count_1h": {
            "description": "Repeater/room only: relay-hop appearances in the last hour.",
            "type": "integer"
          },
          "relay_count_24h": {
            "description": "Repeater/room only: relay-hop appearances in the last 24 hours.",
            "type": "integer"
          },
          "relay_window_hours": {
            "description": "Repeater/room only, /api/nodes/{pubkey} detail endpoint only: width (hours) of the relay-activity window the relay_count_* values cover.",
            "type": "integer"
          },
          "role": {
            "description": "Node role (e.g. repeater, room, client, sensor).",
            "type": "string"
          },
          "temperature_c": {
            "nullable": true,
            "type": "number"
          },
          "traffic_share_score": {
            "description": "#672 Traffic axis: share of non-advert traffic relayed through this repeater. Repeater/room only.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "unscoped_relay_count_24h": {
            "description": "Repeater/room only: subset of relay_count_24h that were unscoped floods (route_type FLOOD). A well-configured repeater sets flood.max.unscoped 0, so a non-trivial count flags a base-config problem.",
            "type": "integer"
          },
          "usefulness_grade": {
            "description": "Letter grade derived from usefulness_score. Repeater/room only.",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ],
            "type": "string"
          },
          "usefulness_score": {
            "description": "#672 composite usefulness = 0.30·bridge + 0.25·coverage + 0.25·redundancy + 0.20·traffic. Until the 4-axis scorer ships (PR #1762) this is aliased to traffic_share_score. Repeater/room only.",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object"
      },
      "NodeAdvert": {
        "additionalProperties": true,
        "description": "A recent transmission/advert from a node (the /api/packets transmission shape). Only the commonly-used fields are documented.",
        "properties": {
          "first_seen": {
            "description": "RFC3339 time the transmission was first observed.",
            "type": "string"
          },
          "from_pubkey": {
            "description": "Originating node public key.",
            "type": "string"
          },
          "hash": {
            "description": "Transmission content hash.",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "payload_type": {
            "description": "MeshCore payload type.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "NodeBatteryResponse": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "description": "Effective lookback window in days."
          },
          "latest_mv": {
            "type": "integer",
            "description": "Newest sample voltage in millivolts, or null when the window is empty.",
            "nullable": true
          },
          "latest_ts": {
            "type": "string",
            "description": "Newest sample timestamp, or null when the window is empty.",
            "nullable": true
          },
          "public_key": {
            "type": "string",
            "description": "The requested public key, lowercased in the response."
          },
          "samples": {
            "type": "array",
            "description": "Battery samples in timestamp order, oldest first; empty array when none are available.",
            "items": {
              "type": "object",
              "properties": {
                "battery_mv": {
                  "type": "integer",
                  "description": "Battery voltage in millivolts."
                },
                "timestamp": {
                  "type": "string",
                  "description": "Stored sample timestamp."
                }
              },
              "required": [
                "timestamp",
                "battery_mv"
              ]
            }
          },
          "status": {
            "type": "string",
            "description": "critical below critical_mv; otherwise low below low_mv; otherwise ok. unknown when the window has no samples.",
            "enum": [
              "critical",
              "low",
              "ok",
              "unknown"
            ]
          },
          "thresholds": {
            "type": "object",
            "properties": {
              "critical_mv": {
                "type": "integer",
                "description": "Configured critical-battery threshold in millivolts; default 3000."
              },
              "low_mv": {
                "type": "integer",
                "description": "Configured low-battery threshold in millivolts; default 3300."
              }
            },
            "required": [
              "low_mv",
              "critical_mv"
            ]
          }
        },
        "required": [
          "public_key",
          "days",
          "samples",
          "latest_mv",
          "latest_ts",
          "status",
          "thresholds"
        ]
      },
      "NodeDetailResponse": {
        "properties": {
          "node": {
            "$ref": "#/components/schemas/Node"
          },
          "recentAdverts": {
            "description": "Up to 20 most recent transmissions from this node (newest first).",
            "items": {
              "$ref": "#/components/schemas/NodeAdvert"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "NodeListResponse": {
        "properties": {
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Per-role node counts.",
            "type": "object"
          },
          "has_more": {
            "description": "True when rows exist past this page. Decided before the blacklist / hidden-prefix / geo-filter / area passes, which drop rows from the page and rewrite total — so neither the page length nor total can be used to stop paginating. Paginate until this is false.",
            "type": "boolean"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": "array"
          },
          "total": {
            "description": "Total nodes matching the query after filtering.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "NodeNeighborsResponse": {
        "properties": {
          "neighbors": {
            "items": {
              "$ref": "#/components/schemas/NeighborEntry"
            },
            "type": "array"
          },
          "node": {
            "description": "The queried node's public key.",
            "type": "string"
          },
          "total_observations": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "NodeRegionPlacement": {
        "type": "object",
        "description": "#1879: which rule puts this node in regions for the /api/nodes ?region= filter, and which regions. Present on every node row.",
        "properties": {
          "basis": {
            "type": "string",
            "description": "zero_hop: observers heard the node zero-hop (a direct advert, not relayed); it is in their regions, and a node on a boundary can have several. fewest_hops: never heard zero-hop; it is in the regions that heard it in the fewest hops. none: never heard zero-hop, and even its closest hearing is more than regionFallback.maxHops (default 3) hops out, so no ?region= filter includes it, even one listing every region; it still shows unfiltered. observer_scan: not in the last placement recompute (its first advert is newer, the packet store holds none, or no hearing of it recorded a path), so the filter puts it in each region whose observers heard any of its adverts.",
            "enum": [
              "zero_hop",
              "fewest_hops",
              "none",
              "observer_scan"
            ]
          },
          "hops": {
            "type": "integer",
            "description": "Fewest hops any region heard the node over. Present for fewest_hops and none."
          },
          "regions": {
            "type": "array",
            "description": "IATA codes, sorted. Present for zero_hop and fewest_hops.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "basis"
        ]
      },
      "NodeResolveResponse": {
        "type": "object",
        "properties": {
          "ambiguous": {
            "type": "boolean",
            "description": "True when multiple distinct public keys match; pubkey and name are then omitted."
          },
          "name": {
            "type": "string",
            "description": "Present only when a unique visible match has a non-empty name."
          },
          "prefix": {
            "type": "string",
            "description": "Trimmed, lowercase query prefix."
          },
          "pubkey": {
            "type": "string",
            "description": "Present only for a unique visible match."
          }
        },
        "required": [
          "prefix",
          "ambiguous"
        ]
      },
      "ObserverClockSkewResponse": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "ReadinessResponse": {
        "type": "object",
        "properties": {
          "from_pubkey_backfill": {
            "type": "object",
            "description": "Fixed compatibility placeholder, not actual ingestor migration progress.",
            "properties": {
              "done": {
                "type": "boolean",
                "description": "Compatibility value: always true; does not establish ingestor migration completion."
              },
              "processed": {
                "type": "integer",
                "description": "Compatibility value: always 0."
              },
              "total": {
                "type": "integer",
                "description": "Compatibility value: always 0."
              }
            },
            "required": [
              "total",
              "processed",
              "done"
            ]
          },
          "ingest_liveness": {
            "type": "object",
            "description": "Optional source-name map from the ingestor stats snapshot; not a broker connection-status check.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "lastMessageUnix": {
                  "type": "integer",
                  "description": "Last reported message-handler entry time in Unix seconds, before decoding or database writes. Reset to 0 on each MQTT connection/reconnection; 0 means no entry has been recorded since initialization or the latest connection reset, even if older traffic exists."
                },
                "lastReceiptUnix": {
                  "type": "integer",
                  "description": "Last reported MQTT callback receipt time in Unix seconds for the current ingestor source state; retained across reconnects. 0 means no receipt has been recorded in that state."
                }
              },
              "required": [
                "lastReceiptUnix",
                "lastMessageUnix"
              ]
            }
          },
          "loadedObs": {
            "type": "integer",
            "description": "Observations currently loaded in the in-memory store."
          },
          "loadedTx": {
            "type": "integer",
            "description": "Transmissions currently loaded in the in-memory store."
          },
          "ready": {
            "type": "boolean",
            "description": "True in the 200 response; false with reason loading in the 503 response."
          }
        },
        "required": [
          "ready",
          "loadedTx",
          "loadedObs",
          "from_pubkey_backfill"
        ]
      },
      "RoleAnalyticsResponse": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "description": "Role groups ordered by nodeCount descending, then role name ascending. Empty array when no nodes are available.",
            "items": {
              "type": "object",
              "description": "Each group summarizes one role's population and clock skew. For each node with clock-skew data, the mean and median use the absolute corrected recentMedianSkewSec, falling back to the absolute lastSkewSec when the recent median is zero. Both statistics are in seconds, rounded to two decimal places, and zero when no clock-skew data is available. The five severity counters exclude bimodal_clock, so their sum can be smaller than withSkew.",
              "properties": {
                "absurdCount": {
                  "type": "integer",
                  "description": "Nodes whose clock-skew severity is absurd."
                },
                "criticalCount": {
                  "type": "integer",
                  "description": "Nodes whose clock-skew severity is critical."
                },
                "meanAbsSkewSec": {
                  "type": "number",
                  "description": "This is the mean absolute corrected skew in seconds across nodes with clock-skew data."
                },
                "medianAbsSkewSec": {
                  "type": "number",
                  "description": "This is the median absolute corrected skew in seconds across nodes with clock-skew data."
                },
                "noClockCount": {
                  "type": "integer",
                  "description": "Nodes whose clock-skew severity is no_clock. Does not count nodes with missing clock-skew data."
                },
                "nodeCount": {
                  "type": "integer",
                  "description": "Nodes in this role in the cached roster, including nodes without clock-skew data."
                },
                "okCount": {
                  "type": "integer",
                  "description": "Nodes whose clock-skew severity is ok."
                },
                "role": {
                  "type": "string",
                  "description": "The stored role has surrounding whitespace removed and letters lowercased. Empty roles become `unknown`."
                },
                "warningCount": {
                  "type": "integer",
                  "description": "Nodes whose clock-skew severity is warning."
                },
                "withSkew": {
                  "type": "integer",
                  "description": "Nodes in this role with clock-skew data, including no_clock and bimodal_clock classifications."
                }
              },
              "required": [
                "role",
                "nodeCount",
                "withSkew",
                "meanAbsSkewSec",
                "medianAbsSkewSec",
                "okCount",
                "warningCount",
                "criticalCount",
                "absurdCount",
                "noClockCount"
              ]
            }
          },
          "totalNodes": {
            "type": "integer",
            "description": "Total nodes in the cached roster, including nodes without clock-skew data."
          }
        },
        "required": [
          "totalNodes",
          "roles"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      },
      "CookieAuth": {
        "description": "User-management session (only when userManagement.enabled). Unsafe methods also need the X-CS-CSRF header from GET /api/auth/me.",
        "in": "cookie",
        "name": "cs_session",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "MeshCore network analyzer — packet capture, node tracking, and mesh analytics.",
    "license": {
      "name": "MIT"
    },
    "title": "CoreScope API",
    "version": "v3.19.0-on8ar.2"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/account": {
      "delete": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Delete own account",
        "tags": [
          "users"
        ]
      },
      "patch": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Update profile",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/companions": {
      "get": {
        "description": "[{pubkey, name, linkedAt, lastSeenAt}], newest link first. lastSeenAt is the newest client reception of that companion (rx_at as stored) or null. Accepts a device token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List own linked companions",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "Body {pubkey, challenge, signature, name}. signature is the companion's Ed25519 signature (64 bytes, hex) over the UTF-8 string \"corescope-link:\" + host of userManagement.publicBaseUrl + \":\" + challenge. The challenge is consumed in every case. 200 {pubkey, name, linkedAt}. The synced settings (meshcore-my-nodes) are not touched: a companion is not a node to monitor. A companion linked to another account moves to the caller (the newest proof wins); both get a companion.transfer audit row and the previous owner a mail (a security notice, sent whatever the node notification settings are). 400 malformed pubkey or signature, or a signature that does not verify; 410 challenge missing, expired, used, or bound to another user or pubkey; 429 rate limited. Accepts a device token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Link a companion",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/companions/challenge": {
      "post": {
        "description": "Body {pubkey} (64 hex). 200 {challenge, expiresAt, host}: host is what to sign (the host of userManagement.publicBaseUrl); challenge is 32 random bytes as hex, single use, valid 5 minutes, bound to the caller and the pubkey. 400 malformed pubkey; 429 above 60 challenge + link requests per hour per user and per IP. Accepts a device token (Authorization: Bearer).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Start linking a companion",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/companions/{pubkey}": {
      "delete": {
        "description": "204. Stored coverage stays. 400 malformed pubkey, 404 not linked to the caller. Accepts a device token.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Unlink an own companion",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/confirm-email": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Confirm an address change",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/email": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Request an address change",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/export": {
      "get": {
        "description": "One JSON file (Content-Disposition attachment corescope-account-\u003cYYYY-MM-DD\u003e.json): {formatVersion: 1, exportedAt, instance, profile, sessions (with kind web|device and the device label), companions (linked companions: pubkey, name, linkedAt), settings, proposals, notifications: {prefs, watches, pushDevices: [{analyzerId, installationId, expiresAt}]}, audit, mail, observerLogin: {username, createdAt, revoked} or null, observerBindings: [{pubkey, boundAt, boundBy}], repeaterClaims: [{pubkey, claimedAt}], newest first, all own claims}. Every row, no caps. Leaves out the password hash, every session, link and unsubscribe token, and companion link challenges. Audit rows name other accounts by id only. Includes activatedAt, activatedBy (id) and each mail row's to-address. Records a user.export audit row after the file is built.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Download own account data",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/notifications": {
      "get": {
        "description": "Returns {enabled, events, availableEvents, externalLabel, watches: [{pubkey, name, known, createdAt}], limits: {maxWatches, perUserPerDay, mailsLast24h}}. node.external and externalLabel appear only when notifications.externalAlerts is configured. A configured push relay adds pushRelay: {relayOrigin, analyzerId, contractVersion, platforms}. enabled controls email delivery. Creates the default settings (on, node.offline and node.battery) on first use. known is false once the node left the analyzer database. Registered only when userManagement.notifications.enabled.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Get own notification settings",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "Body {enabled, events}. events from node.offline, node.battery, node.external (when externalAlerts is configured) and, for admins, foreign.new and observer.offline; for everyone observer.offline.own (mails about the observers bound to the caller's own MQTT login, offered when userManagement.observerLogins is enabled). Answers the GET body. 400 unknown event type or node.external without externalAlerts, 403 an admin event chosen by a non-admin. Events left out lose their stored state, so choosing them again starts without a mail.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Change own notification settings",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/notifications/devices/{installationID}": {
      "delete": {
        "description": "Disables only the caller's binding for this installation and queues relay revocation. Requires an active account and CSRF. Returns 204, including when the caller has no binding. Registered when a push relay is configured.",
        "parameters": [
          {
            "in": "path",
            "name": "installationID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Stop push on a device",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "Body {proof}, issued by the configured relay for this installation and analyzer. Requires an active account and CSRF. Returns 200 {subscription_id, status, expires_at}. Replay the same proof after an ambiguous failure. 409 for a binding conflict or device limit, 410 for an expired proof, 429 for relay throttling, and 503 for temporary unavailability. Registered when a push relay is configured.",
        "parameters": [
          {
            "in": "path",
            "name": "installationID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Link or renew a push device",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/notifications/watch-my-nodes": {
      "post": {
        "description": "Copies the pubkeys of the caller's synced meshcore-my-nodes setting into the watch list, up to the limit. Answers {added, already, skipped, account}; skipped counts malformed keys, nodes not in the analyzer database and nodes over the limit; account is the GET body.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Watch the synced My nodes",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/notifications/watches/{pubkey}": {
      "delete": {
        "description": "Answers the GET body; removing a node that is not watched is 200. 400 when pubkey is not 64 hex characters.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Stop watching a node",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "Answers the GET body. 400 when pubkey is not 64 hex characters, 404 when the node is not in the analyzer database, 409 when userManagement.notifications.maxWatchesPerUser nodes are watched. Watching a watched node is 200.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Watch a node",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/observer-login": {
      "get": {
        "description": "{login: null} or {login: {username, createdAt, revoked}, observers: [{pubkey, name, lastSeenAt}]}. observers are the pubkeys bound to the caller (the first time an observer publishes with the login); name and lastSeenAt come from the analyzer observers (empty name and null lastSeenAt when unknown). Never contains the password, its hash or its ciphertext. Routes exist only when userManagement.observerLogins is enabled. Not available to device tokens.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Own observer MQTT login",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "Generates a username and password, stores the password hashed and sealed, and mails the credentials to the account address in five formats (meshcoretomqtt, Gessaman or Dutch-MeshCore observer firmware, Home Assistant meshcore-ha, OpenHop, plain). 201 {sent: true}: the response never carries the credentials. 409 when the caller already has a login, 403 when it was revoked, 503 when the mail could not be sent (the login exists; use resend) or the feature failed to load.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Request an observer MQTT login",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/observer-login/resend": {
      "post": {
        "description": "Mails the same credentials again. 200 {sent: true}. 404 without a login, 403 when revoked, 429 after 3 credential mails in 24 hours (the first mail counts; Retry-After in seconds), 503 when the mail fails.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Mail the observer MQTT credentials again",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/password": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Change password",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/proposals": {
      "get": {
        "description": "The caller's proposals, newest first: [{id, kind, subject, status, note, createdAt, decidedAt}]. note is the reviewer's reason.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List own proposals",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/repeaters": {
      "get": {
        "description": "{repeaters: [{pubkey, name, known, inactive, role, claimedAt, lastHeard, lastRelayed, status, comaintainers}]} for My account, My repeaters: named repeaters first by name, then the unnamed by pubkey. inactive is true when retention moved the node to inactive_nodes (silent longer than retention.nodeDays); its name, role and last advert are read from there. known is false only when the node is in neither nodes nor inactive_nodes (the claim stays). lastHeard is the newer of the last advert and the last transmission certainly from the node, or null; lastRelayed is the last time its hop prefix was seen relaying (it may be shared with other repeaters), or null. status is the saved repeater status or null. comaintainers are the other active claimers' display names. A browser session or a device token with repeater:claim or repeater:edit; an rx-only token answers 403.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List own claimed repeaters",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/sessions": {
      "get": {
        "description": "[{id, kind, label, createdAt, lastSeenAt, expiresAt, userAgent, current, scopes}]. kind is web (a browser) or device (a device token: CoreDrive RX or another app); label is the device name, empty for web sessions; scopes lists a device token's scopes (absent for web sessions). DELETE /api/account/sessions/{id} revokes either kind.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List own sessions",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/sessions/{id}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Revoke one own session",
        "tags": [
          "users"
        ]
      }
    },
    "/api/account/settings": {
      "delete": {
        "description": "Removes the stored document; the next PUT (baseRevision 0) starts a new one in a new generation.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Delete own synced settings",
        "tags": [
          "users"
        ]
      },
      "get": {
        "description": "Returns {revision, generation, doc, allowlist}. doc is {v: 1, keys: {\u003clocalStorage key\u003e: \u003craw string\u003e}} or null at revision 0. generation is a random id of the stored document (empty at revision 0); revisions restart at 1 after a DELETE, the generation does not repeat. allowlist lists the keys the server accepts: {key, kind: set|scalar, id?}, where id names the field that identifies an item of a set (absent: the item itself).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Get own synced settings",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "Body {baseRevision, baseGeneration, doc}. 200 {revision, generation}. 409 {revision, generation, doc} when baseRevision is not the stored revision or, with a stored document, baseGeneration is not its generation. baseRevision 0 without a stored document starts a new generation. 400 when doc is not {v: 1, keys} or holds a key that is never synced or not allowlisted. 413 above 256 KiB. 429 above 60 PUT requests per hour per user.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Replace own synced settings",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/audit": {
      "get": {
        "description": "Newest first, keyset-paginated: {entries, next}. Pass next as before for the following page; next is null on the last page. Entry: {id, at, action, actor, target, detail}; actor and target are {id, displayName, email}, {id, deleted: true} for a removed account, or null for the system. Login rows (user.login, user.login.failed) are kept 90 days. 400 on an invalid parameter.",
        "parameters": [
          {
            "description": "One action, or a group ending in .* (user.login.* matches user.login and user.login.failed)",
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User id, as actor or target",
            "in": "query",
            "name": "user",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "RFC 3339 time, inclusive",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "RFC 3339 time, inclusive",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only entries with a smaller id (next of the previous page)",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Page size, default 100, capped at 500",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Global audit log (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/mail/test": {
      "post": {
        "description": "Sends a fixed test mail to the calling admin's own address through the configured provider; the address is never a parameter and any body is ignored. 200 {ok: true, provider, messageId}; 502 {ok: false, provider, error} with the provider's error text, addresses redacted. Recorded in the mail log with purpose test and as a mail.test audit row with detail {provider, result: ok|failed}. 401 not logged in, 403 not an admin or CSRF failure, 429 above 3 test mails per admin and per IP address per 10 minutes (Retry-After in seconds).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Send a test mail to your own address (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/notifications/push-relay": {
      "delete": {
        "description": "For self-service enrollments, revokes the analyzer at the relay and removes its local push state. Requires the admin session and CSRF token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Disconnect the push relay (admin)",
        "tags": [
          "users"
        ]
      },
      "get": {
        "description": "Returns {state, publicOrigin, relayOrigin?, relayName?, originLocked?, presets?, analyzerId?, paused?, disconnectPending?}. presets lists the relays an admin can pick by name while state is available.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Push relay enrollment status (admin)",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "Body {relayOrigin}: a preset's origin or any HTTPS relay origin. When the server configuration locks the origin, relayOrigin may be omitted and otherwise must match it. 400 without a relay or for a non-HTTPS origin. Proves control of the configured public HTTPS origin. Requires the admin session and CSRF token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Enroll the analyzer with a push relay (admin)",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "Set paused to true or false. Keeps the relay enrollment and device links. Requires the admin session and CSRF token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Pause or resume push delivery (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/observer-bindings/{pubkey}": {
      "put": {
        "description": "Body {userId: n} binds the pubkey to that user (bound_by admin, no per-user cap); {userId: null} removes the binding so the next publisher can claim it. Records an observer.binding.set audit row.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Reassign or unbind an observer (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/observer-logins": {
      "get": {
        "description": "{logins: [{userId, email, displayName, username, createdAt, revoked, lastAuthAt, observers: [pubkey]}], bindings: [{pubkey, userId|null, boundAt, boundBy, confirmedAt|null}]}. confirmedAt is when the owner's own login first published under the pubkey. Never contains passwords, hashes or ciphertext. Routes exist only when userManagement.observerLogins is enabled.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List observer MQTT logins and bindings (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/observer-logins/{id}/reissue": {
      "post": {
        "description": "New username and password, revocation cleared, credentials mailed to the account address. 200 {sent: true}; 404 without a login; 503 when the mail fails (the new login is already active). Records an observer.login.reissue audit row without the password.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Issue new observer MQTT credentials (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/observer-logins/{id}/revoke": {
      "post": {
        "description": "Takes effect at once for the broker hooks. 404 when the user has no login. Records an observer.login.revoke audit row.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Revoke a user's observer MQTT login (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/proposals": {
      "get": {
        "description": "Newest first, at most 500: the proposal fields plus proposer and reviewer ({id, displayName, email}, or null once the account is deleted). 400 on an invalid filter.",
        "parameters": [
          {
            "description": "pending | approved | rejected | revoked",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "hashtag_channel",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List proposals (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/proposals/{id}/approve": {
      "post": {
        "description": "Body {note} (at most 500 characters). Pending only (409 otherwise). The ingestor decrypts the channel from its next refresh (at most a minute) and /api/channels lists it in approvedChannels. 409 when userManagement.channelProposals.maxApproved channels are approved.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Approve a proposal (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/proposals/{id}/reject": {
      "post": {
        "description": "Body {note}. Pending only (409 otherwise). The name cannot be proposed again until the row is pruned, 90 days after the decision.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Reject a proposal (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/proposals/{id}/revoke": {
      "post": {
        "description": "Body {note}. Approved only (409 otherwise). The ingestor stops decrypting the channel from its next refresh unless the channel is configured; stored messages stay. The name can be proposed again.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Revoke an approved proposal (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/prune-geo-filter": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/admin/prune-geo-filter"
      }
    },
    "/api/admin/prune-geo-filter/status": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/admin/prune-geo-filter/status"
      }
    },
    "/api/admin/repeaters/{pubkey}/claims/{userId}": {
      "delete": {
        "description": "Browser session only; device tokens answer 403. 204. Writes a repeater.unclaim audit row with actor = the admin, target = the user and detail {pubkey, by: admin}. 400 malformed pubkey or user id; 401 not logged in; 403 not an admin or CSRF failure; 404 no such claim.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Remove a user's claim on a repeater (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/stats": {
      "get": {
        "description": "Accounts by status, active admins, pending accounts older than 24 hours (stuckPending), bouncing addresses, registrations in 7 and 30 days and per UTC day for 30 days (newPerDay, oldest first), users active in 7 and 30 days, logins and failed logins in 24 hours, mail sent in 7 days by latest delivery status (mail7d), accounts with 5 or more failed logins in 24 hours (guessing: [{userId, displayName, failed}]), and mailDeliveryStatus: false when the provider (smtp) cannot report delivery events, so mail counts only as sent.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "User figures for the admin overview (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users": {
      "get": {
        "parameters": [
          {
            "description": "pending | active | disabled",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "user | admin",
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Substring of email or display name",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 = only addresses whose mail bounces",
            "in": "query",
            "name": "bouncing",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "List users (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users-backup": {
      "get": {
        "description": "A fresh, consistent copy of users.db (VACUUM INTO) as application/octet-stream, attachment corescope-users-\u003cYYYYMMDD-HHMMSS\u003e.db (UTC). It holds every password hash and address: store it encrypted. Records a user.backup audit row. The analyzer database has its own route, GET /api/backup.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Download a users.db snapshot (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Delete a user (admin)",
        "tags": [
          "users"
        ]
      },
      "get": {
        "description": "{user, sessions, companions, repeaterClaims, mail, audit}. companions is [{pubkey, name, linkedAt, lastSeenAt}] like GET /api/account/companions. repeaterClaims is [{pubkey, claimedAt}], newest first, every claim of the user whatever the user's status. mailDeliveryStatus is false when the provider (smtp) cannot report delivery events: mail shows as sent and there is nothing to refresh.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "User detail with sessions, companions, repeater claims, mail log and audit (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/activate": {
      "post": {
        "description": "For when mail keeps failing. The address stays unverified; recorded as activatedBy + audit row.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Activate a pending user manually (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/disable": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Disable a user (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/enable": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Enable a user (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/mail/{mailId}/refresh": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "mailId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Pull delivery events for one mail from the provider (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/resend-activation": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Resend the activation mail (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/admin/users/{id}/role": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Change a user's role (admin)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/analytics/channels": {
      "get": {
        "description": "Message counts and activity per channel.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Channel analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/distance": {
      "get": {
        "description": "Geographic distance calculations between nodes.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Distance analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/hash-collisions": {
      "get": {
        "description": "Identifies nodes sharing hash prefixes.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Hash collision detection",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/hash-sizes": {
      "get": {
        "description": "Distribution of hash prefix sizes across the network.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Hash size analysis",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/neighbor-graph": {
      "get": {
        "description": "Full neighbor affinity graph for visualization.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Neighbor graph",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/relay-airtime-share": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/analytics/relay-airtime-share"
      }
    },
    "/api/analytics/retransmissions": {
      "get": {
        "description": "Collision-pressure proxy (#1699): per time bucket, the average number of distinct repeaters in the union of all observed paths of each flood event (route types 0/1, TRACE excluded). A transmission's observations are split into flood events at gaps of more than 5 minutes; each event is bucketed by its first observation, and events before the store retention floor are left out. Hop prefixes are not resolved: a prefix counts once per event, so colliding 1-byte prefixes make this a lower bound. Only repeaters some observer heard are counted, so the value also follows observer coverage; each bucket carries its observer count.",
        "parameters": [
          {
            "description": "Comma-separated IATA codes; only observations from observers in the region are counted. A region with no known observers is not filtered",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Relative window: 1h, 24h, 3d, 7d or 30d",
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Absolute window start (RFC3339)",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Absolute window end (RFC3339)",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Bucket size: 5m, 15m, 1h, 6h or 1d (default 1h)",
            "in": "query",
            "name": "bucket",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Retransmission pressure over time",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/rf": {
      "get": {
        "description": "SNR/RSSI distributions and statistics.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "RF analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/roles": {
      "get": {
        "description": "Groups this instance's cached node roster by role. Query parameters do not filter the result. Results may lag newly loaded data. An unavailable store or empty roster returns totalNodes: 0 and roles: []. Responses use Cache-Control: no-store.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleAnalyticsResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Node roles and clock-skew statistics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/subpath-detail": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Subpath detail",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/subpaths": {
      "get": {
        "description": "Common routing subpaths through the mesh.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Subpath analysis",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/subpaths-bulk": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Bulk subpath analysis",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/analytics/topology": {
      "get": {
        "description": "Hop-count distribution and route analysis.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Network topology",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/audio-lab/buckets": {
      "get": {
        "description": "Returns frequency bucket data for audio analysis.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Audio lab frequency buckets",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/auth/activate": {
      "post": {
        "description": "Request body {token, password}: the mailed activation token and the account password chosen at (the newest) registration. A wrong password answers 401 and leaves the token usable; attempts are rate-limited per account. On success consumes the token, activates the account and starts a session.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Activate an account",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/device-token": {
      "post": {
        "description": "Body {email, password, deviceName, scopes}. scopes is optional: omitted (or null) means [\"rx\"], what CoreDrive RX gets; otherwise a non-empty list of rx, repeater:claim and repeater:edit (400 for an empty list or any other value, checked before the password). 200 {token, expiresAt, user: {id, displayName}, scopes} with the granted scopes, repeats removed, in that order. The token is a bearer credential (Authorization: Bearer \u003ctoken\u003e), valid 90 days and extended on use. Every device token may use /api/auth/me and /api/auth/logout; rx adds /api/account/settings and /api/account/companions*; repeater:claim adds POST and DELETE /api/repeaters/{pubkey}/claim; repeater:edit adds PUT /api/repeaters/{pubkey}/info; either repeater scope adds the caller fields on GET /api/repeaters/{pubkey}/info and opens GET /api/account/repeaters. Other routes answer 403 to it. deviceName is cleaned (control characters removed, trimmed, at most 64 characters) and shown under Devices. Same 401 answer, rate limits (shared with /api/auth/login) and user.login audit row (detail via=device, plus the scopes) as /api/auth/login. No Origin check: nothing is stored in the browser.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Issue a device token (CoreDrive RX, mobile clients)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/forgot": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Request a password reset",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/login": {
      "post": {
        "description": "Email + password. Sets the cs_session cookie. Rate-limited per IP and per address.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Log in",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/logout": {
      "post": {
        "description": "With the cs_session cookie (Origin must be publicBaseUrl): ends that browser session and clears the cookie. With Authorization: Bearer \u003cdevice token\u003e: revokes that device token.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Log out",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/me": {
      "get": {
        "description": "Returns the logged-in user and the CSRF token, or 401. Also accepts a device token (Authorization: Bearer); csrfToken is then empty and scopes lists the token's granted scopes (absent for a browser session).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Current user",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/register": {
      "post": {
        "description": "Creates a pending account and mails an activation link. The response is identical whether or not the address is already registered.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Register an account",
        "tags": [
          "users"
        ]
      }
    },
    "/api/auth/reset": {
      "post": {
        "description": "Consumes the mailed reset token and ends all sessions of the user.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Reset the password",
        "tags": [
          "users"
        ]
      }
    },
    "/api/backup": {
      "get": {
        "description": "Streams a consistent SQLite snapshot of the analyzer DB (VACUUM INTO). Response is application/octet-stream with attachment filename corescope-backup-\u003cunix\u003e.db.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "CookieAuth": []
          }
        ],
        "summary": "Download SQLite backup",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/channels": {
      "get": {
        "description": "Returns known mesh channels with message counts. With userManagement.channelProposals.enabled the response also carries approvedChannels: the approved hashtag channel names, oldest approval first, at most maxApproved, listed also before they have traffic.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List channels",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/channels/{hash}/messages": {
      "get": {
        "description": "Returns messages for a specific channel.",
        "parameters": [
          {
            "in": "path",
            "name": "hash",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get channel messages",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/config/areas": {
      "get": {
        "description": "Returns an array of configured area keys and labels with a non-empty label. Labels are not trimmed and keys are not filtered by prefix. Returns an empty array when no entries qualify. Result order is unspecified. Public endpoint with no query parameters.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigAreasResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List configured areas",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/areas/polygons": {
      "get": {
        "description": "Returns polygon coordinates and bounds for all configured areas, including unlabeled entries. Empty polygons and unset bounds are omitted. Each bound is independently optional and can appear alongside a polygon, even when set to zero. Returns an empty array when no areas are configured. Result order is unspecified. Public endpoint with no query parameters.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigAreaPolygonsResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get configured area geometry",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/cache": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get cache configuration",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/client": {
      "get": {
        "description": "Frontend configuration. `clientRxAppUrl` is present only when clientRxCoverage is enabled and clientRxCoverage.appUrl is an absolute https URL; the coverage page shows it as a QR code.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get client configuration",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/geo-filter": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get geo-filter configuration",
        "tags": [
          "config"
        ]
      },
      "put": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/config/geo-filter"
      }
    },
    "/api/config/map": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get map configuration",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/region-quick-picks": {
      "get": {
        "description": "Named groups of region (IATA) codes from config regionQuickPicks, offered as one-tap choices by the region filter. Always a list; empty when none are configured.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get region quick picks",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/regions": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get configured regions",
        "tags": [
          "config"
        ]
      }
    },
    "/api/config/theme": {
      "get": {
        "description": "Returns color maps, CSS variables, and theme defaults.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get theme configuration",
        "tags": [
          "config"
        ]
      }
    },
    "/api/debug/affinity": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "CookieAuth": []
          }
        ],
        "summary": "Debug neighbor affinity scores",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/decode": {
      "post": {
        "description": "Decodes a hex-encoded packet without storing it.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Decode a raw packet",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/dropped-packets": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/dropped-packets"
      }
    },
    "/api/elevation/profile": {
      "get": {
        "description": "Opt-in (config los.enabled). Query pts is a flat comma list lat1,lon1,lat2,lon2,... of 2-16 points; legs[i] is pts[i] to pts[i+1] with distance_km (great-circle) and elev_m, terrain heights in metres evenly spaced along the great circle (about one per 90 m, 64-600, as /api/planner/profile samples a leg), or error too_long (leg over 300 km), unknown_point (endpoint is not a known node), too_many_tiles (the request would load more than 16 terrain tiles), upstream (a terrain tile could not be loaded; retry later) or no_terrain (no terrain data there). Terrain is the planner's SRTM tiles (config terrain block), held in memory; source names it for attribution. Every point must be a known node position. 202 with {state, progress, retry_after_s} while tiles download: re-poll the same URL. 404 when disabled, 400 on bad pts, 429 with Retry-After when the request would start more tile downloads than the client's per-IP allowance.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Terrain elevation along route legs",
        "tags": [
          "map"
        ]
      }
    },
    "/api/health": {
      "get": {
        "description": "Returns server health, uptime, and memory stats.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Health check",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/healthz": {
      "get": {
        "description": "Public readiness probe with no parameters. Returns 503 application/json with {ready:false,reason:\"loading\"} while initializing. Returns 200 with ready:true, loadedTx and loadedObs counts for the current in-memory store (not database totals), and the fixed from_pubkey_backfill compatibility values {total:0,processed:0,done:true}; these do not report actual ingestor migration progress. ingest_liveness is an optional map from source names to reported receipt and handler-entry timestamps from the ingestor stats file; it is omitted when that data is unavailable or empty. The handler-entry clock resets to 0 on MQTT connection/reconnection, while the receipt clock is retained for the current source state. ready:true does not establish MQTT freshness or successful database writes.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Query readiness",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/iata-coords": {
      "get": {
        "description": "Returns lat/lon for known airport codes (used for observer positioning).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get IATA airport coordinates",
        "tags": [
          "config"
        ]
      }
    },
    "/api/known-channels": {
      "get": {
        "description": "Returns the cached community channel catalogue without waiting for an upstream fetch. Catalogue entries do not establish observed traffic or successful decryption. An unavailable cache (including disabled fetching) returns 200 with empty entries, an empty source and the zero fetchedAt timestamp. Failed refreshes retain the last successful snapshot. Result order is unspecified. Cache-Control: public, max-age=30 without a snapshot; public, max-age=300 with a snapshot, including an empty catalogue.",
        "parameters": [
          {
            "description": "Single catalogue region label (not the IATA observer filter), matched by a case-insensitive comparison after trimming whitespace. Omitted or blank returns all entries. Unknown values return an empty entries array; comma-separated values are not expanded.",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnownChannelsResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get the community channel catalogue",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/mail/brevo/webhook": {
      "post": {
        "description": "Authenticated with Authorization: Bearer \u003cuserManagement.mail.webhookSecret\u003e. Registered only when mail.provider is brevo and the secret is set.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Brevo delivery-event webhook",
        "tags": [
          "users"
        ]
      }
    },
    "/api/meshmap/owners": {
      "get": {
        "description": "Fork-local, opt-in (config meshmapOwners.enabled and meshmapOwners.secret). Who claimed which node on meshmap.radio-actief.be, from its partner claims feed, refreshed every meshmapOwners.refreshMinutes (default 60) and replaced as a whole on every fetch. Per node (lower-case pubkey): owner (null when none) and managers, each with a name that is empty when the person hides it. People who do not share with partner tools are absent. fetchedAt is null before the first successful fetch; source is the meshmap base URL. 404 when the feature is off.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Repeater owners and managers from meshmap",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/mqtt-hook/emqx/authn": {
      "post": {
        "description": "Body {username, password, clientid}; answers {result: allow|deny|ignore}. ignore for usernames that are not a managed observer login, so the broker falls through to its own users. Authenticated with the X-CoreScope-Hook-Secret header (401 otherwise). Registered only when userManagement.observerLogins.enabled.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "EMQX authentication hook",
        "tags": [
          "users"
        ]
      }
    },
    "/api/mqtt-hook/emqx/authz": {
      "post": {
        "description": "Body {username, topic, action}, action publish or subscribe; answers {result: allow|deny|ignore}. A managed login may publish only to meshcore/\u003ciata\u003e/\u003cpubkey\u003e/\u003ctype\u003e for a pubkey it owns; an unbound pubkey is bound to the login on first publish. Everything else is denied for managed logins and ignored for other usernames. Authenticated with the X-CoreScope-Hook-Secret header (401 otherwise). Registered only when userManagement.observerLogins.enabled.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "EMQX authorization hook",
        "tags": [
          "users"
        ]
      }
    },
    "/api/mqtt/status": {
      "get": {
        "description": "Returns per-MQTT-source connection state and counters (lastConnectUnix, lastPacketUnix, packetsTotal, etc.). Broker URL passwords are masked. Sourced from the ingestor stats file; empty list when unavailable. (#1043)",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "MQTT source status",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/nodes": {
      "get": {
        "description": "Returns all known mesh nodes with status and metadata. Repeater/room rows carry the issue #672 usefulness metrics (traffic_share_score, bridge_score, coverage_score, redundancy_score), the composite usefulness_score + usefulness_grade, and relay-activity counters. See the Node schema.",
        "parameters": [
          {
            "description": "Filter by node role",
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by status (active/stale/offline)",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeListResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List nodes",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/bulk-health": {
      "get": {
        "description": "Returns health status for all nodes in one call.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Bulk node health",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/clock-skew": {
      "get": {
        "description": "Returns an array of clock-skew summaries for nodes with available data, enriched with nodeName/nodeRole when known. Fleet rows omit samples, recentHashEvidence and calibrationSummary; use the single-node endpoint for that detail. Returns an empty array when no store or no clock-skew data is available.",
        "parameters": [
          {
            "description": "Configured area key. Omit for the unfiltered fleet. Filtering applies only when the area resolves to a non-empty node set; unknown keys and empty results leave the fleet unfiltered.",
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetClockSkewResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Fleet clock-skew summaries",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/declared-regions": {
      "get": {
        "description": "One entry per repeater with a declared-regions answer (node_declared_regions, ANON_REQ_TYPE_REGIONS), newest answer per repeater: `regions` are the flood-allowed named regions without `#`, `wildcard` is true when the repeater also floods unscoped packets (`*`), `truncated` when the reply was cut off. The same answer as `declared_regions` on /api/nodes, in one response, for a mobile client choosing the flood scope of what it sends. Empty when this instance carries no declared source. Cached for 30 seconds.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Every repeater's declared flood regions",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/network-status": {
      "get": {
        "description": "Returns counts of active, stale, and offline nodes.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Network status summary",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/reported": {
      "get": {
        "description": "Repeaters that told a mobile companion their own name (client_node_names, ANON_REQ_TYPE_OWNER) have no row in nodes or inactive_nodes, and were heard directly at least once (a discover or advert reception). 404 when clientRxCoverage is disabled. Each carries its reception counts and, when companions heard it directly from at least `method.min_spots` spots at least `method.min_spread_m` apart, an `estimate`: a SNR-weighted centroid of those spots with `radius_m` (never below `method.min_radius_m`). The estimate is where companions stood, weighted, not a measured position. Cached for 5 minutes.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Repeaters known only from their reported name",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/resolve": {
      "get": {
        "description": "Resolves against nodes and eligible client_node_names entries (reported nodes heard directly), counting distinct public keys across both sources. A unique visible match includes pubkey and a non-empty name when available. No match, or a unique blacklisted or hidden-name match, returns only prefix and ambiguous=false. Multiple candidates return ambiguous=true without pubkey/name. Errors use text/plain: 400 (prefix must be hex / prefix must be at least 4 hex chars), 503 (unavailable database), or 500 (query failed).",
        "parameters": [
          {
            "description": "Hex prefix or full public key, 4 to 64 characters after trimming whitespace and lowercasing. Odd lengths are accepted. Missing, empty, non-hex, shorter or longer values return 400.",
            "in": "query",
            "name": "prefix",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeResolveResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Resolve a node prefix",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/search": {
      "get": {
        "description": "Search nodes by name or public key prefix.",
        "parameters": [
          {
            "description": "Search query",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Search nodes",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}": {
      "get": {
        "description": "Returns full detail for a single node by public key. For repeater/room nodes this includes the issue #672 usefulness axes + composite score/grade (see the Node schema).",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeDetailResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node detail",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/analytics": {
      "get": {
        "description": "Per-node packet counts, timing, and RF stats.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node analytics",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/battery": {
      "get": {
        "description": "Battery voltage history from observer_metrics for the exact stored pubkey. The node lookup does not normalize case or validate hex; unknown keys return 404. Observer IDs are matched in lowercase or uppercase. Samples with non-null battery_mv in the lookback window are sorted oldest first. With no samples, samples is [], latest_mv and latest_ts are null, and status is unknown. Errors use application/json objects with an error string: 404 (node not found), or 500 for node/history database query failures.",
        "parameters": [
          {
            "description": "Lookback in whole days, 1 through 365. Defaults to 7 when omitted, invalid, non-positive or above 365; values are not clamped.",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeBatteryResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node battery history",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/clock-skew": {
      "get": {
        "description": "Returns clock-skew statistics and available sample/calibration evidence for the path pubkey. Returns 404 when the packet store is unavailable or the node has no clock-skew data.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node clock skew",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/health": {
      "get": {
        "description": "Each stored transmission involving this node contributes its longest observed nonempty path. stats.pathHops contains the median and nearest-rank p90 of these lengths in hops. With no samples, pathHops is omitted and the rounded stats.avgHops is zero.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node health",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/hop_analytics": {
      "get": {
        "description": "One entry per flood packet the node forwarded in the window, with the hop count its flood.max check saw (the node's zero-based index in the path) and tags (flood, scoped or unscoped, advert). DIRECT packets are excluded. Every observation in the window is read. A colliding path prefix is attributed only when the previous hop's neighbor_edges neighbors leave this node as the one candidate; the server's resolved-path pick is not used. Packets carrying this node's prefix that cannot be attributed are counted in `ambiguous`.",
        "parameters": [
          {
            "description": "Lookback window in days (default 7, clamped 1-365)",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node hop counts",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/neighbors": {
      "get": {
        "description": "Returns the queried node's first-hop neighbors with affinity scores and observation metadata (count, SNR, distance, observers). Ambiguous edges carry candidate pubkeys.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeNeighborsResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node neighbors",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/paths": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node routing paths",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/nodes/{pubkey}/reach": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/nodes/{pubkey}/reach"
      }
    },
    "/api/nodes/{pubkey}/rx-coverage": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/nodes/{pubkey}/rx-coverage"
      }
    },
    "/api/nodes/{pubkey}/scopes": {
      "get": {
        "description": "Returns the region scopes this repeater has been observed forwarding (matched/unmatched/unscoped, plus route-type mix) alongside its most recently declared region list, if any. declared is null when the repeater has never successfully answered a declared-regions request.",
        "parameters": [
          {
            "description": "Time window: 1h, 24h, or 7d (default 24h)",
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get node scope conformance and declared regions",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/notifications/unsubscribe": {
      "get": {
        "description": "303 to \u003cpublicBaseUrl\u003e/#/account/unsubscribe?token=, the confirm view. Changes nothing, so link scanners cannot unsubscribe anyone.",
        "parameters": [
          {
            "description": "The unsubscribe token from the mail",
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Unsubscribe link (redirect)",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "No session and no Origin check: the confirm button and the mail provider's List-Unsubscribe-Post one-click both land here. 200 {ok, message}, also when already off; 410 for an unknown token. The token can do nothing else.",
        "parameters": [
          {
            "description": "The unsubscribe token from the mail",
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Turn notification mails off",
        "tags": [
          "users"
        ]
      }
    },
    "/api/observers": {
      "get": {
        "description": "Returns all known packet observers/gateways. neighbors_report_at (when the latest /neighbors report arrived) and neighbors_count (how many neighbors it named) are present for observers that ever sent one (#2270).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List observers",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/observers/clock-skew": {
      "get": {
        "description": "Returns an array of observer clock calibrations: observerID, offsetSec (seconds; positive means the observer clock is ahead) and samples (number of multi-observer packet samples used). Returns an empty array when the store or calibration data is unavailable.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObserverClockSkewResponse"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Observer clock calibrations",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/observers/metrics/summary": {
      "get": {
        "description": "Aggregate metrics across all observers within window (noise floor, battery, sparkline). Each row also carries tx_airtime_pct_1h / rx_airtime_pct_1h: the airtime share over the last hour regardless of window, null with under 30 minutes of samples since the last reboot or no sample in the last 15 minutes. duty_cycle_warn_pct is the configured warning threshold (dutyCycleWarnPct, default 10).",
        "parameters": [
          {
            "description": "Lookback such as 1h, 24h, 7d (default 24h)",
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "IATA code to filter observers",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Observer metrics summary",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/observers/{id}": {
      "get": {
        "description": "radio_history lists every radio setting the observer reported, oldest first: {radio_id, radio, first_seen, last_seen}. radio_id is empty for the main radio and the node's own id for an entry of a multi-radio status radios map (#1869). neighbor_report is the latest /neighbors report (#2271): {received_at, reported_at, neighbor_count, queried_neighbors, self_scopes, self_default_scope, neighbors: [{pubkey, name, role, snr, heard_secs_ago, status, scopes}]}; name and role come from the node table when known. Absent when the observer never sent one.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get observer detail",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/observers/{id}/analytics": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get observer analytics",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/observers/{id}/metrics": {
      "get": {
        "description": "Packet rates, uptime, and performance metrics.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get observer metrics",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/packets": {
      "get": {
        "description": "Returns decoded packets with filtering, sorting, and pagination.",
        "parameters": [
          {
            "description": "Maximum transmissions per page. Defaults to 50 for omitted, invalid or non-positive values. Positive values are capped by listLimits.packetsMax (10000 by default).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset. Defaults to 0 when omitted or invalid; use a non-negative integer.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Sort by ingest ID: asc selects ascending; any other value selects descending. Defaults to desc. Ignored when groupByHash=true.",
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by numeric payload_type value.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Filter by numeric route_type value.",
            "in": "query",
            "name": "route",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Comma-separated observer IDs; matches transmissions heard by any listed observer. Whitespace around IDs is trimmed.",
            "in": "query",
            "name": "observer",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Set exactly true to require an observation whose direction is not tx, from one of the selected observer IDs when observer is set, otherwise from any observer. Missing/empty directions remain eligible. Filters transmission membership only; displayed direction and signal values still come from the representative observation. Defaults to false; ignored in multi-node mode.",
            "in": "query",
            "name": "excludeTx",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only packets some observer heard on this radio setting, \"MHz,kHz,SF,CR\" (e.g. 869.618,62.5,8,8). Resolved from each observer's radio history at the time of the observation (#1869); every observation and packet (grouped rows: their header observation) carries the resolved value as radio. Combined with observer, only those observers' observations count. Served from the in-memory window only: a since/until before it does not fall back to SQL for a radio query.",
            "in": "query",
            "name": "radio",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact transmission hash, with input lowercased before matching. This is not a prefix search.",
            "in": "query",
            "name": "hash",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lower time bound; RFC3339 recommended. In-memory lists require first_seen \u003e since; SQL uses observations \u003e= since for RFC3339 values, otherwise first_seen \u003e since. Multi-node mode uses first_seen \u003e= since. Omit for no lower bound.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Upper time bound; RFC3339 recommended. In-memory lists require first_seen \u003c until; SQL uses observations \u003c= until for RFC3339 values, otherwise first_seen \u003c until. Multi-node mode uses first_seen \u003c= until. Omit for no upper bound.",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by the receiving observer's IATA region code.",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by node public key or exact name. SQL fallback matches the originating node; cached results can also include indexed relay involvement.",
            "in": "query",
            "name": "node",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated node public keys or exact names, up to 50 non-empty entries after trimming whitespace. Selects multi-node mode: only limit, offset, order, since and until also apply; other packet filters and modes are ignored. More than 50 entries returns 400.",
            "in": "query",
            "name": "nodes",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact channel identifier: a decoded channel name (for example #test) or enc_\u003cHEX\u003e for an encrypted channel hash.",
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Configured area key, filtering cached packets by the decoded originator's GPS position. The filter is ignored for unknown areas, areas with no located nodes, and SQL queries.",
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Set to observations to include observation details in in-memory, ungrouped results. Otherwise omitted; ignored in SQL queries, multi-node mode and grouped results.",
            "in": "query",
            "name": "expand",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Set exactly true to return one summary per transmission hash, ordered by latest observation descending; order and expand are ignored. Defaults to false.",
            "in": "query",
            "name": "groupByHash",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List packets",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/packets/observations": {
      "post": {
        "description": "Submit multiple observer sightings for existing packets.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Batch submit observations",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/packets/timestamps": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get packet timestamp ranges",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/packets/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get packet detail",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/paths/inspect": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/paths/inspect"
      }
    },
    "/api/perf": {
      "get": {
        "description": "Returns per-endpoint request timing and slow query log.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Performance statistics",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/perf/io": {
      "get": {
        "description": "Per-second server disk I/O rates from /proc/self/io (Linux): read/write/cancelled-write bytes and read/write syscall rates. The first server sample has zero rates. Includes an ingestor object when a usable, recent ingestor I/O sample is available; omits it when unavailable.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Process disk I/O rates",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/perf/reset": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "CookieAuth": []
          }
        ],
        "summary": "Reset performance stats",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/perf/sqlite": {
      "get": {
        "description": "Returns SQLite WAL sizes (walSize in bytes; walSizeMB in MiB), pageCount, pageSize and cacheSize. cacheHitRate is the PacketStore row-cache hit ratio, not a SQLite cache counter. Unavailable database/WAL measurements remain zero; failures reading these diagnostics do not change the 200 status.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "SQLite diagnostic metrics",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/perf/write-sources": {
      "get": {
        "description": "Returns ingestor write counters under sources and the published timestamp as sampleAt. Backfill counters use backfill_ prefixes. Successfully decoded stats also include writer_perf (empty when no writer metrics were published). An unreadable or malformed stats file returns 200 with empty sources, an empty sampleAt and no writer_perf. No freshness check is applied to the published timestamp.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Ingestor write counters",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/planner/coverage": {
      "get": {
        "description": "Opt-in (config planner.enabled). For bbox s,w,n,e (each side at most config planner.maxAreaKm, 100 km by default, settable from 20 to 250; must contain known repeaters) suggests up to sites=N new repeater sites, greedily minimising backbone components, then single points of failure, then maximising repeaters reached. 202 while computing: re-poll the same URL.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Repeater backbone plan for an area",
        "tags": [
          "map"
        ]
      }
    },
    "/api/planner/profile": {
      "get": {
        "description": "Opt-in (config planner.enabled). pts is a flat comma list of 2-16 points near the mesh; legs[i] is pts[i] to pts[i+1] with distance_km and elev_m (SRTM terrain, ~90 m spacing) or error too_long|out_of_area|no_terrain. 202 + {state,progress,retry_after_s} while terrain loads: re-poll the same URL.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Terrain profiles for a multi-point LOS chain",
        "tags": [
          "map"
        ]
      }
    },
    "/api/planner/relay": {
      "get": {
        "description": "Opt-in (config planner.enabled). Direct A-B link plus ranked relay options among known repeaters and open terrain in the corridor, each with both legs' clearance and profiles. 202 while computing: re-poll the same URL.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Best relay site between two points",
        "tags": [
          "map"
        ]
      }
    },
    "/api/planner/viewshed": {
      "get": {
        "description": "Opt-in (config planner.enabled). For site=lat,lon (near a known node) at h metres (default planner.newAntennaM) within range km (one of the planner's ranges, default planner.defaultRangeKm): a grid of cells over bbox [s,w,n,e], row 0 north, row-major, base64 in cells, one byte per cell: low nibble the Users class 1-5 (handheld reach curve planner.userReach, lowered in deep terrain shadow), high nibble the Repeaters class 1-3 (blocked below -20% first-Fresnel clearance, slightly blocked -20% to 0%, line of sight 0% or more, for a receiver at rx metres, default planner.existingAntennaM), 0 for no data. links lists the known repeaters within range (rooms, stale repeaters and repeaters within 100 m of the site excluded), nearest first, with the site-to-repeater link at h and rx (no elev_m profile). truncated is true only when the 300-node cap may have dropped a repeater within range. 202 while computing: re-poll the same URL.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Theoretical reach of one candidate repeater site",
        "tags": [
          "map"
        ]
      }
    },
    "/api/proposals": {
      "post": {
        "description": "Body {kind: \"hashtag_channel\", subject}. subject is trimmed and gets a leading # when missing; at most 31 UTF-8 bytes including the #, no control or invisible characters (ZWJ allowed), not Public. 201 with the proposal {id, kind, subject, status, note, createdAt, decidedAt}. 400 invalid kind or name, 409 already pending, already approved or rejected, or already decrypted on this instance (a name in config.json hashChannels or channelKeys, case-sensitive), 429 when the caller created userManagement.channelProposals.perUserPerDay proposals in 24 hours or maxPending proposals wait for review. Registered only when userManagement.channelProposals.enabled.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Propose a hashtag channel",
        "tags": [
          "users"
        ]
      }
    },
    "/api/push-relay/enrollment-proof": {
      "get": {
        "description": "During an active enrollment only, returns a signature binding the requesting relay's origin to its unpadded base64url-encoded 32-byte challenge (see docs/specs/2026-11-22-push-relay-contract.md).",
        "parameters": [
          {
            "in": "query",
            "name": "challenge",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Verify public analyzer control during push relay enrollment",
        "tags": [
          "users"
        ]
      }
    },
    "/api/radios": {
      "get": {
        "description": "Every radio setting (canonical \"MHz,kHz,SF,CR\") some observer has listened on, with those observers and the span of time, for the radio filter of /api/packets (#1869).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Radio settings heard on",
        "tags": [
          "observers"
        ]
      }
    },
    "/api/repeaters/info": {
      "get": {
        "description": "{repeaters: [...]} ordered by pubkey; each entry has the shape of GET /api/repeaters/{pubkey}/info without canEdit and claimedByMe. Contains every pubkey with a saved info row or at least one active claimer. Only display names are public, never email. 404 when user management is off.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Community details of all repeaters with details or claimers",
        "tags": [
          "users"
        ]
      }
    },
    "/api/repeaters/{pubkey}/claim": {
      "delete": {
        "description": "A browser session (with the CSRF header) or a device token with repeater:claim. Removes only the caller's claim; other claimers keep theirs. 200 the repeater info with canEdit and claimedByMe. Writes a repeater.unclaim audit row (via=device when sent with a device token). 400 malformed pubkey; 401 not logged in or the token is gone; 403 CSRF failure or a token without repeater:claim; 404 the caller has no claim on it; 429 rate limited.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Remove own claim on a repeater",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "A browser session (with the CSRF header) or a device token with repeater:claim. No body. 200 the repeater info with canEdit and claimedByMe. A repeater may have several claimers. Idempotent: a repeat answers 200 and writes no second repeater.claim audit row (via=device when sent with a device token). 400 malformed pubkey or not a repeater; 401 not logged in or the token is gone; 403 CSRF failure or a token without repeater:claim; 404 unknown node; 429 rate limited.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Claim a repeater",
        "tags": [
          "users"
        ]
      }
    },
    "/api/repeaters/{pubkey}/info": {
      "get": {
        "description": "{pubkey, revision, heightM, gainDbi, status, power, notes, claimers: [{displayName, claimedAt}], updatedAt, updatedBy}. revision counts saves of the details from 1 (claims do not change it); send it as baseRevision with PUT. A repeater without a saved row answers 200 with defaults: revision 0, heightM null, gainDbi 0, status null, power null, notes \"\", claimers [], updatedAt null, updatedBy null. heightM 0 is a real value, null is unknown. canEdit and claimedByMe appear with a browser session, or with a device token holding repeater:claim or repeater:edit; a device token without either scope, or a bearer that is no live device token (unknown, expired, or an auth proxy's own Authorization header), reads the public view. The pubkey is case-insensitive; 400 when it is not 64 hex characters. No analyzer lookup: any well-formed pubkey answers. 404 when user management is off.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Community details of one repeater",
        "tags": [
          "users"
        ]
      },
      "put": {
        "description": "A browser session (with the CSRF header) or a device token with repeater:edit. Body is a full replace, omitted fields are cleared, and an unchanged body is a no-op: {heightM (null = unknown, 0 to 300), gainDbi (omitted = 0, -10 to 30), status (active|maintenance|decommissioned|empty), power (mains|battery|solar|empty), notes (at most 500 characters), baseRevision (optional)}. With baseRevision the save is conditional: it must be the stored revision (0 when no details are saved yet), checked in the same statement as the write; otherwise 409 with the stored repeater info (canEdit and claimedByMe included) and nothing is written, also for a body that would change nothing. Merge and retry from the 409's revision. Without baseRevision the save is unconditional. 200 the repeater info with canEdit and claimedByMe. Allowed for an admin, for any active user when the repeater has no active claimer, otherwise only for its claimers. Writes a repeater.edit audit row with the changed fields (none when nothing changed), with via=device when sent with a device token. 400 malformed pubkey, invalid value, negative baseRevision, or a node that is not a repeater; 401 not logged in or the token is gone; 403 not a maintainer, CSRF failure or a token without repeater:edit; 404 unknown node; 429 above 120 repeater requests per hour per user and per IP.",
        "parameters": [
          {
            "in": "path",
            "name": "pubkey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "security": [
          {
            "CookieAuth": []
          }
        ],
        "summary": "Edit a repeater's community details",
        "tags": [
          "users"
        ]
      }
    },
    "/api/resolve-hops": {
      "get": {
        "description": "Resolves hash prefixes in a hop path to node names. Returns affinity scores and best candidates.",
        "parameters": [
          {
            "description": "Comma-separated hop hash prefixes",
            "in": "query",
            "name": "hops",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Resolve hop path",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/rf-noise": {
      "get": {
        "description": "GeoJSON hex cells of the LoRa noise floor measured by mobile clients along their tracks, from client_rf_samples. Lower (more negative) dBm is quieter, the opposite direction to the SNR-coloured coverage layer. Stationary samples are excluded: a parked companion logs hundreds of samples at one point and would otherwise define the cell. Gated on clientRfSamples.",
        "parameters": [
          {
            "description": "Bounding box as minLat,minLon,maxLat,maxLon",
            "in": "query",
            "name": "bbox",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Leaflet zoom level; sets the hex resolution",
            "in": "query",
            "name": "z",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Look-back window in days (1-30, default 7)",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Only this companion's samples",
            "in": "query",
            "name": "rx",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 = only samples of companions linked to the logged-in user (browser session; 401 without one)",
            "in": "query",
            "name": "mine",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "RF noise-floor hex grid",
        "tags": [
          "coverage"
        ]
      }
    },
    "/api/rf-params": {
      "get": {
        "description": "Opt-in (config rfParams.nodesUrl, issue #1268). Frequency, SF, bandwidth and coding rate the MeshCore map holds for the nodes this instance knows, keyed by lower-case pubkey, limited to adverts within rfParams.maxAgeDays (default 7). Also returns the named presets and fetched_at, the time of the last successful map fetch (null before the first one), and deviations: the nodes whose frequency, SF or bandwidth differs from a setting that more than half of the nodes within rfParams.compareRadiusKm (default 50) on the same band share, the node itself counted, with that majority and the counts. Frequencies within a quarter of the bandwidth count as the same channel. enabled is false when the feature is off.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "LoRa RF parameters per node",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/rx-coverage": {
      "get": {
        "description": "GeoJSON hex cells where mobile clients directly heard nodes (client_receptions): count, best SNR and the nodes heard per cell. With gaps=1 the payload also carries a `gaps` member: cells a companion drove through (moving client_rf_samples) with no reception in the same window, each with its sample count, plus `gaps_truncated` when capped. Gaps are only returned without a node filter and with clientRfSamples on; they mean nothing was received in this period, not that there is no coverage. Gated on clientRxCoverage.",
        "parameters": [
          {
            "description": "Bounding box as minLat,minLon,maxLat,maxLon",
            "in": "query",
            "name": "bbox",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Leaflet zoom level; sets the hex resolution",
            "in": "query",
            "name": "z",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Look-back window in days (1-30, default 7)",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Only receptions of this node (pubkey or 2-3 byte prefix); disables gaps",
            "in": "query",
            "name": "node",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this companion's receptions (and, with gaps=1, its own track)",
            "in": "query",
            "name": "rx",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 = add cells driven through with nothing received",
            "in": "query",
            "name": "gaps",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Mobile RX coverage hex grid",
        "tags": [
          "coverage"
        ]
      }
    },
    "/api/rx-leaderboard": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/rx-leaderboard"
      }
    },
    "/api/scope-audit": {
      "get": {
        "description": "For every repeater that has answered a declared-regions request: the regions it declares, which of those it has NOT been observed forwarding in the window, which scopes it forwards without declaring, and whether it forwards unscoped floods while omitting the '*' wildcard. '*' is never listed as a region — it governs unscoped floods, not a scope. Repeaters never successfully asked are absent rather than shown as declaring nothing. Rows with missing regions sort first; a short window is weak evidence, since a quiet region simply has no traffic.",
        "parameters": [
          {
            "description": "Time window: 1h, 24h, or 7d (default 24h)",
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "declared (default) or transport",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "mode=transport only: region scope to split the fleet by",
            "in": "query",
            "name": "scope",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Observer IATA codes, comma-separated: count only forwarding heard by observers there. All means no filter",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Network-wide scope audit",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/scope-stats": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "/api/scope-stats"
      }
    },
    "/api/stats": {
      "get": {
        "description": "Returns aggregate stats (node counts, packet counts, observer counts). Cached for 10s.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Network statistics",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/traces/{hash}": {
      "get": {
        "description": "Returns all observer sightings for a packet hash.",
        "parameters": [
          {
            "in": "path",
            "name": "hash",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get packet traces",
        "tags": [
          "packets"
        ]
      }
    },
    "/api/uplink-coverage": {
      "get": {
        "description": "GeoJSON hex cells where mobile companions sent uplink pings (CoreDrive RX, client_uplink_pings). Per cell: pings, and how many were `both` (a repeater re-broadcast was heard by the companion AND an observer received the ping), `observed` (observer only), `echo` (re-broadcast heard, no observer received it) or `none`; `best` is the best class in the cell, plus the first-hop repeaters (`first_hops`, with `first_hop_names` parallel: the name, or empty when the prefix is unknown, ambiguous or hidden), the most observers reached and the longest path. `observed` depends on observer placement: a ping no observer received may still have travelled. Gated on clientUplink.",
        "parameters": [
          {
            "description": "Bounding box as minLat,minLon,maxLat,maxLon",
            "in": "query",
            "name": "bbox",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Leaflet zoom level; sets the hex resolution",
            "in": "query",
            "name": "z",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Look-back window in days (1-30, default 7)",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Only this companion's pings",
            "in": "query",
            "name": "rx",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 = only pings of companions linked to the logged-in user (browser session; 401 without one)",
            "in": "query",
            "name": "mine",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Uplink ping hex grid",
        "tags": [
          "coverage"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Server administration and diagnostics",
      "name": "admin"
    },
    {
      "description": "Network analytics and statistics",
      "name": "analytics"
    },
    {
      "description": "Mesh channel operations",
      "name": "channels"
    },
    {
      "description": "Server configuration",
      "name": "config"
    },
    {
      "description": "Mesh node operations",
      "name": "nodes"
    },
    {
      "description": "Packet observer/gateway operations",
      "name": "observers"
    },
    {
      "description": "Packet capture and decoding",
      "name": "packets"
    },
    {
      "description": "Optional user management (accounts, sessions, admin)",
      "name": "users"
    }
  ]
}
