Skip to main content

PBX Nodes

The PBX Nodes resource returns the operational information shown in Admin → PBX Nodes (nodes.php): saved system health and service checks, plus optional live Asterisk readings. It is read-only.

Endpoints and authentication

GET https://pbx.example.com/pbx/openapi.php/nodes
GET https://pbx.example.com/pbx/openapi.php/nodes/{id}

Use a full or read-only global API key. Send it with X-API-Key, Authorization: Bearer, or the key query parameter. Normal API IP restrictions apply. Tenant keys and extension Dial API Keys cannot read this resource. Omit tenant, including when using a global key. Only GET is supported; these endpoints cannot change node configuration.

Parameters and pagination

ParameterMeaning
idNumeric node ID. Supply it in /nodes/{id} or as a query parameter. Both forms return one object in data; conflicting IDs are rejected.
livetrue by default. Include live Asterisk version, peer/contact counts, channels/calls and ODBC state. Use false for database readings without an AMI connection.
limitFor lists: 1–100 nodes per page; default 10.
offsetFor lists: number of nodes to skip, default 0; maximum 10,000,000. A nonzero offset is not accepted for a single-node request.

GET /nodes returns an array in data, ordered by numeric node ID. Read has_more and use next_offset to retrieve the next page. A missing single node returns 404; an empty list page returns data: [].

Examples

# All returned nodes, including live AMI readings
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/nodes"

# One node, saved/database readings only
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/nodes/3?live=false"

# A bounded page for monitoring without AMI
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/nodes?live=false&limit=10&offset=0"

# Equivalent query-style single-node request
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php?object=nodes&action=get&id=3&live=false"

The query-style list form is openapi.php?object=nodes&action=list&live=false. The OpenAPI specification lists these operations as listNodes and getNode in its global catalog.

Response fields

FieldMeaning
objectnodes for both list and single-node responses.
generated_at, timezoneResponse snapshot time and PBX server timezone. This is not a new collection timestamp for saved metrics.
dataNode objects for a list, or one node object for an ID lookup.
limit, offset, has_more, next_offsetPagination. next_offset is null on the last page.
peers_online_on_pageSum of the live peer/contact counts for the returned nodes only; null when a returned count is unavailable or live readings are disabled. It is not a cluster total when pagination is used.
contextAI processing backlogs for returned processing nodes, cluster housekeeping and the database auto-increment capacity check.
Node fieldMeaning
id, name, peer_name, ip_address, pbx_versionNode identity, host address and installed PBX version.
osversion, pending security/normal updates, last checked timestamp, upgrade status, error text and health colour. End-of-life status or pending security updates is red; other pending updates yellow.
checks.croncheckSaved scheduling cursor and freshness check. Includes wall-clock last_check, effective epoch, stored_epoch, age_seconds, threshold_seconds, future and status.
checks.devstateSaved device-state heartbeat with a 1,800-second threshold; installed and expected versions, ping and pong timestamps.
checks.geoip_module, checks.geoip_data, checks.dahdiSaved GeoIP module/data and DAHDI status values and colours.
checks.asterisk_recoveryWhether automatic recovery is enabled, saved recovery state, last restart timestamp and status.
services.amirouter, services.openaigatewayConfigured enable value, saved runtime state, installed/expected versions, icon state and status.
services.voipmonitorWhether VoIPmonitor is enabled and its saved status message.
systemCPU cores and governor, system/Asterisk uptime in seconds, three load averages, memory, swap, disks, recordings awaiting processing and firewall suspension minutes. cached is true because these measurements come from stored samples.
liveAMI availability, probe time, live Asterisk readings, four ODBC link states and warning codes.

Memory fields are total_bytes, used_bytes, free_bytes, shared_bytes, buffers_bytes, cached_bytes, page_free_ratio and status. They follow the stored free command positions displayed by the web page; the meaning of its last columns can differ across OS versions. page_free_ratio follows the page calculation, (free + cached) / total. Swap returns total, used and free bytes, free ratio and status.

Each system.disks entry contains filesystem, mount, total/used/available bytes, used_percent and status. Usage is yellow above 80% and red above 90%, including 100%. Health colours are green, yellow, red or unknown. Missing or malformed samples yield null/unknown values rather than fabricated healthy zero readings. The existing page memory, swap and recordings alert semantics are retained.

Reading the croncheck cursor

checks.croncheck.last_check corresponds to no_nodes.no_croncheck. stored_epoch is no_nodes.no_croncheck_epoch, when available; the effective epoch falls back to the legacy timestamp when no valid stored epoch exists. The freshness threshold is 360 seconds. The future flag helps identify a saved cursor ahead of the current time.

