API

Every RockRecorder server has a small JSON API for monitoring and for connecting it to other systems. It runs on your own recorder, at https://<your recorder>/api/…. The recorder can also send each emergency to your system as it happens, with a webhook, and each change to its radio alias cache with another.

Endpoints

EndpointWhat it returnsKey
GET /api/healthUp or down, for uptime checks and load balancersNo
GET /api/health/detailsEvery health check, for monitoring systemsYes
GET /api/statisticsCall statistics for a period, as on the Statistics pageYes
GET /api/alias-cacheThe radio IDs heard on MRadio channels and their aliasesYes
GET /api/mradios/emergenciesMRadio emergencies and their recordingsYes

Getting started

  1. On the recorder, sign in as a SuperAdmin and open Administration > API Access.
  2. Turn on API access. A key is created the first time; copy it from the API key card.
  3. Send the key in the X-API-Key header:
curl -H "X-API-Key: <your key>" https://recorder.example.org/api/health/details

The recorder makes its own HTTPS certificate unless you install one. If your client doesn't trust it yet, install the recorder's certificate on the client, or install a certificate from your own CA on the recorder (Administration > Certificate). For a quick test, curl -k skips the check.

Authentication

  • Each recorder has one API key. Regenerate key on the API Access page replaces it at once: update every system that uses the old one.
  • API access is off until a SuperAdmin turns it on. Turning it off stops the key working, and turning it back on brings the same key back.
  • A key can read every channel on the recorder, whatever the users' groups.
  • Signed in to the recorder as a SuperAdmin, you can open the endpoints in your browser without the key to try them. Other users get 403.
  • /api/health needs no key and shows nothing but up or down.

Times

Times in responses are UTC, in ISO 8601: 2026-10-05T12:57:33.574Z.

Times you send can be a date (2026-10-05) or a date and time (2026-10-05 14:30, or 2026-10-05T14:30), with a time zone if you like (Z, -04:00). Without one they're read in the recorder's own time zone. An end given as a date includes that whole day.

Errors

StatusMeaning
400A parameter isn't valid; error says which.
401The key is wrong, or API access is off on the recorder.
403Signed in to the recorder, but not as a SuperAdmin.
500The recorder couldn't read its database.
503/api/health only: the recorder is down.
{"detail": "Invalid API key or API access disabled"}
{"detail": "The API needs the API key or a SuperAdmin"}

Endpoints

GET/api/health No key

Whether the recorder's web app is answering and can reach its database. Nothing else is shown, so it's safe to leave open to uptime checks and load balancers.

StatusBody
200{"status": "ok"}
503{"status": "down"}

GET/api/health/details

Every health check, an overall status and the problems in words: what a monitoring system needs. It answers 200 whenever it can, so read status_code: 0 ok, 1 warning, 2 critical. The checks are refreshed every 30 seconds.

CheckWarningCritical
databaseCan't be reached
servicesA recorder service isn't running
storageFixed size limit: recordings disk over 85% full.
Use available space: a disk can't keep its free space, or the free space check failed or hasn't run for over an hour
Fixed size limit: over 95% full.
Use available space: the recordings disk has under half its reserve free
recordingsA recorder type with enabled channels has recorded nothing for 12 hours
cleanupThe nightly storage cleanup is overdue or had errorsRecordings it checked have audio that changed since they were recorded (audio_changed: how many)
certificateThe HTTPS certificate expires within 14 daysIt has expired
licenseThe license expires within 30 daysIt's missing or invalid
emailScheduled reports or emergency alerts can't be sent
archivingAn archive destination has been failing for 15 minutes, or a server sending here isn't accepted
remote_sitesRemote Sites: on a site, its service isn't running or it hasn't reached the central recorder for 15 minutes; on the central recorder, a site hasn't connected for 15 minutes
default_adminThe SuperAdmin admin account still signs in with the password every installation starts with (checked hourly)
demoStatus stays ok; on a demo server problems gains "Demo mode: not recording", since its recorders idle on purpose

