API reference

Every Netlens page uses this API, so anything you can do in the web interface you can script. Send the token as Authorization: Bearer <token>. Create tokens under Settings, Users and tokens; make them read-only for monitoring tools. Reading needs a viewer, changing needs an administrator. Prometheus numbers are at /metrics, and /api/health needs no token.

This reference lists 243 endpoints, generated from the current release. To browse it interactively, start Netlens with NETLENS_API_DOCS=on and open /docs.

audit

Method Path What it does
GET /api/audit List Audit
GET /api/audit.csv Audit Csv

auth

Method Path What it does
GET /api/auth/oidc/callback Callback
GET /api/auth/oidc/login Login

backup

Method Path What it does
GET /api/backup Download a consistent snapshot of the whole database (includes saved SMTP/Proxmox credentials).

backups

Method Path What it does
GET /api/backups Get Backups
POST /api/backups/run Run Now
PUT /api/backups/schedule Put Schedule
DELETE /api/backups/{name} Delete
GET /api/backups/{name} Download
POST /api/backups/{name}/restore Restore

central

Method Path What it does
GET /api/central Get Link
PUT /api/central Put Link
POST /api/central/push Send a report now and say what happened.

changelog

Method Path What it does
GET /api/changelog All releases, newest first; with since only those after that version (up to the running one).

changes

Method Path What it does
GET /api/changes List Changes

config

Method Path What it does
GET /api/config Get Config
PUT /api/config/general Put General
PUT /api/config/ranges Set the scan ranges. An empty list removes the override (env value or auto-detect).

dashboard

Method Path What it does
GET /api/dashboard The start page: the summary plus what needs attention, the latest events and a few small series.
DELETE /api/dashboard/default Delete Default
GET /api/dashboard/default The dashboard an administrator set for everybody (null while there is none).
PUT /api/dashboard/default Put Default
DELETE /api/dashboard/layout Delete Layout
GET /api/dashboard/layout The cards this user chose, in order (null while the user still has the default).
PUT /api/dashboard/layout Put Layout
GET /api/dashboard/shared Cards an administrator made available to everybody (they are added from the card pool).
PUT /api/dashboard/shared Put Shared

devices

Method Path What it does
GET /api/devices List Devices
POST /api/devices/baseline Take the current open ports of devices as their normal ones (or forget the baseline).
POST /api/devices/group Put devices in a group (or none).
POST /api/devices/trust Mark devices as known (or unknown again). Without ids it applies to all devices (“trust everything on my network now”).
DELETE /api/devices/{device_id} Delete a device with its ports, names, history and links.
GET /api/devices/{device_id} Get Device
PATCH /api/devices/{device_id} Patch Device
GET /api/devices/{device_id}/flapping Why a device keeps going offline: analysis of the scan history (tz = the browser’s offset from UTC in minutes).
POST /api/devices/{device_id}/flapping/probe The live test: ask the device now, several times, by ARP, ICMP and TCP.
DELETE /api/devices/{device_id}/hostkey Delete Hostkey
GET /api/devices/{device_id}/limits The limits that apply to this device, and which of them were set for it alone.
PUT /api/devices/{device_id}/limits Put Device Limits
DELETE /api/devices/{device_id}/monitor Delete Monitor
GET /api/devices/{device_id}/monitor Get Monitor
PUT /api/devices/{device_id}/monitor Put Monitor
POST /api/devices/{device_id}/monitor/run Read now (the answer says what happened) instead of waiting for the next round.
POST /api/devices/{device_id}/monitor/test Try the readings with what is in the form (or what is stored, for the secrets left empty). Nothing is saved.
POST /api/devices/{device_id}/ping Ping Device
POST /api/devices/{device_id}/scan Run a full scan of this one host: all TCP ports, service versions, OS detection and traceroute.
POST /api/devices/{device_id}/trace Trace Device
GET /api/devices/{device_id}/uptime Get Device Uptime
POST /api/devices/{device_id}/wake Send a Wake-on-LAN magic packet to the device’s MAC address.
GET /api/devices/{device_id}/wifi Signal history of a Wi-Fi client (from the router plugin), its current node and its last moves between nodes.

dns

Method Path What it does
GET /api/dns Get Dns
POST /api/dns/apply Apply
POST /api/dns/refresh Read the DNS server(s) now and show the new preview.
PUT /api/dns/settings Put Settings

documentation

