Developer API

One API for the website and the mobile apps

JSON over HTTPS with cursor pagination (?cursor&limit → { items, nextCursor }) plus Socket.IO for live chat, presence and reactions.

Get the mobile app

Torah Radio Network Music for iPhone, iPad, Mac and Android. Streaming only.

iOS 13+ (App ID 6755811598) · Android 7+ (package com.cw.torahRadio)

Authentication

Send Authorization: Bearer <accessToken>. Access tokens last 7 days; exchange the 30-day refresh token at /api/auth/refresh. Website requests use the signed-in session cookie automatically.

Real-time

Connect with io(origin, { path: '/api/socketio', auth: { token } }). Requests are limited to 5 messages per 10 seconds.

Nested replies & threads

Every discussion surface — community chat rooms, the prayer wall, artist fan walls, testimonies, song stories and Beraḵah (blessings) — supports threaded replies. Direct messages stay flat.

  • Create a reply: add an optional parentId to the same create endpoint / socket event you use for a top-level post (e.g. POST /api/prayer-wall/{id}/replieswith { body, parentId }, or send_message with { roomId, content, parentId }).
  • Read a thread: list and detail responses include parentId, a replyCount of direct children, and a nested replies[] array (each node the same shape, recursively).
  • Depth cap: threads nest up to 3 levels. Replying to a level-3 comment re-parents the new reply to its level-3 ancestor so the tree never grows deeper than 3.

Authentication

  • GET/api/auth/register

    Public signup options → { avatarIcons, avatarIconNone: "none", defaultAvatarIcon: null, languages }

  • POST/api/auth/register

    { email, password, displayName, language?, avatarIcon? } → { user, accessToken, refreshToken } · avatarIcon optional: null / "" / "none" = no emoji (default)

  • POST/api/signup

    Web signup form — same body as /api/auth/register → 201 { ok, user, tokens }

  • POST/api/auth/login

    { email, password } → { user, accessToken (7d), refreshToken (30d) }

  • POST/api/auth/refresh

    { refreshToken } → new token pair

  • GET/api/auth/token

    Web session → { accessToken, expiresIn } (used by the website socket)

  • GET/api/auth/me

    Current account, profile and settings

  • POST/api/auth/forgot-password

    Public · { email } → always 200 { ok, message } (never reveals whether the email exists) · emails a single-use reset link

  • GET/api/auth/reset-password

    Public · ?token= → { valid: true|false } (show valid / expired state)

  • POST/api/auth/reset-password

    Public · { token, password (min 8) } → { ok: true } · 400/404 { error } if invalid, expired, used or too short

Radio

  • GET/api/stations

    All stations with now playing, listeners and stream URL

  • GET/api/stations/{id}

    Station detail, listeners (unique/total), up next and song history

  • GET/api/stations/{id}/requests

    Requestable songs · ?search&page → { items, total, page, hasMore }

  • POST/api/stations/{id}/requests

    Request a song { requestId, title?, artist?, platform? } → always 200 { ok, message } (auth) · successful requests feed Most Requested

  • GET / POST/api/reactions

    ?stationId → { track, counts, mine } · POST { stationId, emoji } toggles ❤️ 🔥 🙌 🙏 (409 nothing playing, 429 rate limit)

  • POST/api/listening/heartbeat

    Every 60s while audio plays { stationId, platform?: web|ios|android|other } → accepted, creditedMinutes, todayMinutes, totalMinutes, level… (18h/day cap)

  • GET/api/listening/stats

    { stats, levels } — hours, level, today, perStation, last14Days

  • GET/api/listening/leaderboard

    ?period=all|month|week&stationId&limit (default 50, max 100) → { period, stationId, leaderboard }