This cursor records the last completed scheduling minute, not the exact finish time of every croncheck task. It can lag during backlog processing. During daylight-saving clock changes, use the epoch rather than comparing ambiguous wall-clock strings. This endpoint reads the cursor; it never advances or resets it.

Example excerpt from a single-node response; other response fields are omitted:

{
  "object": "nodes",
  "generated_at": "2026-12-01T11:02:00+00:00",
  "timezone": "Europe/Rome",
  "data": {
    "id": 3,
    "checks": {
      "croncheck": {
        "last_check": "2026-12-01 12:00:00",
        "epoch": 1796122800,
        "age_seconds": 120,
        "threshold_seconds": 360,
        "future": false,
        "status": "green",
        "stored_epoch": 1796122800
      }
    }
  }
}

AI queues, housekeeping and database capacity

context.ai_queues contains entries with type (transcript, summary or sentiment), node_id, pending and status. Only processing nodes returned on this page are included. As in the web page, the count includes entries first checked in the last day or not yet checked. It is green below 100, yellow below 1,000, otherwise red.

context.housekeeping identifies the cluster node with the latest housekeeping start, together with start/end timestamps and completion status. context.database_capacity returns the page’s database-wide auto-increment capacity check: database/table/column, column type, next ID, maximum ID, percentage and status. Large IDs are strings to preserve their precision. These two checks are cluster-wide, including for a single-node request.

Saved data and live AMI readings

live=true opens one AMI connection per returned, configured node, with events disabled, and issues only fixed read commands: sip show peers, pjsip list contacts, core show version, core show channels count, and odbc show for asterisk1, asterisk2, asteriskcdrdb1 and asteriskcdrdb2.

Live fieldMeaning
requested, available, partialWhether live data was requested, an AMI connection succeeded, and some requested readings were unavailable.
checked_atTime of a probe attempt, not proof of a successful connection. Null when live probing was disabled or not admitted due to the request budget.
asterisk_versionLive Asterisk version.
sip_peers_onlineMonitored SIP peers reported online by Asterisk.
pjsip_contactsPJSIP contact objects, including multiple contacts for one endpoint. This is not a distinct endpoint or phone count.
peers_onlineSIP plus PJSIP counts, or null if either is unavailable.
active_channels, active_calls, calls_processedLive Asterisk channel/call counters.
odbcFor each queried link: name, connected state, active and maximum connection counts, and status.
warningsMachine-readable reasons for unavailable or partial live data.

A missing SIP/PJSIP channel driver contributes zero for that technology. An empty, failed or unrecognized response contributes null. Nodes are queried sequentially, so the response is not an atomic cluster snapshot. A healthy cached reading is not proof of a successful live connection.

AMI failure does not discard the saved node data. The response is HTTP 200 with explicit unavailable/partial live fields and warnings. Warning codes include ami_not_configured, ami_client_unavailable, ami_connection_failed, ami_request_failed, ami_response_unavailable_*, ami_time_budget_exceeded and ami_request_budget_exceeded.

Connection and socket reads use a two-second timeout. There is a per-node command budget and a 20-second budget for admitting more node probes. These are best-effort limits, not a hard HTTP deadline; an in-progress probe can finish later. Paginate larger clusters or use live=false for monitoring that must avoid AMI.

live=false does not instantiate an AMI client or select AMI credentials. Saved health/service values can be stale. Queue counts and global context are still read from the database. generated_at is the response snapshot time, not the collection time of every stored value; no extra freshness timestamp is invented.

Errors and access boundaries

HTTP status / codeMeaning
400 invalid_nodes_requestInvalid ID, pagination, live flag or conflicting selectors.
400 tenant_not_applicableTenant supplied for a global operation; omit it.
401 missing_api_key / invalid_api_keyMissing or invalid credentials.
403 admin_required / api_ip_not_allowedA verified tenant key is not a global key, or the normal API IP filter denied access.
404 node_not_found / not_foundRequested node or route does not exist.
405 method_not_allowedOnly GET is supported; standard OpenAPI OPTIONS handling is available.
503 node_status_unavailableThe server could not read the node status from the database. Internal SQL and credentials are not returned.

The response uses an explicit allowlist. It does not expose AMI usernames/passwords, health-probe passwords or arbitrary configuration columns. Repository URL credentials and common secret query parameters are redacted from error text. Standard OpenAPI authentication, auditing and usage accounting apply. No node updates, cron cursor changes, job submissions, module reloads or service restarts are performed.