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
parentIdto the same create endpoint / socket event you use for a top-level post (e.g.POST /api/prayer-wall/{id}/replieswith{ body, parentId }, orsend_messagewith{ roomId, content, parentId }). - Read a thread: list and detail responses include
parentId, areplyCountof direct children, and a nestedreplies[]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/registerPublic 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/signupWeb 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/tokenWeb session → { accessToken, expiresIn } (used by the website socket)
- GET
/api/auth/meCurrent account, profile and settings
- POST
/api/auth/forgot-passwordPublic · { email } → always 200 { ok, message } (never reveals whether the email exists) · emails a single-use reset link
- GET
/api/auth/reset-passwordPublic · ?token= → { valid: true|false } (show valid / expired state)
- POST
/api/auth/reset-passwordPublic · { token, password (min 8) } → { ok: true } · 400/404 { error } if invalid, expired, used or too short
Radio
- GET
/api/stationsAll 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}/requestsRequestable songs · ?search&page → { items, total, page, hasMore }
- POST
/api/stations/{id}/requestsRequest 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/heartbeatEvery 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/roomsStation rooms and The Gathering Place
- GET
/api/chat/rooms/{id}/messagesFlat 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}/reactionsReaction 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}/readAuth · 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-allAuth · mark every visible room read → { ok, count }
- GET
/api/chat/rooms/{id}/songsStation 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}/moveStaff · 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}/reparentStaff · hang a reply under another top-level comment in the same room { targetParentId } → { ok, id, fromParentId, parentId }
Community conversations & activity
- GET
/api/community/threadsGuests 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}/readMembers · mark thread read → { threadId, lastReadAt } · 401 without token
- GET
/api/community/activityGuests OK · Across the site feed: public chat, prayers, testimonies, song stories · ?limit (default 40, max 60) → { items }
- GET
/api/presence/activePublic · { activeNow } members active now (never errors; poll every 30–60 s)
Public API (world-readable, CORS-open)
- GET
/api/public/chat/roomsNo 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}/messagesNo 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/conversationsList or start 1:1 / group (max 25) { memberIds, name? }
- GET / POST
/api/dm/conversations/{id}/messagesThread 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}/readMark 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}/prayPOST 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}/renewExtend another 30 days
Profiles & community
- GET
/api/profiles?search= member search
- GET / PUT / PATCH
/api/profiles/meOwn profile and settings (DM privacy, language, unlisted, avatarIcon — null / "" / "none" clears it)
- GET
/api/profiles/{id}Public profile
- GET
/api/profiles/{id}/statsListening stats
- POST / DELETE
/api/follow/{userId}Follow / unfollow
- POST / DELETE
/api/block/{userId}Block / unblock
- GET
/api/blockedBlocked 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}/joinJoin or leave a gathering
- POST
/api/gatherings/circles/matchAuto-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}/praiseToggle 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=®ion= → opt-in Keepers near you (city-level, requires shareLocation)
Content
- GET
/api/announcementsActive announcements · ?language&cursor&limit (default 20, max 50)
- GET
/api/eventsUpcoming events and feast days · ?from&feasts=1&language&cursor&limit (default 30, max 100)
- GET
/api/events/{id}Event detail → { event }
- GET
/api/events/calendarsPublic · 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}/songsPublic · songs credited to the artist · ?station&q&sort&limit&offset (bad sort → 400)
- GET
/api/artistsArtist Corner · ?search&cursor&limit
- GET
/api/artists/{id}Id or slug → { artist, tracks, messages (latest 30) }
- POST
/api/artists/{id}/messagesPost 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/artistsAdmin · 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/roleAdmin · { userId, role }
- GET / POST / DELETE
/api/moderate/banned-wordsWord 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/statsAnalytics payload
- GET
/api/admin/listeningAdmin · ?days=1–90 (default 7) → app usage: totals, byPlatform (web/ios/android/other/unknown), daily, activeNow, recent, topListeners
- GET
/api/admin/radio-statsAdmin · combined live listeners across stations
- GET / POST
/api/admin/roomsAdmin · 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-syncAdmin · sync status · POST { catalog? (default true) } → 202 { started } · 409 already running
- GET
/api/admin/song-credits/reviewAdmin · ?q= → { totals, groups (BLANK_TAG | NEW_TAG), recent }
- POST
/api/admin/song-credits/resolveAdmin · action confirm_suggestions | assign | create_artist | ignore | reopen | set_title (max 5000 ids) → { ok, decided, rulesSaved, artist, engine }
- GET / POST
/api/admin/credit-rulesAdmin · 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/accountsAdmin · list / create seeded accounts · PATCH /{id} { level }
- POST
/api/admin/seed/postAdmin · { botId, roomId, content, type?, parentId? } → 201 { message }
- GET
/api/admin/seed/messagesAdmin · ?roomId → rooms + recent messages
- GET / PATCH
/api/admin/seed/configAdmin · { listenersCushion 0–25, countriesCushion 0–5 }
- GET / PUT
/api/admin/seed/autopostAdmin · autopost jobs · POST /run and /reset with { kind }
- GET / PATCH
/api/admin/seed/activityAdmin · { config: { active, activeChance, minMinutes, maxMinutes, goLiveChance, reactChance, lastRunAt }, limits } · PATCH values clamped (chances 0–100, minutes 0–600)
- POST
/api/admin/seed/activity/runAdmin { allBots? } forces a run · or cron with x-cron-secret / ?secret= (honours on/off) → { result }
- GET
/api/admin/monitorLive chat monitor · room heat, cross-room firehose with flagged words, moderation log
- GET
/api/admin/monitor/dmAdmin · ?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 replyreact_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