With [retention] mode = "auto" (use available space) a full disk is normal, so storage goes by the free space each disk keeps, not by how full it is. mode in the storage check is "auto" or "fixed", and reserve_bytes, only in auto mode, is the free space kept on the recordings disk. Don't alert on used_percent in auto mode: read status.

version is the RockRecorder version, and package is the installed package with its build number, to tell builds of one version apart (from 2.9.16-10; null on a server not installed from a package).

Example response (shortened)
{
  "status": "warning",
  "status_code": 1,
  "problems": ["Recordings disk 86.2% full"],
  "version": "2.9.16",
  "package": "2.9.16-10-debian12",
  "site": "County Dispatch",
  "hostname": "recorder",
  "checked_at": "2026-10-14T15:59:19+00:00",
  "checks": {
    "database": {"status": "ok"},
    "services": {"status": "ok", "units": {"rockrecorder-mradios.service": "active"}},
    "storage": {"status": "warning", "path": "/opt/rockrecorder/recordings", "mode": "fixed",
                "used_percent": 86.2, "free_bytes": 4650975232, "total_bytes": 32626225152},
    "recordings": {"status": "ok", "quiet_hours": 12.0,
                   "types": {"MRadio": {"status": "ok", "channels": 16,
                                        "last": "2026-10-14T15:57:35+00:00", "hours_ago": 0.0}}},
    "cleanup": {"status": "ok", "last_run": "2026-10-14T06:00:12+00:00", "hours_ago": 10.0,
                "ok": true, "errors": [], "audio_changed": 0},
    "certificate": {"status": "ok", "expires": "Aug 5, 2028", "days_left": 660},
    "license": {"status": "ok", "expires": null, "days_remaining": null},
    "email": {"status": "ok", "in_use": true, "reports": 1, "alerts": 1, "configured": true},
    "archiving": {"status": "ok", "in_use": true},
    "remote_sites": {"status": "ok", "in_use": false},
    "default_admin": {"status": "ok", "default_password": false},
    "demo": {"status": "ok", "in_use": false}
  }
}

GET/api/statistics

The figures from the recorder's Statistics page for whole days: totals, calls per day and per weekday and hour, each channel, the top talkers, phone numbers and call-taker positions, and the MPhone call figures. For dashboards (Grafana, Power BI) and your own reports.

ParameterDefaultDescription
start7 days before endFirst day, YYYY-MM-DD
endYesterdayLast day, YYYY-MM-DD; up to 366 days from start
channelAllOnly these channels, comma-separated
typeAllOnly these recorder types, comma-separated: MRadio, MPhone, ETC, Generic RTP, Cisco BiB, Solacom, Avtec
tzThe recorder'sTime zone for days and hours, e.g. America/New_York
top10How many talkers, phone numbers and positions to list, 1 to 100
  • summary: calls, total talk_time and avg_duration in seconds, unique talkers, channels with calls, and the busiest_hour.
  • by_day: every day of the period, including days without calls.
  • by_weekday_hour: calls per hour (0 to 23) for each weekday, added up over the period.
  • by_channel: each channel with calls, busiest first.
  • talkers: the busiest radio talkers (phone lines are under phone_numbers).
  • phone_numbers and positions: the most frequent callers and called numbers on phone lines, and calls per Solacom call-taker position.
  • mphone_calls: answered, abandoned, ring and talk times for Mindshare console phone lines, when the console parser is on; otherwise null.
Example request
curl -H "X-API-Key: <your key>" \
  "https://recorder.example.org/api/statistics?start=2026-10-01&end=2026-10-07&type=MRadio&top=2"
