All notable changes to zm-api are recorded here. The format follows
Keep a Changelog, and versioning is
SemVer — carrying the v3 major from ZoneMinder's API
lineage, so a client written against the legacy /api/v3 surface has a
recognisable path forward.
-
Streams across servers (multi-server installs). The WebRTC signalling WebSocket (
/api/v3/live/{id}/webrtc/ws) for another server's monitor is relayed: this server checks the caller, connects to the owning server, then accepts the upgrade, so a server that is down or refuses gives an HTTP error.GET /api/v3/events/streamnow carries every server'salarm_statemessages, by following each other server's stream with the client's own token.GET /api/v3/monitor-status/{id}is answered by the server that runs the monitor.GET /api/v3/live/sessionsand/live/sourcestake?server_id=<n>|all. On a multi-server install the event stream no longer reports other servers' monitors asunknown. Enables therustls-tls-native-rootsfeature oftokio-tungsteniteforwss://. -
System control across servers (multi-server installs). The daemon and system routes (
/api/v3/daemons,/api/v3/system/*) take?server_id=<n>to act on another server, relayed to its zm-api with the caller's own token, or?server_id=allto act on every server and get a 207 with one result per server. Applying a run state (POST /api/v3/system/state) now also tells every other server to restart its daemons, and the response gains an optionalserverslist. The request gains an optionaldaemons_onlyflag, which restarts daemons and writes nothing. Withoutserver_id, everything behaves as before on a single-server install. -
Multi-server installs (#230). Every ZoneMinder server runs a zm-api, and a request for a monitor another server runs is relayed to the zm-api there with the caller's own token: live HLS, WHEP, snapshots, alarms, PTZ, monitor state, pipeline, and edits to the monitor's row. A client needs one address. Every server must share the same JWT key files. New
[cluster]settings name the other servers where the default (this server's scheme and port onServers.Hostname) is wrong.GET /api/v3/serversgainsapi_urlandis_this_server. See the multi-server guide for the limits: WebSocket signalling is not relayed. -
Recordings on per-server storage (multi-server installs). A storage area with a
ServerIdholds its files on that server only. A request for an event's video, frames, thumbnail, synopsis or generated videos, or to delete the event, is now relayed to the server that holds the files, with the caller's own token. Storage with noServerIdis shared and is never relayed. Export and the storage list act on what this server can read, and say so. Media jobs wait for the server that can read the event. -
Live event stream,
GET /api/v3/events/stream(Server-Sent Events):event_start,event_endandevent_updated(notes changed, where object detection writes) for every monitor the caller may see, and each monitor'salarm_stateon connect and on change. Reconnect withLast-Event-IDor?since=to replay missed events. One watcher reads alarm state from shared memory four times a second and events from theEventstable, and runs only while someone is subscribed. Heartbeat every 15 s; the stream ends at token expiry or loss of access. -
WHEP for live WebRTC (RFC 9725):
POST /api/v3/live/{monitor_id}/webrtc/wheptakes the viewer's SDP offer and answers201with the SDP answer (zm-api's candidates included) and the session inLocation;PATCHit with trickled candidates,DELETEit to stop. Clients whose browser makes the offer (Home Assistant's camera WebRTC, WHEP players) can now play zm-api's WebRTC without go2rtc.406when the offer can't receive the camera's codec. A session's user is checked again every minute. -
[streaming.webrtc]nat_ips(advertise a public address, for 1:1 NAT or containers) andudp_port_min/udp_port_max(media ports from a range instead of ephemeral ones), for WHEP and the WebSocket path alike. -
RTSP server for live video (
[streaming.rtsp], off by default). Players that take one URL (Home Assistant, VLC, NVRs) get a monitor's live video atrtsp://host:8554/live/{id}?st=…, fromPOST /api/v3/live/{monitor_id}/rtsp/link. The credential is the signed link HLS already uses: one monitor, view only, an expiry, revoked with its user, and checked again every minute while a stream plays. ZoneMinder'szm_rtsp_servertakes a username and password in the URL instead. H.264 or H.265, RTP interleaved on the RTSP connection (TCP; UDP gets 461), RTSPS ontls_portwithserver.tls's certificate. Video only for now. -
Generate a video for an event (#187), the first kind in the media job queue of
docs/FILTERS_PLAN.md.POST /api/v3/events/{id}/videosqueues ZoneMinder's Generate Video, with a format fromZM_FFMPEG_FORMATS, a speed (rate) or frame rate (fps), ascaleorsize, an optional greyscaletransform, andoverwrite. The video is made from the recording, or from the capture JPEGs for an event without one, and named aszmvideo.plnames its files.GET /api/v3/events/{id}/videoslists the event's video files with the options read back from their names, andGET/DELETE .../videos/{name}downloads or deletes one (not the recording).GET /api/v3/jobs[/{id}]shows the queue, andDELETEcancels a queued job or removes a finished one. Videos are made in-process with libav, one job at a time, and jobs a restart interrupted run again. -
Event export (#30):
POST /api/v3/events/export {ids, include}streams a zip, built as it goes, with a{event_id}/folder per event.includepicks fromdetails(event.json),frames(frames.json),images,videoandmisc, and defaults to details and video. Up to 500 ids; each is checked before anything is sent, so an id that doesn't exist or isn't visible is a404. Media files are stored as they are and the JSON is deflated. -
Push token registrations (#175):
/api/v3/notificationslists, reads, registers, changes and removes the Notifications rows that zmeventnotification-style push uses, as ZoneMinder'snotifications.jsondoes. Any logged-in user manages their own tokens, and a System editor sees everyone's. Posting a token that is already registered updates its row (200), posting another user's token is a403, and another user's row is a404.last_notified_atis in UTC. -
Monitor actions (#179):
GET/POST /api/v3/monitors/{id}/actions,GET/PATCH/DELETE /api/v3/monitors/{id}/actions/{action_id}andGET /api/v3/monitors/{id}/actions/targetscover ZoneMinder 1.39.30's MonitorActions, the lights and sounds one monitor's events trigger on another's device. An action type the target's control can't perform, or an audio file outside its range, is a400. A change restarts the monitor's daemons, since zmc reads the list at start.POST .../actions/{action_id}/runruns an enabledManualaction. It needs Control view on the monitor and the target, and builds the command from the stored row. -
Config options say where their value comes from (#183): each
/configsentry carriesrequires(the option's dependency, as ZoneMinder stores it),source(dborfile) andsource_file. Whenzm.confor aconf.dfile sets the option, the response shows the file's value, which is the one in effect, and aPUTanswers409, since the file would override the change anyway. A private option set in a file still returns an empty value. -
Signed media links for players that can't send a header (#153, #34).
POST /api/v3/live/{monitor_id}/hls/linkandPOST /api/v3/events/{id}/stream/linkmint a playlist URL signed for that monitor's live stream or that event's recording, read-only, lasting 30 days by default (up to 365). Every URI the playlist lists then carries its own signature (?st=), valid for minutes on a live stream and renewed with each playlist refresh, so FFmpeg, VLC, Safari's native player and Home Assistant play it, and a segment URL caught in a log is soon useless. Nothing is stored: a link is checked against its user's current permissions and dies when the user is logged out everywhere, changes password or is disabled. See the Media URLs section of the authentication guide. -
The schema follows ZoneMinder to 1.39.41 (#152). Eight more upstream updates are mirrored as migrations, vendored into the raw chain for
migrator bridge, and the entities follow.FrameResponsegainsaudio_level, the peak audio level since the previous frame row (0-100, the scaleMonitors.AudioThresholduses; 0 means silence or no audio). Upgrading also does what upstream's updates do to data: Remote/rtsp monitors become Ffmpeg with the equivalent url, Libvlc monitors become Ffmpeg, NVSocket monitors become Ffmpeg with capturing off,onvifcontrols move toONVIF, the duplicated Pelco-D/Pelco-P controls are merged, and a Reolink HTTP control is added. -
Fresh databases start at ZoneMinder 1.39.1 and are upgraded by one portable migration per upstream
zm_update-1.39.x(docs/DB_VERSIONING_PLAN.md).migrator upon an empty MySQL/MariaDB or Postgres produces the 1.39.1 create script, then every upgrade upstream has shipped since (currently through 1.39.41), the wayzmupdate.pldoes for MySQL alone. Stored procedures in the upstream updates (zone-coordinate conversions) are Rust loops; MySQL-only trigger rewrites are skipped on Postgres and logged. Theschema-parityCI job now proves the mirrored migrations reproduce upstream's create script exactly; a newpostgres-schemajob proves the Postgres schema has every table and column MySQL has. Existing MySQL installs are unchanged:migrator bridgewalks the raw chain to the latest vendored version and records the migrations that version embodies (#48). -
Monitors.DeviceClass,AudioDetection,AudioThresholdandAudioAlarmScore(upstream 1.39.30/31) on the monitor create/update requests and response;Controlsgains its light and audio capability columns (#48). -
Reports.CreatedByis read and written (#29). The column has existed since 1.37 but was never modelled, so it was neither stored nor returned. Attribution comes from the authenticated token rather than the request body — letting a client name the creator is forging authorship. (description, the other half of that issue, is not possible: there is no such column.) -
Native replacements for three Perl maintenance daemons —
zmstats.pl,zmaudit.pl(database side) andzmtelemetry.pl— each independently switchable under[maintenance]and all off by default, so an existing install keeps running the Perl until the operator moves over. Only one of a pair may run: in takeover mode an enabled native job stops the supervisor starting its Perl counterpart; in passive mode disable the Perl daemon in ZoneMinder yourself.
Stats samples CPU and memory intoServer_Stats, evicts staleMonitor_Statusheartbeats, ages events out of theEvents_Hour/Day/Week/Monthwindows and resyncs the counters they feed, and prunesLogsandSessionsunder ZoneMinder's own retention settings.
Audit removesFrames/Statsrows whose event is gone, deletes events that never recorded a frame, closes events left open by a capture daemon that died, and recomputesEvent_SummariesandStorage.DiskSpacefrom the rows they summarise.
Telemetry posts the same anonymous report on the same schedule.
Three deliberate differences from the Perl, each because the original is wrong rather than because this is simpler: archived events are genuinely skipped when deleting frameless events (zmaudit tests a column it never selects, so its guard never fires);dry_runwrites nothing at all (zmaudit's--reportstill performs updates, log pruning and counter resyncs); and telemetry performs no geolocation lookup — zmtelemetry callsipinfo.ioon every collection, disclosing the server's public IP to a third party under the heading of anonymous statistics. Those fields are still sent, always"Unknown".
Retention limits and the telemetry interval are read from ZoneMinder'sConfigtable but parsed rather than interpolated: the Perl splicesZM_LOG_DATABASE_LIMITstraight into SQL andevalsZM_TELEMETRY_INTERVALas code, so aConfigrow is an injection surface in both.
The filesystem half reconciles event directories againstEventsrows, and is off even when the audit is on. It deliberately does not work the wayzmaudit.pldoes: zmaudit computes a directory fromStartDateTimeandrm -rfs the result, so a timezone difference, corrupted timestamp, changedSchemeor wrongStorageIdmakes it remove an unrelated directory with no error. Here nothing destructive acts on a computed path — directories are found by walking, identified from evidence inside them, and only an enumerated path is ever moved. A directory nothing identifies is reported and left alone.
Orphans are moved to a quarantine directory rather than deleted (an atomic rename within the storage, swept afterquarantine_retention_days); a pass refuses if the storage is missing or has no monitor directories, so an unmounted volume cannot orphan the whole database; an orphan must be seen in two consecutive passes before anything happens; and a derivation canary compares computed against actual paths for events found by both routes, disabling the filesystem half on sustained disagreement. That last one turns the timezone class of bug from silent data loss into an alarm. -
zm-api can serve the zm-web browser UI itself (
[web] enabled = true,APP_WEB__ENABLED). One process instead of a reverse proxy in front of two: the UI and the API share an origin by construction, so CORS stops applying, and TLS is already handled by[server.tls]/[server.acme]. Includes the SPA fallback so a refresh on/events/123works,immutablecaching for hashed assets withno-cacheonindex.html, and a configurable Content-Security-Policy applied to UI responses only.
API paths keep their JSON 404 envelope — the SPA fallback never shadows/api/,/swagger-ui,/api-docsor/.well-known/, so a mistyped endpoint still fails loudly instead of returning an HTML page with status 200.
Off by default; enabling it with noindex.htmlpresent logs a warning and serves the API anyway rather than refusing to start. -
Still images are rotated to match the monitor's
Orientation./events/{id}/thumbnailand/monitors/{id}/snapshotnow return an upright JPEG, as ZoneMinder's own image view does — previously aROTATE_90camera produced sideways thumbnails, and the failure was silent because nothing errored. Stills only: rotating live video would mean re-encoding, and a client can do it in CSS for free.ROTATE_0keeps the existing zero-copy path. -
Man pages:
zm-api(8),zm-api.env(5),zm-api-takeover(8),zm-api-db(8). -
zm-api --help,--version, and--openapi(writes the OpenAPI spec to stdout, so the API surface can be diffed or fed to a client generator without running a server). All three work before configuration is loaded, so they still answer on a host whose config is broken. -
The migration tool ships as
/usr/bin/zm-api-dbin all three packages. It was previously built but packaged nowhere, leaving no upgrade path for an existing ZoneMinder database. -
server.allowed_origins(APP_SERVER__ALLOWED_ORIGINS) as a documented,APP_-prefixed setting, accepting a TOML array or a comma-separated string. -
A documentation site (mdBook) published to GitHub Pages, covering install, configuration, deployment architecture, TLS, passive/takeover mode, and permissions — plus a browsable API reference rendered from the OpenAPI spec, which CI exports from the freshly built binary so it cannot drift from the code.
docs/is now the contributor-facing plan tree only. -
The OpenAPI spec is exported in CI and attached to each release, alongside a
SHA256SUMSfile covering every artifact. -
Release notes are taken from this file's entry for the tag, falling back to GitHub's generated commit list only when there isn't one.
-
scripts/check-version-consistency.sh, run in CI before any package is built, so a half-finished version bump fails fast. -
openapi.jsonis committed as a reviewed baseline, and CI fails a pull request whose spec change could break a deployed client — a removed endpoint, a replaced response shape, a response field no longer guaranteed, a dropped enum value, or a request that gained a required field. New endpoints and new optional fields pass with a notice. This is the guard that would have caught the/mechange above in the pull request that made it. -
GET /api/v3/statstakesevent_id,frame_idandzone_id(#141), so a client can fetch one frame's or one event's rows without paging the table.frame_idalone is a 400, because frame numbers restart in every event. -
The log page's remaining filters (#142).
GET /api/v3/logstakeslevelas a comma list of exact levels (-1,-5for warnings and audit rows),ids, andsort_byon any column.unfiltered_total=trueaddstotal_unfiltered, the whole table's row count; it is opt-in because it costs a secondCOUNT(*)on every poll.GET /api/v3/logs/componentslists the components in the table.DELETE /api/v3/logstakes the sameids, and an empty or unparseableidsis a 400 rather than "clear everything". -
GET /api/v3/events(#136):tag_id=nonekeeps untagged events andtag_id=anykeeps events with at least one tag (legacy's0and-1are accepted for the same),tag_op=not_ininverts the tag filter,sorttakesarchived,emailedanddisk_space, andtotals=trueaddstotal_length_secondsandtotal_disk_spacesummed over the whole result instead of the page. Sorting on tags and a free-textqare not included. -
Install tests that run the package against ZoneMinder master (
packaging/e2e/, thePackagingworkflow). The built package is installed on a container running systemd, beside a ZoneMinder from upstream's master repository that is recording from a synthetic RTSP camera, and walked through passive mode, takeover, revert, upgrade and removal, checking at each step that capture and recording carried on. Ubuntu 24.04 (amd64 and arm64) and Debian 13 run that flow; Fedora, openSUSE and Arch, which have no upstream master package, run the install, account, upgrade and removal checks. It runs on packaging pull requests, onmaster, and nightly, and theReleaseworkflow now holds back any package that fails it. -
zm-api-takeover --checkruns the pre-flight checks and changes nothing.--forcetakes over despite a failed check.
-
The retention reaper and the maintenance audit no longer act on another server's storage. On a multi-server install they ran against every
Storagerow. They could not see a per-server area's files, so the audit could take every event on it for one with no media and delete the rows, and the reaper measured the wrong disk. Both now skip a storage whoseServerIdis another server, and say so once in the log. The audit's empty-event sweep and the event audit report also leave those events alone. -
POST /eventsworks. It never setEvents.StateId, which is NOT NULL with no default, so every create failed with 500. It now records the active run state, or 0, as zmc does. -
PTZ commands reach zmcontrol.pl's socket where ZoneMinder puts it. The Perl bridge looked for
zmcontrol-{id}.sockin/run/zmwhateverZM_PATH_SOCKSsaid. ZoneMinder's RPM packages use/run/zoneminder, where it missed the socket and ran zmcontrol.pl for every command. -
Starting a daemon zm-api won't run is 400.
POST /daemons/{id}/startfor a command that isn't one of ZoneMinder's daemons answered 200 with"success": false. The daemon endpoints' 404 and 503 are now documented with the error body they send. -
The OpenAPI document describes every response. Each operation now has a
defaultresponse with the standard error body (AppResponseError), so clients get a schema for 401, 403, 404 and 500 wherever they occur. The motion synopsis endpoints (/events/{id}/synopsis,/layout,/mp4,/reviewand/events/synopsis) were served but missing from the document, and are now in it.GET /host/getVersionandPOST /server/control/{action}documented their errors asMessageResponse, andGET /daemonsits 503 with no body; they now sayAppResponseError, which is what they send.MonitorPresetResponse.max_fpswas documented as a number but has always been sent as a decimal string ("5.000"); the document now says string. Integration tests check every JSON response against the document (#237). -
HTTP/2 with Let's Encrypt (ACME). In ACME mode the TLS config came from rustls-acme's default, which advertises no ALPN protocol, so browsers spoke HTTP/1.1 and its six connections per host held back HLS grids. It now offers
h2andhttp/1.1, as certificate-file mode already did. -
localhostreaches MariaDB through its socket on openSUSE too. zm-api connects tolocalhostthrough the standard socket, as libmysqlclient does (#217), but its list lacked openSUSE's/run/mysql/mysql.sock, so it fell back to TCP. On a server withskip-name-resolvethezmuser@localhostgrant then refused it and zm-api didn't start. -
Event video byte ranges follow HTTP.
GET /events/{id}/videoand/stream/video.mp4answered a range past the end of the file with 400; it is now 416 withContent-Range: bytes */<size>, as players expect. A range whose last byte is past the end (bytes=0-99999999) now returns the rest of the file instead of 400 (RFC 9110 §14.1.2). -
Changing a monitor you can see but not edit is 403, not 404. A user with a View row on a monitor got 404 from
PATCH /monitors/{id}(and the other monitor writes) althoughGETshowed it. A monitor outside the caller's scope is still 404. -
A duplicate username is 409.
POST /userswith a username already in use returned 500DATABASE_ERROR; it now returns 409 Conflict. -
The stream socket reader identifies codecs by name. zmc's HELLO now carries FFmpeg's codec name (
hevc,aac, tag0x0B, ZoneMinder#5336). zm-api uses it ahead of the numericAVCodecID, which changes between FFmpeg versions, so H.265 and audio work when zmc and zm-api link different FFmpegs. A zmc that sends no name falls back to the id, then to the parameter sets (#212). -
A new monitor gets a full-frame zone. ZoneMinder's monitor editor adds an "All" zone to every monitor it creates, and
POST /api/v3/monitorsdid not, so a Modect monitor added through the API never alarmed. It now adds "All" in the same transaction. It covers the whole picture with the thresholds of ZoneMinder's "Default" zone preset, which are percentages of the zone, so they fit any resolution or orientation. (ZoneMinder's PHP editor still writes pixel counts into these columns, which zmc has read as percentages since 1.39.3, so its new zones can't alarm. That needs fixing upstream.) -
Zones turn with the monitor. Changing a monitor's
orientationnow moves its zones to match the turned or flipped picture, using the same clockwise turns as zmc. Before, zones stayed put and covered a different part of the scene. Percentage and pixel zones are both handled. -
A ZoneMinder schema older than this build no longer stops capture (#147). At startup zm-api compares ZoneMinder's schema version with the one it mirrors. When the schema is behind, zm-api logs it as an error, does not upgrade ZoneMinder's tables by itself, and doesn't take over the daemons, so capture is left alone. Until the schema is upgraded, every API call answers
503naming the fix (zm-api-db up, orbridgefor a database not on the migration system); the health check and version still answer. A schema that ZoneMinder's own packages have already brought forward counts as current.zm-api-db statusstarts with "DB behind binary" when that applies, and zm-api-db falls back to the databasezm.confnames when given no URL. -
Event time filters use the server's time zone (#173).
start_time/end_timeonGET /events(and the times onPOST /events, saved-search date terms and the audit report window) were turned into naive UTC and compared against ZoneMinder's local-time columns, so on any server not on UTC the window was off by the offset. They now convert to server-local time, the inverse of what responses already do. -
PTZ light and audio commands (#190), following the iris and power routes:
POST /ptz/monitors/{id}/light/{on|off}and/indicator-light/{on|off},GET /ptz/monitors/{id}/light(each lighton,offor null, from the control module's status reply),POST .../audio/play/{file}(checked against the control's sound range),/audio/stopand/audio/volume/{up|down}. Each answers 400 when the monitor's control can't do it, andPtzCapabilitiesgainslightandaudioso a client shows only what it can invoke. -
GET /api/v3/monitors/{id}/audio-level, the live audio level for the monitor editor's meter (#180):level(0-100) andalarmfrom zmc's shared memory, null while zmc isn't running, with the monitor'sthresholdanddetection. Each call asks zmc to keep measuring for ten more seconds even with audio detection off, as ZoneMinder's editor does. -
POST /api/v3/system/privacyrecords the answer to the privacy statement as ZoneMinder's privacy page does (#189):ZM_SHOW_PRIVACYoff,ZM_TELEMETRY_DATAfollowing the answer. System edit. -
Controls carry their light and audio capabilities (#177):
can_light,can_indicator_light,can_audio_play,min_audio_file,max_audio_fileandcan_audio_volume, on the response and on create and update. -
Zone presets carry their thresholds (#188): the fourteen threshold columns a preset applies, on the response and on create and update, named as on
ZoneResponse. -
componentonGETandDELETE /logstakes a comma list (#186), asleveldoes, for the log page's multi-select and for clearing by it. -
PATCH /storage/{id}takesdo_delete(#185), so the switch that stops ZoneMinder deleting media from an area can be changed after creation. -
Login accepts short passwords (#174).
POST /auth/loginrejected any password under 6 characters before checking it, so ZoneMinder users with short passwords, the defaultadmin/adminincluded, couldn't log in. Setting a password still enforces a minimum. -
EventResponsecarriesmax_score_frame_id(#176), the frame a client reports as the match (pyzm'ssnapshotframe resolves through it). -
Live and recorded HLS play in header-less players (#153). Playlists fetched with a URL credential listed bare URIs, so FFmpeg and Home Assistant got the playlist and then a 401 on the init segment and every segment. They now list signed URIs. A playlist fetched with
?token=<JWT>lists signatures rather than copying the access token into its URIs. -
Recorded-event playlists play in FFmpeg (#154). Segment URIs had no extension, which FFmpeg's HLS demuxer refuses; they are now
segment/N.m4s, and a bareNstill works. -
Start, stop and restart of ZoneMinder fall back to
zmpkg.pl(#157) whensystemctlfails, as ZoneMinder's own API does. The fallback waszmcontrol.pl, the PTZ script. -
The OpenAPI spec documents
PATCH /monitors/{id}/statewith its own body (#158),MonitorStateRequest({"state": "start|stop|restart"}). Two structs shared the nameUpdateStateRequest, and the run-state one won. -
Takeover no longer runs
zmaper monitor (#160). Analysis has run insidezmcsince 1.36, and on 1.39zma -e <event>re-analyses one event and exits, so the supervisor restarted it forever. -
Takeover knows
zm_rtsp_server(#161), and starts it whenZM_MIN_RTSP_PORTis set, aszmpkg.pldoes.zmdc.pl start zm_rtsp_serverfailed as an invalid daemon spec. -
PTZ capabilities no longer advertise gain, white balance or auto-scan (#146). No command exists for them (and no ZoneMinder control module implements them), so clients drew controls that did nothing. They read as unsupported until a command exists.
-
migrator bridgeleaves triggers alone on a database past its cutover (#162), where they are upstream's newer ones. -
The synopsis pipeline produces cutouts and plates (#128). For a synopsis monitor the generated zm-next pipeline put
review_exportstraight under capture, where it got compressed packets and produced nothing, passed it two keys its schema rejects, and placed nothing to make background plates. It now follows zm-next's synopsis layout:decode_ffmpeg(rgb24)→review_export, anddecode_ffmpeg(gray)→motion_pixel_diffwithplate_export, with the frame size taken from the monitor and the plate directory set when the pipeline is composed (stored graphs included). -
Monitor changes reach the capture daemons in passive mode (#155). Creating, editing and deleting a monitor, and
PATCH /monitors/{id}/state, now start, restart or stop itszmc(andzmcontrol.plwhen controllable) through ZoneMinder'szmdc.sock, as ZoneMinder's own API does. The state change answered 200 and did nothing, edits waited for something else to restartzmc, and a delete leftzmcrunning. An edit in takeover mode restarts the monitor's daemons too. -
The live alarm state, and Disable/Enable Alarms (#139).
GET /api/v3/monitor-status/{id}addsalarm_state(idle,prealarm,alarm,alert),alarms_disabledandanalysingfrom the monitor's shared memory while zmc runs, andPATCH /api/v3/monitors/{id}/alarmtakesdisable_alarmsandenable_alarms, ZoneMinder'szmu -nandzmu -c. -
Each storage reports its filesystem (#145):
StorageResponsegainsfilesystem(total_bytes,used_bytes,available_bytes,usage_percent) for the disk its path is on, asdfreports it, or null when the path can't be read from this server. It is the disk's own size, labelled as such, beside the event bytes; the capacity declared for retention (docs/STORAGE_PLAN.md) is separate. -
Encoder templates and menu items (#144).
/api/v3/encoder-templatesand/api/v3/menu-itemsare CRUD over ZoneMinder 1.39'sEncoderTemplatesandMenu_Items(System-gated), andGET /api/v3/system/menureturns the enabled menu items in order for any logged-in user, so a client can render the navbar the operator configured instead of a hard-coded one. -
ZoneMinder 1.39 roles (#143).
GET/POST /api/v3/rolesandGET/PUT/DELETE /api/v3/roles/{id}manageUser_Roles, and users gainrole_id. A user's permissions are now, per feature, the higher of their own level and their role's, as ZoneMinder computes them, at login, on refresh and for signed media links; and the role's per-monitor and per-group grants feed the monitor ACL beneath the user's own. A user whose access came from a role was gated on their own levels alone. -
GET /api/v3/reports/event-audit, legacy's Audit Events Report (#36): per monitor, the events overlapping a window, their span, the smallest and largest gap between one event's end and the next one's start (negative where they overlap), and the events whose video is missing or empty on disk. Defaults to the hour ending an hour ago, as legacy does; at most 10000 events per report. -
GET /events/counts/{hours}?monitor_id=gives one monitor's hourly event counts, for the console's per-monitor sparkline (#36), instead of paging up to a thousand events per monitor to bucket them. -
GET /events/{id}carries the event's directory aspath(#140), resolved from its storage and scheme the way ZoneMinder's event page shows it, so a client need not reimplement the Deep/Medium/Shallow layout. -
GET /events?q=searches the way legacy's events search box does (#136): a substring match over id, monitor, storage, name, cause, start and end time, length, frame counts, scores, archived, emailed, notes and disk space, any of which may match. -
A monitor can be created with only the fields that matter (#159).
CreateMonitorRequestrequired 84 of its fields with no server-side defaults; now onlynameandtypeare required, and an omitted field takes ZoneMinder's column default (PreEventCount10,SaveJPEGs3, and so on), so a monitor created through v3 starts out the way one created in ZoneMinder does. Columns the response already returned but no request could set are now settable on create and update:go2rtc_enabled,wall_clock_timestamps,default_player,encoder_hw_accel_name,encoder_hw_accel_device,stream_channel,what_display, and on create the object-detection fields. -
Daemon and system status work in passive mode (#156).
/api/v3/daemons*and/api/v3/system/statusanswered 503; they now read whatzmdc.plsupervises from itszmdc.sock, with this host's load, memory and disk, and the per-daemon start/stop/restart/reload endpoints send their command to it. -
Alarm control through shared memory works on ZoneMinder 1.39 (#148, PR #149 by Nic Boet).
SharedDatagrew to 888 bytes on master and zm-api assumed 872, soPATCH /monitors/{id}/alarmwroteTriggerData16 bytes early: no alarm, and the cause text landed onTriggerData.size, which made zmwatch restart the capture daemon. The offset now comes from thesizefield zmc writes, and a layout zm-api does not recognise is refused instead of written at a guessed offset. -
migrator bridgeno longer stamps an older ZoneMinder version over a newer database (#150, PR #151 by Nic Boet). On a database past the mirrored chain it wroteZM_DYN_DB_VERSIONandZM_DYN_CURR_VERSIONback to the cutover version, so ZoneMinder re-ran its newer updates andgetVersionreported the wrong schema. The rows are only ever raised. -
GET /monitorsandGET /monitors/{id}work on ZoneMinder 1.39.37 and later. Upstream droppedMonitors.RTSPDescribe(the install tests against master caught it as a 500:Unknown column 'Monitors.RTSPDescribe'). The column is gone from the entity;rtsp_describestays in the request and response bodies, ignored on the way in and alwaysnullon the way out, so existing clients keep working. Reported by zm-holodeck's review as well. -
The Arch package depends on
ffmpeg. The binary links the FFmpeg libraries, and pacman has no automatic shared-library dependencies, so on a host without FFmpeg the service failed to start with "libavutil.so.61: cannot open shared object file". -
The RPM builds on EL9. The debugsource subpackage was always empty for a Rust binary, which rpm on Rocky 9 treats as a build error; it is no longer generated.
-
The package now runs zm-api as ZoneMinder's own account, and the previous fixed
zoneminderaccount is gone from the unit. ZoneMinder's daemons run as the web server's user (www-data,apache,wwwrun,http, by distribution), and upstream's packages close its files to everyone else. Aszoneminder, zm-api could not read/etc/zm/zm.confon Debian or Ubuntu (mode 0640, owned bywww-data), so a fresh install beside upstream's package crash-looped on "Access denied for user 'username'", and after takeoverzmccould not have written the events tree. The post-install script now readsZM_WEB_USERandZM_WEB_GROUPfromzm.confand writes them to/etc/systemd/system/zm-api.service.d/10-account.conf; a host with no ZoneMinder still gets a dedicatedzoneminderaccount. No existing account is modified. On upgrade the service account changes. State and logs follow automatically; recordings made in takeover mode under the old account need thechown --from=the upgrade prints. -
zm-api exits on SIGTERM. A clean shutdown returned
Okinto a join that only ever returned on an error, so the process sat idle until systemd killed it atTimeoutStopSec. Every stop and restart took 50 seconds and ended in SIGKILL, which in takeover mode was a 50 second capture gap on each upgrade. -
The unit starts on distributions without an
ssl-certgroup. The shippedSupplementaryGroups=video ssl-certnamed a Debian-only group, and systemd refuses to start a unit that lists a missing one, so the RPM and Arch packages could not start. Extra groups are now written per host, and only those that exist.WorkingDirectoryno longer fails the start on a host without ZoneMinder's share directory. -
A ZoneMinder schema newer than the mirrored chain no longer blocks zm-api's own tables. First start against upstream master (1.39.35 against the mirrored 1.39.33) failed its migration step with "vendor the newer upstream updates first" and left
monitor_pipelineand friends uncreated. Such a schema embodies every mirrored migration, so they are stamped and zm-api's own migrations run, with a warning that newer upstream columns are not yet available through the API. -
Socket and binary paths follow
zm.conf.daemon.socket_path,streaming.zoneminder.socks_pathanddaemon.bin_pathleft at their defaults now takeZM_PATH_SOCKSandZM_PATH_BIN. The Red Hat family keeps ZoneMinder's sockets in/var/lib/zoneminder/sock, not the/run/zmthe package assumed. The shippedzm-api.envno longer sets either. -
zm-api-takeoverchecks before and after the switch. It refuses to take over when zm-api is not up in passive mode, runs as a different account from ZoneMinder, or cannot write the events and socket directories. After the switch, if zm-api does not stay up, orzmcwas capturing and has not been started again, it undoes the switch, restartszoneminder.serviceand exits 3. Previously a failed takeover left the host recording nothing. -
Removing the package in takeover mode hands control back to ZoneMinder before stopping the service. It used to leave
zoneminder.servicedisabled with no supervisor running. -
A package upgrade restarts the service. The Debian postinst only ran
systemctl start, so the old binary kept running until the next reboot. -
Purging the
.deb, or removing the.rpmor Arch package, removes the account drop-in. -
Over-long request fields are a 400 naming the field, not a 500 (#55). About forty request structs had no length rule for columns that are
varchar(N)ortinytext, so anything past the width reached MySQL and came back as a truncation error. Every bounded field on those structs now carries the column's cap, the handlers that never calledvalidate()do, and the caps count characters forvarchar(a 64-character non-ASCII name is legal) and bytes fortinytext(which is 255 bytes). The monitor requests' 26#[garde(skip)]fields are bounded the same way. The 1406→400 safety net stays for columns nobody has enumerated. -
The watchdog judges
zmcby its capture heartbeat, not CPU time (#123).zmwatch.plreads the heartbeat in the monitor's shared memory; the CPU heuristic could not see a capture loop that was alive and spinning but no longer capturing. The health loop now reads the heartbeat (fromZM_PATH_MAP) for each runningzmcpast its startup grace, and falls back to CPU time only when there is no segment to read — an unreadable segment is not treated as hung, so a wrong path cannot restart every camera each tick. -
The audit no longer closes or deletes a video-only event that zmc is still writing (#124). Frame freshness (#96) is blind to an event that has no
Framesrows at all, so such an event was deleted as empty, or closed as unclosed, aftermin_age_seconds. Both sweeps now also require evidence the daemon is done with it: a newer event on the same monitor, no liveMonitor_Statusrow, or an age past the monitor'sSectionLengthplus the grace period. -
The hung-daemon watchdog could never fire (#73).
check_activitystamped a timestamp on every sample andappears_hungthen asked whether that stamp was older thanwatch_max_delay_seconds— microseconds later it never was. Azmcblocked on a stalled RTSP read stayed dead until an operator noticed, while the docs saidzmwatch.plwas replaced. The stamp now moves only when CPU time advances, so its age is the stall. -
A second
startupon a running supervisor SIGKILLed every daemon (#74). Thepkill -9orphan sweep ran insidestart_all_daemons, which the legacy socketstartup/pkg_startcommands andPOST /system/startupalso call. Because the entries still read Running nothing respawned them until the health tick and first backoff — a 10–20s capture gap on every monitor. The sweep now runs once per manager. It also usespkill -x: the unanchored default matchedzmaudit.plfor "zma" andzmcontrol.plfor "zmc". -
A daemon stopped and started again was never crash-supervised (#78).
stop_daemonclearsauto_restartso the health loop does not resurrect a deliberate stop, but nothing re-armed it on the next spawn (monitor restart, reconcile). Supervision is re-armed on every spawn. -
zm-api.servicedeleted ZoneMinder's/run/zmon every stop/restart (#82). It was declared as the unit'sRuntimeDirectory, so systemd chowned it on start and removed it on stop — in passive mode, from under a runningzmdc.pland everyzmcstream socket. The unit now only creates the directory when it is missing and never touches an existing one. -
Takeover started the Perl maintenance daemon alongside its native replacement (#87).
base.tomlsaid to enable the Rust job and disable the Perl daemon together, but nothing in zm-api did the second half: the singleton gates read only ZoneMinder'sConfig/Serversrows. With[maintenance.stats]on,zmstats.plstill ran and both wrote the same rows. Each enabled native job now suppresses its Perl counterpart's automatic start (an explicitstartover the socket or REST is still honoured). -
The daemon manager never knew which server it was (#75) and the stats job read
ZM_SERVER_IDfrom an environment variable nothing sets (#100). On a multi-server install every host started every monitor'szmc, the per-serverServers.zm*gates were dead, andServer_Statsrows landed underServerId = 0. The id is now resolved the way ZoneMinder's own daemons do it —ZM_SERVER_IDfromzm.conf, elseZM_SERVER_HOSTagainstServers, else the machine hostname — and shared by both. -
Three documented
[daemon]keys were never read (#88).enable_watchdognow gates the hung-process check (exit detection and crash restarts are never optional),stats_update_interval_secondsdrives theServersstatus loop instead of a hard-coded 60s, andenable_rest_api = falseleaves the daemon/system routes unregistered. -
The retention reaper could empty a storage in one pass (#105). With
Events.DiskSpaceNULL — the normal state of a freshly recorded event until something backfills it — each deletion credited zero bytes, the free-space model never moved, and the loop ran to the end of the table. NULL sizes are now measured on disk, free space is re-read from the filesystem every 25 deletions, and a newmax_deletes_per_pass(default 500,0= unlimited) bounds one pass. Alongside it: an unmounted storage (missing or empty directory) is skipped rather than reaped against the parent filesystem's free space, and the first pass waits 60s after start (#104); a failed media removal stops the pass instead of deleting row after row while the disk stays full (#106); an event archived after the candidate list was taken is left alone (#109); and event deletion now removes the event'sStatsrows, which have no foreign key and were left behind (#110). -
Audit and stats SQL — a batch from the same review. The
Storage.DiskSpaceresync never ran: its SELECT could not decode the unsignedIdand the DECIMALSUMinto signed Rust integers, and the error was swallowed (#90); the columns are cast and a failed job is now part of the audit report, so a test asserting a clean pass fails (#101 for the stats job likewise). Every "older than N" comparison used a session forced to UTC against columns ZoneMinder writes in local time (#98); the connection now setstime_zone = SYSTEM. The window-counter and total-counter resyncs took locking reads inside an UPDATE in the reverse order of ZoneMinder's Events triggers (#99); they read with a plain SELECT and write by primary key. The orphan-frame sweep full-scannedFramesunder next-key locks (#94); it selects the orphan ids first and deletes by index in batches.max_deletes_per_passcapped which rows were looked at rather than deleted (#91). TwoStoragerows on one path confirmed an orphan in a single pass (#93).min_age_secondsnever applied to directory quarantine (#95).close_unclosed_eventsclosed live events still receiving frames (#96). A Deep-scheme day directory holding one.{id}symlink was recorded as the event itself (#92); the link is followed to the leaf. A storage whose mount dropped, then got a fresh monitor directory from zmc, passed the preconditions and had every older row deleted as "no media" (#89); a pass now refuses when more rows are missing than events were found. ONVIF event-listener rows, which never have frames, were deleted as empty (#97). -
Supervisor lifecycle — reconcile only diffed the database against the process map in one direction, so a deleted monitor's daemons ran on, and a hard-deleted one crash-looped forever (#76).
restart_monitorslept 500ms and spawned over a process still shutting down, orphaning it (#77); starts are refused over aStoppingentry and restarts wait for the exit. A daemon restart latched the process-wide shutdown flag, so the ONVIF event listeners exited and never came back (#79); they now watch a separate process-exit flag. Background loops that missed the shutdown wake-up mid-tick ran on beside their replacements (#80); every startup retires the previous generation. Stop/kill on a crashed entry signalled a dead, possibly reused pid (#81). Two Local monitors on one device had their sharedzmc -dstopped and restarted every tick (#113). A database still coming up at boot left the singleton daemons unstarted for the life of the process (#114); it retries. Reconcile respawned a crash-looping daemon every 60s, capping the documented backoff (#115). The HTTP drain ran unbounded and before the daemon SIGTERM wave, so systemd could SIGKILL zmc mid-stop (#116); both run concurrently and bounded, andTimeoutStopSecleaves margin.POST /system/statereturned a bare 500 after committing when the restart failed (#117). -
zmdc.sock compatibility —
status/checkignored the daemon and never emitted zmdc.pl's per-daemon lines or words, which the web console string-matches (#83). Daemons were keyed by name alone, sozmdc.pl stop zmc -m 1missed the trackedzmc -m 1andstartspawned a duplicate (#84); one canonical"<command> <args>"key everywhere. The socket was 0660 in the service user's own group, so ZoneMinder's web user could not connect (#85); it is chgrp'd toZM_WEB_GROUP(ordaemon.socket_group) and the install script adds the service account to that group.logrotsent SIGHUP — reload, which drops zmc's camera — to every daemon, so nightly logrotate interrupted capture (#86); it sends SIGWINCH like zmdc.pl. The orphan sweep missed four Perl daemons andzm-core, and never checked for a live zmdc.pl before pkilling (#118); the list is derived from the spawn table, anchored on the full command line, and takeover refuses while something answers on the socket. Command reads had no size or time bound (#119). -
Smaller ones — telemetry kept the query string, so
?user=&password=camera credentials were sent (#102); it ignoredZM_TELEMETRY_DATAand silently minted a fresh uuid every pass on a database without the Config row (#103). Deep-scheme deletion removed a timestamp-derived directory with no check it held the event, and unlinked the.{id}marker from the wrong directory (#107); it follows the marker and refuses a directory naming another event.Storage.DoDeletewas never read (#108). The byte quota counted only deletable events (#110). The retention guide's grep matched nothing and the promised per-deletion reason was never logged (#112). The ONVIF listener's reconnect backoff never reset, its renew cancelled an in-flight pull whose response the device had already dequeued, and listeners were spawned for deleted monitors (#120).POST /monitors/{id}/zmnextreturned 200 with zm-next disabled (#121). Non-DB unit tests now cover the reaper's free-space loop, NULLDiskSpace, age cutoff, quota and cap (#111). -
The rate limiter made the API unusable for any browser client (#70). A burst of
0with the limiter enabled was clamped silently to1, so one request succeeded and everything after it returned 429 — no page in any single-page app could load, and nothing said why. A burst that small is never intentional, so it is now treated as the misconfiguration it is: the server substitutes a usable value and logs an error naming the setting.
The setting is renamedrate_limit_period_secs, becauserate_limit_per_secondread as a rate while meaning a period — setting it to4expecting four requests a second gave one request every four seconds. The old name is still accepted, so existing configuration keeps working.
The production defaults are retuned from one token per 25 seconds with a burst of 50 to one per second with a burst of 120. The old values let the first screen through and then throttled everything after it to one request every 25 seconds. Credential brute-forcing is handled separately and far more tightly by the auth limiter, which is why the global one can afford to be generous. -
Six duplicate
operationIds (#32) — the five AI-model routes collided with the camera-model routes, and two unrelatedupdate_statehandlers with each other. A generator silently emits one method and drops the other. -
Four routes that enforce authentication did not say so in the spec (#32):
/daemons,/daemons/{id},/system/statusand the WebRTC signalling socket. A generated client reads a missingsecuritykey as "no token needed". -
NaiveDateTimeWrapperclaimedformat: date-time(#32) while emitting2025-04-24T12:34:56, which has no offset and is therefore not RFC 3339. Generators built an offset-aware parser that rejected every value the API sends. It is now described as what it is — local wall-clock time as ZoneMinder stores it. -
Zone
Areawas never computed (#43). Every zone created through the API hadArea = 0hardcoded, and changing a zone's coordinates never recomputed it. That is not cosmetic: when a zone's units arePercent, the alarm thresholds are stored relative toArea, so those zones had thresholds that silently did not mean what they said. Area is now derived fromCoordson both create and update, matching ZoneMinder's owngetPolyArea(plain shoelace — upstream keeps an inclusive-pixel variant but no longer calls it). Coordinates that do not describe a polygon are rejected with a 400 rather than stored with a zero. -
SaveJPEGsrejected its own default (#39). It is a two-bit mask whose column default is 3, but the bound was-1..=1, so the API refused the value ZoneMinder ships with — the same class of bug as #19. The two neighbouring fields had the same copy-pasted bound and were also wrong:VideoWriteris 0–2 (disabled / encode / camera passthrough) andRecordAudiois 0–1. All three confirmed against the upstream monitor form rather than inferred. -
Storage created through the API could never be reclaimed (#44).
DoDeletewas hardcoded to 0 while the column defaults to 1, so neither the retention reaper norDELETE /events/{id}could remove media from a storage the API created — the disk fills and nothing says why. Now defaults to 1, matching the column, and is settable on create. -
Over-long values return 400 instead of 500 (#55). Roughly forty request fields write to fixed-width columns with no length rule of their own, and each turned an over-long value into
DATABASE_ERRORwith no indication of what was wrong. A "data too long" error is now mapped toVALUE_TOO_LONG/ 400 naming the offending column. Only the column name is surfaced — the driver's message can carry the rejected value and surrounding SQL, and that redaction is tested. Per-DTO rules remain better where they exist, since they reject before the round trip; this is the net under everything else. -
Bridged installs kept a legacy collation (#40), failing upgrade-parity on every pull request since #14. The bridge normalised
EncoderTemplatestoutf8mb4_unicode_ci, which is the value the legacy chain creates it with — converting toward the old collation guaranteed the mismatch against a fresh baseline instead of removing it. It now converges on the database's own default, and any other table that drifts is logged by name.
-
Generate Video can't replace the event's recording, and the queue has a limit. A video's file name comes from the event's name, so renaming an event to match its recording (
{id}-video) and asking for a video withoverwritereplaced the recording with the render.POST /api/v3/events/{id}/videosnow refuses (409) a video whose file would be the recording, and a queued job that would land on it fails instead. Each user can have 4 videos queued or running (409 after that), andsizecan be at most 4 times the event's width and height, the same limit asscale. -
RTSP connections must present a working link within 15 seconds. A connection holds one of the RTSP server's slots from the moment it opens, and
OPTIONSneeds no link, so a client that kept sendingOPTIONScould hold every slot without ever authenticating and lock out every player. A connection that hasn't presented a working link 15 seconds after it opens is now closed. -
PTZ can't be pointed at the server itself. A monitor's
control_addressis set by anyone with Monitors Edit, and PTZ commands make zm-api send requests there. It took any address, followed redirects, and returned up to 512 bytes of whatever answered in the error, so the address could be used to read local services. A control address that reaches this server (loopback, its own addresses) or a cloud metadata address is now refused with 400, host names included, whether the control is native ONVIF or a zmcontrol module. The ONVIF client no longer follows redirects or uses proxy settings, and transport and parse errors say only that the camera didn't answer, or didn't answer as ONVIF. -
A role's group grants now limit the groups API, and moving a group needs Edit on both parents. The groups API read only the user's own
Groups_Permissions, so a user whose role was limited to some groups, with no rows of their own, could see and edit every group. Monitor access already applied the role's group grants to each group's subgroups, so moving a hidden group under a group the role grants made its monitors visible. Now the role's rows count, with the user's own row deciding first, as for monitors. Moving a group withPUT /api/v3/groups/{id}needs Edit on the old and the new parent, and creating one under a parent needs Edit on that parent. -
Onboarding a discovered camera needs Monitors Create.
POST /api/v3/discovery/onboardadds a monitor, but it only needed Monitors Edit and unrestricted monitor access, so a user ZoneMinder doesn't allow to add monitors could add them this way. It now needs Monitors Create or System Edit, asPOST /api/v3/monitorsdoes. -
linked_monitorscan only name monitors you can see. A user who could edit one monitor could link it to any other, including monitors they're denied, and so record events off a hidden camera's alarms.POSTandPATCH /api/v3/monitorsnow refuse (400) a link to a monitor the caller can't see, with the same message as for one that doesn't exist. The value must also be an expression zmc reads: monitor ids, orid:zone, joined by|,&,,and parentheses. ZoneMinder's zmc stops on a piece that isn't a number. -
Only a monitor's editors can stop its live stream.
DELETE /api/v3/live/{monitor_id}/stopends the session for every viewer, but Stream View was enough to call it, so any viewer could keep cutting off everyone else. It now needs Monitors Edit on that monitor (403 otherwise). Viewers don't need it: closing the player is enough, and idle sessions are reaped. -
A huge
hoursno longer crashes the request.GET /api/v3/events/counts/{hours}and/events/counts-by-monitor/{hours}did date arithmetic on the value unchecked, so any signed-in user could send a number like9223372036854775807and panic the request, which a proxy reports as 502. Both now answer 400 unlesshoursis from 1 to 87600 (ten years). Zero and negative values, which used to return nothing, get 400 too. -
Live WebRTC sessions over the WebSocket are rechecked, capped and timed out. A token or signed link opened
/api/v3/live/{id}/webrtc/wsonce and the session then ran until the client left. Now:- The viewer's access is checked every minute, as WHEP does. A disabled or revoked user, or one who lost Stream or the monitor, is cut off.
- WebSocket and WHEP sessions share one
streaming.webrtc.max_connectionscap, taken in a single atomic step. Before, WHEP checked a count, so sessions starting together could pass the limit, and the WebSocket had no cap at all. - A client that doesn't answer the offer within 30 seconds is closed. The timer used to start only once it answered.
-
Rate limits can't be dodged with a forged
X-Forwarded-For. Withtrust_proxy_headerson, whichprod.tomlsets, the limiters took the leftmostX-Forwarded-Foraddress from any connection. A client reaching zm-api directly could send a new address with each request and get a fresh login allowance every time. Even behind a proxy the leftmost address is the one the client wrote. Now the headers are believed only on connections fromserver.middleware.trusted_proxies(new; loopback by default, for Apache on the same host). The client is the rightmost address that isn't a trusted proxy. A proxy on another host needs adding totrusted_proxies. -
Event playback no longer keeps every played event in memory. HLS playback of a recorded event (
/events/{id}/stream/...) packaged the video into memory and kept it there for the life of the process. Playing events one after another grew memory without limit. The cache now holds at most 256 MiB, drops the least recently played event first and any event not played for 10 minutes, and doesn't keep an event bigger than that. It also notices when an event's video file changes (a recording still being written, or a regenerated video) and packages it again instead of serving the old one. -
Tags only show events the caller can see.
GET /api/v3/tags/{id}listed every event with the tag, including ones on monitors the caller is denied, andGET /api/v3/tagscounted them inevent_count. Both now use the caller's visible monitors, as/eventsdoes.page=0on a tag is page 1, where it used to overflow. -
ONVIF inspect can't reach the server itself.
POST /api/v3/discovery/inspectaccepted loopback addresses, so a Monitors Edit user could probe the server's own ports and read back what answered. It now refuses loopback, the unspecified address, the server's own interface addresses and the cloud metadata addresses (169.254.169.254, fd00:ec2::254). It no longer follows redirects, and says only that a device didn't answer as ONVIF instead of passing on transport or parse errors. Cameras on private and link-local addresses work as before. -
Camera passwords inside monitor URLs are hidden from viewers.
passandonvif_passwordwere already left out of monitor responses, but a password inpath,second_path,control_addressoronvif_url(rtsp://user:pass@host,user:pass@host, or apwd=query parameter) went to anyone with Monitors View.GET /api/v3/monitorsand/monitors/{id}now show it as***unless the caller can edit that monitor. Editors still see the URLs as stored, because they edit them. -
Filters with automatic actions need Edit on every monitor.
zmfilter.plruns a saved filter over every monitor's events, whoever owns it. A user limited to some monitors could save a filter with AutoDelete, AutoEmail or another automatic action, and it would delete or send events from monitors they can't see.POSTandPUT /api/v3/filtersnow refuse such a filter (403) unless the caller has Edit on every monitor or System Edit. Restricted users can still save filters without actions, and can turn the actions off on a filter they own. Filters already in the database are unchanged. -
/api/v3/sessionsis removed. It gave read and write access to ZoneMinder's PHP web sessions to anyone with System access. A System View user could read another user's session id, which is the classic UI's login cookie, and the session data, which holds that user's row with its password hash. With the admin's session id they could use the classic UI as admin. A System Edit user could create or change session rows, and so forge a web login as anyone. zm-api logs in with JWTs and never uses these sessions, so the routes (GET/POST /sessions,GET/PATCH/DELETE /sessions/{id}) are gone rather than restricted. The maintenance service still prunes expired rows for installs that run the PHP UI. -
Event videos no longer run the ffmpeg program. Media jobs ran the binary named by
ZM_PATH_FFMPEGwithZM_FFMPEG_INPUT_OPTIONSandZM_FFMPEG_OUTPUT_OPTIONSas arguments, so anyone who could write the Config table chose the program and its arguments. Videos are now decoded, filtered, encoded and muxed in-process with libav.ZM_PATH_FFMPEGis ignored. The option strings are parsed into an allowlist of encoder and muxer settings (-r,-c:v,-pix_fmt,-preset,-tune,-profile:v,-level,-crf,-qp,-b:v,-maxrate,-minrate,-bufsize,-g,-bf,-threads,-movflags). Anything else is dropped and logged, andPUT /api/v3/configs/{name}refuses it. A recording is opened only ifDefaultVideois a plain file name, and only as a local file in a recording container, so it can't name a URL, a playlist or another file. -
Stored values can't change the commands ZoneMinder runs. Anything that becomes part of a command now needs
System: Editor is checked first:- Filters with
AutoExecuteor a command, and monitorEventStartCommand/EventEndCommand, needSystem: Edit, as in ZoneMinder. Other users can't edit a filter that already runs a command. - Monitor
Path/SecondPathmust use a known capture scheme or be a local path (go2rtc runsexec:sources).Devicemust be under/dev/.Storage.Pathis limited to characters a shell treats literally. ControlsProtocolmust be a bare Perl module name. - zm-api won't start zmc, zma, zmtrack, zmcontrol, zmfilter or zmaudit
while the rows they read hold such values, including rows written
outside zm-api. It also refuses zmfilter when the installed version
doesn't escape filter tags and an
AutoExecutecommand uses text tags. Unsafe stored values are logged at startup and every hour.
- Filters with
-
Monitor access follows ZoneMinder's rules. A user's monitors are decided as ZoneMinder's
visibleMonitorandeditableMonitordecide them: their own per-monitor grant, then their groups (aNonegroup denies), then their role's monitors and groups, then theirMonitorslevel. A group grant now covers its child groups. A user with no grant rows got every monitor before; they now get what theirMonitorslevel allows, soMonitors: Nonesees none. The grants are read in one query. -
Adding a monitor needs
Monitors: Create(orSystem: Edit), as in ZoneMinder.Editchanges existing monitors only. -
Live streaming needs
Viewon the monitor, notEdit, for every method, since ZoneMinder treats watching as a read. -
/live/sessionsand/live/sourceslist only the caller's monitors. -
Group membership changes need
Editon the group, and reads list only groups the caller can see. -
Moving a stat to another monitor needs
Editon that monitor. -
Admin changes to a user's access, and deleting a user, revoke their tokens at once.
-
Private config values are hidden below System Edit (#184).
GET /api/v3/configsandGET /api/v3/configs/{name}returnedPrivateoptions in clear to anyone with System View,ZM_AUTH_HASH_SECRETincluded, which is enough to sign an admin token (ZoneMinder fixed the same in 1.39.41, GHSA-7g3f-93q8-fhwj). Theirvalueis now empty unless the caller can edit System. -
Media responses to URL-credentialed requests are no longer cacheable by shared caches (
Cache-Control: private) and sendReferrer-Policy: no-referrer, so a proxy can't replay a segment fetched with a signature and the URL doesn't leak throughReferer. -
Dependency bumps for RUSTSEC-2026-0338 to 0342 (
quinn-proto0.11.19), RUSTSEC-2026-0346 to 0349 (rustls0.23.46), andasync-trait0.1.92, whose generated code tripped clippy'sdouble_must_useon current stable. Thezip3 advisories (RUSTSEC-2026-0367 to 0369) are ignored with a justification indeny.toml: zip is a build-time dependency ofutoipa-swagger-ui9 that unpacks the bundled Swagger UI, not runtime code, and no release of that crate depends on zip 9 yet. Clearing them needs the utoipa 6 migration (#164).
-
The unused "native WebRTC" engine and session manager (
src/streaming/webrtc/).AppStatebuilt them at startup, but no handler used them; live WebRTC has always gone throughsrc/streaming/live/webrtc.rs. -
frame_skipfrom the monitor create/update requests and response: upstream droppedMonitors.FrameSkipin 1.39.24.motion_frame_skipremains.User_Preferences.Nameis required on create (NOT NULL and unique per user since 1.39.19) (#48). -
Config blocks nothing implemented (#53).
[streaming.rtsp_proxy]declared a port and an RTP range that nothing bound, and[streaming.go2rtc]a base URL that nothing called — an operator could configure either, restart, and get no behaviour change and no warning. Both are gone, along with an unused request DTO.Monitors.Go2RTCEnabledstays: that is ZoneMinder's own column and the response passes it through. Removing them is upgrade-safe — no config struct denies unknown fields, so a stale block in an existing file is ignored rather than refusing to start, and there is a test for that. -
Enums emitted Rust variant names instead of the values ZoneMinder stores.
#[sea_orm(string_value = …)]governs only the database mapping, so serde fell back to the variant name:/monitorsreportedRotate90where the column holdsROTATE_90, andCurlwhere it holdscURL. Nine enums were affected —Orientation,MonitorType,DefaultCodec,EventCloseMode,Rtsp2WebType,Decoding,OutputContainer,StorageType,SynopsisStatus. It was self-consistent, and therefore invisible: requests accepted the same wrong spelling responses emitted, so a client that only ever talked to this API round-tripped fine while anything that knows ZoneMinder's real values silently mismatched.
Responses and the OpenAPI schema now carry the DB values. The previous spelling is still accepted on input via a serde alias, so clients keep working while they migrate. A test walksActiveEnum::values()for every affected enum, so a newly generated one is covered without anyone remembering. -
A configured TURN server had no effect.
AppStatebuilt the WebRTC engine from defaults rather than the loaded[streaming.webrtc]config, sostun_serversandturnwere parsed, validated, and discarded — viewers behind symmetric NAT could not connect, with nothing in the log to explain it. -
CORS was undiscoverable. The allowed-origin list came from a bare, un-prefixed
ALLOWED_ORIGINSvariable that appeared in no config file and no documentation, defaulting to localhost. A dashboard on any other origin was silently blocked with no string in the repo to grep for. The variable is still honoured (with a deprecation warning) so existing deployments keep working; the effective list and its source are now logged at startup. -
APP_DAEMON__SCRIPT_PATHshipped a value wrong for Debian and Ubuntu. One env file serves all three package formats, and no single value suits every distribution, so daemon paths are now resolved by searching the standard locations, with the setting as an override. -
Requires=mariadb.servicefailed the unit on hosts usingmysql.serviceor a remote database. The unit is still orderedAfter=both, andRestart=on-failurecovers a slow database. -
A stream socket the service user cannot open now reports that
ZM_STREAM_SOCKET_GROUPmembership is missing, rather than a bare "permission denied" naming nothing actionable. -
docs/tls.mdclaimed the systemd unit usesDynamicUser; it runs asUser=zoneminder.
-
Requests use about a third less CPU. Measured across 19 read endpoints: 1.56x less CPU per request and 1.75x lower median latency. Per-request INFO logs and
#[instrument]spans are now DEBUG (the bunyan layer wrote a START and END line for every span). Log output to stdout no longer blocks the request. A verified access token is cached until it expires, so its RSA signature is checked once rather than two or three times per request; revocation is still checked on every request. Pooled connections are pinged only after 30 s idle, not before every query. -
Dependencies brought up to current releases. Every semver-compatible update was taken, and these crossed a major line: sea-orm and sea-orm-migration 1.1 → 2.0 with sqlx 0.8 → 0.9 (raw statements go through the
*_rawconnection methods,Value::Stringis unboxed,ExprTraitis imported where expressions are built), utoipa 5 → 6 with utoipa-swagger-ui 9 → 10 (no code changes;openapi.jsonregenerated), quick-xml 0.41 → 0.42 (string-based events in the ONVIF parsers), rand 0.9 → 0.10, argon2 0.5 → 0.6 (same PHC hashes), sha1/sha2 0.11, chacha20poly1305 0.11, jsonwebtoken 11, base64 0.23, tower-http 0.7, garde 0.23, sentry 0.49, jemalloc 0.7, itertools 0.15, tokio-tungstenite 0.30 and axum-test 21. The unused mockall and rstest dev-dependencies and the unused direct rand_core dependency are gone. -
webrtc 0.17 → 0.21 (#165). 0.20 rebuilt the crate as an async layer over a Sans-I/O core (
rtc), so the live WebRTC session was rewritten against it: peer connections come fromPeerConnectionBuilder, events arrive through onePeerConnectionEventHandlerinstead of per-event closures, and each track writes samples with its own SSRC and the payload type the browser's answer negotiated. Host candidates now come from one UDP socket per interface, IPv4 always and IPv6 when the host can open an IPv6 socket. The 0.12-era workaround that synthesised "connected" from the DTLS transport state is gone. The interceptor, webrtc-media, webrtc-util and rcgen dependencies are dropped. The signaling protocol is unchanged. -
The crate declares
rust-version = "1.94", which sea-orm 2 and sqlx 0.9 need. Debian, Ubuntu, Arch and openSUSE builds already use a toolchain at or past it. EL9's rust-toolset is 1.92, so the RPM builder for Rocky now installs current stable through rustup, as the Debian builders do; building the RPM on EL9 by hand needs the same. The Fedora package and release jobs move from Fedora 41, which is end of life and frozen at rust 1.91, to Fedora 44. -
tag_idthat doesn't parse is a 400 (#136).GET /api/v3/eventsused to drop non-numeric values, sotag_id=abcquietly became "no tag filter" and returned every event. -
BREAKING:
GET /api/v3/monitorsleaves out soft-deleted monitors (#137). The list had noDeletedfilter, so a monitor ZoneMinder's web UI had deleted (Deleted = 1, the row kept until its events are gone) came back looking live. Passinclude_deleted=trueto list them; each row'sdeletedsays which is which.GET /api/v3/monitors/{id}still returns a soft-deleted monitor, so its page loads while its events exist. -
BREAKING: frames are addressed by event and frame number. ZoneMinder 1.39.36 drops
Frames.Idand makes(EventId, FrameId)the primary key, soFrameResponse.idis gone andGET/PATCH/DELETE /api/v3/frames/{id}become/api/v3/frames/{event_id}/{frame_id}.GET /api/v3/frames/{id}/imageis removed;GET /api/v3/events/{id}/frames/{fid}/imageserves the same image. -
BREAKING:
Libvlcis no longer a monitor, preset or control type. ZoneMinder 1.39.38 removes the Libvlc and NVSocket capture methods and converts existing rows to Ffmpeg. -
typeon controls is accepted and ignored. ZoneMinder 1.39.39 dropsControls.Type, which nothing ever read. Create and update still accept the field, so existing clients keep working, andControlResponse.typeis alwaysnull. -
BREAKING:
frame_skipis gone from monitor requests and responses. ZoneMinder 1.39.24 dropsMonitors.FrameSkip, and zm-api now mirrors that update, soMonitorResponseno longer carries the field and create/update ignore it.motion_frame_skipis unchanged. -
BREAKING: six
operationIds renamed (#32). They were duplicated, which meant a generated client silently got one method and lost the other, so this had to change — but it renames methods for anyone already generating against the spec.list_models→list_ai_models,create_model→create_ai_model,get_model→get_ai_model,update_model→update_ai_model,delete_model→delete_ai_model(the AI registry; the camera-model routes keep the plain names).update_stateon/monitors/{id}/state→update_monitor_state, and on/states/{id}→update_state_preset.
The compatibility gate did not catch this on its first run — it compared paths, response shapes and schemas but not operation ids. It does now, which is how the list above was produced. -
BREAKING:
rate_limit_per_secondrenamed torate_limit_period_secs(#70). The old name read as a rate and meant a period. It is still accepted as an alias, so no configuration needs changing, but the old spelling is misleading enough that it should not be used in new files. -
BREAKING:
GET /api/v3/mereturns a wrapper, not a bare user. As of5ce04e5the response isMeResponse—{ user, issued_at, expires_at, token_type }— where it was previouslyUserResponsewith the eight permission columns at the top level. This shipped without a changelog entry and broke zm-web's permission gating: reading the wrapper as a user finds no permission columns, and absent columns fail closed toNone, so the camera wall and every edit control disappeared.
Clients should readresponse.user. Accepting both shapes is worth it while older backends are still deployed. -
BREAKING: the project is named
zm-apithroughout, including on disk. The binary is/usr/bin/zm-api, config lives in/etc/zm-api/, state in/var/lib/zm-api/, logs in/var/log/zm-api/, and the unit iszm-api.service; the helpers arezm-api-dbandzm-api-takeover, and the man pages match. The distribution packages were already calledzm-api— only what they installed disagreed. Nothing has been released, so there is no upgrade path to migrate; a pre-release install should be removed and reinstalled. The Rust crate is still imported aszm_api, which is the normal Cargo mapping for a hyphenated package name. -
packaging/install.shrewritten for source installs: it now matches the package layout, installs the man pages andzm-api-db, and runssetup-instance.shto generate JWT keys. Previously it installed the unit to a different directory than the packages, never generated keys, and left a freshly "installed" service unable to sign a token. -
Removed the dead
[package.metadata.rpm]block fromCargo.toml; nothing invoked cargo-rpm, and it duplicatedpackaging/rpm/zm-api.spec.
First Rust release, replacing ZoneMinder's Perl/PHP/CGI API surface with a single native service. It talks directly to an existing ZoneMinder MySQL/MariaDB database and ships in passive mode, serving only the REST API so it can be installed alongside a running ZoneMinder without touching its daemons.
- REST API under
/api/v3for monitors, events, frames, zones, groups, users, storage, controls, PTZ presets, and configuration — with an auto-generated OpenAPI 3 spec at/api-docs/openapi.jsonand Swagger UI at/swagger-ui. - Live streaming over WebRTC and HLS, sourced from zmc's per-monitor stream socket (video and audio on one connection with a HELLO codec handshake).
- Event playback — VOD, fragmented-MP4 streaming, thumbnails, and motion synopsis.
- Authentication and authorisation — RS256 JWTs with separate access and refresh key pairs, server-side revocation, feature-level RBAC, and row-level monitor ACLs.
- Daemon supervision (takeover mode) — one native supervisor replacing both
zmdc.plandzmwatch.pl, with exponential backoff, database reconciliation, REST daemon control, and azmdc.sockcompatibility shim.zm-api-takeoverswitches a host between modes in one command, either way. - Retention — automatic recording cleanup bounded by free-space floor, age, and per-storage quota, deleting media and database rows together.
- ONVIF device discovery, media profiles, PTZ, and event pull-point.
- Natural-language event search over MariaDB 11.8 native vectors.
- Object-detection registry — CRUD over ZoneMinder 1.39's
AI_Datasets,AI_Models, andAI_Object_Classes, plus the per-monitor detection columns. - Packaging for Debian/Ubuntu (
.deb), Fedora/RHEL/openSUSE (.rpm), and Arch (PKGBUILD), with a systemd unit, per-install JWT key generation, and built-in TLS/ACME.
- Upgrading an existing ZoneMinder database requires
zm-api-db bridge -u mysql://...before first start. Only a fresh, empty database should usezm-api-db up. - Passive mode is the install-time default so the package cannot disturb a
running ZoneMinder. Takeover is the intended destination — one native
supervisor replacing
zmdc.plandzmwatch.pl— andzm-api-takeoverswitches either way in one command.