Skip to content

Gateway#

The state of the node that served the request.

The node status object#

Attributes#

objectstringrequired
Always node_status.
nodeobjectrequired
Child attributes
idstringrequired
kindenumrequired
One of edge, onprem.
regionstring
colostring
The Cloudflare data centre that answered. Edge only.
checked_attimestamprequired
RFC 3339 in UTC, with up to millisecond precision.
airportsarray of objectsrequired
Child attributes
airportICAO coderequired
An ICAO airport code.
roleenumrequired
The primary admits writes for the airport. The standby serves reads and follows the primary. One of primary, standby.
epochintegerrequired
Increases by one each time the primary changes.
revisionintegerrequired
peerobjectrequired
Child attributes
kindenumrequired
One of edge, onprem.
reachablebooleanrequired
lag_msinteger | null
How far the standby is behind the primary.

Node status object

{
  "object": "node_status",
  "node": {
    "id": "edge",
    "kind": "edge",
    "region": "apac",
    "colo": "BKK"
  },
  "checked_at": "2026-11-23T02:58:41Z",
  "airports": [
    {
      "airport": "VTBS",
      "role": "primary",
      "epoch": 7,
      "revision": 48213377,
      "peer": {
        "kind": "onprem",
        "reachable": true,
        "lag_ms": 420
      }
    }
  ]
}

Retrieve node status#

GET/v1/status

Describes the node that answered: edge or on-premise, which airports it is primary for, and how far behind it is. Clients use it to decide where to send requests. See Fail over to on-premise.

Any valid key.Preview 1

Response#

200 The node's status. Returns node status object.

curl https://api.surfacelens.app/v1/status \
  -H "Authorization: Bearer $SURFACELENS_KEY"
const res = await fetch("https://api.surfacelens.app/v1/status", {
  headers: { Authorization: `Bearer ${process.env.SURFACELENS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const nodeStatus = await res.json();
import httpx, os

res = httpx.get(
    "https://api.surfacelens.app/v1/status",
    headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
)
res.raise_for_status()
node_status = res.json()

Response200

{
  "object": "node_status",
  "node": {
    "id": "edge",
    "kind": "edge",
    "region": "apac",
    "colo": "BKK"
  },
  "checked_at": "2026-11-23T02:58:41Z",
  "airports": [
    {
      "airport": "VTBS",
      "role": "primary",
      "epoch": 7,
      "revision": 48213377,
      "peer": {
        "kind": "onprem",
        "reachable": true,
        "lag_ms": 420
      }
    }
  ]
}