DJs and relays

Use ?server=1 to filter lists. Public reads use a reduced representation without ip and password. Send a panel token with DJ permissions for administrative operations.

Endpoint /api/v2/djs/
HTTP methods GET, POST
Authentication GET is public. Changes require a panel JWT.

List or create DJ sources. Set server, name and source settings. Direct connections use port and password.

Endpoint /api/v2/djs/{id}/
HTTP methods GET, PUT, PATCH, DELETE
Authentication GET is public. Changes require a panel JWT.

Read or manage one source. AutoDJ cannot be deleted.

Endpoint /api/v2/relays/
HTTP methods GET, POST
Authentication GET is public. Changes require a panel JWT.

List or create relay sources. Set server, name and stream_url.

Endpoint /api/v2/relays/{id}/
HTTP methods GET, PUT, PATCH, DELETE
Authentication GET is public. Changes require a panel JWT.

Read, update, or delete a relay.

Endpoint /api/v2/djs/{id}/toggle/
HTTP methods POST
Authentication Panel JWT

Toggle the source. Returns the new active flag in result.

Endpoint /api/v2/relays/{id}/toggle/
HTTP methods POST
Authentication Panel JWT

Toggle the relay. Returns the new active flag in result.

Endpoint /api/v2/djs/{id}/rewind/
HTTP methods POST
Authentication Panel JWT

Rewind AutoDJ. Returns {"result":"rewind_done"} or HTTP 400 with a reason in result.

Endpoint /api/v2/relays/{id}/start_broadcasting/
HTTP methods POST
Authentication Panel JWT

Schedule a one-time relay starting at the next minute. Optional timezone is an IANA zone. Returns result: success with Unix seconds in start_ts, or result: error and msg: grid_busy.

Endpoint /api/v2/djs/set_priority/
HTTP methods POST
Authentication Panel JWT

Send server and a priorities object mapping DJ IDs to integer priorities. Returns result: done and new_priorities.

Source fields

The source object includes id, server, name, cat (auto for AutoDJ, real for an encoder connection, ws for web DJ, server for a relay), active, priority, port, stream_url, dj_buffer_ms (milliseconds), metadata, meta_charset, volume_change, and image. connected, on_air, dt_connect and dt_disconnect describe live connection state. do_recording enables recording and do_recording_hourly splits files by hour.

Recordings

Endpoint /api/v2/djs/{id}/recordings/
HTTP methods GET
Authentication Public

Array of MP3 file names, newest first.

Endpoint /api/v2/djs/{id}/download_recording/
HTTP methods GET
Authentication Public

Query parameter file is a name from the recordings list . Returns the audio attachment.

Endpoint /api/v2/djs/{id}/recording_air_timeline/
HTTP methods GET
Authentication Panel JWT

Pass file for timing markers. available indicates whether markers exist and events contains at_ms offsets and on_air flags.

Endpoint /api/v2/djs/{id}/delete_recording/
HTTP methods DELETE
Authentication Panel JWT

Pass the file name in the file query parameter. Returns an empty body.

Endpoint /api/v2/djs/{id}/delete_recordings/
HTTP methods POST
Authentication Panel JWT

Send files, an array of file names. Returns an empty body.

GET /api/v2/djs/7/recording_air_timeline/?file=show.mp3
{
  "available": true,
  "events": [
    {
      "at_ms": 1200,
      "on_air": true
    }
  ],
  "recording_type": "raw_input"
}

Buffer and recording values

dj_buffer_ms accepts 0 (no jitter reserve), 1000 (1 second), 3000 (3 seconds), 8000 (8 seconds), 30000 (30 seconds), or 60000 (60 seconds). In the recording example, 7 is the DJ ID and at_ms: 1200 marks the start of on-air playback 1.2 seconds into the raw recording.

volume_change is the percentage adjustment to the incoming source level. Use 0 for no adjustment. meta_charset names the stream metadata encoding and defaults to UTF-8. In priorities, each key is a DJ ID and its integer value is the desired priority for that DJ.