Example response (shortened)
{
  "success": true,
  "start": "2026-10-01",
  "end": "2026-10-07",
  "time_zone": "America/New_York",
  "channels": null,
  "types": ["MRadio"],
  "summary": {
    "calls": 16292,
    "talk_time": 52921.8,
    "avg_duration": 3.25,
    "talkers": 363,
    "channels": 12,
    "busiest_hour": {"weekday": "Sat", "hour": 14, "calls": 420}
  },
  "by_day": [
    {"date": "2026-10-01", "calls": 2386},
    {"date": "2026-10-02", "calls": 2303}
  ],
  "by_weekday_hour": {
    "Mon": [9, 26, 42, 67, 58, 4, 52, 73, 125, 123, 135, 88, 89, 180, 158, 127, 135, 126, 164, 140, 92, 129, 143, 64]
  },
  "by_channel": [
    {"channel": "Fire", "type": "MRadio", "calls": 8901, "talk_time": 29276.9, "avg_duration": 3.29, "share": 54.6}
  ],
  "talkers": [
    {"name": "Engine 12", "radio_ids": ["24271"], "calls": 1496, "avg_duration": 3.21, "share": 9.2,
     "main_channel": "Fire"}
  ],
  "phone_numbers": [],
  "positions": [],
  "mphone_calls": null
}

GET/api/alias-cache

The radio recorder's learned aliases: every radio ID heard on the MRadio channels and the alias it last transmitted with (the most recent 1,000 IDs). enabled says whether the recorder uses the cache to fill in missing aliases.

Example response
{
  "success": true,
  "enabled": true,
  "count": 2,
  "aliases": [
    {"uid": "24271", "alias": "Engine 12", "updated_at": "2026-10-01T18:46:25.000Z"},
    {"uid": "24277", "alias": "Medic 4", "updated_at": "2026-10-01T17:30:19.000Z"}
  ]
}

GET/api/mradios/emergencies

MRadio emergencies, newest first, counted the same way as the recorder's Emergencies page and its emergency alert emails: one per radio per channel, from the radio's emergency message or its first emergency transmission. It's active until it ends, and ended_by says how:

  • transmission: the radio transmitted on the channel without the emergency flag.
  • timeout: 30 minutes passed since it started. If the radio is still in emergency after that, it's counted as a new emergency.
ParameterDefaultDescription
start7 days ago (30 with active_only)From this time (see Times)
endNowUp to this time
channelAllOnly these channels, comma-separated
active_onlyfalseOnly emergencies that haven't ended
include_recordingstrueList each emergency's transmissions
limit100Most emergencies to return, 1 to 1,000
Example request
curl -H "X-API-Key: <your key>" \
  "https://recorder.example.org/api/mradios/emergencies?start=2026-10-01&channel=Fire"
Example response
{
  "success": true,
  "start": "2026-10-01T04:00:00.000Z",
  "end": "2026-10-14T15:59:19.430Z",
  "count": 1,
  "emergencies": [
    {
      "channel": "Fire",
      "source_id": "24271",
      "alias": "Engine 12",
      "event_number": 7,
      "event_numbers": [7],
      "status": "ended",
      "started_at": "2026-10-13T15:04:28.327Z",
      "last_activity_at": "2026-10-13T15:05:57.561Z",
      "last_transmission_at": "2026-10-13T15:05:57.561Z",
      "ended_at": "2026-10-13T15:06:12.520Z",
      "ended_by": "transmission",
      "latitude": 34.9249,
      "longitude": -81.0251,
      "messages": 1,
      "transmissions": 1,
      "recordings": [
        {
          "id": 159271,
          "timestamp": "2026-10-13T15:04:28.327Z",
          "alias": "Engine 12",
          "uid": "24271",
          "duration": 1.12,
          "latitude": 34.9249,
          "longitude": -81.0251,
          "url": "/recordings/Fire/2026/10/13/Fire_Engine_12_rx_20261013_110428_327.wav"
        }
      ]
    }
  ]
}

