Skip to content

HTTP API ​

The node serves REST + SSE under /api/*. peregrin (the CLI) and peregrin-hub both consume this surface — everything the UI can do is on this wire.

Identity and health ​

RoutePurpose
GET /api/healthLiveness + store readability
GET /api/nodeNode identity, agents, capabilities
PATCH /api/nodeRename the node (persisted to PEREGRIN_NODE)
GET /api/userOS user the node runs as
GET /api/agentsAgent runtimes registered on the plane
GET /api/fsSubdirectory listing for a path
GET /api/eventsSSE feed — session/meta/project/heartbeat
POST /api/pairRedeem a pair code for a bearer token

Sessions ​

RoutePurpose
GET /api/sessionsMerged list (?locks=1 probes live holders)
GET /api/sessions/:idSession detail or summary
GET /api/sessions/:id/historyPaginated history
GET /api/sessions/:id/exportSession IR JSON
POST /api/sessionsCreate (cwd, agent, title, model)
POST /api/sessions/importImport IR or history array → store
POST /api/sessions/:id/promptSend a turn to an attached session
POST /api/sessions/:id/attachAttach (takeover preempts live holder)
POST /api/sessions/:id/detachRelease a held session
POST /api/sessions/:id/cancelCancel a running turn
POST /api/sessions/:id/permissionResolve a permission request
POST /api/sessions/:id/convertCopy into another agent's store
DELETE /api/sessions/:idDelete from the owning store
PATCH /api/sessions/:idRename / pin / archive (overlay meta)

Projects and config ​

RoutePurpose
GET /api/projectsNode-local project grouping of sessions
GET /api/configAgent config IR (rules, skills, hooks, MCP)

Auth and errors ​

Non-loopback nodes require Authorization: Bearer <PEREGRIN_TOKEN>. Errors are JSON { "code", "message", "cause" } mirroring ControlErrorCode — not_found, locked (a live holder blocks the op; pass takeover), invalid_params, internal.