Most Requested, charts & stats

  • GET/api/requests/top

    ?range=day|week|month|year|all (default week)&stationId&limit (1–100, default 25) → { totalRequests, items[rank, previousRank, movement up|down|same|new, change, requests, requesters, stations, requestAgain], climbing }

  • GET/api/requests/recent

    ?stationId&limit (1–50, default 20) → latest requests with requestedBy (null when unlisted)

  • GET/api/charts

    ?range=day|week|month|year|all&limit → { range, songs[rank, trackTitle, trackArtist, total, reactors, emojis] } — Most Loved

  • GET/api/stats/station/{id}

    ?range&limit → { mostPlayed, mostRequested, trending, trends } from station history

Chat rooms

  • GET/api/chat/rooms

    Station rooms and The Gathering Place

  • GET/api/chat/rooms/{id}/messages

    Flat list, newest first · ?cursor&limit (default 50, max 100) · each message has parentId, replyCount, reactions · public rooms readable without auth (guests), gathering rooms need a member

  • POST/api/chat/rooms/{id}/messages

    { content, type?, metadata?, parentId? } → 201 { message } · type TEXT|PRAYER_REQUEST|SCRIPTURE_REFERENCE|SONG_REACTION|VOICE_NOTE_URL

  • GET/api/chat/rooms/{id}/messages/{messageId}/reactions

    Reaction summary [{ emoji, count, userIds, mine }]

  • POST/api/chat/rooms/{id}/messages/{messageId}/reactions

    { emoji, mode?: toggle|add|remove } · emoji 🙏 ❤️ 🙌 🔥 🐑 → { reacted, reactions } · emits message_reaction

  • DELETE/api/chat/rooms/{id}/messages/{messageId}/reactions

    ?emoji= remove your reaction

  • PATCH/api/chat/rooms/{id}/messages/{messageId}

    Edit own text/prayer message { content } → { message } (author only)

  • DELETE/api/chat/rooms/{id}/messages/{messageId}

    Delete own message or staff

  • POST/api/chat/rooms/{id}/read

    Auth · mark room read → { ok, previousReadAt } (null on first visit — use a 7-day window for the "new" divider) · 404 missing room

  • POST/api/chat/rooms/read-all

    Auth · mark every visible room read → { ok, count }

  • GET/api/chat/rooms/{id}/songs

    Station room · ?ids=trackId,… (max 50) → { counts: { [trackId]: n } } comment counts per song

  • GET/api/chat/rooms/{id}/songs/{trackId}

    Every comment posted while that song was on air → { trackId, count, items }

  • POST/api/chat/rooms/{id}/messages/{messageId}/move

    Staff · move a top-level comment and all replies { targetRoomId } → { ok, id, fromRoomId, roomId, movedCount } · 400 reply/circle/same room, 404 missing

  • POST/api/chat/rooms/{id}/messages/{messageId}/reparent

    Staff · hang a reply under another top-level comment in the same room { targetParentId } → { ok, id, fromParentId, parentId }

Community conversations & activity

  • GET/api/community/threads

    Guests OK · ?lens=unanswered|questions|for-you|prayer|all (default unanswered) &sort=newest|waiting|active &limit 1–60 (default 30) &offset &q (≤100) &roomId · one card per top-level post with its replies · 400 bad lens/sort

  • GET/api/community/threads/{id}

    Any message id → { room, root, replies (flat, oldest first) } · 404 not found, 403 private room

  • POST/api/community/threads/{id}/read

    Members · mark thread read → { threadId, lastReadAt } · 401 without token

  • GET/api/community/activity

    Guests OK · Across the site feed: public chat, prayers, testimonies, song stories · ?limit (default 40, max 60) → { items }

  • GET/api/presence/active

    Public · { activeNow } members active now (never errors; poll every 30–60 s)

