API Reference
The Hub API is a Fastify HTTP server. All endpoints are under /api/.
Authentication
| Method | Description |
|---|---|
| JWT cookie | Set by POST /api/auth/login, sent automatically by browsers |
| Bearer JWT | Authorization: Bearer <jwt> for user sessions (mobile, scripts) |
| Bearer API key | Authorization: Bearer <hex-key> for machine-to-machine clients (tenant-scoped or satellite-scoped) |
| Internal API key | Authorization: Bearer ${OTAVI_HUB_INTERNAL_API_KEY} for the nginx reverse proxy and trusted internal callers |
The auth resolver tries internal key, JWT cookie, JWT bearer, then API key, in that order. Whichever matches sets request.auth = { userId? | apiKeyId?, satelliteId?, tenantId, role, isPlatformAdmin }. API keys are SHA-256 hashed in storage; the raw key is shown once at creation. Satellite-scoped keys are minted by registration (POST /api/satellites returns apiKey) and rotated via POST /api/satellites/:id/rotate-api-key hub 0.32.5; they carry role=member and a satellite_id FK so they can be revoked individually.
Authorization hub 0.70: every route declares the action it performs in the permissions registry (packages/shared/src/permissions.ts), and one guard applies the action's rule before the route runs: 401 when no one is signed in; 403 when the role, or the kind of caller, is not allowed (an API key where a person must act, a satellite's key outside the routes declared for it); 404 when the team or the item the route names is out of reach; 400 when a body must name its team and does not. The role counts in the team the action concerns (the item's own team, or the team the request names), whichever team the caller has active. The Auth column below gives the minimum role; Settings and permissions lists every action.
Login security:
- Rate limiting: max 20 attempts per IP per 15 minutes (429
TOO_MANY_ATTEMPTS); each route's own per-minute limit answers 429RATE_LIMITED - Account lockout: 5 failed attempts locks for 15 minutes, answered as a wrong password (401
INVALID_CREDENTIALS), so a refusal never tells whether an address has an account - Every refusal of the
/authroutes carries acodebeside its Englisherror, for the pages to say it in the reader's language hub 0.107.0; a request without a session answers 401NOT_SIGNED_IN - Last login timestamp + IP recorded on success
- Hub admin status resolved from DB on every request (not from stale JWT)
Auth
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /auth/register |
Public* | Register user. Body: {email, password, name, inviteToken?}. With inviteToken the account joins the invitation's team as POST /auth/invites/accept does (and self-registration may be off). 400 FIELDS_REQUIRED, PASSWORD_TOO_SHORT, INVITE_INVALID (unknown, expired or used); 403 SELF_REGISTRATION_DISABLED, INVITE_FOR_OTHER_EMAIL (the invitation names another address); 409 EMAIL_TAKEN; 500 REGISTERED_NOT_SIGNED_IN (the account exists, signing in failed) |
| POST | /auth/login |
Public | Login. Returns {user, token?} on success, or {mfaRequired:true, mfaToken, hasPasskeys} when MFA is enabled (the session cookie is only set after the second factor succeeds, or when the mfa-remember cookie matches a remembered device). 401 INVALID_CREDENTIALS, 403 ACCOUNT_BLOCKED, 429 TOO_MANY_ATTEMPTS |
| POST | /auth/login/mfa/totp |
Public | Complete MFA challenge with a 6-digit TOTP code. Body: {mfaToken, code, rememberDevice?}. 401 INVALID_CODE, MFA_EXPIRED (the step's token is stale: sign in again), MFA_TOO_MANY_ATTEMPTS (five wrong codes on one token), ACCOUNT_UNAVAILABLE |
| POST | /auth/login/mfa/backup |
Public | Complete MFA challenge with a single-use backup code. Body: {mfaToken, code, rememberDevice?}. The same refusals as the TOTP step |
| POST | /auth/login/mfa/passkey/begin |
Public | Begin WebAuthn assertion ceremony. Body: {mfaToken} → returns PublicKeyCredentialRequestOptionsJSON. 401 MFA_EXPIRED, 404 NO_PASSKEYS |
| POST | /auth/login/mfa/passkey/finish |
Public | Finish WebAuthn assertion. Body: {mfaToken, response, rememberDevice?}. 401 PASSKEY_FAILED, MFA_EXPIRED, MFA_TOO_MANY_ATTEMPTS, ACCOUNT_UNAVAILABLE |
| POST | /auth/forgot-password |
Public | Request a password reset email. Body: {email}. Always returns 204 (whether or not the email exists, to avoid account enumeration). Rate-limited per IP via the login_attempts ledger. Sends a 60-minute single-use link. Requires OTAVI_SMTP_HOST to actually deliver mail; without it the request is recorded but silently dropped |
| POST | /auth/reset-password |
Public | Complete a password reset. Body: {token, password}. Token is the raw hex string from the email link (SHA-256 hashed in storage). On success: updates password_hash, clears failed_login_attempts and locked_until, marks the token used_at. MFA-enabled users still face their second factor on the next sign-in. 400 FIELDS_REQUIRED, PASSWORD_TOO_SHORT, RESET_LINK_INVALID (unknown, used or expired) |
| POST | /auth/logout |
Authenticated | End the current session on the hub and clear its cookie (does NOT clear the mfa-remember cookie) |
| GET | /auth/me |
Authenticated | Current user, tenants, preferences (as they apply: the person's own, else the hub's default), mfa.{enabled, enrolledAt, backupCodesRemaining, enrollmentRequired, available, passkeys, rememberedDevices}. Each membership carries welcome: {inviterName, role, via, joinedAt} until the person dismisses the team's welcome panel (via: invite, request, open, added by a hub admin, created), else null hub 0.105.0. digest: {lastSentAt, next: {daily, weekly}, mail}: when the person's next digest would go out at each frequency, and whether the hub sends email hub 0.112.0 |
| POST | /auth/me/welcome/:tenantId/dismiss |
Authenticated | Put the team's welcome panel away for good. 404 NOT_MEMBER hub 0.105.0 |
| PUT | /auth/me/preferences |
Authenticated | Update preferences by their field names (primaryLanguage, secondaryLanguages, dateFormatPrimary, dateFormatSecondary, timeFormat, startOfWeek, paperSize, showVoting, digestFrequency hub 0.112.0; null = follow the hub). Checked by the settings registry (400 for a value outside its options); the account page uses PATCH /settings/effective?level=account |
| PUT | /auth/me/profile |
Authenticated | Update name and/or email. 403 EMAIL_RESERVED, 409 EMAIL_TAKEN |
| PUT | /auth/me/password |
Authenticated | Change password (requires current). Ends every session and sets a fresh session cookie. 400 FIELDS_REQUIRED, PASSWORD_TOO_SHORT; 403 WRONG_PASSWORD |
| GET | /auth/me/sessions |
Session | The person's open sign-in sessions, newest first, ended and expired ones left out: {sessions: [{id, label, ip, createdAt, lastSeenAt, expiresAt, current, rememberedDevice}]}. current marks the session making the request; rememberedDevice, a sign-in that used or created a remembered two-factor device still valid hub 0.112.0 |
| DELETE | /auth/me/sessions/:id |
Session | End one of the person's sessions: its token is refused from its next request. Rate-limited. 400 CURRENT_SESSION (the session making the request: sign out instead), 404 SESSION_NOT_FOUND (unknown, someone else's, already ended or expired). Audited user.session_ended hub 0.112.0 |
| POST | /auth/me/sessions/end-others |
Session | End every session of the person but the current one. Answers {status: "ended", count}. Rate-limited. Audited user.sessions_ended with {count} hub 0.112.0 |
| GET | /auth/me/digest/preview |
Session | The digest email the person would receive now, as HTML with its pictures written in (period: weekly, the default, covers the 7 days before today; daily, yesterday). Header X-Otavi-Digest: ready, or empty with a page saying so when none of their teams counted anything then. 400 INVALID_PERIOD hub 0.112.0 |
| POST | /auth/me/digest/send-preview |
Session | Send that preview to the person's address, its subject marked as a preview. Body {period}. Answers {status: "sent", to}. 3 an hour per person. 409 DIGEST_EMPTY (nothing counted), MAIL_NOT_CONFIGURED; 400 INVALID_PERIOD. Audited user.digest_preview_sent with {period, teams} hub 0.112.0 |
| GET | /auth/me/contributions |
Session | What the person brought to their teams, all of them or the one named by tenantId (one they are not in: 401 as on every route naming a team, 404 NOT_MEMBER for a hub admin): {votes: {total, confirms, rejects, unsures, last_at}, annotations, fieldNotes, photos, recordings: {chunks, detections, species, satellites: [{id, name, detections}]}, leaderboard: {rank, of}, firsts: {count, latest: [{scientific_name, common_name, detected_at}]}}. Recordings come from the satellites the person registered; leaderboard ranks them by votes among the people who voted in those teams, all time (rank null before a first vote); firsts counts the species one of their satellites heard first in the team, the last three listed. Detections count as the Detections page lists them hub 0.112.0 |
| DELETE | /auth/me |
Authenticated | Delete own account. 403 HUB_ADMIN_SELF_DELETE; 409 SOLE_OWNER (transfer the teams the person alone owns first) |
| POST | /auth/mfa/totp/begin |
Authenticated | Begin TOTP enrollment — returns {qrDataUrl, manualKey}. Secret cached in Redis 10 min |
| POST | /auth/mfa/totp/confirm |
Authenticated | Confirm TOTP enrollment with a 6-digit code. Body: {code} → returns {backupCodes} (one-shot) |
| POST | /auth/mfa/totp/cancel |
Authenticated | Cancel pending TOTP enrollment |
| POST | /auth/mfa/disable |
Authenticated | Disable MFA. Body: {password}. Wipes secrets, passkeys, and remembered devices. Forbidden for hub admins |
| POST | /auth/mfa/backup-codes/regenerate |
Authenticated | Generate a new set of backup codes (invalidates the old set). Body: {password} |
| POST | /auth/mfa/passkeys/register/begin |
Authenticated | Begin passkey registration — returns PublicKeyCredentialCreationOptionsJSON |
| POST | /auth/mfa/passkeys/register/finish |
Authenticated | Commit a new passkey. Body: {response, name?} |
| GET | /auth/mfa/passkeys |
Authenticated | List the user's passkeys (id, name, createdAt, lastUsedAt) |
| DELETE | /auth/mfa/passkeys/:id |
Authenticated | Remove a passkey |
| GET | /auth/mfa/remembered-devices |
Authenticated | List remembered devices for the current user |
| DELETE | /auth/mfa/remembered-devices/:id |
Authenticated | Revoke one remembered device |
| POST | /auth/mfa/admin/users/:id/reset |
Hub admin | Reset MFA for another user (escape hatch for lost-device recovery). Wipes secrets, passkeys, remembered devices |
| POST | /auth/invites |
Admin+ (a person) | Invite people. Body: {tenantId, role: viewer|member|admin, emails?: string[] (50 at most), note?: string (300 characters at most, trimmed), expiresInHours?: 24|72|168 (default 72, a week at most)}. Each distinct address gets its own single-use invitation bound to it; without emails, one link-only invitation. Answers 201 {results, emailed}, one result per address: {email, status, inviteId?, link?, expiresAt?, wasBlocked?, memberSince?, memberRole?, memberName?, invitedAt?, invitedBy?, invitedByMe?}, status being sent (emailed; the link comes too), link (no mail on this hub, or no address), already_member, already_invited (the pending invitation's id and link) or invalid. wasBlocked: the account was blocked from the team, which the invitation lifts once used. Links are https://<OTAVI_APP_FQDN>/invite/<token>. 400 INVALID_ROLE, INVALID_EMAILS, TOO_MANY_ADDRESSES, NOTE_TOO_LONG |
| GET | /auth/invites/preview/:token |
Public | The card an invitation opens (30 a minute): {state: open|expired|used, team: {id, name, slug, description, memberCount, satelliteCount, speciesCount, listeningSince}, inviter: {name}|null, role, note, expiresAt, email}. email is the address the invitation names, while it is open. 404 INVITE_UNKNOWN for an unknown or revoked token hub 0.105.0 |
| POST | /auth/invites/accept |
Authenticated (a person) | Take an invitation. Body: {token} → {tenantId, role, alreadyMember}. Adds the membership with the invitation's role (an existing one keeps the higher of the two, an owner stays owner), lifts a block on the person in that team and closes their pending request to join. 400 INVITE_INVALID, 403 INVITE_FOR_OTHER_EMAIL hub 0.105.0 |
| POST | /auth/invites/:id/resend |
Admin+ (a person) | The same email again: same link, same expiry → {emailed}. 400 INVITE_NOT_EMAILED when the invitation names no address, INVITE_INVALID when it is used or expired hub 0.105.0 |
| GET | /auth/invites |
Admin+ | Pending invitations and those used in the last 7 days: {id, role, email, note, emailed, link, expires_at, created_at, created_by_name, used_by_name, used_at, tenant_id, tenant_name}; link is null for an API key |
| DELETE | /auth/invites/:id |
Admin+ | Revoke an invitation |
| GET | /auth/members |
Admin+ | List tenant members (excludes hub admins). role, search (name or email) hub 0.103.0, sortBy (name, role, joined, tenant), sortDir, limit (25, at most 100), offset. Answers {members, total, roles}; roles counts everyone listed by role (owner, admin, member, viewer) whatever the role and search filters hub 0.103.0 |
| POST | /auth/create-tenant |
Logged in* | Create new tenant |
*Gated by hub settings (allow_self_registration, allow_tenant_creation)
The scope
The routes that count or list detections for people take the scope the web's header sets (the satellites, the recording quality, the status and one species), as query parameters beside their own hub 0.110.0. Each route below says which parts it takes; a part it does not take is ignored.
satelliteIds: satellites of the team, comma-separated; absent or empty, all of them.satelliteIdreads as a list of one (satelliteIdswins when both are sent). A malformed id answers 400, a satellite of another team 404, as one that does not existquality: the recording quality, a gradeAtoEmeaning that grade or better (C: A, B or C),gradedany grade,ungradednone; absent, every detectionstanding: the status filter ofGET /detections(counted,any,to_check,possible,likely,strong,confirmed,rejected), on the routes that list or draw detections; the routes that count figures count what countsspecies: one species code, as the Detections list takes it (the scientific name on this hub)
An unknown quality or standing filters nothing.
Detections
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /detections |
Viewer+ | List detections (filterable, query params below); the whole scope hub 0.110.0 |
| GET | /detections/summary |
Viewer+ | The detections that count in a window (start, end), one row per species. Also possible_detections and possible_species, the possible ones it leaves out, with aggregation, their teams' common rule (null when they differ); rejected_detections and satellites (the satellites that heard what counts) hub 0.101.0. The scope's satelliteIds, quality and species hub 0.110.0 |
| GET | /detections/species-timeline |
Viewer+ | Every detection in a window, bucketed per species (buckets); a species with possible detections also has possible and possible_buckets, and aggregation gives their rule; bucket_listening says per bucket whether a satellite in scope listened (heartbeats, chunks or detections) and listening_since from when heartbeats count hub 0.97.0. The whole scope hub 0.110.0: without standing, every detection but the rejected ones; standing=counted keeps what counts, and the listening follows satelliteIds |
| GET | /detections/:id |
Viewer+ | Detection detail with storage key |
| GET | /detections/votes |
Viewer+ | Get user's votes for detection IDs |
| POST | /detections/:id/verify |
Member+ | Vote confirm, reject or unsure (one per person, changeable); answers {status, evidence, verdict, counts, votes: {confirms, rejects, unsures, consensus}}, the detection's status once the team's votes are counted (hub 0.99.0; verificationStatus repeats verdict) |
| POST | /detections/:id/phone-vote |
Phone key | A vote from a registered phone, in the name of the person who registered it, on the phone's own detections, while the team takes votes from phones (verification.phoneVotes; hub 0.99.0). 403 PHONE_VOTES_OFF, 409 REGISTRANT_UNAVAILABLE (reason: unregistered, not_member, blocked); answers as /verify |
| GET | /detections/:id/comments |
Viewer+ | List comments on a detection |
| POST | /detections/:id/comments |
Member+ | Add a comment |
| DELETE | /detections/:id/comments/:commentId |
Member+ | Delete own comment (admin can delete any) |
| GET | /detections/:id/share |
Viewer+ | {shareUrl, expiresAt}: a link that opens for 90 days hub 0.79.0; 409 NOT_SHAREABLE for a detection that does not count, a category the team hides hub 0.78.1 or a rejected detection hub 0.87.0 |
| GET | /share/detection/:id/:token |
Public | View shared detection (no auth). Promoted detections in a category the team shows only; species, time, confidence and badges, never the team, the satellite's name or its position hub 0.64.5 |
| GET | /share/audio/:id/:token |
Public | Stream audio for shared detection (no auth); the same detections as the page. The page, the audio and the link preview answer 410 SHARE_EXPIRED once the link has expired, 403 for a forged one |
| POST | /detections/:id/annotate |
Member+ | Time-boxed spectrogram annotation, which is also the person's vote. Body: {vote, timeStartMs, timeEndMs, freqLowHz?, freqHighHz?, notes?}; answers as /verify |
| GET | /detections/:id/annotations |
Viewer+ | List annotations for a detection |
Query params for GET /detections:
tenantId— filter by tenantsatelliteId— filter by satellitesatelliteIds: several satellites of the team, comma-separated hub 0.110.0 (the scope)species— filter by species codespeciesSearch— search by common or scientific name (ILIKE)minConfidence— minimum confidence thresholdstanding— the status filter hub 0.99.0: absent, the detections that count;counted,any(everything but rejected),to_check(possible or likely, no verdict: what a vote would change), an evidence levelpossible/likely/strong(that level, no verdict), or a verdictconfirmed/rejectedquality: the recording quality hub 0.108.0, a gradeAtoEmeans that grade or better (C: A, B or C),gradedany grade,ungradednone; absent, every detectionunvotedByMe,votedByMe—true: the detections the caller has not voted on, or has (a phone's key: its registrant); withvotedByMeand nostanding, every one of them whatever it stands at now, rejected includedwithVotes—true: each row carries its vote countsconfirms,rejects,unsuresand the caller's ownmy_votesortBy— sort field:date(default),confidence,trust,species,standing(withsortDir=asc: weakest first, then the lowest confidence),vote(the caller's latest vote first)sortDir— sort direction:ascordesc(default)limit,offset— paginationstart,end: time window (ISO, end exclusive); all time when absentwithCount— set tofalseto skip the multi-secondCOUNT(*)over the visibility-filtered table when the caller doesn't need pagination (Dashboard recent-detections, Verification queue). Whenfalse,totalisnullin the response
Response: { detections: [...], total: number | null, rules }. Each detection carries its status hub 0.99.0: evidence (possible, likely, strong), verification_status (unverified, confirmed, rejected), counts, evidence_peers (the other calls heard within the window at the last assessment), Perch's second_opinion_share and second_opinion_status (done, unknown, pending, or null before the second opinion existed), trust_score, neighbor_count, calibrated_confidence when a curve exists, the recording quality hub 0.108.0 quality (the calls' clarity less the noise's penalty, over 30 dB, 0 to 1) and quality_grade (A to E, both null when the worker could not grade it; what a grade means), the noise hub 0.111.0 contamination (the loudest of the chunk's gate scores for voice, machines and other animals, each clamped to 1; null when the satellite sent no gate scores) and contamination_category (human_voice, anthropogenic, other_animal, the loudest one; null with no noise or no contamination), and the flags is_first_of_season, is_first_of_day, is_rare. /detections/:id and the share page's detection carry quality, quality_grade, contamination and contamination_category too. rules maps each team listed to what its status reads with: aggregation ({enabled, count, windowMinutes, confidenceHigh, retentionHours}; retentionHours is null while the hub's retention is off, since nothing then deletes possible detections), secondOpinion ({mode, minShare}) and consensus.
Sessions
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /sessions |
Viewer+ | List recording sessions |
| GET | /sessions/timeline |
Viewer+ | Chunks + detections for a time range |
Query params for GET /sessions:
tenantId— filter by tenantsatelliteId— filter by satellitefilter— session type:with-detections,empty, or omit for allsortBy— sort field:date(default),duration,detections,species,chunkssortDir— sort direction:ascordesc(default)limit,offset— pagination
Response: { sessions: [...], total: number }
Query params for GET /sessions/timeline:
tenantId— filter by tenantsatelliteId— filter by satellitefrom,to— ISO 8601 time range boundaries
Sessions are groups of consecutive audio chunks separated by a gap of 5 minutes or more. Each session includes its start/end time, chunk count, and detection summary.
Satellites
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /satellites |
Viewer+ | List satellites (filterable, sortable, paginated). Rows carry registered_by, registered_by_name, registered_by_me and can_manage hub 0.51, and hub 0.93.0 status (registered, recording, paused, scheduled_off, error, offline), reachable (heard within the team's offline timeout), health (low_storage, low_battery, overheating), next_change_at and applied_profile, and hub 0.95.0 heartbeat_error (why it reports an error). ?status= takes a status, warnings or reachable; sortBy=status puts problems first; listened_today_seconds, the listening record in the viewer's day (tz, an IANA zone) hub 0.101.0 |
| GET | /satellites/:id |
Viewer+ | Satellite detail, same fields, plus detections_24h, species_24h and api_key_rotated_at hub 0.101.0 |
| POST | /satellites |
Member+ / Admin+ | Register satellite. Member+ when the team's device_policy is members (default), admin+ when admins (403 DEVICE_POLICY_ADMINS). Stamps registered_by. Re-registering by deviceId is for the registrant, an admin, or a member claiming a team-owned device; adoption by name only for the registrant or an admin. Registered with a key, the satellite's registrant is the person who created the key hub 0.93.0. replaceSatelliteId (hub 0.63, with deviceId) makes the device take over that entry, keeping its id, settings and history; the caller must be able to administer it (its registrant under the members policy, or an admin), and the entry holding this device id until then is archived with its credentials revoked (audited device.satellite_replaced). Returns { id, mqtt, apiKey }, both secrets shown once |
| POST | /satellites/:id/rotate-api-key |
Device rule | Mint a fresh satellite-scoped API key, expire previous keys for this satellite |
| PATCH | /satellites/:id |
Device rule | Update satellite (rename) |
| POST | /satellites/:id/profile |
Device rule | Set the recording profile, then push it when the satellite is reachable (else at its next connection). Under "Only admins can change its settings", 403 CONFIG_LOCKED for others |
| GET | /satellites/:id/schedule |
Viewer+, its own key | Its profile's windows from the shared rule at the position the hub knows: reason, active, nextChangeAt, upcoming, sun (with polar), windows |
| POST | /satellites/:id/update |
Device rule | Request remote update via MQTT. The message, the audit entry and the reply name the latest release of the satellite's own stream (targetVersion: the Pi's or the phone's; the hub's own version for builds that report no stream; hub 0.67.4) |
| POST | /satellites/:id/transfer |
Hub admin | Move a satellite to another team (destinationTenantId): its detections, recordings, alerts and its own API keys follow, its broker role moves to the new team's topics, and when it is reachable the old team's update topic carries newTenantId first (pushedAutomatically). Audited admin.satellite_transferred |
| POST | /satellites/:id/logs |
Device rule | Trigger MQTT log-request, satellite responds with tail of its journal (400 when it is not reachable) |
| GET | /satellites/:id/config |
Viewer+ | Get effective config (overrides merged with tenant defaults): tenantId (the satellite's team hub 0.96.1, read by a phone moved to another team while away), configLocked, recordingProfile, effective, overrides. Each setting's source, default and lock: GET /settings/effective (the inherited and deviceInference fields of hub 0.64.0 to 0.64.5 moved there) |
| PUT | /satellites/:id/config |
Device rule | Update the lock state and/or replace the whole override row (a field left out is cleared). The values go through the settings writer: out of range or of the wrong type answers 400 with refusals, a new value under a lock from above 403 LOCKED_BY_TEAM or LOCKED_BY_PLATFORM (a stored value may be re-sent or cleared). PATCH /settings/effective?satelliteId= changes only the fields it is sent |
| GET | /satellites/:id/config/history?limit= |
Viewer | Effective-configuration history, newest first: `{history:[{id, changedAt, source: web |
| POST | /satellites/:id/archive / /:id/unarchive |
Device administer right (admin+, or the registrant under the members policy) |
Archive = retire but keep: hidden from the fleet list and pickers (list takes ?includeArchived=1), no offline alert, data and credentials untouched; audited. A heartbeat or a re-registration by device id unarchives it (device.satellite_unarchived_by_heartbeat) |
| GET | /satellites/:id/deletion-preview |
Viewer | {detections, counted, chunks, audioBytes, alerts, fieldNotes}: what a deletion removes or unlinks |
| DELETE | /satellites/:id |
Device administer right | Destructive: audio objects removed from the bucket, then rows cascade (chunks, detections and their votes, config, telemetry, keys); alerts and field notes keep their rows with the device unlinked. Optional body {confirmName} must equal the device name (400 CONFIRM_NAME_MISMATCH); the web always sends it. Audit entry carries the counts |
| GET | /satellites/:id/schedule |
Viewer+ | Resolved recording schedule with sun times |
| DELETE | /satellites/:id |
Device rule | Delete satellite (revokes MQTT) |
Device rule hub 0.51. Every mutating satellite route is authorized against the device's own team, never the caller's active one: hub admin; or admin+ in that team; or the member who registered the device (registered_by) while the team's device_policy is members. A device's own satellite-scoped key may rename, rotate its key and push its config, nothing else. A device with no registrant is team-owned and admin-managed. Unknown or invisible devices answer 404, visible but not manageable ones 403.
PUT /satellites/:id/config body:
configLocked: boolean (admins of the satellite's team only: "Only admins can change its settings")overrides: object with nullable fields:filter_enabled,filter_min_rms,yamnet_min_bird_prob,outbox_soft_size_mb,outbox_hard_size_mb,outbox_max_age_hours,heartbeat_interval_sec,drop_amphibian_at_satellite,drop_insect_at_satellite,drop_anthropogenic_at_satellite,drop_human_voice_at_satellite,drop_other_animal_at_satellite,device_inference.nullfollows the team (which follows the hub).
Config resolution: one rule for every setting, from the settings registry: the satellite's own value, else its team's, else the hub's, else the built-in default, with a lock at the hub or the team ending the walk there. See Settings and permissions.
Audio
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /audio/:chunkId |
Viewer+ | Stream audio WAV from MinIO |
Alerts
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /alerts |
Viewer+ | List alerts, newest first (?acknowledged=true/false; start, end: a window on created_at, ISO, end exclusive, either one alone hub 0.103.0; limit, 50 by default, at most 500). Each alert carries satellite_name, rule_name for a team rule's alert, and scientific_name / common_name when it points to a detection hub 0.103.0 |
| POST | /alerts/:id/acknowledge |
Viewer+ | Dismiss alert |
Activity
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /activity |
Member+ | The team's alerts and changes, newest first, people by name; limit (50, at most 200), before (the nextBefore cursor). kind (alert or audit), start / end and actorId (that person's changes only) filter it hub 0.103.0; the first page (no before) also carries the window's counts (alerts, changes) and actors (id, name, count, most first), whatever the kind and the person |
Field notes
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /field-notes |
Viewer+ | The team's notes, newest first (satelliteId, detectionId, limit, offset); start / end keep those written in the window, bySatellite counts them per satellite (satellite_id null: none named), and each note gives its detection's detection_scientific_name and detection_common_name while the detection is kept and its team shows it hub 0.103.0. The scope's satelliteIds (the notes of those satellites) and species (the notes on a detection of that species) hub 0.110.0 |
| POST | /field-notes |
Member+ | Write a note: text, satelliteId, detectionId, weather (an object of values) |
| DELETE | /field-notes/:id |
Member+ | Delete a note and its photos: its author, or a hub admin |
| POST | /field-notes/:id/photos |
Member+ | Add a JPEG, PNG or WebP photo (10 MB at most): its author, or a hub admin |
Export
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /export/detections |
Member+ | Export CSV or JSON (?format=csv/json; from, to, minConfidence), with the quality_grade and quality columns (empty when not graded) and contamination hub 0.111.0 (empty without the satellite's gate scores); the scope's satelliteIds, quality and species hub 0.110.0 |
| GET | /export/ebird |
Member+ | eBird checklist format; a graded detection's species comment ends with "recording grade X"; the scope's satelliteIds, quality and species hub 0.110.0 |
| GET | /export/inaturalist |
Member+ | iNaturalist observation format; the scope's satelliteIds, quality and species hub 0.110.0 |
| GET | /export/xenocanto |
Member+ | xeno-canto submission format; the scope's satelliteIds, quality and species hub 0.110.0 |
| GET | /export/report.pdf |
Member+ | The PDF report of a window (start, end, tz, size, blocks); the scope's satelliteIds (several satellites in one report: the map, the figures and the species cards cover them, the title names them) and quality hub 0.110.0 |
Stats
Every count below, the exports above and the PDF report cover the detections the Detections page lists: those that count (confirmed, or not rejected with evidence better than possible; hub 0.99.0), one row per stitched call, in the categories the team shows hub 0.78.0.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /stats/dashboard |
Viewer+ | Species count, detection count, chunk count, toCheck (the detections a vote would change over the last 7 days: possible or likely with no verdict, the Verification queue); the scope's satelliteIds (the chunks too) and quality hub 0.110.0 |
| GET | /stats/highlights |
Viewer+ | New species, unexpected ones and first of season over the last days (7), one per species; the scope's satelliteIds and quality keep those heard there, a new species being new to the team hub 0.110.0 |
| GET | /stats/trends |
Viewer+ | Daily detection trends (?days=30, or start and end); satelliteId keeps one satellite of the team (404 for any other) hub 0.103.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/top-species |
Viewer+ | Top species ranking (limit, default 20); satelliteId as for the trends hub 0.103.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/activity |
Viewer+ | Hourly detection activity; satelliteId as for the trends hub 0.103.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/verification |
Viewer+ | Verification progress counts (total, confirmed, rejected, likely, strong, possible); start / end keep the detections heard in the window and satelliteId those of one satellite hub 0.103.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/leaderboard |
Viewer+ | Verification contributor ranking, by name (names only, never email addresses); start / end keep the votes cast in the window and satelliteId those on its detections hub 0.103.0; the scope's satelliteIds and quality keep the votes on their detections hub 0.110.0 |
| GET | /stats/species |
Viewer+ | Species catalog with rich per-species stats; start, end and satelliteId scope the counts, dates and flags to the window hub 0.101.0, with first_heard_ever (across all time) and first_of_season_count; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/species/quiet |
Viewer+ | Species gone quiet: heard at least min times (default 20) in the 90 days before their last detection, nothing for days days (default 30) since; at most 20 hub 0.101.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/species/:code |
Viewer+ | Species profile (stats, trend, hourly, satellites, places, confidence, recent); places counts detections by position (about 100 m, a detection's own else its satellite's) and month of the year, for the species maps; start, end and satelliteId scope every figure, chart and list hub 0.101.0, first_heard_ever and last_heard_ever staying across all time; quality (a grade meaning that grade or better, graded, ungraded) scopes them too and the trend covers the window, else everything the team heard, by day up to four months, by week up to three years, by month beyond (trend_bucket) hub 0.109.0; the scope's satelliteIds hub 0.110.0 |
| GET | /stats/compare |
Viewer+ | Side-by-side satellite comparison (species overlap, Jaccard index); each side carries its Shannon, Simpson and evenness (Pielou's J) hub 0.103.0; its own two satellites, and the scope's quality hub 0.110.0 |
| GET | /stats/weather-correlation |
Viewer+ | Weather + detection correlation (Open-Meteo); the scope's satelliteIds and quality, the weather of the first of those satellites with a position hub 0.110.0 |
| GET | /stats/migration |
Viewer+ | Migration patterns (monthly species presence); the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/biodiversity |
Viewer+ | Biodiversity indices (Shannon, Simpson, evenness per satellite); satelliteId as for the trends hub 0.103.0; the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/expected-species |
Viewer+ | Expected species at location (eBird integration) |
| GET | /stats/activity-heatmap |
Viewer+ | Hour×day heatmap (optional satelliteId filter); the scope's satelliteIds and quality hub 0.110.0 |
| GET | /stats/satellite-activity |
Viewer+ | Peak hours per satellite |
| GET | /stats/map |
Viewer+ | Satellite positions with detection summaries; the whole scope hub 0.110.0: the markers of satelliteIds, each counting what quality, standing (absent: what counts) and species keep |
| GET | /stats/map/detections |
Viewer+ | Per-detection GPS points (filterable by days); the whole scope hub 0.110.0, what counts without standing |
| GET | /stats/species-accuracy |
Viewer+ | Per-species verification accuracy stats |
Species
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /species/languages |
Public | Available translation languages |
| GET | /species/translate |
Viewer+ | Translate single species |
| POST | /species/translate |
Viewer+ | Bulk translate species names |
| POST | /species/images |
Viewer+ | Get image statuses (queues missing) |
| GET | /species/range |
Viewer+ | ?scientific=: where the species was observed on iNaturalist, by month hub 0.89.0: {status: "ready", taxon: {id, name}, cells, layers, fetchedAt, counts}, counts being base64 of deflated uint16 little-endian, layers (all year, then January to December) of cells × cells Web Mercator cells, row-major from the north-west. Otherwise {status}: off (iNaturalist off on the hub), none (no real taxon: engines, voices), not_found (unknown to iNaturalist), pending (being fetched; asking puts a detected species first in line) |
| GET | /species/image-gallery |
Viewer+ | A species' photos in gallery order: display, square, wide and full-resolution URLs (served by /species/image/by-key, which takes the same ?original=1, &maxBytes=, ?square= and ?wide=), the full-resolution copy's size as originalBytes hub 0.62.4, the credit and the licence |
| GET | /species/image/proxy |
Viewer+ | Serve species image from MinIO. ?original=1 for the full-resolution copy, with &maxBytes=N to get the display copy instead when the original is larger (the web asks with 8 MB); ?square=64|128|256|512 for a smart-cropped square positioned on the bird (JPEG; cached a week once the crop is settled, ten minutes while the photo still awaits analysis); ?wide=640|960|1280 for a 16:10 picture as large as the photo holds, placed on the bird for that shape: the whole bird when it fits, else from its head (hub 0.88.0, the species page's picture). Same parameters on /species/image/by-key (gallery extras) and the public /species/showcase/image |
| GET | /species/image-cache/stats |
Hub admin | Image cache statistics |
| POST | /species/image-cache/clear |
Hub admin | Clear entire image cache |
| POST | /species/image-cache/retry |
Hub admin | Re-queue failed downloads |
Webhooks
Webhook delivery is an alert-channel type; manage channels via /alert-rules/channels and see webhooks.md for payloads and X-Otavi-Signature verification. The former standalone /webhooks routes were removed in hub 0.37.2.
Alert Rules
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /alert-rules/rules |
Viewer+ | List alert rules for tenant |
| POST | /alert-rules/rules |
Admin+ | Create alert rule. in_app (default true) and to_phones (default false) hub 0.96.0 say whether its alerts show in the app and on the team's phones; cooldown_scope (global, per_species, per_satellite), fire_mode (cooldown, once_until_clear, on_state_change) and message_template as for an update hub 0.103.0. 400 ACK_NEEDS_APP as for an update |
| PUT | /alert-rules/rules/:id |
Admin+ | Update alert rule. 400 ACK_NEEDS_APP for a rule kept out of the app that fires once until acknowledged |
| DELETE | /alert-rules/rules/:id |
Admin+ | Delete alert rule |
Trigger types: detection (on new detection matching conditions), absence (no activity for N minutes), trend (species diversity or detection count drop/increase)
Alert Channels
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /alert-rules/channels |
Viewer+ | List notification channels for tenant. Each carries its last test hub 0.103.0: last_tested_at (null: never tested), last_test_ok, and last_test_error for the team's admins (null for everyone else, like config) |
| POST | /alert-rules/channels |
Admin+ | Create notification channel |
| PUT | /alert-rules/channels/:id |
Admin+ | Update channel |
| DELETE | /alert-rules/channels/:id |
Admin+ | Delete channel |
| POST | /alert-rules/channels/:id/test |
Admin+ | Send test message and keep its outcome on the channel. {status: "sent", testedAt}, or 502 TEST_FAILED with detail when the service refuses it (any answer but 2xx) or cannot be reached hub 0.103.0 |
Channel types: email (SMTP), slack (Block Kit), telegram (Bot API), google_chat (Cards v2), discord (rich embeds), webhook (generic with HMAC)
Scheduled Exports
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /exports/scheduled |
Admin+ | List scheduled exports for tenant (their delivery holds addresses and webhook URLs) |
| POST | /exports/scheduled |
Admin+ | Create scheduled export |
| PUT | /exports/scheduled/:id |
Admin+ | Update scheduled export |
| DELETE | /exports/scheduled/:id |
Admin+ | Delete scheduled export |
Formats: csv, json, ebird, inaturalist
Schedule: cron expression (e.g. 0 6 * * 1 for weekly Monday 6am)
Delivery: via alert channel (email attachment or webhook POST)
Calibration hub 0.30
Per-(tenant, model) isotonic-regression confidence calibration. Inputs: confirmed/rejected verification votes. Output: a monotonic mapping from raw confidence buckets to calibrated probabilities, stored in confidence_calibration (migration 069).
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /calibration/refresh |
Admin+ | Refit the curve for (tenantId, modelId). Body: {tenantId?, modelId?} (admin only). Hub admin can refresh all pairs |
| GET | /calibration/curve |
Viewer+ | Return the bucket array for ?tenantId&modelId |
| GET | /calibration/coverage |
Admin+ | Verified-sample counts per (tenant, model), so the UI can show "ready / not enough data" |
GET /detections already decorates each row with calibrated_confidence (bulk-loaded once per request); single-detection callers read it directly from the row, not from this endpoint.
Mobile Releases
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /mobile/latest |
Public | Newest APK metadata {updateAvailable, version, downloadUrl, fileSize, sha256, forceUpdate, notes}. Mobile app polls this on launch. With ?currentVersion= and an update to offer, also changes (the phone releases after it up to the offered one, newest first, {version, date, groups: [{type, items}]}, at most 10) and earlierChanges (how many more) hub 0.94.0 |
| GET | /mobile/latest?channel=dev |
Hub admin, or a phone a hub admin registered (its own key) | The test build for the dev app hub 0.111.0: {channel: "dev", updateAvailable, version, versionCode, buildId, fileSize, sha256, forceUpdate: false, notes: null, downloadUrl: "/api/mobile/dev/download", releasedAt, changes: []}, or {channel: "dev", updateAvailable: false} when the slot is empty. updateAvailable compares ?currentBuild= with the build's id (a later id is newer), else ?currentVersion= with its version. 401 without sign-in, 403 DEV_BUILD_ADMINS_ONLY for anyone else; channel other than release or dev: 400 BAD_CHANNEL |
| GET | /mobile/download/:id |
Public | Stream the APK. Used by both the mobile in-app updater and the hub UI download buttons |
| GET | /mobile/releases |
Hub admin | List all uploaded APKs (most recent 20) |
| POST | /mobile/upload |
Hub admin | Multipart upload. Fields: apk file, version, notes, forceUpdate, changelog (JSON: the phone's releases up to this one, as build-apk.sh sends them; 400 BAD_CHANGELOG when unreadable) |
| PUT | /mobile/releases/:id |
Hub admin | Toggle force_update |
| DELETE | /mobile/releases/:id |
Hub admin | Delete the APK from MinIO and the row |
| GET | /mobile/dev |
Hub admin | The test build (build-apk.sh --dev) hub 0.111.0: {build: {version, versionCode, buildId, sha256, sizeBytes, uploadedAt, uploadedBy, uploadedByName}}, or {build: null} |
| POST | /mobile/dev |
Hub admin (the internal key too) | Multipart upload replacing the test build. Fields, before the file: version (X.Y.Z, 400 BAD_VERSION), versionCode (default: derived from the version), buildId (the build's UTC time, YYYYMMDDHHMMSS; 400 BAD_BUILD); the hub computes the sha256. Never offered as a release, never announced to phones |
| GET | /mobile/dev/download |
Hub admin, or a phone a hub admin registered (its own key) | Stream the test build as otavi-satellite-dev.apk. 401 without sign-in, 403 DEV_BUILD_ADMINS_ONLY for anyone else (team keys and the internal key included), 404 NO_DEV_BUILD when empty |
| DELETE | /mobile/dev |
Hub admin | Delete the test build from MinIO and its record; 404 NO_DEV_BUILD when empty |
The test build is one slot: the APK at dev/otavi-satellite-dev.apk in the mobile bucket, its record under mobile_dev_build in platform_settings. The releases' paths (/mobile/latest without channel=dev, the update MQTT announcement, the newest phone version on /system/versions) and the APK retention pass read the releases only; the storage figures count its bytes.
Workers
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /workers |
Admin+ | Queue stats + connected workers (IP-based dedup). Each worker reports jobsProcessed, jobsSucceeded, jobsFailed, avgDurationMs |
| GET | /workers/jobs |
Admin+ | Recent completed jobs |
Settings
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /settings/tenant |
Viewer+ | Tenant settings |
| GET | /settings/effective?satelliteId= | ?tenantId= | ?level=hub | ?level=account[&tenantId=] |
Viewer+ of the satellite's or the team's team; hub admins for the hub; a person for their own preferences (tenantId = the team they act in, for what they inherit from it) |
Every setting of the registry at that scope (hub 0.65+, team and hub scopes 0.66+): {level, tenantId?, satelliteId?, settings:[{key, value, source: hub|team|satellite|default, inherited:{value, from}, lockedBy: hub|team|null, own, mayOverride?}]} in the registry's order. inherited is what the scope gets by setting nothing, own its own value (null = follows the level above), mayOverride its own lock where it can lock one. Satellite keys are refused (403) |
| PATCH | /settings/effective?satelliteId= | ?tenantId= | ?level=hub | ?level=account |
The device rule and admin-only settings; admin+ of the team; hub admins; a person for their own preferences | Change only what is sent at that scope hub 0.66: {values?: {key: value | null}, mayOverride?: {key: boolean}}, null = follow the level above. All or nothing: 400 with refusals for an unknown key, a level that cannot hold it, the wrong type or a value outside the registry's range; 403 LOCKED_BY_PLATFORM / LOCKED_BY_TEAM for a new value under a lock (keeping or clearing the stored one is allowed). Audited; history for every satellite reached and a push to those whose configuration changed. Answers like the GET |
| PUT | /settings/tenant |
Admin+ | Update team settings; only the fields sent change. Registry fields (the team's columns of the settings registry, null = follow the hub) go through the settings writer first, with its checks and locks; resolved values are read with GET /settings/effective?tenantId=. invite_note (300 characters at most, empty = none, 400 NOTE_TOO_LONG) is the note the Invite form proposes hub 0.105.0 |
| GET | /settings/platform |
Hub admin | Hub settings |
| PUT | /settings/platform |
Hub admin | Update hub settings. Keys that are the settings registry's hub values go through the settings writer and reach every satellite of every team; device_inference_teams_may_override is still accepted as the hub's lock on on-satellite inference |
Tenants
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /tenants |
Authenticated | List tenants: the caller's teams, every team for a hub admin. A hub admin's rows also carry member_count and satellite_count (archived satellites left out) hub 0.106.0 |
| POST | /tenants/:id/leave |
Session | Leave a team. Owners get 400 OWNER_CANNOT_LEAVE (transfer ownership first). The leaver's devices are disconnected and become team-owned |
| GET | /public/teams/:slug?lang= |
Public | A team's public page hub 0.53: name, description, since, counts (species, detections, devices), top species with credited photos, recent firsts by day, 30 daily totals, towns only if the team opted in, and a join hint when the team is joinable. Promoted detections and the team's own category visibility only. 404 unless the hub switch allow_public_pages AND the team's public_page are on. Cached 10 min, dropped on any settings save |
| GET | /public/teams/:slug/og |
Public | Link-preview HTML for bots (nginx rewrites /t/:slug here for bot user agents); every value escaped |
| GET | /tenants/directory?search= |
Session | Teams that accept newcomers (listed, request or open). Name, description, policy, member and device counts, plus the caller's is_member / has_pending. { enabled: false, teams: [] } while the hub switch allow_public_teams is off hub 0.52 |
| GET | /tenants/:id/join |
Session | One team's public card, for a shared link (works for unlisted teams). 404 when the team is invite-only, the caller is blocked, or the hub switch is off |
| POST | /tenants/:id/join |
Session | open: join at once with the team's default_join_role (200 {status:"joined"}). request: create a pending request and mail the team's admins (202 {status:"requested"}). 409 ALREADY_MEMBER / ALREADY_REQUESTED. Body { message? } (500 chars). Rate-limited |
| DELETE | /tenants/:id/join |
Session | Withdraw the caller's pending request |
| GET | /tenants/:id/join-requests |
Admin+ of that team | Pending requests with name, email, message |
| POST | /tenants/:id/join-requests/:rid/approve |
Admin+ of that team | Body { role?: "viewer" | "member" } (default: the team's default_join_role; never admin). Mails the requester |
| POST | /tenants/:id/join-requests/:rid/deny |
Admin+ of that team | Body { block?: boolean }. No mail is sent on a refusal |
| GET / DELETE | /tenants/:id/blocks[/:userId] |
Admin+ of that team | People blocked from asking or joining; lift a block. An admin's invite also lifts it |
Admin (hub admins only)
| Method | Path | Description |
|---|---|---|
| GET | /admin/users |
List all users (search, status, tenant filters, query params below) → {users, total, counts}. counts are the hub's figures whatever the filters: registered, active, blocked, hubAdmins, twoFactor, signedInToday (since midnight in ?tz=, an IANA zone, default UTC) and inTeams (people with at least one membership) hub 0.106.0 |
| GET | /admin/users/:id |
User detail |
| PUT | /admin/users/:id |
Update user (name, email, admin flag) |
| POST | /admin/users/:id/block |
Block/unblock user |
| POST | /admin/users/:id/reset-password |
Reset password |
| DELETE | /admin/users/:id |
Delete user: the same erasure as self-deletion (satellites released and disconnected, email and IP removed from the audit log). 409 when the person is a team's sole owner; hub admins cannot be deleted |
| POST | /admin/users/:id/tenants |
Add user to tenant (409 if already member). A team has one owner: owner only for a team without one, else 409 TEAM_HAS_OWNER (hand it over with the transfer below) |
| DELETE | /admin/users/:id/tenants/:tid |
Remove from tenant. ?devices=keep leaves the person's devices running for the team; the default disconnects them (keys expired, broker login dropped, device becomes team-owned) |
| PUT | /admin/members/:id/role |
Admins of the member's team (not only hub admins): viewer, member or admin. An admin's role is the owner's to change (403 OWNER_ONLY, hub 0.71+); the owner's never changes here (400) |
| DELETE | /admin/members/:id |
Admins of the member's team: remove a member. An admin: the owner only (403 OWNER_ONLY); the owner: never (400) |
| POST | /admin/members/:id/transfer-ownership |
The team's owner, or a hub admin. The previous owner becomes admin and the member owner, in one transaction (a unique index keeps one owner per team, migration 102). 400 if the member already owns the team |
| GET | /admin/audit-log |
Audit log, newest first: ?limit= (100, at most 500), ?offset=, ?action=, ?search= (part of a person's address or name), ?tenantId= (__all__ = every team), ?start= / ?end= (ISO, both or neither, 400 otherwise) → {entries, total, counts?}. Each entry carries userName and tenantName as they are today. The first page (offset 0) adds counts for the window and the team, whatever the action and the person: total, people, byAction and byActor (the five largest, {action, count} and {name, count}; a failed sign-in counts under the address typed) hub 0.106.0 |
| GET | /admin/audit-log.csv |
The same entries as a CSV file, the newest 50,000 at most (same filters, no paging): created_at, user_name, user_email, action, team, ip_address, target_type, target_id, details (JSON). Cells starting with = + - @ are apostrophe-prefixed hub 0.106.0 |
User list query params: ?search= (name or address), ?status=active|blocked, ?tenantId=, ?sortBy=name|email|joined|last_login, ?sortDir=asc|desc, ?limit= (50), ?offset=, ?tz=
Audit Log
All audit log entries include the real client IP address (via X-Forwarded-For, with trustProxy enabled on Fastify).
Each route that changes something declares the entries it writes (config.audit, hub 0.72+) and writes them through request.audit(), which records who acted, from which address, and in which team; a team's entries also feed its activity page. The list below is generated from services/audit.ts and the audit log page's labels.
user
| Action | Label |
|---|---|
user.login |
Login |
user.login_failed |
Login failed |
user.logout |
Logout |
user.register |
Registered |
user.profile_updated |
Profile updated |
user.password_changed |
Password changed |
user.password_reset_requested |
Password reset requested |
user.password_reset_completed |
Password reset completed |
user.password_reset_failed |
Password reset failed |
user.account_deleted |
Account deleted |
user.session_ended |
Session ended |
user.sessions_ended |
Other sessions ended |
user.preferences_updated |
Preferences updated |
user.digest_preview_sent |
Digest preview sent |
user.mfa_challenge_issued |
Two-factor code asked |
user.mfa_login_failed |
Two-factor sign-in failed |
admin
| Action | Label |
|---|---|
admin.user_blocked |
User blocked |
admin.user_unblocked |
User unblocked |
admin.user_deleted |
User deleted |
admin.password_reset |
Password reset |
admin.user_edited |
User edited |
admin.user_added_to_tenant |
Added to a team |
admin.user_removed_from_tenant |
Removed from a team |
admin.member_role_changed |
Role changed |
admin.member_removed |
Member removed |
admin.join_request_approved |
Join request approved |
admin.join_request_denied |
Join request declined |
admin.member_unblocked |
Block lifted |
admin.invite_created |
Invite created |
admin.invite_revoked |
Invite revoked |
admin.invite_resent |
Invitation sent again |
admin.tenant_created |
Team created |
admin.image_cache_cleared |
Image cache cleared |
admin.image_recrop_started |
Crops rerun |
admin.satellite_deleted |
Satellite deleted |
admin.satellite_archived |
Satellite archived |
admin.satellite_unarchived |
Satellite unarchived |
admin.satellite_renamed |
Satellite renamed |
admin.satellite_position_set |
Satellite position set |
admin.satellite_transferred |
Satellite moved |
admin.satellite_profile_changed |
Recording profile changed |
admin.satellite_config_changed |
Config changed |
admin.satellite_update_requested |
Update requested |
admin.satellite_api_key_rotated |
Satellite key rotated |
admin.alert_rule_created |
Alert rule created |
admin.alert_rule_updated |
Alert rule updated |
admin.alert_rule_deleted |
Alert rule deleted |
admin.alert_channel_created |
Alert channel created |
admin.alert_channel_updated |
Alert channel updated |
admin.alert_channel_deleted |
Alert channel deleted |
admin.tenant_settings_updated |
Team settings |
admin.platform_settings_updated |
Hub settings |
admin.scheduled_export_created |
Scheduled export created |
admin.scheduled_export_updated |
Scheduled export updated |
admin.scheduled_export_deleted |
Scheduled export deleted |
admin.retention_run |
Retention run |
admin.mobile_release_uploaded |
Mobile release uploaded |
admin.mobile_release_deleted |
Mobile release deleted |
admin.model_uploaded |
Model installed |
admin.model_set_default |
Default model changed |
admin.model_deleted |
Model deleted |
admin.api_key_created |
API key created |
admin.calibration_refreshed |
Calibration refitted |
admin.mobile_release_updated |
Mobile release changed |
admin.mobile_dev_uploaded |
Mobile test build uploaded |
admin.mobile_dev_deleted |
Mobile test build deleted |
admin.model_updated |
Model changed |
admin.satellite_logs_requested |
Satellite logs fetched |
member
| Action | Label |
|---|---|
member.left_team |
Left a team |
member.joined_team |
Joined a team |
member.join_requested |
Asked to join |
member.join_request_withdrawn |
Join request withdrawn |
device
| Action | Label |
|---|---|
device.satellite_unarchived_by_heartbeat |
Satellite back from the archive |
device.satellite_replaced |
Satellite replaced |
device.satellite_config_requested |
Satellite changed its settings |
device.satellite_config_rejected_locked |
Satellite settings refused |
device.satellite_registered |
Satellite registered |
device.satellite_reregistered |
Satellite registered again |
detection
| Action | Label |
|---|---|
detection.voted |
Voted |
detection.annotated |
Annotated |
detection.pinned |
Pinned |
detection.unpinned |
Unpinned |
detection.comment_deleted |
Comment deleted |
auth
| Action | Label |
|---|---|
auth.mfa_enabled |
Two-factor turned on |
auth.mfa_enrollment_failed |
Two-factor setup failed |
auth.mfa_disabled_self |
Two-factor turned off |
auth.mfa_backup_code_used |
Backup code used |
auth.mfa_backup_codes_regenerated |
Backup codes renewed |
auth.mfa_passkey_added |
Passkey added |
auth.mfa_passkey_removed |
Passkey removed |
auth.mfa_reset_by_admin |
Two-factor reset by a hub admin |
auth.mfa_device_revoked |
Remembered device revoked |
field_note
| Action | Label |
|---|---|
field_note.deleted |
Field note deleted |
satellite
| Action | Label |
|---|---|
satellite.listened_live |
Listened live |
WebSocket
Connect to /ws/events?tenantId=<id> for real-time events (signed in; a socket stays within its team, hub admins excepted).
Live listening: ?listenSatelliteId=<id> at connection, or a {"type":"live-start","satelliteId":"<id>"} message, streams that satellite's microphone. It needs member or above in the satellite's own team, which must be the socket's team. Any team the client sends is ignored.
Event types:
detection— new bird detected (species, confidence, satellite, rare flag)alert— system alert (rare species, satellite offline, etc.)
Toast format: Rare species notifications show translated names (primary + secondary languages).
System
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /system/status |
Hub admin | Every container of the hub under its compose name, with its status and the figures it reports, then what the hub holds (satellites, detections, images, chunks, teams, people) |
| GET | /system/versions |
Viewer+ | Latest SemVer per stream: {hub, satellite, mobile}. Satellites + SatelliteDetail pages compare a satellite's heartbeat-reported version against the matching stream's target |
Response includes:
- Services: each registered instance (API, dispatcher, web, workers, satellites) with status, version, uptime, memory usage, IP address, and service-specific details (e.g., per-worker job stats: processed, succeeded, failed, avg duration)
- Infrastructure: PostgreSQL, Redis, MQTT, MinIO connectivity and status
- Data summary: detection counts, inference queue stats, species image totals, tenant and user counts
Service instances are discovered via Redis service registry (otavi:registry:{service}:{instanceId}, 30s TTL).
Health
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health |
Public | Returns { status, version, timestamp } |