🎙 RadioKit Diretta Low-latency studio↔remote audio RadioKit Timer Automatic broadcast countdown 🌐 Websites & Apps Custom development for radio 🎤 RadioKit Stage NEW Professional timers for events, theater, streaming

Blog Beta Forum Beta Updates
Sign in / Sign up

RadioKit Stage — API & integrazioni

Controlla Stage da Stream Deck, Bitfocus Companion, Slack/Discord bot, Zapier, IFTTT, OBS WebSocket o qualsiasi sistema che parli HTTP. Endpoint REST JSON, autenticazione via API key per stanza, webhooks firmati HMAC-SHA256.

🎤 Apri controller ▶ Demo viewer

🔐 Autenticazione

Due modi di autenticazione:

1. Owner key (per controller admin)

Header X-RK-Key: <LICENSE_KEY> oppure query ?key=.... Usa le chiavi licenza RadioKit (RK-/RKT-/RKR-/RKS-).

2. API key per-room (per Stream Deck / Companion / 3rd party)

Generala in Stage admin → API keys. Header X-RK-API-Key: rks_xxxxxxxx... oppure query ?api_key=.... Una chiave è legata a UNA room, scope read o control.

🎛 Endpoint control (Stream Deck / Companion)

Endpoint pubblico che agisce sul timer corrente della room (il primo running/idle in ordine di posizione).

POST/api/stage/?action=control&cmd=start Avvia il timer attivo della room.
POST/api/stage/?action=control&cmd=pause Mette in pausa.
POST/api/stage/?action=control&cmd=resume Riprende dopo pausa.
POST/api/stage/?action=control&cmd=reset Reset a 0:00.
POST/api/stage/?action=control&cmd=adjust&delta_sec=60 Aggiunge/toglie secondi (positivo o negativo).
POST/api/stage/?action=control&cmd=finish Forza la fine timer.
POST/api/stage/?action=control&cmd=message&text=...&auto_hide_sec=8 Mostra un messaggio cue sul viewer per N sec.
GET/api/stage/?action=control&cmd=state Stato corrente (solo lettura). Funziona anche con scope read.

Opzionale: ?timer_id=<ID> per agire su un timer specifico anziché quello "attivo".

🪝 Webhooks

Quando un evento avviene nella tua room (timer finito, warning, sforamento, ecc.) chiamiamo il tuo URL con un POST JSON.

Payload

{
  "event": "done",           // vedi sezione Eventi
  "room_id": 42,
  "timer_id": 17,
  "ts": "2026-05-14T15:23:45+02:00",
  "data": { ... }     // payload specifico per evento
}

Firma HMAC (opzionale ma consigliato)

Se hai impostato un secret, mandiamo header X-RK-Signature: sha256=<hex>. Verifica con:

# Node.js / Express
const sig = req.headers['x-rk-signature'];
const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');
if (sig !== expected) return res.status(401).end();

📡 Eventi disponibili

start
Timer avviato.
pause
Timer messo in pausa.
resume
Timer ripreso.
reset
Timer reso idle.
done
Timer finito (raggiunto 0:00 o finish manuale).
warn
Sotto soglia warning_at_sec.
over
Sforamento (negativo).
adjust
Timer aggiustato (+/- sec).
message_shown
Cue messaggio mostrato sul viewer.

Configura quali eventi vuoi ricevere come CSV (es. done,warn,over) o * per tutti.

📚 CRUD completo (owner key)

Per integrazioni server-side, gestione completa di room/timer/messaggi/preset:

GET/api/stage/?action=room_list
POST/api/stage/?action=room_create body: {name: "..."}
POST/api/stage/?action=room_update body: branding/font/watermark/obs_*
POST/api/stage/?action=room_delete body: {room_id}
POST/api/stage/?action=timer_create body: name, duration_sec, mode, target_at?, round_count?, round_break_sec?
POST/api/stage/?action=timer_control body: {timer_id, cmd: 'start|pause|resume|reset|finish|adjust', delta_sec?}
POST/api/stage/?action=msg_create / msg_toggle / msg_delete
POST/api/stage/?action=cue_create / cue_fire / cue_delete
POST/api/stage/?action=webhook_create / webhook_test / webhook_delete
GET/api/stage/?action=stats&room_id=...&days=7
GET/api/stage/?action=room_state&slug=... Pubblico, no auth — usato dal viewer.

🎚 Stream Deck — HTTP Request action

Plugin consigliato: HTTP Request (gratuito). Configura ogni tasto così:

  • URL: https://radiokit.io/api/stage/?action=control&cmd=start&api_key=rks_TUACHIAVE
  • Method: POST
  • Headers: X-RK-API-Key: rks_TUACHIAVE (alternativo al query string)

Crea un tasto diverso per ogni comando: start, pause, resume, reset, adjust&delta_sec=60, adjust&delta_sec=-60, finish, message&text=Tempo!.

🎛 Bitfocus Companion

Companion supporta nativamente le HTTP request. Crea un nuovo button con action "HTTP POST" → URL endpoint control con la tua API key. Tutte le combinazioni di feedback sono possibili pollando action=control&cmd=state.

📦 JSON config Companion exportabile in arrivo (q3 2026).

💻 Esempi

curl

# Start del timer attivo
curl -X POST \
  -H "X-RK-API-Key: rks_xxxxxxxxxxxx" \
  "https://radiokit.io/api/stage/?action=control&cmd=start"

# Aggiungi 30 secondi
curl -X POST \
  -H "X-RK-API-Key: rks_xxxxxxxxxxxx" \
  "https://radiokit.io/api/stage/?action=control&cmd=adjust&delta_sec=30"

# Mostra messaggio "Ultimo minuto!" per 10 secondi
curl -X POST \
  -H "X-RK-API-Key: rks_xxxxxxxxxxxx" \
  --data-urlencode "text=Ultimo minuto!" \
  "https://radiokit.io/api/stage/?action=control&cmd=message&auto_hide_sec=10"

JavaScript (browser)

const API_KEY = 'rks_xxxxxxxxxxxx';
async function stage(cmd, params = {}) {
  const qs = new URLSearchParams({ action: 'control', cmd, ...params });
  const r = await fetch(`/api/stage/?${qs}`, {
    method: 'POST', headers: { 'X-RK-API-Key': API_KEY }
  });
  return r.json();
}
// Uso:
stage('start');
stage('adjust', { delta_sec: -60 });
stage('message', { text: '5 minuti!', auto_hide_sec: 8 });

Python

import requests
API_KEY = 'rks_xxxxxxxxxxxx'
URL = 'https://radiokit.io/api/stage/'
def stage(cmd, **kw):
    params = {'action': 'control', 'cmd': cmd, **kw}
    headers = {'X-RK-API-Key': API_KEY}
    return requests.post(URL, params=params, headers=headers).json()

stage('start')
stage('adjust', delta_sec=30)
stage('message', text='Tempo!', auto_hide_sec=5)

Webhook receiver (Node.js)

const express = require('express');
const crypto = require('crypto');
const app = express();
const SECRET = 'mio-secret';

app.post('/rk-stage', express.raw({type: 'application/json'}), (req, res) => {
  const sig = req.headers['x-rk-signature'];
  const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(req.body).digest('hex');
  if (sig !== expected) return res.status(401).end();
  const evt = JSON.parse(req.body);
  console.log('Stage event:', evt.event, evt.timer_id);
  // es. se evt.event === 'done' → manda Slack notification, avvia jingle, ecc.
  res.send('OK');
});

app.listen(3000);
Share:
Chat