Public API (world-readable, CORS-open)

  • GET/api/public/chat/rooms

    No auth · CORS * · community & station rooms (topics) → { rooms[id, slug, name, topic, type, stationId, stationName, language, messageCount, onlineCount, nowPlaying] } · private gatherings never exposed

  • GET/api/public/chat/rooms/{id}/messages

    No auth · CORS * · read-only messages, newest first · ?cursor&limit (default 50, max 100) → { room{id, name, topic}, items, nextCursor }

  • OPTIONS/api/public/chat/rooms(/{id}/messages)

    CORS preflight → 204

Direct messages

  • GET / POST/api/dm/conversations

    List or start 1:1 / group (max 25) { memberIds, name? }

  • GET / POST/api/dm/conversations/{id}/messages

    Thread history and send

  • PATCH/api/dm/conversations/{id}/messages/{messageId}

    Edit own message { content } → { message } (author only)

  • DELETE/api/dm/conversations/{id}/messages/{messageId}

    Delete own message (or staff) — soft-deleted

  • POST/api/dm/conversations/{id}/read

    Mark read (read receipts)

Translation (read every comment in your language)

  • POST/api/translate

    { target, items: [{ id, text }], persist? } → { target, translations: { [id]: { text, sourceLang, same } } } · guests allowed · target = a code from GET /api/auth/register → languages · items 1–25, id 1–100 chars (echoed back), text 1–4000 chars · persist default true (send false for a live composer preview) · same: true = already in target, text is the original · sourceLang und = undetected · sacred names (Yahuah, Yahusha, Shabbath…) and scripture refs never change · 400 validation, 429 over 60 calls/min per user or IP, 502 service error, 503 not configured, 500 other

  • PUT / PATCH/api/profiles/me

    { language } saves the reader language so every device translates into it · messages are stored as written: translate on the reader side and never translate your own messages

Prayer Wall

  • GET / POST/api/prayer-wall

    ?status=ACTIVE|ANSWERED|ARCHIVED&mine=1 · create { title, body, isAnonymous }

  • GET / PATCH / DELETE/api/prayer-wall/{id}

    Detail, mark answered, remove

  • POST / DELETE/api/prayer-wall/{id}/pray

    POST adds (idempotent) → { hasPrayed: true, prayingCount } · DELETE removes → { hasPrayed: false, prayingCount }

  • POST/api/prayer-wall/{id}/replies

    { body, parentId? } → 201 { reply } (replies come with GET /api/prayer-wall/{id})

  • PATCH/api/prayer-wall/{id}/replies/{replyId}

    Edit own reply { body } → { reply } (author only)

  • DELETE/api/prayer-wall/{id}/replies/{replyId}

    Delete own reply (or staff)

  • POST/api/prayer-wall/{id}/renew

    Extend another 30 days

Profiles & community

  • GET/api/profiles

    ?search= member search

  • GET / PUT / PATCH/api/profiles/me

    Own profile and settings (DM privacy, language, unlisted, avatarIcon — null / "" / "none" clears it)

  • GET/api/profiles/{id}

    Public profile

  • GET/api/profiles/{id}/stats

    Listening stats

  • POST / DELETE/api/follow/{userId}

    Follow / unfollow

  • POST / DELETE/api/block/{userId}

    Block / unblock

  • GET/api/blocked

    Blocked members

  • POST/api/report

    { reason: spam|harassment|hate_speech|inappropriate|false_teaching|impersonation|other, details?, targetUserId? | messageId? | directMessageId? | prayerId? }

  • POST/api/upload/presigned

    { purpose: avatar (5MB) | artist_image (5MB) | voice_note (10MB), fileName, contentType, size } → { uploadUrl, cloud_storage_path, publicUrl }

Gatherings & circles

  • GET/api/gatherings

    ?kind=STUDY_GROUP|CHAVURAH|PRAYER_CIRCLE|SCRIPTURE_ROOM&mine=1&q= · ?cursor&limit

  • POST/api/gatherings

    { kind, name, description?, topic?, isPrivate?, stationId?, bookSlug?, bookName?, chapter?, maxSize? }

  • GET / PATCH / DELETE/api/gatherings/{id}

    Detail with members and chat room · owner edits / closes

  • POST / DELETE/api/gatherings/{id}/join

    Join or leave a gathering

  • POST/api/gatherings/circles/match

    Auto-match into the smallest open prayer circle (≤5) or start one

