Skip to content

Bridge API

A bridge talks to the server over a WebSocket for radio state and tune requests, and over REST for logging contacts. The API can change between releases. GET /api/version returns the current version.

Both interfaces use the radio bridge token. Send it as an Authorization: Bearer <token> header, as the Windows app does, or as a ?token=<token> query parameter, as the scripts do. The server answers 503 if no token is configured and 401 if the token is wrong.

All endpoints are under /api/radio/bridge.

GET /operators returns the active members a bridge can offer in its who-is-operating box. contest_ok tells you whether the member can be credited with a contest contact, so you can warn the operator before the server refuses.

{ "items": [ { "id": "…", "display_name": "…", "personal_callsign": "W1XYZ", "contest_ok": true } ] }

GET /contests returns the contests that can accept a contact right now: contests that are running, start within an hour, or ended within the last six hours. WSJT-X does not know a contest’s exchange, so the bridge asks for it here.

{ "items": [ { "id": "…", "name": "…", "template": "…", "live": true, "sends_serial": true, "next_serial": 12,
"exchange": [ { "key": "section", "label": "Section", "kind": "region", "required": true, "default": null,
"placeholder": null, "help": null, "strict": true, "in_log": true, "options": null, "regions": ["EMA", "WMA"] } ] } ] }

POST /contacts logs a contact. Send JSON with these fields:

Field Notes
callsign, mode Required. A callsign has 3 to 20 letters, digits and /.
frequency_mhz, band If you send frequency_mhz, the server works out the band.
qso_at ISO 8601 UTC. Defaults to now.
operator_user_id An id from /operators. Without it, the contact goes to the Unknown operator.
contest_id An id from /contests. Without it, the contact goes to the general log.
exchange, exchange_sent, exchange_rcvd Used only with contest_id. If the contest sends a serial number and exchange_sent is missing, the server fills in the next one.
Others rst_sent, rst_rcvd, power_watts, name, qth, grid_square, country, dxcc, continent, lat, lon, qsl_status, notes, station_callsign and transmitter_id. The server fills in a missing location and country from the callsign.

A bridge cannot stop and ask, so the server saves an unusual callsign with a flag. A contest contact can only be credited to a station operator. Otherwise the server answers 400.

The server treats a contact with the same call, band, mode, minute and log as one contact, because WSJT-X sends two messages and bridges retry. 201 means the server created the contact. 200 with "duplicate": true means it already existed, and you can remove it from your queue. The audit log records each contact with no actor and source: bridge.

Each bridge opens one WebSocket to /api/radio/bridge with the same token. Several bridges can be connected at once. Frequencies are in MHz.

Direction Message
Bridge to server {"type":"state","state":{…}} whenever the radio changes. It carries the radio, its slices and the transmit slice.
Bridge to server {"type":"ack","id":"…","ok":true} after a tune. On failure, ok is false and an error explains why.
Server to bridge {"type":"tune","id":"…","freq_mhz":14.245,"mode":"SSB","by":"…"}

The server pings every few seconds and drops a bridge that does not answer within about 12 seconds. Send state again after you reconnect. The server forgets a tune that is not acknowledged within ten seconds.

The server identifies a bridge by the radio in its state: model, nickname, version and ip, plus an optional id. A bridge is not listed until it reports a radio.

  • The key is the id if you send one. Otherwise it is model, nickname and ip together. Keep these values stable so members’ choices survive a reconnect.
  • Members see the nickname, or the model if the nickname is empty.
  • If a new connection reports a radio that is already connected, the server closes the older connection with code 1000 and replaced by a newer bridge. Do not reconnect immediately after that message, or two bridges for one radio replace each other in a loop.
  • If your bridge loses its radio but keeps running, send radio: null with no slices. The radio stays listed under its last name with nothing tuned.