Method Path What it does
GET /api/documentation Get Settings
PUT /api/documentation Put Settings
GET /api/documentation/export Export
GET /api/documentation/site/{probe_id} The documentation of a remote site, from what the site reports; named after its customer.

engineer

Method Path What it does
GET /api/engineer Get Engineer
PUT /api/engineer Put Engineer
POST /api/engineer/test Test Engineer

escalation

Method Path What it does
GET /api/escalation Get Escalation
PUT /api/escalation Put Escalation
POST /api/escalation/{event_id}/ack Ack

events

Method Path What it does
GET /api/events List Events

export

Method Path What it does
GET /api/export/devices.csv Export Devices Csv
GET /api/export/devices.json Export Devices Json

forecast

Method Path What it does
GET /api/forecast Monitored disks with their growth trend and the day they run full, the ones that fill soonest first.

groups

Method Path What it does
GET /api/groups Get Groups
POST /api/groups Add Group
DELETE /api/groups/{group_id} Remove Group
PATCH /api/groups/{group_id} Edit Group

guest backups

Method Path What it does
GET /api/guest-backups Get Guest Backups

health

Method Path What it does
GET /api/health Health

hierarchy

Method Path What it does
GET /api/hierarchy Which device sits below which: flat nodes with parent_id, how the parent was found, and counts.

ignored

Method Path What it does
GET /api/ignored Devices that scans skip (deleted with ‘ignore’). Newest first.
DELETE /api/ignored/{ignored_id} Stop ignoring a device: the next scan adds it again if it is on the network.

insights

Method Path What it does
GET /api/insights Get Insights
POST /api/insights/ask Ask Question
GET /api/insights/identify/{device_id} Identify Device
POST /api/insights/incidents/{incident_id}/words The incident in the language model’s words (the plain summary stays when there is no model).
POST /api/insights/model-check Five small exams that show whether the connected language model is reliable enough (takes a minute with a slow model).
GET /api/insights/postmortem/{run_id} Get Postmortem
PUT /api/insights/settings Put Settings

inventory

Method Path What it does
GET /api/inventory Get Inventory

ipv4

Method Path What it does
GET /api/ipv4/health Get Health4
POST /api/ipv4/health/run Look at the IPv4 side of the network now.

ipv6

Method Path What it does
GET /api/ipv6 Get Ipv6
PUT /api/ipv6 Put Ipv6
POST /api/ipv6/discover Look for IPv6 addresses now (without a scan).
GET /api/ipv6/health The last IPv6 health result (null before the first run).
POST /api/ipv6/health/run Look at the IPv6 side of the network now.

licence

Method Path What it does
DELETE /api/licence Delete Licence
GET /api/licence Get Licence
PUT /api/licence Put Licence
POST /api/licence/trial Start Trial

login

Method Path What it does
POST /api/login Login

logout

Method Path What it does
POST /api/logout Logout

maintenance

Method Path What it does
GET /api/maintenance Get Windows
POST /api/maintenance Create Window
POST /api/maintenance/now A one-time window that starts now, for the device page’s quick button.
DELETE /api/maintenance/{window_id} Delete Window
PUT /api/maintenance/{window_id} Update Window

map

Method Path What it does
GET /api/map Get Map

map settings

Method Path What it does
GET /api/map-settings Get Map Settings
PUT /api/map-settings The layout the map opens with in browsers where nobody picked one, and the domain suffix hidden in displayed names.

me

Method Path What it does
POST /api/me/password A signed-in user changes their own password (all their other logins end).
GET /api/me/preferences Get Preferences
PUT /api/me/preferences Put Preferences

metrics

Method Path What it does
GET /metrics Prometheus scrape endpoint. Needs the same token as the API (Prometheus: authorization: credentials: <token>).

monitoring

Method Path What it does
GET /api/monitoring/limits Get Limits
PUT /api/monitoring/limits Put Limits

monitors

Method Path What it does
GET /api/monitors Every monitored device with its newest readings and the readings that are past a limit.

netchecks

Method Path What it does
GET /api/netchecks Get Netchecks
PUT /api/netchecks Put Netchecks
POST /api/netchecks/dhcp/run Look for DHCP servers right now (about ten seconds).
DELETE /api/netchecks/dhcp/{ip} Forget Dhcp
PUT /api/netchecks/dhcp/{ip} Trust Dhcp

notify channels

