Webhooks#
HTTPS callbacks for low-rate operational events.
The webhook object#
Attributes#
idstringrequiredobjectstringrequired- Always
webhook. urlstringrequiredeventsarray of enumsrequiredairportsarray of ICAO codesrequiredstatusenumrequireddisabledafter 24 hours of failed deliveries. One ofenabled,disabled.secretstring- Signing secret. Returned only on creation.
created_attimestamprequired- RFC 3339 in UTC, with up to millisecond precision.
Webhook object
The delivery payload#
Attributes#
idstringrequired- Unique per event. Deduplicate on it.
typeenumrequired- One of
airfield.status_changed,feed.health_changed,scenario.completed. airportICAO coderequired- An ICAO airport code.
created_attimestamprequired- RFC 3339 in UTC, with up to millisecond precision.
dataobjectrequired
Delivery payload
{
"id": "evt_3c81f0a9d2",
"type": "airfield.status_changed",
"airport": "VTBS",
"created_at": "2026-11-23T03:00:02Z",
"data": {
"entity": "runway:02R-20L",
"previous": {
"status": "open"
},
"current": {
"status": "closed",
"reason": "inspection",
"until": "2026-11-23T03:30:00Z"
},
"observation": "obs_9Ar2Te6mH0kc"
}
}
List webhooks#
GET/v1/webhooks
Returns the application's webhooks. Secrets are not included.
Query parameters#
limitinteger- Page size, from 1 to 500. Default
100. cursorstring- The
next_cursorfrom the previous page. Other parameters must not change between pages. Cursors expire after one hour.
Response#
200 A page of webhooks. data holds webhook objects.
objectstringrequired- Always
list. dataarray of objectsrequired-
Child attributes
idstringrequiredobjectstringrequired- Always
webhook. urlstringrequiredeventsarray of enumsrequiredairportsarray of ICAO codesrequiredstatusenumrequireddisabledafter 24 hours of failed deliveries. One ofenabled,disabled.secretstring- Signing secret. Returned only on creation.
created_attimestamprequired- RFC 3339 in UTC, with up to millisecond precision.
next_cursorstring | nullrequired- Pass as
cursorto fetch the next page. Null on the last page.
Response200
{
"object": "list",
"data": [
{
"id": "wh_0a7d3e91c4",
"object": "webhook",
"url": "https://ops-board.example.net/hooks/surfacelens",
"events": [
"airfield.status_changed",
"scenario.completed"
],
"airports": [
"VTBS"
],
"status": "enabled",
"created_at": "2026-11-23T03:02:17Z"
}
],
"next_cursor": null
}
Create a webhook#
POST/v1/webhooks
Registers an HTTPS endpoint to receive the listed event types. The response includes the signing secret, which is shown only once.
Headers#
Idempotency-Keystring- A unique value, such as a UUID, that makes the request safe to retry for 24 hours.
Request body#
urlstringrequired- An HTTPS URL. Must answer within 10 seconds.
eventsarray of enumsrequiredairportsarray of ICAO codes- Only events for these airports. Omit for every airport the application can read.
Response#
201 The webhook was created. Returns webhook object.
curl https://api.surfacelens.app/v1/webhooks \
-H "Authorization: Bearer $SURFACELENS_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"url": "https://ops-board.example.net/hooks/surfacelens",
"events": [
"airfield.status_changed",
"scenario.completed"
],
"airports": [
"VTBS"
]
}'
const res = await fetch("https://api.surfacelens.app/v1/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SURFACELENS_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
url: "https://ops-board.example.net/hooks/surfacelens",
events: ["airfield.status_changed", "scenario.completed"],
airports: ["VTBS"],
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const webhook = await res.json();
import httpx, os, uuid
res = httpx.post(
"https://api.surfacelens.app/v1/webhooks",
headers={
"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"url": "https://ops-board.example.net/hooks/surfacelens",
"events": ["airfield.status_changed", "scenario.completed"],
"airports": ["VTBS"],
},
)
res.raise_for_status()
webhook = res.json()
Response201
Delete a webhook#
DELETE/v1/webhooks/{webhook}
Stops deliveries immediately. Deliveries already in flight may still arrive.
Path parameters#
webhookstringrequired- The webhook ID.
Response#
204 The webhook was deleted.
Response204 No content
Event types#
Every delivery is a POST with a JSON body and a SurfaceLens-Signature header: t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of t, a full stop and the raw body, keyed with the webhook secret. Reject deliveries whose t is more than 300 seconds old. See Verify each delivery.
airfield.status_changed#
A runway, taxiway or stand opened, closed or changed restriction.
{
"id": "evt_3c81f0a9d2",
"type": "airfield.status_changed",
"airport": "VTBS",
"created_at": "2026-11-23T03:00:02Z",
"data": {
"entity": "runway:02R-20L",
"previous": {
"status": "open"
},
"current": {
"status": "closed",
"reason": "inspection",
"until": "2026-11-23T03:30:00Z"
},
"observation": "obs_9Ar2Te6mH0kc"
}
}
feed.health_changed#
A feed moved between healthy, degraded and silent.