Skip to content

Latest commit

 

History

History
161 lines (153 loc) · 10 KB

API.md

File metadata and controls

161 lines (153 loc) · 10 KB

HTTP API reference

Generated by tools/gen_docs.py from panel/main.go. Do not edit by hand.

Every path is served under the panel's secret base path: http(s)://<host>:<port>/<secret>/api/... (the secret is shown by hashem show-panel-url).

Authentication

  • session — log in with POST /api/login ({username, password, code?}); the reply sets the gre_session cookie and a gre_csrf cookie.
  • session + CSRF — state-changing calls also need the CSRF token in an X-CSRF-Token header (the value of the gre_csrf cookie).
  • peer secret — server-to-server calls between hub and spoke send the shared peer secret as X-Peer-Secret or Authorization: Bearer <secret>. A valid admin session is accepted too.
  • none — GET /api/health and POST /api/login. GET /metrics is off by default and, when enabled, needs Authorization: Bearer <metrics token> (see /api/metrics-token).

Errors are JSON with a stable E-XXXX-NN code; see ERROR_CODES.md. Request and response bodies are defined by the handlers named below in panel/.

Endpoints

Method Path Auth Handler
GET /api/2fa session handle2FAStatus
POST /api/2fa/disable session + CSRF handle2FADisable
POST /api/2fa/enable session + CSRF handle2FAEnable
POST /api/2fa/setup session + CSRF handle2FASetup
GET /api/access session handleAccessGet
POST /api/access session + CSRF handleAccessPost
POST /api/action session + CSRF handleAction
GET /api/alerts session handleAlertsGet
POST /api/alerts session + CSRF handleAlertsPost
GET /api/audit session handleAuditGet
GET /api/bagher session handleSSHFwdGet
POST /api/bagher session + CSRF handleSSHFwdPost
GET /api/benchmark session handleBenchmarkGet
POST /api/benchmark/apply session + CSRF handleBenchmarkApply
POST /api/benchmark/autopilot session + CSRF handleBenchmarkAutoPilot
POST /api/benchmark/run session + CSRF handleBenchmarkRun
GET /api/carrier session handleCarrierGet
POST /api/carrier session + CSRF handleCarrierPost
GET /api/carrier/advice session handleCarrierAdvice
POST /api/cluster/dns session + CSRF handleClusterDNS
POST /api/cluster/hubs/add session + CSRF handleClusterHubAdd
POST /api/cluster/hubs/delete session + CSRF handleClusterHubDelete
POST /api/cluster/join-code session + CSRF handleClusterJoinCode
POST /api/cluster/join-hub session + CSRF handleClusterJoinHub
POST /api/cluster/leave-hub session + CSRF handleClusterLeaveHub
POST /api/cluster/member session + CSRF handleClusterMember
POST /api/cluster/pool session + CSRF handleClusterPool
POST /api/cluster/pool/delete session + CSRF handleClusterPoolDelete
POST /api/cluster/pool/failback session + CSRF handleClusterPoolFailback
GET /api/cluster/rules session handleClusterRules
POST /api/cluster/settings session + CSRF handleClusterSettings
GET /api/cluster/status session handleClusterStatus
GET /api/dashboard session handleDashboard
GET /api/dial session handleDialGet
POST /api/dial session + CSRF handleDialPost
GET /api/doctor session handleDoctorGet
POST /api/doctor session + CSRF handleDoctorPost
GET /api/errors session handleErrors
GET /api/fleet session handleFleet
GET /api/health none handleHealth
GET /api/history session handleHistoryGet
GET /api/license session handleLicenseGet
POST /api/license session + CSRF handleLicensePost
GET /api/limits session handleLimitsGet
POST /api/limits session + CSRF handleLimitsPost
POST /api/link-name session + CSRF handleLinkName
POST /api/login none handleLogin
POST /api/logout none handleLogout
GET /api/logs session handleLogs
GET /api/metrics-token session handleMetricsTokenGet
POST /api/metrics-token session + CSRF handleMetricsTokenPost
POST /api/password session + CSRF handlePassword
GET /api/pathtest session handlePathTestGet
POST /api/pathtest session + CSRF handlePathTestPost
POST /api/peer/apply-carrier peer secret (or session) handlePeerApplyCarrier
POST /api/peer/apply-engine peer secret (or session) handlePeerApplyEngine
POST /api/peer/carrier-info peer secret (or session) handlePeerCarrierInfo
GET /api/peer/config session handlePeerConfigGet
POST /api/peer/config session + CSRF handlePeerConfigPost
POST /api/peer/handshake peer secret (or session) handlePeerHandshake
POST /api/peer/ping peer secret (or session) handlePeerPing
POST /api/peer/rescue-ack rescue peer handlePeerRescueAck
GET /api/peer/rescue-offer rescue peer handlePeerRescueOffer
POST /api/peer/revpath-probe peer secret (or session) handlePeerRevPathProbe
POST /api/peer/sshfwd-install-key peer secret (or session) handlePeerSSHFwdInstallKey
GET /api/peer/status peer secret (or session) handlePeerStatus
POST /api/peer/swap-carrier peer secret (or session) handlePeerSwapCarrier
GET /api/peer/swap-request peer secret (or session) handlePeerSwapRequestGet
POST /api/peer/swap-request peer secret (or session) handlePeerSwapRequest
GET /api/peer/swap-status peer secret (or session) handlePeerSwapStatus
GET /api/peer/wrap-request peer secret (or session) handlePeerWrapStatus
POST /api/peer/wrap-request peer secret (or session) handlePeerWrapRequest
GET /api/peers session handlePeersGet
PATCH /api/peers session + CSRF handlePeersPatch
POST /api/peers session + CSRF handlePeersPost
GET /api/perf session handlePerfGet
POST /api/perf session + CSRF handlePerfPost
GET /api/releases session handleReleases
GET /api/rescue session handleRescueGet
POST /api/rescue session + CSRF handleRescuePost
GET /api/revpath session handleRevPathGet
POST /api/revpath/fix session + CSRF handleRevPathFix
GET /api/revpath/fixes session handleRevPathFixes
POST /api/revpath/run session + CSRF handleRevPathRun
GET /api/selfstats session handleSelfStats
GET /api/sentinel session handleSentinelGet
POST /api/sentinel session + CSRF handleSentinelPost
GET /api/session-settings session handleSessionSettingsGet
POST /api/session-settings session + CSRF handleSessionSettingsPost
GET /api/setup session handleSetupGet
POST /api/setup session + CSRF handleSetupPost
GET /api/spoof session handleSpoofGet
POST /api/spoof session + CSRF handleSpoofPost
GET /api/spoof/tester session handleSpoofTester
POST /api/spoof/tester session + CSRF handleSpoofTester
GET /api/sshfwd session handleSSHFwdGet
POST /api/sshfwd session + CSRF handleSSHFwdPost
GET /api/status session handleStatus
GET /api/suggest session handleSuggest
GET /api/support session handleSupport
POST /api/support session + CSRF handleSupport
GET /api/term/allowlist session handleTermAllowGet
POST /api/term/allowlist session + CSRF handleTermAllowPost
POST /api/term/enable session + CSRF handleTermEnable
POST /api/term/kill session + CSRF handleTermKill
GET /api/term/status session handleTermStatus
POST /api/term/ticket session + CSRF handleTermTicket
GET /api/term/ws session handleTermWS
DELETE /api/tls session + CSRF handleTLSRemove
GET /api/tls session handleTLSGet
POST /api/tls session + CSRF handleTLSIssue
POST /api/tls/check session + CSRF handleTLSCheck
POST /api/tls/custom session + CSRF handleTLSCustomPost
POST /api/tls/ip session + CSRF handleTLSIPPost
GET /api/tls/ip/ca session handleTLSIPCAGet
GET /api/tls/proxy-config session handleReverseProxyConfig
POST /api/tls/renew session + CSRF handleTLSRenew
GET /api/traffic/usage session handleUsageGet
GET /api/tunnel-health session handleTunnelHealthGet
POST /api/tunnel-health/run session + CSRF handleTunnelHealthRun
GET /api/tunnel/swap session handleSwapGet
POST /api/tunnel/swap session + CSRF handleSwapPost
POST /api/update session + CSRF handleUpdate
GET /api/update/channel session handleUpdateChannelGet
POST /api/update/channel session + CSRF handleUpdateChannelPost
GET /api/update/peer session handleUpdatePeer
GET /api/version session handleVersion
GET /api/watchdog session handleWatchdogGet
POST /api/watchdog session + CSRF handleWatchdogPost
GET /api/watchdog/backup-download session handleBackupDownload
POST /api/watchdog/backup-download session + CSRF handleBackupDownload
GET /api/xray session handleXrayGet
POST /api/xray session + CSRF handleXrayPost
GET /metrics none handleMetrics

Total: 134 routes.