Method Path What it does
GET /api/notify-channels Get Channels
POST /api/notify-channels Create Channel
DELETE /api/notify-channels/{channel_id} Delete Channel
PUT /api/notify-channels/{channel_id} Update Channel
POST /api/notify-channels/{channel_id}/test Send a test message through the saved channel settings (works while the channel is switched off).

notify quiet

Method Path What it does
PUT /api/notify-quiet Put Quiet

passive

Method Path What it does
GET /api/passive Get Passive
PUT /api/passive Put Passive

plugin compat

Method Path What it does
GET /api/plugin-compat After a Netlens upgrade: which installed plugins may no longer work, and what fixes it.
POST /api/plugin-compat/dismiss Plugin Compat Dismiss

plugin index

Method Path What it does
GET /api/plugin-index The index joined with what is installed. Served from a six-hour cache unless refresh is set; cache_only never uses the network.
GET /api/plugin-index/settings Get Index Settings
PUT /api/plugin-index/settings Put Index Settings
PUT /api/plugin-index/{plugin_id}/auto-update Switch automatic updating of one plugin on or off (only plugins installed from the index can be updated automatically).
POST /api/plugin-index/{plugin_id}/install Install or update a plugin from the index (checksum verified; a new plugin starts switched off).
POST /api/plugin-index/{plugin_id}/rollback Rollback Plugin

plugins

Method Path What it does
GET /api/plugins List Plugins
POST /api/plugins Install a plugin from a zip file sent as the request body (Content-Type: application/zip).
GET /api/plugins/example.zip Plugin Example
GET /api/plugins/guide Plugin Guide
DELETE /api/plugins/{plugin_id} Delete Plugin
GET /api/plugins/{plugin_id} Get Plugin
PUT /api/plugins/{plugin_id} Put Plugin
POST /api/plugins/{plugin_id}/diagnose Run the plugin’s diagnostic with the values in the form (saved secrets are used when none is typed). Saves nothing.
POST /api/plugins/{plugin_id}/sync Sync Plugin
POST /api/plugins/{plugin_id}/test Try the values in the form (saved secrets are used when none is typed). Saves nothing.

probe

Method Path What it does
POST /api/probe/push Push

probes

Method Path What it does
GET /api/probes List Probes
POST /api/probes Create Probe
DELETE /api/probes/{probe_id} Delete Probe
GET /api/probes/{probe_id} Probe Detail
PATCH /api/probes/{probe_id} Update Probe
GET /api/probes/{probe_id}/config Get Config
PUT /api/probes/{probe_id}/config Put Config
POST /api/probes/{probe_id}/token A new token; the old one stops working at once.
Method Path What it does
GET /api/probes-search Devices of the remote sites that match a search text (name, address, MAC or vendor), for the search box. Frozen sites are left out.

relations

Method Path What it does
GET /api/relations Get Relations
POST /api/relations Create Relation
DELETE /api/relations/{relation_id} Remove Relation

remediation

Method Path What it does
GET /api/remediation Get Remediation
PUT /api/remediation/paused Pause
POST /api/remediation/rules Create Rule
DELETE /api/remediation/rules/{rule_id} Delete Rule
PUT /api/remediation/rules/{rule_id} Update Rule
POST /api/remediation/rules/{rule_id}/run Try a rule on a device now (it is recorded like any run; the cooldown and limits do not apply to a test).
POST /api/remediation/runs/{run_id}/ask Ask Engineer
POST /api/remediation/runs/{run_id}/decide Decide Run

remote

Method Path What it does
GET /api/remote Get Remote
DELETE /api/remote/{device_id}/saved/{proto} Forget Credentials
POST /api/remote/{device_id}/session Check everything and hand out a one-time ticket for the WebSocket, so the password never appears in an address.

reports

Method Path What it does
GET /api/reports/availability Availability of the devices and services in one calendar month (default: this one). scope=core: only the always-on devices; services=false: no service
GET /api/reports/availability.csv Availability Csv
GET /api/reports/monthly The monthly report of the last full month as it would be sent now, and the settings.
POST /api/reports/monthly/send Send the monthly report now to the channels that ticked “Monthly report” (to try it out).
GET /api/reports/weekly The weekly summary as it would be sent now, and the schedule.
POST /api/reports/weekly/send Send the weekly report now to the channels that ticked “Weekly report” (to try it out).
PUT /api/reports/weekly/settings Put Settings

restore

Method Path What it does
POST /api/restore Replace the database content with an uploaded backup (raw request body).

