Edgeweir
Reference

API overview

Console HTTP endpoints and the public API's authentication, access levels, request format, idempotency, concurrency control and pagination.

Endpoints

These paths are on the web port (PORT, default 3000), served by ROLE=app and all only.

PathAuthenticationPurpose
/api/v1/*x-api-keyPublic API (OpenAPI); cookies in the request are stripped
/api/v1/openapi.jsonNoneOpenAPI document
/rpc/*Session cookie + x-csrf-token: orpcWeb UI only (oRPC RPC protocol); x-api-key in the request is stripped
/api/auth/*Per endpointEndpoints on the better-auth allow list; see Authentication endpoints
/healthzNoneHealth check
/install.shNoneNode installer
/downloads/*NoneRelease file mirror; 404 without EDGEWEIR_DOWNLOADS_DIR
/node-channelNode channel mTLSWebSocket entry of the node channel; a plain request answers 426 while it is open, 404 while it is closed
Any other pathNoneWeb UI

Unmatched requests under /api/*, /rpc/*, /downloads/*, /install.sh, /healthz and /node-channel return 404 with {"error":"not found"} and never fall back to the web UI. Every response without its own cache-control carries cache-control: no-store.

Resources

/api/v1 and /rpc come from the same oRPC contract in packages/contract: 275 procedures.

PageResourcesProcedures
SitesSites, enabling and disabling sites, tags and batch operations, copying and cloning, cache tasks, error pages and maintenance, access authentication, access control, image format conversion, usage protection, automatic mitigation51
Access controlSite rules, platform rules, bulk redirects, IP lists, IP check, bans, greylist, challenges and CC mitigation, OWASP CRS32
CertificatesCertificates, ACME accounts, DNS credentials, origin client CA, Origin CA, origin certificates28
Clusters and nodesClusters, revisions and canary, cluster network settings, enrollment tokens, node groups, nodes, node logs, regions, node upgrades, port pools and L4 apps60
DNS and schedulingDNS providers, DNS bindings and records, DNS revisions and reconciliation, regional probes, scheduling rules28
Overview, analytics and alertsOverview, analytics, access logs, usage, audit log, alerts29
System and accountSetup and status, account, AccessKeys, service accounts, system settings47

OpenAPI document

GET /api/v1/openapi.json returns the OpenAPI document: info.version is the console version, servers is <EDGEWEIR_PUBLIC_URL>/api/v1, security scheme apiKey (header x-api-key). "OpenAPI" in System settings links to it.

curl -fsS https://cdn-admin.example.com/api/v1/openapi.json

Authentication

CredentialPrefixWhereIdentity
AccessKeyewk_/api/v1, header x-api-keyThe operator (the only account, created by the setup wizard); audit actor type api_key
Service account keyews_/api/v1, header x-api-keyThe service account; audit actor type service_account
Session cookie—/rpc, plus header x-csrf-token: orpcThe signed-in account; audit actor type user
  • No credential, or an invalid, revoked or expired key, or a disabled service account: 401 UNAUTHORIZED.
  • Procedures without credentials (security: [] in OpenAPI): system.status (GET /system/status), system.setup (POST /system/setup).
  • GET /me (account.me) returns the caller; see System and account.
  • AccessKeys are created and changed only in a signed-in session (accessKeys.create, accessKeys.update); through /api/v1 they answer 403 ACCESS_KEY_SESSION_REQUIRED.
  • The login IP allow list limits sessions (/rpc, /api/auth) only, not keys on /api/v1.

AccessKey

AccessKeys are managed in the "Access keys" card of Personal settings (user menu), or with accessKeys.* over /rpc in a signed-in session.

PropertyValue
Scope"Read only" or "Read and write" (default read and write); see Access
Requests per minuteDefault 600, 1–100000, or unlimited; see Rate limits
KeyStarts with ewk_, shown once at creation
RevokingRequests with a revoked key answer 401; the key stays listed
Auditapi_key.create, api_key.update, api_key.revoke

Procedures and fields: System and account. better-auth's /api/auth/api-key/* endpoints are closed and answer 404.

Access

LevelProceduresCallers
ReadEvery GET procedure and rules.validateSessions, every AccessKey, the demo account
WriteEvery other procedureSessions and "Read and write" AccessKeys; a "Read only" AccessKey gets 403 ACCESS_KEY_READ_ONLY, the demo account 403 DEMO_READ_ONLY

An AccessKey's scope is "Read only" or "Read and write" (a key without one counts as read and write). The resource pages mark each procedure read or write.

Service accounts

Service accounts can call only the procedures below, each with its scope; any other procedure answers 403 SERVICE_ACCOUNT_FORBIDDEN, a missing scope 403 SCOPE_REQUIRED (data.scope names it). Scopes apply to service accounts only.

ProcedureEndpointScope
system.statusGET /system/status—
account.meGET /me—
dns.catalogGET /dns/catalog—
settings.getGET /settingssystem:read
clusters.list, clusters.getGET /clusters, GET /clusters/{id}clusters:read
sites.list, sites.get, sites.launchGET /sites, GET /sites/{id}, GET /sites/{id}/launchsites:read
dns.siteTargetGET /sites/{siteId}/cnamesites:read
sites.setEnabledPUT /sites/{id}/enabledsites:write
usage.list, usage.changesGET /usage, GET /usage/changesusage:read

Procedures managing service accounts and their keys: System and account.

Node capabilities

When the changed configuration needs a feature an active node of the cluster lacks (nodes report them in supportedFeatures, such as challenge-v1 or modsecurity-v1):

CallerResult
The operator (session or AccessKey)Saved and published; nodes lacking the feature keep their configuration and show "Upgrade required" in Clusters & nodes
A service account, the console's automatic jobs409 NODE_CAPABILITY_REQUIRED; data.features lists the missing features (comma-separated), data.nodes the nodes lacking them (first 5, then +N); nothing is saved

Upgrading nodes: Node upgrades.

Request format

ItemRule
Base URL<EDGEWEIR_PUBLIC_URL>/api/v1
Path parameters{name} in the path
Other inputGET: query parameters; POST, PUT, PATCH, DELETE: JSON body (content-type: application/json)
Arrays in the queryname[]=a&name[]=b
Body limit1 MiB without valid credentials, 16 MiB with them; over it 413 PAYLOAD_TOO_LARGE, before the procedure runs
TimesISO 8601 strings with an offset (such as 2026-10-30T08:00:00Z)
IDsUUIDs
ResponseThe procedure's output JSON; status 200, or 201 where a resource page says so
Validation failure400 BAD_REQUEST, data.issues holds the issues

Error format and all error codes: Error codes.

curl -fsS -H "x-api-key: $EDGEWEIR_API_KEY" \
  "https://cdn-admin.example.com/api/v1/sites?page=1&pageSize=20"
curl -fsS -X PUT -H "x-api-key: $EDGEWEIR_API_KEY" -H 'content-type: application/json' \
  -d '{"enabled":false}' \
  https://cdn-admin.example.com/api/v1/sites/<site ID>/enabled

Rate limits

Each AccessKey has its own "Requests per minute": default 600, 1–100000, or unlimited (requestsPerMinute: null).

RuleDescription
WindowFixed 60-second windows, each starting with the key's first request after the previous one ended; at most "Requests per minute" requests per window
Over the limit429 API_KEY_RATE_LIMITED; data.retryAfterSeconds is the time to the window's end (at least 1)
CountingIn the console process: each instance counts on its own, a restart starts over; a changed limit starts a new count
Not countedUnlimited AccessKeys, service account keys

The sign-in endpoints of /api/auth have better-auth's own rate limiting (NODE_ENV=production, counted in PostgreSQL).

Idempotency keys

POST, PUT and PATCH on /api/v1 accept an Idempotency-Key header: 1–255 printable ASCII characters, as an RFC 8941 string ("key") or bare. GET and DELETE ignore it.

CaseResponse
First requestRuns; method, path (with query), body SHA-256 and the final response are stored
Same caller, key and requestThe stored response (status and body) with Idempotent-Replayed: true
Same key, another method, path or body422 IDEMPOTENCY_KEY_MISMATCH
The first request still runs409 IDEMPOTENCY_IN_PROGRESS
Malformed key400 IDEMPOTENCY_KEY_INVALID
A body with SSH credentials: sshInstalls.start, sshInstalls.retry400 IDEMPOTENCY_KEY_UNSUPPORTED, not run, and no hash of the body is kept; send it again without the header
A response with a credential shown once: accessKeys.create, serviceAccounts.createKey, clusters.createEnrollmentToken, probes.createToken, authRules.signUrl, originCertificates.issue400 IDEMPOTENCY_KEY_UNSUPPORTED, not run; send it again without the header
  • Keys are scoped to each credential and its current permissions: every AccessKey and service-account key has its own namespace. Expired, disabled, revoked or narrowed credentials cannot replay an earlier successful response.
  • Kept 24 hours; expired records are removed hourly.
  • 5xx responses are not stored, so the same key can be retried; neither are 401 and 429 (the procedure never ran). 4xx responses are stored and replay the same error.
  • A record still running after 10 minutes counts as abandoned; the next request takes it over and runs again.

Optimistic concurrency

These writes accept an optional expectedUpdatedAt (ISO 8601, the updatedAt the caller read). When it differs from the current value they answer 409 UPDATED_AT_MISMATCH with the current value in data.updatedAt (empty while there is none). Left out, nothing is compared.

ProcedureupdatedAt compared
sites.setEnabledThe site's; already in the requested state, it returns at once without comparing
accessControl.updateThe site's access control
authRules.update, authRules.forgetIdentityHeadersThe site's access authentication
errorPages.updateThe site's error pages
maintenance.updateThe site's maintenance mode
usageGuard.updateThe site's usage protection
autoMitigation.updateThe site's automatic mitigation
clusters.setRolloutPolicypolicyUpdatedAt of the cluster's canary policy (rollouts and canary progress do not change it; the updatedAt read at the time passes too)
l4Apps.update, l4Apps.setEnabledThe L4 app's; setEnabled in the requested state returns at once without comparing

Pagination

StyleRequestResponseProcedures
Pagespage (≥1, default 1), pageSize{ items, total }sites.list, cacheTasks.list (pageSize 1–100, default 20); bans.list, greylist.list, security.events (1–100, default 50)
Offsetoffset (≥0, default 0), limit (1–200, default 50){ items, total }auditLogs.list
Cursorcursor (the previous page's nextCursor), limitnextCursor; null on the last pageusage.list, nodes.logs
SequenceafterSeq (the highest seq received, default "0"), limitRecords in seq orderusage.changes (incremental sync)
CountlimitA listAnalytics and access log queries; limits on each procedure

An invalid cursor answers 400 (USAGE_CURSOR_INVALID, NODE_LOG_CURSOR_INVALID). Parameter ranges are on the resource pages.

Web UI RPC

/rpc/* speaks the oRPC RPC protocol for the web UI; the path is the procedure's, such as POST /rpc/sites/list.

RequirementDescription
Session cookieIssued by the sign-in endpoints of /api/auth
x-csrf-token: orpcWithout it: 403 CSRF_TOKEN_MISMATCH
x-api-keyStripped; never replaces the session cookie
Login IP allow listA client IP outside it gets 403 LOGIN_IP_NOT_ALLOWED (except the demo account)

Third-party integrations use /api/v1.

Authentication endpoints

better-auth handles /api/auth/*; only the paths and methods below are allowed (AUTH_HTTP_ROUTES). Matching is exact (no prefixes, encoded variants or trailing slashes); anything else returns 404. x-api-key in the request is stripped; the client IP is resolved per EDGEWEIR_TRUSTED_PROXIES and passed on. Body limit 64 KiB. The console has no sign-up; the only account is created by the setup wizard.

PathMethodLogin IP allow listDemo account
/api/auth/get-sessionGETLimitedAllowed
/api/auth/sign-in/emailPOSTLimitedAllowed
/api/auth/sign-outPOSTNot limitedAllowed
/api/auth/change-passwordPOSTLimited403 DEMO_READ_ONLY
/api/auth/two-factor/enablePOSTLimited403 DEMO_READ_ONLY
/api/auth/two-factor/disablePOSTLimited403 DEMO_READ_ONLY
/api/auth/two-factor/verify-totpPOSTLimitedAllowed
/api/auth/two-factor/verify-backup-codePOSTLimitedAllowed
/api/auth/passkey/generate-register-optionsGETLimited403 DEMO_READ_ONLY
/api/auth/passkey/verify-registrationPOSTLimited403 DEMO_READ_ONLY
/api/auth/passkey/generate-authenticate-optionsGETLimitedAllowed
/api/auth/passkey/verify-authenticationPOSTLimitedAllowed
/api/auth/passkey/list-user-passkeysGETLimitedAllowed
/api/auth/passkey/delete-passkeyPOSTLimited403 DEMO_READ_ONLY

A client IP outside the login IP allow list gets 403 LOGIN_IP_NOT_ALLOWED from the limited endpoints before better-auth sees the request (the demo account's sign-in and session excepted). With NODE_ENV=production better-auth's rate limiting is on, counted in PostgreSQL.

Health check

GET /healthz returns 200:

{ "status": "ok", "version": "20261029-0c26898" }
FieldDescription
statusAlways ok
versionRunning version (EDGEWEIR_VERSION); dev from source

It answers as soon as the HTTP server listens and does not check the database. Container health check: Command line.

Installer and release mirror

GET /install.sh returns the node installer (text/x-shellscript; charset=utf-8, cache-control: no-store) with the console URL replaced by EDGEWEIR_PUBLIC_URL. Options: Command line.

GET and HEAD /downloads/* serve files from EDGEWEIR_DOWNLOADS_DIR; the URL path equals the relative path in the directory:

PathContentcache-control
/downloads/<project>/latestLatest version, textno-cache
/downloads/<project>/v<semver>/<file>Release filepublic, max-age=86400, immutable

<project> is edgeweir-node or cosign; the edgeweir-openresty and edgeweir-openresty-modsecurity packages sit in the same version directory as edgeweir-node. Other paths, missing files and symbolic links leading outside the directory return 404. Preparing the directory: Adding nodes.

Node channel

ItemValue
ProtocolConnect-RPC over HTTPS (HTTP/2, HTTP/1.1 compatible), TLS 1.2 or later
ListenerNODE_API_HOST:NODE_API_PORT, default 8443
WebSocket entry/node-channel on the web port: the node channel's TLS runs inside the WebSocket and ends at the console. Open while the node channel URL is wss:// or ws://, or with EDGEWEIR_NODE_API_WEBSOCKET
Servicesedgeweir.node.v1.NodeService (nodes) and edgeweir.node.v1.ProbeService (regional probes and nodes that probe), defined in proto/edgeweir/node/v1/node.proto and probe.proto
Server certificateIssued by the console's internal CA; names in Environment variables
AuthenticationEnroll, EnrollProbe: a one-time enrollment token (nodes ewt_, probes ewp_); the node or probe pins the internal CA's SHA-256 fingerprint. Every other RPC: a client certificate from the internal CA (mTLS) with the node ID (O=Edgeweir Node) or probe ID (O=Edgeweir Probe) as CN; probe certificates can call ProbeService only, node certificates call GetProbeTargets and ReportProbeResults only while the node probes
Other paths404

The node channel must be reached directly or through layer-4 passthrough; a proxy that terminates TLS breaks node mTLS. See Ports, reverse proxies and trusted proxies.

Edit on GitHub

On this page