Skip to main content

NetBeez JSON:API & OpenAPI 20.0 Reference

Authenticate with Bot Users, fetch the OpenAPI 20.0 specification, and query or automate NetBeez NextGen resources via JSON:API and the in-app Code viewer.

Written by Panickos Neophytou

NetBeez NextGen (Version 20.0+) provides a unified JSON:API HTTP interface for querying monitoring telemetry and automating configuration across Agents, Agent Groups, Targets, Scheduled Tests, Wi-Fi Profiles, Hopping Groups, Alerts, Incidents, Monitoring Conditions, and Reports. Every NextGen server also serves its complete OpenAPI 20.0 contract at GET /openapi.yaml, includes an in-app Code JSON:API and curl inspector on entity pages, and pairs with the MCP Server (/mcp) for AI-driven workflows.

In this article:

Overview & Key Conventions

All programmatic HTTP endpoints in NetBeez NextGen follow the JSON:API specification with consistent conventions across read and write operations:

  • UUID v4 Identifiers: Every resource primary key (id) and relationship foreign key is a standard UUID v4 string (replacing legacy integer IDs).

  • Slash-Namespaced Resource Types: JSON:API type values and compound-document include paths use forward-slash namespacing—for example, agent, agent/group, target, target/ping_template, scheduled/iperf_template, wifi/profile, and wifi/hopping_group.

  • JSON Headers Required: Always send Accept: application/json (and Content-Type: application/json on POST and PUT requests). Browser-oriented text/html or Turbo Stream requests carrying an Authorization header are rejected with 403 Forbidden.

Authenticating with Bot Users

In Version 20.0+, dedicated Bot Users replace legacy Bearer API keys and JWT sessions. An Administrator can create Bot Users in Settings → Users & Access → Bot Users with either Read Only or Read Write permissions.

Settings Users & Access Bot Users page showing Bot User identifiers, assigned roles, and Create Bot User button

Include the Bot User's one-time generated password (as token) and system email (bot-<uuid>@netbeez.local, as email) in the HTTP Authorization header on every request:

Authorization: Token token=<bot_password>, email=<bot_email>
Accept: application/json
Content-Type: application/json
Cache-Control: no-store
  • Role Enforcement:Read Only Bot Users can call GET endpoints across the API; POST, PUT, and DELETE mutations require a Read Write Bot User. For least-privilege security, Bot Users cannot be assigned the Administrator role.

  • MFA & License Rules: Bot Users are exempt from interactive Authenticator-app MFA challenges (whereas human local accounts cannot use HTTP token headers when MFA is enabled). If the server license expires (Settings → License), Bot User requests return 403 Forbidden (License is expired) until renewed.

Fetching the OpenAPI 20.0 Specification

Every NetBeez NextGen deployment serves its authoritative OpenAPI 3.0.3 YAML specification (version 20.0.0) directly from GET /openapi.yaml. This endpoint requires Bot User token authentication and never falls back to browser session cookies:

curl -sS "https://<your-netbeez-hostname>/openapi.yaml" \
  -H "Authorization: Token token=<bot_password>, email=<bot_email>" \
  -o netbeez-openapi-20.0.yaml

You can import netbeez-openapi-20.0.yaml directly into Postman, Insomnia, Bruno, or OpenAPI client generators to inspect every request body schema, enum, filter parameter, and response structure. Connected AI assistants using the NetBeez MCP Server can also retrieve this specification on demand via the get_openapi_spec tool.

In-App JSON:API & cURL Viewer

To inspect the live JSON:API representation of a specific monitoring resource without leaving the dashboard, open any Agent, Target, Wi-Fi Profile, or Scheduled Test detail page (or an individual test graph header) and click the Code button in the top-right header:

Target detail page with the Code popover expanded displaying the resource JSON:API document, Copy Code button, and Copy as cURL button
  • Copy Code: Copies the resource's serialized JSON:API payload to your clipboard as a template for automation scripts.

  • Copy as cURL: Copies a ready-to-run curl command targeting that resource's exact UUID endpoint with BOT_USER_PASSWORD and BOT_USER_EMAIL placeholders.

Endpoint Groups & Query Parameters

Core JSON:API Endpoint Groups

Domain

Primary Endpoints

Supported Operations

Agents & Agent Groups

/agents, /agents/{id}, /agents/availabilities, /agents/{agent_id}/metrics, /agents/groups, /agents/groups/{id}

List, get, update, soft-delete agents; CRUD agent groups; query availability and CPU/RAM/disk metrics

Targets & Target Tests