scan options

Method Path What it does
DELETE /api/scan-options Reset Scan Options
GET /api/scan-options nmap options (ports, timing, detection) used by scans, plus presets and the resulting command lines.
PUT /api/scan-options Change the nmap options; only the keys sent are changed. Applies from the next scan.

scans

Method Path What it does
GET /api/scans Get Scans
POST /api/scans Create Scan
POST /api/scans/cancel Stop the running scan. Not possible once its results are being saved.
GET /api/scans/current Get Current Scan

service checks

Method Path What it does
GET /api/service-checks List Checks
POST /api/service-checks Create Check
DELETE /api/service-checks/{check_id} Delete Check
PATCH /api/service-checks/{check_id} Update Check
GET /api/service-checks/{check_id}/results Results
POST /api/service-checks/{check_id}/run Run a check now and record the result (the answer shows what happened).

session

Method Path What it does
GET /api/session Session

setup

Method Path What it does
GET /api/setup Get Setup
POST /api/setup Do Setup

share

Method Path What it does
GET /share/{token} Share Page

share api

Method Path What it does
GET /share-api/{token} Share Data

shares

Method Path What it does
GET /api/shares Get Shares
POST /api/shares Add Share
DELETE /api/shares/{link_id} Remove Share

siem

Method Path What it does
GET /api/siem Get Siem
PUT /api/siem Put Siem
POST /api/siem/test Test Siem

sites

Method Path What it does
GET /api/sites List Sites

snoozes

Method Path What it does
DELETE /api/snoozes Delete Snooze
GET /api/snoozes List Snoozes
POST /api/snoozes Create Snooze

speedtest

Method Path What it does
GET /api/speedtest Overview
POST /api/speedtest/browser Stores what the page measured (the page is the only one who can know).
GET /api/speedtest/down Download
DELETE /api/speedtest/history Clear History
POST /api/speedtest/internet Run Internet
POST /api/speedtest/iperf/run Run Iperf
PUT /api/speedtest/iperf/server Put Iperf Server
GET /api/speedtest/ping Ping
PUT /api/speedtest/schedule Put Schedule
GET /api/speedtest/status What a running test is doing (polled once a second by the page).
POST /api/speedtest/up Upload

sso

Method Path What it does
GET /api/sso Get Sso
PUT /api/sso Put Sso
POST /api/sso/test Test Sso

stats

Method Path What it does
GET /api/stats Everything for the Statistics page. range is 24h, 7d, 30d or 90d (the window of the history groups).
GET /api/stats/summary Small, versioned document for Home Assistant and other integrations (see api in the answer).

timeseries

Method Path What it does
GET /api/timeseries/{entity}/{entity_id} The measurements of one device / check / probe, with the newest value of each.
GET /api/timeseries/{entity}/{entity_id}/{metric} History

update

Method Path What it does
GET /api/update Is a newer Netlens available? Answers from a one-day cache unless refresh is set.
PUT /api/update Put Update

uptime

Method Path What it does
GET /api/uptime Per-device heartbeat bars and 24h/7d/30d uptime, like Uptime Kuma’s dashboard. With range each bar is a slice of that period with its
GET /api/uptime/core Every device with whether it is marked always-on, plus Netlens’s suggestions.
PUT /api/uptime/core Mark exactly these devices as always-on (an administrator; viewers are refused by the role filter).

users

Method Path What it does
GET /api/users Get Users
POST /api/users Add User
DELETE /api/users/{user_id} Remove User
PATCH /api/users/{user_id} Edit User
POST /api/users/{user_id}/tokens Create an API token for a user. The token itself is in the answer once and is never shown again.
DELETE /api/users/{user_id}/tokens/{token_id} Remove Token

vault

Method Path What it does
GET /api/vault Get Status
GET /api/vault/key Get Key
PUT /api/vault/key Use this key, or the one the recovery passphrase unlocks (after restoring a backup on another machine). Refused while the current key
PUT /api/vault/recovery Set the recovery passphrase: from then on every backup carries the key, wrapped with it.

vendor db

Method Path What it does
GET /api/vendor-db Get Vendor Db
POST /api/vendor-db/refresh Download the newest vendor registry from IEEE now.

vulns

Method Path What it does
GET /api/vulns Get Vulns

wizard

Method Path What it does
GET /api/wizard Get Wizard
PUT /api/wizard Put Wizard