Daily & Scripture

  • GET/api/daily

    ?lang=en → Sacred Name of the Day, Torah Command of the Day and { roomId } for the discussion

  • GET/api/scripture/books

    ?lang=en → book list for the Scripture Reading Room picker

Testimonies & encouragement

  • GET/api/testimonies

    ?mine=1 · ?cursor&limit — the Testimony Wall

  • POST/api/testimonies

    { title, body }

  • PATCH/api/testimonies/{id}

    Edit own testimony { title?, body?, isAnonymous? } → { testimony } (author only)

  • DELETE/api/testimonies/{id}

    Remove own testimony (or staff)

  • POST/api/testimonies/{id}/praise

    Toggle a HalleluYah reaction

  • GET/api/encouragements

    ?userId= → Beraḵah (blessing) wall for a member

  • POST/api/encouragements

    { toUserId, message, scriptureRef? } → send a Beraḵah (blessing)

  • PATCH/api/encouragements/{id}

    Edit a Beraḵah you sent { message?, scriptureRef? } → { encouragement } (author only)

  • DELETE/api/encouragements/{id}

    Remove a Beraḵah (sender, recipient or staff)

Song Stories & local connections

  • GET/api/song-stories

    ?mine=1&songKey= · ?cursor&limit

  • POST/api/song-stories

    { title, story, trackTitle?, artist?, stationId? }

  • PATCH/api/song-stories/{id}

    Edit own song story { story } → { story } (author only; track stays fixed)

  • DELETE/api/song-stories/{id}

    Remove own song story (or staff)

  • GET/api/connect

    ?country=&region= → opt-in Keepers near you (city-level, requires shareLocation)

Content

  • GET/api/announcements

    Active announcements · ?language&cursor&limit (default 20, max 50)

  • GET/api/events

    Upcoming events and feast days · ?from&feasts=1&language&cursor&limit (default 30, max 100)

  • GET/api/events/{id}

    Event detail → { event }

  • GET/api/events/calendars

    Public · feast calendar hub by publisher · ?year= (2026–2100, default current) → { items, years } · civil daytime dates, endDate inclusive · 400 out of range

  • GET/api/artists/{id}/songs

    Public · songs credited to the artist · ?station&q&sort&limit&offset (bad sort → 400)

  • GET/api/artists

    Artist Corner · ?search&cursor&limit

  • GET/api/artists/{id}

    Id or slug → { artist, tracks, messages (latest 30) }

  • POST/api/artists/{id}/messages

    Post on the fan wall { body, parentId? } → 201 { message }

  • PATCH/api/artists/{id}/messages/{messageId}

    Edit own fan-wall message { body } → { message } (author only)

  • DELETE/api/artists/{id}/messages/{messageId}

    Delete own fan-wall message (or staff)

  • POST / PUT / DELETE/api/announcements · /api/events · /api/artists

    Admin · create, edit ({id}) and remove ({id})