/targets, /targets/{id}, /targets/nb_tests, /targets/nb_tests/metrics, /targets/nb_tests/path_analysis_results

CRUD targets with Ping, DNS, HTTP, Traceroute, and Path Analysis templates; pause/resume tests; query metrics and hop results

Scheduled Tests

/scheduled/test_templates, /scheduled/test_templates/{id}, /scheduled/runs, /scheduled/metrics

CRUD Iperf, Network Speed, VoIP, and Custom Command templates; inspect runs and metrics

Wi-Fi Monitoring

/wifi/profiles, /wifi/hopping_groups, /wifi/metrics, /agents/{agent_id}/wifi_metrics, /agents/{agent_id}/access_point_connections

CRUD Wi-Fi profiles and hopping groups; query signal/link metrics, access points, and connection timing statistics

Alerts, Incidents & Conditions

/alerts, /alerts/detectors, /incidents, /monitoring_conditions

Query open/closed alerts, alert detectors, correlated incidents, and monitoring conditions

Reports & Schedules

/reports, /reports/{id}, /reports/schedules, /reports/schedules/{id}

List, generate, and delete reports; CRUD recurring report schedules

Pagination, Filtering, Sorting & Includes

  • Pagination: Pass page[page]=1 (1-based) and page[limit]=25 (1 to 500, default 25). Collection responses include meta.page (page, limit, total) and links (self, next, prev).

  • Filtering: Scope collections using filter[<field>] parameters—for example, filter[ids][], filter[active]=true, filter[categories][]=network_agent, filter[groups][]=<group_uuid>, filter[names]=HQ-Core (prefix with ! to negate), or filter[names][regexp]=^branch-. Array filters accept repeated filter[field][]=a&filter[field][]=b keys or comma-separated values.

  • Time Windows: Metric, availability, alert, and hop-result endpoints accept filter[time] (5_min, 15_min, 1_hour, 4_hour, 12_hour, 24_hour, 7_day, yesterday, week, month, or custom with filter[time_range][]).

  • Sorting: Pass order[attributes]=name (or occurred_at, started_at, scheduled_at) and order[direction]=asc or desc.

  • Compound Documents (include): Request related records in a single call using comma-separated whitelisted relationship paths, such as include=agent/network_interfaces,agent/groups on /agents or include=test_templates,agents,agent_groups on /targets/{id}.

JSON:API Read & Write Examples

Example 1: List Active Network Agents with Interfaces and Groups

curl -sS "https://<your-netbeez-hostname>/agents?filter[categories][]=network_agent&filter[active]=true&include=agent/network_interfaces,agent/groups&page[limit]=10" \
  -H "Authorization: Token token=<bot_password>, email=<bot_email>" \
  -H "Accept: application/json"

Example 2: Create a Target with an ICMP Ping Template and Agent Group

Using a Read Write Bot User, send a JSON:API data payload to POST /targets. To detach an existing relationship on a later PUT /targets/{id} call, include "action": "remove" on that relationship identifier object:

curl -sS -X POST "https://<your-netbeez-hostname>/targets" \
  -H "Authorization: Token token=<bot_password>, email=<bot_email>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "type": "target",
      "attributes": {
        "name": "Core DNS Resolver",
        "description": "Primary internal DNS health check",
        "wired_test": true,
        "wifi_test": true
      },
      "relationships": {
        "test_templates": {
          "data": [
            {
              "type": "target/ping_template",
              "attributes": {
                "destination": "1.1.1.1",
                "ping_type": 2,
                "interval": 5,
                "timeout": 5,
                "jitter_mos": true
              }
            }
          ]
        },
        "agent_groups": {
          "data": [
            {
              "id": "00000000-0000-4000-8000-000000000001",
              "type": "agent/group"
            }
          ]
        }
      }
    }
  }'

Migrating from the Legacy 15.x API

  • Swagger & Legacy Routes Retired: Legacy Swagger UI (/swagger/index.html), legacy v0/v1//nb_api/ endpoints, JWT session endpoints, and integer resource IDs are retired in NextGen 20.0. Fetch GET /openapi.yaml for the current contract.

  • API Keys Migrated to Bot Users: During a Legacy 15.6 to NextGen 20.0 server migration, existing API keys are converted into Bot Users. Update client scripts from Authorization: Bearer <key> to Authorization: Token token=<bot_password>, email=<bot_email> and replace deprecated page[offset] pagination with page[page] and page[limit].

  • Developer Community: For integration patterns and community scripts, visit the NetBeez Community.

Did this answer your question?