messages counts the radio's emergency messages (they don't make a recording) and transmissions its emergency transmissions, listed in recordings. A recording's url is on the recorder and needs a signed-in user to play; it ends in .flac on a server that stores recordings as FLAC, and .wav otherwise. latitude and longitude are the last position the radio sent, or null. event_numbers lists the radio's emergency event numbers (Mindshare numbers them per channel, so they don't identify an emergency on their own).

Webhooks

POST<your URL> Emergency alerts

An emergency alert can send each MRadio emergency to another system, such as a phone-call or paging service, as well as or instead of emailing it. The recorder POSTs it as JSON to your URL, signed with the alert's own secret.

  1. On the recorder, sign in as a SuperAdmin and open Administration > Emergency Alerts. Only a SuperAdmin can set, change or remove a webhook or its secret; an Admin sees an alert's webhook URL but can't change it.
  2. Create an alert or edit one, and under Webhook enter your system's URL (http:// or https://, without a user name or password in it).
  3. Copy the Signing secret into your system, then save the alert. Regenerate secret makes a new one; the old one stops working when you save.
  4. Send test sends a sample emergency with "test": true.

The webhook gets what the emails get: one request per radio per channel in 30 minutes, only for the alert's channels. After 10 alerts on a channel in 10 minutes, the next emergency there sends one alerts_paused request instead, and the channel's alerts pause for 10 minutes.

Several alerts can send to the same URL. Alerts with the same URL and the same secret send one request per emergency, with each of them in alerts. Alerts with the same URL but different secrets send one request per secret, each signed with its own and carrying the same id: your system accepts the one signed with its secret and skips the rest by id.

Headers
HeaderValue
Content-Typeapplication/json
User-AgentRockRecorder/<version>
X-RockRecorder-Eventemergency or alerts_paused
X-RockRecorder-DeliveryThe event's id, the same on every retry and for every alert that sends this emergency
X-RockRecorder-TimestampWhen this try was sent, in Unix seconds
X-RockRecorder-Signaturesha256= and the signature (see Checking the signature)
Body
FieldDescription
typeemergency or alerts_paused
idIdentifies the event. Skip an id you've already handled
testtrue for Send test. Ignore these unless you're testing
sent_atWhen the request was made (see Times)
serverThe recorder's site name, or its host name
alertsThe alerts that sent it: id and name
emergencychannel, the radio's source_id and alias, Mindshare's event_number, the last latitude and longitude the radio sent, and at, when it started. Any of them but channel and at can be null
pausedFor alerts_paused, in place of emergency: the channel, until when, and the limit (alerts in minutes)
Example: emergency
{
  "type": "emergency",
  "id": "5b0f6a3e-2c4d-4e8a-9f1b-7d2c6e9a1b34",
  "test": false,
  "sent_at": "2026-11-02T18:33:12.904Z",
  "server": "County Dispatch",
  "alerts": [{"id": 3, "name": "Fire emergencies"}],
  "emergency": {
    "channel": "Fire",
    "source_id": "24271",
    "alias": "Engine 12",
    "event_number": 7,
    "latitude": 34.9249,
    "longitude": -81.0251,
    "at": "2026-11-02T18:33:12.638Z"
  }
}
Example: alerts paused
{
  "type": "alerts_paused",
  "id": "c41e9d27-8b3a-4f6e-a2d5-0e7f1c9b8a62",
  "test": false,
  "sent_at": "2026-11-02T18:41:05.117Z",
  "server": "County Dispatch",
  "alerts": [{"id": 3, "name": "Fire emergencies"}],
  "paused": {"channel": "Fire", "until": "2026-11-02T18:51:05.117Z", "alerts": 10, "minutes": 10}
}

POST<your URL> Alias cache

The MRadio recorder's radio alias cache (the alias each radio ID last used, as in GET /api/alias-cache) can send each change to your system as it happens, so it can keep its own copy: a CAD or a dashboard, for example. It's signed and tried again like the emergency alert webhook, with the same headers.

  1. On the recorder, sign in as a SuperAdmin and open Administration > Recording Interfaces, then the MRadio interface.
  2. In Radio alias cache, turn on Remember radio aliases and enter your system's URL under Webhook.
  3. Copy the Signing secret into your system, then save and Apply.
  4. Send full cache sends every alias the cache has learned, to fill your copy or to test the webhook.
Body
FieldDescription
typealiases_changed or alias_cache (also in X-RockRecorder-Event)
id, test, sent_at, serverAs for an emergency. test is always false
changesFor aliases_changed, in the order they happened: the radio's uid, its new alias, the previous one (null for an ID new to the cache), the channel it was heard on, removed, and at. An ID put on the never-cache list comes with removed: true, alias and channel null: delete it from your copy
count, aliasesFor alias_cache: every ID with its uid, alias and updated_at, when it was last changed. Replace your copy with it
  • Changes that happen within 2 seconds of each other come in one request (up to 500).
  • Requests are sent one at a time, in order. If one still isn't delivered after its retries, its changes are dropped and the next request goes on: use Send full cache to catch up.
  • The cache keeps 1000 IDs. When it's full, the oldest leaves without a request: keep it in your copy.
  • Turning Remember radio aliases off empties the cache: you get an alias_cache with no aliases.
  • The card shows the last request's outcome.
Example: aliases changed
{
  "type": "aliases_changed",
  "id": "9e2b7c41-5a0d-4f3e-8c6b-2d1f0a9e7b53",
  "test": false,
  "sent_at": "2026-11-04T15:02:13.418Z",
  "server": "County Dispatch",
  "changes": [
    {"uid": "24271", "alias": "Engine 12", "previous": "Engine 11", "channel": "Fire",
     "removed": false, "at": "2026-11-04T15:02:11.203Z"},
    {"uid": "31007", "alias": null, "previous": "Medic 4", "channel": null,
     "removed": true, "at": "2026-11-04T15:02:11.950Z"}
  ]
}
Example: full cache
{
  "type": "alias_cache",
  "id": "0d6f3a92-7e1b-4c58-b9a4-6f2e8d1c5a07",
  "test": false,
  "sent_at": "2026-11-04T15:10:00.512Z",
  "server": "County Dispatch",
  "count": 2,
  "aliases": [
    {"uid": "24271", "alias": "Engine 12", "updated_at": "2026-11-04T15:02:11.000Z"},
    {"uid": "24305", "alias": "Ladder 3", "updated_at": "2026-11-03T22:47:39.000Z"}
  ]
}

Checking the signature

Checking the signature is optional. It proves a request came from your recorder, which matters most when your URL can be reached from outside your own network. To check it:

  1. Join X-RockRecorder-Timestamp, a dot and the request body exactly as received (the raw bytes, before any JSON parsing): 1793644392.{"type":"emergency",…}
  2. Make an HMAC-SHA256 of that, with the signing secret as the key (the 64-character text as it is, not decoded from hex).
  3. Compare sha256= and its hex digest with X-RockRecorder-Signature, in constant time.
  4. Turn away a timestamp more than 5 minutes from your clock, so an old request can't be replayed.
Python
import hashlib, hmac, time

def verify(secret, headers, body):     # body: the raw bytes received
    ts = headers.get("X-RockRecorder-Timestamp", "")
    if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
        return False
    mac = hmac.new(secret.encode(), ts.encode() + b"." + body, hashlib.sha256).hexdigest()
    return hmac.compare_digest("sha256=" + mac, headers.get("X-RockRecorder-Signature", ""))
Node.js
const crypto = require('crypto');

function verify(secret, headers, body) {   // body: the raw Buffer received
  const ts = headers['x-rockrecorder-timestamp'] || '';
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const mac = 'sha256=' + crypto.createHmac('sha256', secret)
    .update(ts + '.').update(body).digest('hex');
  const sig = headers['x-rockrecorder-signature'] || '';
  return sig.length === mac.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(mac));
}

Retries

Your answerWhat the recorder does
2xxDelivered
3xx, 408, 429, 5xx, no answer in 10 seconds, or no connectionTries again 5, 15, 30, 60 and 120 seconds later: 6 tries over about 4 minutes. Redirects aren't followed
Any other 4xxDoesn't try again
  • A retry has the same id and body, with a new timestamp and signature. Answer 2xx to one you've already handled.
  • Answer within 10 seconds: take the request, answer 2xx, then do the slow work.
  • The Emergency Alerts list shows each alert's last request: Webhook delivered, or Webhook failed with the reason.
  • The email, if the alert has addresses, doesn't wait for the webhook.
  • For the alias cache, Send full cache is tried once, and the card says how it went.