Menu / Internal APIs

Reference

Internal APIs

open-bot's processes talk over a few small HTTP and websocket APIs. None of them is a public, stable API: they change together with the code. This page lists them, so you can find where any request is handled.

The web app

Public endpoints

Method and pathAuthPurpose
GET, POST, PUT /api/hooks/:tokenThe tokenA teammate's webhook. Body up to 256 KB. Returns 202 with the run id.
POST /api/inbound/email/:tokenThe tokenPostmark's inbound email webhook
/api/auth/*Better AuthSign-in, sign-up (owner only), passkeys, sessions

Read routes

Every other route under /api needs the owner's session, and returns JSON. They back the client's TanStack Query cache:

PathReturns
GET /api/stateThe app shell's state: teammates, chats, the computer, sign-in status, counts
GET /api/stream?chat=&after=Server-sent events (see Web app)
GET /api/chats/:chatIdA chat's messages and runs, with its event cursor
GET /api/runs/:runIdOne run with its timeline
GET /api/artifacts/:idA screenshot or upload
GET /api/activity, /api/briefingHome's activity and "While you were away"
GET /api/approvals, /api/notificationsThe inbox and notifications
GET /api/schedules, /api/schedules/:id/runsSchedules and their recent runs
GET /api/triggers, /api/triggers/:id/runsWatches and webhooks, and their recent runs
GET /api/tasks, /api/skills, /api/vault, /api/connections, /api/emailEach page's data
GET /api/bots/:id/lessons, /api/bots/:id/spending, /api/bots/:id/exportA teammate's lessons, spending, and an export file
GET /api/memoryMemory items, history and export
GET /api/profile, /api/usage, /api/model-access, /api/rate-limitsAbout you, usage, plan or key, and plan limits
GET /api/telegram, /api/pushTelegram and push status
GET /api/search?q=⌘K search across teammates, chats and messages
GET /api/files/list, /api/files/downloadThe computer's files under /home/bot
GET /api/desktop/tokenA 60-second VNC token and the worker's websocket URL
GET /api/desktop/egress-tokenA 120-second egress token and URL, for the desktop app

Writes are server actions in apps/web/src/lib/actions.ts, not routes.

The worker

Base URL WORKER_URL (port 4001). Every route except /healthz requires x-worker-secret: <WORKER_SECRET>. Bodies and responses are JSON.

Runs and messages

RoutePurpose
GET /healthzLiveness, unauthenticated
GET /internal/statusComputer, Codex and egress status
POST /internal/messages/:id/dispatchRoute a saved message: steer a running turn, or queue runs
POST /internal/runs/:id/retryQueue a failed or stopped request again
POST /internal/runs/cancelProcess cancellations now
POST /internal/bots/:id/syncRewrite a teammate's workspace after an edit

Approvals and screens

RoutePurpose
POST /internal/approvals/:id/decideApprove or deny, optionally with an Always allow pattern
POST /internal/approval-rules/:id/deleteRemove an Always allow rule
POST /internal/screens/:id/wakeStart a screen to watch it
POST /internal/screens/:id/takeTake over a screen
POST /internal/screens/:id/hand-backHand it back, with an optional note
POST /internal/screens/:id/touchReport your input, to keep control from timing out
POST /internal/screens/:id/forgetStop a screen and delete its profile
POST /internal/takeover/:id/dismissDismiss a teammate's request to take over

Automations, tasks and skills

RoutePurpose
POST /internal/schedules, /internal/schedules/:idCreate or update a schedule
POST /internal/schedules/:id/enabled, /internal/schedules/:id/runPause or resume; run now
POST /internal/triggers, /internal/triggers/:idCreate or update a watch or webhook
POST /internal/triggers/:id/enabled, /delete, /check, /rotatePause, delete, check now, new webhook URL
POST /internal/hooks/:tokenFire a webhook (called by the web app's public route)
POST /internal/tasks, /internal/tasks/:id, /delete, /startThe task board
POST /internal/skills, /internal/skills/:id/deleteSave or delete a skill
POST /internal/swarms/:id/stopStop a swarm's helpers

Files

RoutePurpose
GET /internal/files/list, /internal/files/readBrowse and read files under /home/bot
POST /internal/files/write, /upload, /put, /removeWrite, upload and delete. Folders the computer needs and active workspaces are protected.

Integrations and settings

RoutePurpose
POST /internal/codex/device-loginStart a device-code ChatGPT login on the computer
POST /internal/codex/auth-sourceSwitch between borrowing the host's login and the computer's own
POST /internal/codex/logoutSign the computer out
GET /internal/codex/rate-limitsThe plan's usage windows
POST /internal/egress/modeSet the egress mode
POST /internal/connections/:id/testTest an MCP connection
POST /internal/email/inbound/:tokenReceive an email (called by the web app)
GET /internal/telegram, POST /internal/telegram/connect, /link-code, /test, /unlink, /disconnectTelegram
GET /internal/push, POST /internal/push/subscribe, /unsubscribe, /testPush notifications

Websockets

PathAuthPurpose
/vnc?screen=&mode=view|control&token=VNC tokenProxies to botd's /vnc. control requires that you hold the screen.
/egress/agent?token=Egress tokenThe desktop app's end of the egress tunnel

botd

Base URL BOTD_URL (port 7000, private). Every route except /healthz requires Authorization: Bearer <BOTD_TOKEN>, or ?token= on websockets.

RoutePurpose
GET /healthzLiveness, unauthenticated
GET /healthComputerHealth: Codex state, screens with leases, egress
POST /computer/action{ run, action }: perform a desktop action and return a screenshot, the pointer, and any apply guard blocks
POST /computer/read{ run, selector? }: the front page's text and links
POST /computer/fill{ run, secret, site }: type a vault secret, after checking the site
POST /computer/screenshotA screenshot without an action
POST /screens/startStart a screen without using it
POST /screens/forgetStop a screen and delete its profile
POST /lease/run/releaseRelease a run's lease when it ends
POST /lease/user/takeGive you a screen's lease, preempting a run
POST /lease/user/releaseRelease your lease (handed_back, user_idle, user_disconnected)
POST /lease/user/touchRecord your input
WebsocketPurpose
/eventslease and health events, pushed to the worker
/codexA bridge to codex app-server on 127.0.0.1:4500
/egressThe computer's end of the egress tunnel
/vnc?screen=&mode=A bridge to a screen's view-only or control VNC server

Action errors

/computer/* routes return { ok: false, code, message } on failure, and the message goes to the model as the tool's result:

CodeMeaning
user_has_controlYou hold the screen, or took it during the action
desktop_busyAnother run of the same teammate holds the screen, after waiting 30 s
invalid_actionThe action or identity failed validation
wrong_siteA vault login didn't match every visible page
failedAnything else, like a screen that couldn't start

Codex app-server

The worker speaks JSON-RPC 2.0 to Codex through botd's /codex bridge. The methods and server requests open-bot uses are listed on Agent runtime.