HTTP API reference

HTTP endpoints and conventions for the open-source self-hosted gateway-server.

Conventions

  • Envelope: always { ok: true, data: … } / { ok: false, error: { code, message } }.
  • Dual auth: Authorization: Bearer <token> (takes priority; an invalid token returns 401 with no fallback) or the session cookie zr_gw_session (32-byte random hex; only its sha256 is stored).
  • Error codes: SCREAMING_SNAKE (NOT_FOUND, INVALID_REQUEST, RATE_LIMITED, OTP_COOLDOWN, QUOTA_EXCEEDED, …).

Auth & sessions

MethodPathDescription
POST/api/v1/auth/loginEmail and password login; returns a session token
POST/api/v1/auth/signupRegister an account (returns 403 when sign-up is disabled)
POST/api/v1/auth/logoutEnd the current session
GET/api/v1/auth/meCurrent identity and quota
POST/api/v1/auth/send-otpSend a verification code (purpose=signup/reset_password)
POST/api/v1/auth/reset-passwordReset password using a verification code

Account settings

MethodPathDescription
PATCH/api/v1/auth/account/passwordChange account password
POST/api/v1/auth/account/email/requestRequest an email change (sends a verification code)
POST/api/v1/auth/account/emailConfirm email change

Networks & members

MethodPathDescription
GET/api/v1/networksList networks owned by the current user
POST/api/v1/networksCreate a network (supports inviteTtlHours 1–720 default 168, inviteMaxUses 1–1000 default 10)
PATCH/api/v1/networks/:idRename, update admission mode, member cap, or peerDirectMaxRttMs (0–10000 ms, default 300, 0 = uncapped)
DELETE/api/v1/networks/:idDelete a network
POST/api/v1/networks/:id/rotate-keyRotate the join key and reset expiry & use count (optional inviteTtlHours / inviteMaxUses; see the zr-net protocol spec)
POST/api/v1/networks/:id/members/:nodeId/approve / rejectApprove or reject a pending member
POST/api/v1/networks/:id/members/:nodeId/pause / resumePause or resume a member
POST/api/v1/networks/:id/members/:nodeId/repinRe-pin an identity fingerprint
PATCH/api/v1/networks/:id/members/:nodeIdUpdate member note or display name
DELETE/api/v1/networks/:id/members/:nodeIdRemove a member

Topology & events

MethodPathDescription
GET/api/v1/networks/:id/topologyLive topology snapshot
GET/api/v1/networks/:id/eventsSSE topology stream (text/event-stream; disable proxy buffering)

Admin

MethodPathDescription
GET/PATCH/api/v1/admin/settingsGateway settings (including live SMTP configuration)
POST/api/v1/admin/settings/smtp-testSend a test email
POST/DELETE/api/v1/admin/settings/api-keyMint or revoke an API key
GET/api/v1/admin/runtimeRuntime status
GET/POST/PATCH/DELETE/api/v1/admin/groups(/:id)User-group CRUD (quota configuration)
GET/POST/PATCH/DELETE/api/v1/admin/users(/:id)User CRUD
POST/api/v1/admin/users/:id/reset-passwordAdmin-triggered password reset

Certificates & auto-update (admin)

MethodPathDescription
GET / PATCH/api/v1/admin/tlsRead or modify TLS configuration
PUT/api/v1/admin/tls/certificateUpload a TLS certificate
POST/api/v1/admin/tls/reloadReload TLS certificates
GET/api/v1/admin/updateRead update state
POST/api/v1/admin/update/check / apply / dismiss-rollbackCheck, apply, or dismiss the rollback notice

Node internal surface (peer)

The control WebSocket /peer/v1/ws is covered in the zr-net protocol spec.

MethodPathDescription
GET/peer/v1/pingNode liveness ping
POST/peer/v1/leaveNode leave report