Skip to main content
One listener, two surfaces. Tunnel 1 is served at the phone’s tailnet address; Tunnel 2 is served under /door2/ at the recorded public address (and on the same listener, for the front door to forward).

The two surfaces

Conventions: request and response bodies are JSON unless noted (the log endpoint is plain text). A token is sent on every authenticated call. Tokens are tunnel-scoped — presenting a token on the wrong tunnel is a 403, exactly like a wrong token. Examples use placeholder values throughout.

Tunnel 1 endpoints

GET /health — liveness and diagnosis

Auth: none for the basic form; a Tunnel 1 token for the full form. Basic form (no token, or an unrecognised one is treated as no token for this endpoint’s public half):
Full form (valid Tunnel 1 token) adds the self-diagnosis — the same content the Status screen shows:
  • ready — true when no blocking diagnosis item is open. Informational items never hold it false.
  • Each diagnosis item carries an item id, a fix of "agent" (resolvable through the API, or the app self-heals) or "user", and an instruction written for the human when the fix is theirs.
  • The door2 block summarises the chatbot tunnel’s state (enabled, the selected mode — the surface answers only in front-door mode — whether a public address is recorded, its own readiness) without exposing any Tunnel 2 secret.

GET /status — bridge status

Auth: Tunnel 1 token required.
  • token_name — the name of the token you authenticated with.
  • tokens — the names of all tokens on the phone. Names only, never values.
  • hosts — the names of configured SSH hosts. Host management arrives with the jump-host phase; until then this list is empty.

POST /run — run a command

Auth: Tunnel 1 token required. Request:
Response:
  • code — the command’s exit code. A non-zero code is a completed run, not an API error; read stderr.
  • id — this run’s id, matching the Activity record.
  • truncated — true when the output was cut to the bridge’s output cap; the run still completed.
At most 4 commands run at once on Tunnel 1; further calls wait or fail with 429 rather than piling up.

GET /log — the event log (Tunnel 1 only)

Auth: Tunnel 1 token required. A Tunnel 2 token gets 403. Returns the app’s event log as plain text, one event per line: ISO-8601 UTC timestamp, level, category, message. Recorded: app starts (with app and Android versions), screen opens, diagnosis runs with the facts that decided them, permission checks and answers, token operations by name, bridge bind/unbind, Tunnel 2 toggles, relay queue/approve/dismiss, run completions, rejected-token refusals (tunnel and address, never the value), updater steps, and exceptions with stack traces. Token values are registered as secrets and scrubbed before anything is stored — a log line never contains one.

Tunnel 2 endpoints

All Tunnel 2 paths sit under /door2/. While the app is in Mode 1 — the Tunnel 2 surface switched off — the whole surface answers 403 with “door 2 is off” — including for valid tokens. Tunnel 2 accepts the token as the X-Token header or as an Authorization: Bearer token, to fit how different chatbot connectors authenticate.

GET /door2/health

Auth: none for basic liveness; a Tunnel 2 token for the full form. The basic form is the same shape as Tunnel 1’s. The full form returns the complete diagnosis (a chatbot helper may need to relay a user fix) — but never anything from Tunnel 1’s private data.

GET /door2/status

Auth: Tunnel 2 token required. Deliberately reduced:
No token list, no tailnet address, no host names — nothing about the private side crosses this tunnel.

POST /door2/run

Auth: Tunnel 2 token required. Request and response shapes are identical to Tunnel 1’s POST /run (including the host reservation). Tunnel 2’s limits apply: 30 authenticated calls per minute for this token, at most 2 commands running at once. Every run is flagged in the app’s Activity as public-tunnel origin.

GET /door2/openapi.json

The OpenAPI actions schema for this phone, generated by the app with the recorded public address already in servers[0].url (always a full https address). It describes the Tunnel 2 endpoints for import into a custom GPT or another actions-based chatbot, and it contains no token — authentication is configured separately in the chatbot, as an API key sent in the X-Token header. The same schema can be copied from the app’s Tunnel 2 panel.

POST /door2/mcp — remote MCP endpoint

Auth: Tunnel 2 token required. A stateless JSON-RPC endpoint (no sessions, no server-initiated messages) exposing one tool:
timeout is in seconds and optional. Standard MCP discovery (tools/list) returns the single tool; calls count against the same Tunnel 2 rate limits as the REST surface.

Not on Tunnel 2

  • /door2/log — does not exist (404). Logs never cross the public tunnel.
  • Token management — there is no way to create, read, rotate, or revoke a token over HTTP on either tunnel. Tokens are managed only in the app.

Errors, all surfaces

Error bodies are small JSON objects, e.g. {"error": "bad token"}. The distinction between no response (nothing listening) and 403 (listening, refusing your token) is deliberate and load-bearing — it is how you tell a stopped bridge from a revoked token without guessing.

Relay-mode blocks (no HTTP)

For chatbots with no tool ability, the protocol is two fenced text blocks, carried by the user (full flow in the Tunnel 2 guide):
One command per block. A block pasted into the Agent Inbox is queued, never auto-run; the owner approves it with a tap. A bunnybridge-result block is output, and the app refuses to accept one as a command.
Source: Leverine/Leverine-BunnyBridge@902c77c — docs/site/BunnyBridge/api-reference.html.