Moderation & admin (staff)

  • GET/api/reports

    ?status=OPEN|RESOLVED|DISMISSED

  • PATCH/api/reports/{id}

    { status, note? }

  • POST/api/moderate/mute

    { userId, minutes, reason? }

  • POST/api/moderate/ban

    { userId, reason?, unban? }

  • POST/api/moderate/role

    Admin · { userId, role }

  • GET / POST / DELETE/api/moderate/banned-words

    Word filter

  • GET/api/admin/users

    ?search&role&banned=1&cursor&limit (emails shown to admins only)

  • PATCH / DELETE/api/admin/users/{id}

    Admin · PATCH { password } (min 8, revokes tokens) · DELETE member (not self / other admins)

  • GET/api/admin/stats

    Analytics payload

  • GET/api/admin/listening

    Admin · ?days=1–90 (default 7) → app usage: totals, byPlatform (web/ios/android/other/unknown), daily, activeNow, recent, topListeners

  • GET/api/admin/radio-stats

    Admin · combined live listeners across stations

  • GET / POST/api/admin/rooms

    Admin · list rooms with sidebar groups · POST { name 2–60, description? ≤240, groupLabel? ≤40 } → 201 { ok, room }

  • PATCH/api/admin/rooms/{id}

    Admin · { groupLabel | null } move room to another sidebar group (gathering rooms → 400)

  • PATCH/api/admin/calendars/{id}

    Admin · edit calendar profile (method, summary, boundary, cautions) · does not recalculate dates

  • PATCH/api/admin/calendars/dates/{id}

    Admin · edit one feast date (date, status, notes, source) · revision conflict check, 1-day/7-day validation

  • GET / POST/api/admin/radio-sync

    Admin · sync status · POST { catalog? (default true) } → 202 { started } · 409 already running

  • GET/api/admin/song-credits/review

    Admin · ?q= → { totals, groups (BLANK_TAG | NEW_TAG), recent }

  • POST/api/admin/song-credits/resolve

    Admin · action confirm_suggestions | assign | create_artist | ignore | reopen | set_title (max 5000 ids) → { ok, decided, rulesSaved, artist, engine }

  • GET / POST/api/admin/credit-rules

    Admin · list / create { matchType TITLE_CONTAINS|ARTIST_EXACT|ARTIST_CONTAINS|PLAYLIST|BLANK_ON_STATION, pattern, stationId?, artistId?, role?, action?, priority −100…100 } · 409 duplicate

  • PATCH / DELETE/api/admin/credit-rules/{id}

    Admin · { isActive, priority, note } · DELETE re-runs affected songs

  • GET / POST/api/admin/seed/accounts

    Admin · list / create seeded accounts · PATCH /{id} { level }

  • POST/api/admin/seed/post

    Admin · { botId, roomId, content, type?, parentId? } → 201 { message }

  • GET/api/admin/seed/messages

    Admin · ?roomId → rooms + recent messages

  • GET / PATCH/api/admin/seed/config

    Admin · { listenersCushion 0–25, countriesCushion 0–5 }

  • GET / PUT/api/admin/seed/autopost

    Admin · autopost jobs · POST /run and /reset with { kind }

  • GET / PATCH/api/admin/seed/activity

    Admin · { config: { active, activeChance, minMinutes, maxMinutes, goLiveChance, reactChance, lastRunAt }, limits } · PATCH values clamped (chances 0–100, minutes 0–600)

  • POST/api/admin/seed/activity/run

    Admin { allBots? } forces a run · or cron with x-cron-secret / ?secret= (honours on/off) → { result }

  • GET/api/admin/monitor

    Live chat monitor · room heat, cross-room firehose with flagged words, moderation log

  • GET/api/admin/monitor/dm

    Admin · ?userId= direct-message safety review (every lookup is logged)

Socket events

Client → server

  • join_room { roomId }
  • leave_room { roomId }
  • send_message { roomId, content, type?, metadata?, parentId?, clientId? } with ack — parentId nests the message as a reply
  • react_message { roomId, messageId, emoji, mode?: toggle|add|remove } → ack { reacted, reactions }
  • typing_start / typing_stop { roomId } (no ack)
  • heartbeat { stationId, platform? } every 60s while listening → ack with credited minutes and level

Server → client

new_messagemessage_editedmessage_deletedmessage_reactionuser_joineduser_leftuser_typingpresence_updatenew_direct_messagedirect_message_editeddirect_message_deleteddm_readconversation_createdprayer_requestprayer_replyprayer_updateprayer_reply_editedprayer_reply_deletedannouncementreactiongathering_syncencouragementmoderation