AUDIO

Listen to this page

0:00
Chapters

    API reference

    Base URL: /api/v1 (port 8080, same host as the dashboard). All routes except /auth/login and /health require Authorization: Bearer <JWT>; scope enforcement follows architecture.

    Auth & health

    Method Path Scope Description
    POST /auth/login public {username, password, remember?} → {token, user} (JWT, embedded role)
    POST /auth/guest public Passwordless guest session (least-privileged role); accepts the same remember flag
    GET /health public Core + STT + TTS + plugin status

    By default the issued JWT expires after JWT_TTL (12 h). Passing "remember": true issues a long-lived token instead (JWT_LONG_TTL, default 90 days) so mobile clients persist the session across app restarts — they already store it locally and reuse it via /auth/me. The token is self-contained: a role/password change takes effect only at the next login, and all previously issued tokens are invalidated at once by rotating JWT_SECRET.

    Voice & execution

    Method Path Scope Description
    POST /voice any authenticated Multipart .wav (16 kHz PCM), field audio — full pipeline STT → Agent → Tool → TTS; optional multipart field history (JSON string of [{mine, text}], same as /chat) so the assistant keeps the dialogue in the voice pipeline; without it the core's rolling per-user memory provides the context. Returns JSON + audioId
    POST /chat any authenticated Text variant: JSON {text, language?, history?} or multipart with text + an attached media file (photo/video). history is the recent conversation context ([{mine, text}, …], last ~20 turns) that clients send so the Agent sees the ongoing dialogue, not only the current message. Attached media is stored, audited and shown to the Agent as part of the message context
    POST /tts any authenticated {text, language?} — synthesize arbitrary client-side text through the piper pipeline; returns audio/wav bytes. The voice is picked the same way as for saved replies (per-language map via /settings/speech); without the TTS container → 502. Markdown emphasis in text is stripped from the spoken version, like for replies
    POST /tools/:name per-plugin scopes Direct tool invocation without voice; args validated against the manifest parameters
    GET /tools any authenticated Tools available to the current user (already filtered by role)
    GET /audio/:id any authenticated Fetches a generated TTS response by id
    POST /media any authenticated Standalone upload of a chat attachment (multipart file, ≤ 25 MB) — returns {id, kind, mime, size, url}
    GET /media/:id any authenticated Previously uploaded media
    POST /notify any authenticated {title, body, audioId?} — publishes an in-app notification (phone push when remote)
    POST /dictation any authenticated One wav chunk of a long dictation — voice recorded for minutes to hours and delivered as DATA, never as a command. Multipart audio (wav chunk) or JSON {id, audioBase64, target, doc, final} (the hub tunnel path). Fields: id (client-generated session id), target (message | docs | obsidian — honored on the FIRST chunk), doc (document/note name, optional), final (1 on the last chunk; a final without audio finalizes the transcript as is). Every chunk is transcribed immediately (faster-whisper per chunk keeps latency flat; the first chunk's detected language pins the hint for the rest); a response with final: true carries {text, minutes, chars, reply, confirmAudioId, audioId, delivered} — audioId is a /media/:id entry with the MERGED recording (message target), confirmAudioId a short spoken confirmation. Sessions live under data/dictation/<id>/ and survive a core restart; the hard cap is 2 h (the session auto-finalizes at the cap)
    GET /dictation/:id any authenticated Session status: {id, target, doc, language, seconds, chars, final, text} — the transcript so far

    A finished dictation is broadcast to every client as a dictation event ({by, id, minutes, chars, target, doc, audioId, text (first 4000 chars), truncated}) — other devices render it as a feed card; the full transcript stays available via GET /dictation/:id. The delivery targets: message → a feed card plus the full recording (media entry); docs → the text goes through the google_docs tool (dated block on top of the document, default title "holai notes"); obsidian → the text appends to a note (default Dictation.md) via the obsidian tool. When the target plugin is not installed/connected, the dictation degrades to a message card and the reply says so honestly.

    The /voice pipeline also carries the dictation START: phrases like "dictation", "dictation to my document" match BEFORE the agent and answer with tool: "dictation", args: {action: "start", target} (spoken confirmation) — the speaker bridge enters its long-recording state on this; the dictation ENDS with the wake word (speaker) or the stop button (client).

    Example /voice response:

    {
      "transcript": "turn off the lights in the kitchen",
      "tool": "manage_light",
      "args": { "room": "kitchen", "action": "off" },
      "result": { "success": true, "message": "The lighting in the kitchen is off." },
      "audioId": "resp_ab12cd"
    }
    

    Without STT/TTS containers reachable, /voice returns 502 with the service URL — that is the intended degrade, not a bug; /chat works standalone (TTS failure only drops audioId).

    Plugins

    Method Path Scope Description
    GET /plugins any authenticated Installed plugins: version, enabled state, granted scopes, minRole
    GET /plugins/:name/manifest any authenticated Raw manifest.json
    POST /plugins/:name/enable plugins:update Registers the tool with the Agent
    POST /plugins/:name/disable plugins:update Unregisters the tool, instance unloaded
    POST /plugins/install plugins:install npm package (name/version) → staged install; unverified packages (not @holai-org scope, not allowlisted) require acknowledgeRisk: true (docs/marketplace.md "Plugin verification & trust")
    POST /plugins/:name/apply-update plugins:update Runs validate → migrate → swap → health check; returns the permission diff if admin approval is required
    POST /plugins/:name/rollback plugins:update Reverts to the previous version
    GET /plugins/:name/migrations any authenticated Applied / pending migration list
    GET /plugins/updates any authenticated Installed vs latest versions for locked packages
    DELETE /plugins/:name plugins:remove Uninstall (state kept for reinstall)
    * /plugins/<plugin>/<path> per-route role/scope Plugin's own HTTP routes — the contract lives in plugins-api

    Plugin UI pages are served (static) at GET /plugins-ui/<plugin>/<path>; they authenticate by calling the API above with the dashboard token.

    Settings, users, audit, registry

    Method Path Scope Description
    GET/PUT /settings/ai-provider settings:ai-provider Provider, model, temperature, fallback
    GET/PUT /settings/env env:read / env:write Env variables; secrets are write-only and masked in GET
    GET/POST /users users:manage Household profiles, roles, kid restrictions, voice enrollment
    GET /audit audit:read Queryable log (filter by user, tool, date range from/to; limit + offset pagination).The tool filter includes by default; toolExclude=1 drops the tool's entries instead. Every row carries the RESPONSE too: tool calls store the tool's result, agent entries store the question + the answer, plugin routes store their JSON body
    GET/PUT /events/priorities settings:events Event priority rules (dashboard → Event priorities): a rule matches an event's type, source and/or a text fragment and assigns moderate or alarm; first match wins, no rule = normal
    GET /events/recent settings:events The last ~200 published events (ring, since restart) — the rules editor's "mark a past event" picker
    GET /events/alarms?since=ISO any authenticated Moderate/alarm events newer than since — polled by thin clients (the speaker bridge speaks ALARM events out loud)
    GET /consent/pending any authenticated Open AI permission requests (architecture "AI permissions & consent") — one's own; admins see all. Payload {requests: [{id, userId, username, kind, key, name, at}]}
    POST /consent/respond owner or admin {id, allow, always?} answers a pending request; always:true upgrades the subject's mode to allow. Errors: 403 (not the owner), 404 (already answered/expired)
    GET/PUT /permissions/:userId settings:ai-permissions AI permission modes per user: {provider, tool, device, scenario} maps of allow/ask/deny (default ask); PUT takes {kind, key, mode}
    GET /permissions/catalog settings:ai-permissions What can be permitted: external providers + every tool's control actions; device keys ride GET /plugins/tuya/devices
    POST /stt any authenticated Bare transcription: multipart audio (wav 16 kHz PCM) → {text, language} — the speaker bridge's spoken consent answers; no agent, no tools
    GET /registry/search?q= plugins:install npm marketplace search
    GET /registry/:pkg plugins:install Package details + manifest preview + scopes + trust (official/approved/unverified)
    GET /updates any authenticated Core software-update state: current version, channel, latest release of the channel, updateAvailable, staged request, live updater status, history (docs/deployment.md "Software updates & rollback")
    POST /updates/check any authenticated Force a GitHub releases poll now (10 min feed cache, HOLO_GH_API overrides the API base for tests/forks)
    PUT /updates/channel settings:updates {channel: stable|unstable, repo?: owner/name} — the channel decides whether pre-releases count
    POST /updates/apply settings:updates {version?} (default: the channel's newest) — db snapshot → staged request for the host updater; docker mode only (409 with the manual commands otherwise)
    POST /updates/rollback settings:updates {version?} (default: the previous version) — stages the same-shape rollback request (previous image + pre-update db snapshot)

    WebSocket ws://…/api/v1/events — pushes live events to the dashboard: plugin state changed, update progress, migration steps, errors, incoming commands, speech.language swaps. Remote phones receive the same events as push frames through the hub (see hub). Every event carries a priority when a rule matches (moderate/alarm — see /events/priorities). The AI permission gate publishes consent.request (a dialog in the app / a spoken question on the speaker) and consent.done (the answer or the timeout) for every gated call — see docs/architecture.md.

    Machine tokens (plugin → core / sidecar auth)

    ctx.token(ttl='10m') mints a short-lived JWT with admin role and sub: plugin-<name> — the standard auth between a plugin, the core API and its own worker containers. Cameras-worker is the reference user: worker → core ingest calls carry a self-minted machine JWT; revoke = rotate JWT_SECRET.

    Last updated: November 2026