Relay Manager Docs
Reference

HTTP APIs

relay-api routes, relay-agent REST, and how the panel proxies to the Web Server.

HTTP API reference

This page consolidates relay-api (Web Server) and relay-agent (Relay Server Agent) routes. relay-panel proxies through its own /api/* routes — see the table under relay-panel.


relay-api (Hono, Web Server)

Base URL example: https://relay-api.bitmacro.io

Auth (panel / connect proxy):

MethodHeader(s)
API keyX-API-Key + X-Provider-User-Id
JWTAuthorization: Bearer <token> (NextAuth session clients)

Relays and config

RouteMethodDescription
/relaysGETList relays for provider_user_id
/relaysPOSTCreate relay
/relay/:idPATCHUpdate relay
/relay/:idDELETEDelete relay
/relay-updatePATCHAlternative update: body { id, name?, endpoint?, token? }
/relay/:id/configGETEndpoint + token (for UI)
/meGETJWT payload / session

Proxy → agent

RouteMethodDescription
/relay/:id/statsGETProxy → agent /stats
/relay/:id/healthGETProxy → agent /health
/relay/:id/eventsGETProxy → agent /events
/relay/:id/probeGETConnectivity test
/relay/:id/policyGETProxy → agent /policy
/relay/:id/usersGETProxy → agent /users
/relay/:id/policy/blockPOSTProxy → agent
/relay/:id/policy/allowPOSTProxy → agent

Proxy mechanics: relay-api reads endpoint, token, and agent_relay_id from relay.relay_configs, then calls GET/POST ${endpoint}${path} with Authorization: Bearer ${token}. Paths include the /:relayId/ prefix for v0.2 multi-relay agents.

NIP-46 /signer

Same handlers are also mounted under /api/signer/*.

RouteMethodDescription
/signer/configGETRelays available for NIP-46 for this provider_user_id
/signer/connectPOSTCreate nip46_sessions row + nostrconnect_uri
/signer/sessionsGETList sessions (polling)
/signer/session/:id/completePOSTVerify pairing secret → active
/signer/session/:idDELETERevoke session

relay-agent (strfry REST)

v0.2 multi-relay: path prefix /:relayId/. v0.1: same routes without prefix when RELAY_INSTANCES is unset.

Global

RouteMethodAuthDescription
/healthGETe.g. { status: "ok", relayIds?: [...], version? }
/:relayId/healthGETPer-relay health (v0.2)

Authenticated (Bearer)

RouteMethodDescription
/:relayId/statsGETEvents count, DB size, uptime, version
/:relayId/eventsGETQuery strfry / events
/:relayId/events/:idDELETEDelete event
/:relayId/policyGETWrite policy
/:relayId/policy/blockPOSTBlock pubkey + optional cleanup
/:relayId/policy/allowPOSTAllow pubkey
/:relayId/usersGETUsers / pubkeys

Repositories

RepoRoleLicense
relay-agentREST → strfryMIT
relay-connectSDK NIP-46 / NIP-07MIT
relay-connect-webConnect UIMIT
relay-panelAdmin UIBSL 1.1
relay-apiHub + Supabase + proxy + /signerPrivate

Planned: @bitmacro/connect on npm — shared client for /signer and NIP-46 helpers for relay-panel, relay-connect-web, and third-party frontends.


Supply chain (summary)

RepoTypical automation
relay-agentCI (Vitest); tag v*.*.* → npm + GHCR
relay-panelCI lint + build; Vercel deploy
relay-connectCI / build; Vercel typical
relay-apiVercel deploy

npm org @bitmacro; images ghcr.io/bitmacro/*.