Appearance
Live streaming
Agora RTC broadcasting: a creator schedules a stream or goes live now, free or ticketed. All paths are under /v1. Responses are { data, meta }, and errors are RFC 9457 problem documents. Auth: user means a signed-in user is required. optional means guests are allowed, and signed-in callers get more. Money routes need an Idempotency-Key header.
Lifecycle: scheduled → live → ended, and scheduled → cancelled. Only the host starts a stream. The host or the system ends it. A stream that has gone live can't be cancelled. The system ends any stream still live after 12 hours.
Streams
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /live/streams | optional | status (live|scheduled|ended, default live), profileId?, category?, platform?, cursor?, limit? | page of StreamView (public streams only) | PAGINATION_CURSOR_INVALID |
| POST | /live/streams | user | CreateStream | 201 HostStreamView | PROFILE_NOT_FOUND, LIVE_SCHEDULE_INVALID, LIVE_TICKETING_INVALID |
| GET | /me/live/profiles/:profileId/streams | user (profile owner) | cursor?, limit? | page of HostStreamView | PROFILE_NOT_FOUND |
| GET | /live/streams/:id | optional | platform? | StreamView (viewer is null for guests) | LIVE_STREAM_NOT_FOUND |
| GET | /live/streams/:id/manage | user (host) | – | HostStreamView | LIVE_NOT_HOST |
| PATCH | /live/streams/:id | user (host) | any editable field of CreateStream | HostStreamView | LIVE_NOT_HOST, LIVE_INVALID_TRANSITION, LIVE_SCHEDULE_INVALID, LIVE_TICKETING_INVALID (prices are locked once a ticket is sold) |
| POST | /live/streams/:id/start | user (host) | – | HostStreamView | LIVE_NOT_HOST, LIVE_INVALID_TRANSITION |
| POST | /live/streams/:id/end | user (host) | – | HostStreamView | LIVE_NOT_HOST, LIVE_INVALID_TRANSITION |
| POST | /live/streams/:id/cancel | user (host) | { reason? } | HostStreamView | LIVE_NOT_HOST, LIVE_INVALID_TRANSITION |
| POST | /live/streams/:id/entry | optional | { inviteCode? } | EntryResult (see Joining from a link): a subscriber token for the audience, a publisher token for the host and co-hosts, or the replay once ended | see that section |
| POST | /live/streams/:id/publisher-token | user (host/co-host) | – | RtcCredentials (publisher) | LIVE_NOT_HOST, LIVE_NOT_LIVE |
| PUT / DELETE | /live/streams/:id/reminder | user | – | { status: "ok" } | LIVE_INVALID_TRANSITION (only while scheduled) |
| GET | /live/streams/:id/replay | optional | – | ReplayView | LIVE_REPLAY_NOT_FOUND, LIVE_REPLAY_LOCKED |
| PUT | /live/streams/:id/replay/access | user (host) | { access: "free"|"ticket_holders"|"subscribers" } | { access } | LIVE_NOT_HOST |
CreateStream fields:
- Required:
profileId,title. - Optional:
description,category(concert,dj,acoustic,jam,talk,rehearsal,listening_party,podcast,q_and_a),coverAssetId,languageCode,countryCode,isExplicit,visibility(public,unlistedorprivate),startNow,scheduledStartAt,scheduledEndAt. - Ticketing:
access(free|ticketed),prices([{ amountMinor, currency, storePriceTierId? }], one per currency, needed when ticketed; see In-app purchases),capacity,ticketSalesStartAt,ticketSalesEndAt. - Settings:
isChatEnabled,isGiftingEnabled,isRecordingEnabled,replayAccess.
StreamView returns those fields plus:
statusticketsRemainingstartedAt,endedAtviewerCount,peakViewerslinks:{ url, appUrl }.urlis the universal link (DEEP_LINK_BASE_URL/live/<id>), andappUrluses the app schemefundingPresets:[{ currency, amountsMinor[] }], the one-tap funding amountsviewer:{ role, hasTicket, hasReminder, isBanned, isMuted, isFollowingHost }, or null for guests
HostStreamView adds ticketsSold, totalViewers and agoraChannel.
RtcCredentials: { appId, channel, uid, role: "publisher"|"subscriber", token, expiresAt }. Each person keeps the same Agora uid in a stream.
In-app purchases
App Store (apple_iap) and Google Play (google_play) purchases use the wallet's staff-managed store price tiers. The live module reads them through the storeTiers port. Live only sends a tier the wallet will accept. Web, wallet, card and bank-transfer payments keep free amounts.
- Gifts. Each catalogue gift may carry a
live_gifttier (storePriceTierId).- An in-app gift buys one gift at exactly the tier's price. The
currencyin the request is ignored. - Quantity above 1 →
LIVE_STORE_SINGLE_ITEM. - No tier, or no product on that store →
LIVE_STORE_NOT_AVAILABLE. - A retired or wrong-kind tier →
LIVE_STORE_TIER_INVALID.
- An in-app gift buys one gift at exactly the tier's price. The
- Tickets. When a creator sets prices, each price may carry a
live_tickettier:prices: [{ amountMinor, currency, storePriceTierId? }].- The tier must be active, of kind
live_ticket, and cost exactly that price in that currency. Otherwise create or update fails withLIVE_STORE_TIER_INVALIDorLIVE_STORE_TIER_MISMATCH. - At purchase, an in-app method needs a price row with a tier, and the match is checked again. Failures are
LIVE_STORE_NOT_AVAILABLE,LIVE_STORE_TIER_INVALIDandLIVE_STORE_TIER_MISMATCH. - The tier id goes on the payment intent as
storePriceTierId.
- The tier must be active, of kind
- Product ids. Add
?platform=ios|androidtoGET /live/gifts,GET /live/streams,GET /live/streams/:idandGET /live/streams/:id/manage.- Each gift then carries
storeProductId. StreamView.storePriceslists[{ currency, amountMinor, storePriceTierId, storeProductId }]for the prices that can be paid in the app.storeProductIdis null withoutplatform, or when the tier has no product on that store.
- Each gift then carries
Tickets
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| POST | /live/streams/:id/tickets | user, idempotency key | { currency, method } | 201 { orderId, payment: { id, status, checkoutUrl }, ticket } | LIVE_FREE_STREAM, LIVE_TICKET_SALES_CLOSED, LIVE_TICKETS_SOLD_OUT, LIVE_TICKET_CURRENCY_UNAVAILABLE, LIVE_TICKET_ALREADY_OWNED, LIVE_STORE_NOT_AVAILABLE, LIVE_STORE_TIER_INVALID, LIVE_STORE_TIER_MISMATCH, IDEMPOTENCY_KEY_REQUIRED |
| GET | /me/live/tickets | user | cursor?, limit? | page of TicketView (ticket history, newest first) | – |
| GET | /me/live/tickets/:ticketId | user | – | TicketView | LIVE_TICKET_NOT_FOUND |
| POST | /live/streams/:id/tickets/verify | user (host/co-host/moderator) | { qrPayload } | { isValid, ticketId, userId, status } | LIVE_NOT_MODERATOR |
A ticket is issued only when the payment for purpose live_ticket succeeds, and it is issued once per payment. Until then, ticket is null, and the client polls /me/live/tickets. A refund revokes the ticket. TicketView fields:
id,streamId,status(valid|used|revoked)code(XXXXX-XXXXX)qrPayload: a signed string to render as a QR codeprice,issuedAt,firstEnteredAtstream:{ title, status, scheduledStartAt, hostProfileId }
Co-hosts, moderators, bans, kicks and mutes
A stream can have up to live.maxCohosts co-hosts (a staff setting, seeded from LIVE_MAX_COHOSTS, maximum 10). Each co-host fetches a publisher token from /publisher-token. A newly promoted co-host is also sent one directly in cohost:promoted.
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| GET | /live/streams/:id/members | optional | – | [MemberView] for the host, co-hosts and moderators | – |
| POST | /live/streams/:id/cohost-invites | user (host) | { userId } | 201 InviteView (valid for 10 minutes) | LIVE_NOT_HOST, LIVE_SELF_ACTION, LIVE_ALREADY_COHOST, LIVE_COHOST_LIMIT |
| GET | /me/live/cohost-invites | user | – | [InviteView] (pending) | – |
| POST | /live/cohost-invites/:inviteId/accept | /decline | user (invitee) | – | InviteView | LIVE_COHOST_INVITE_NOT_FOUND, LIVE_COHOST_LIMIT |
| PUT | /live/streams/:id/cohosts/:userId | user (host) | – | ok (promotes someone straight from the audience) | LIVE_NOT_HOST, LIVE_ALREADY_COHOST, LIVE_COHOST_LIMIT |
| DELETE | /live/streams/:id/cohosts/:userId | user (the host, or the co-host stepping down) | – | ok (demotes to viewer) | LIVE_MEMBER_NOT_FOUND |
| PUT / DELETE | /live/streams/:id/moderators/:userId | user (host) | – | ok | LIVE_NOT_HOST, LIVE_SELF_ACTION |
| GET | /live/streams/:id/bans | user (staff of the stream) | – | [MemberView] | LIVE_NOT_MODERATOR |
| POST | /live/streams/:id/bans | user (staff of the stream) | { userId, reason?, durationMinutes? } (no duration: banned for the stream) | ok | LIVE_NOT_MODERATOR, LIVE_SELF_ACTION |
| POST | /live/streams/:id/kicks | user (staff of the stream) | { userId, reason?, durationMinutes? } (default 10 minutes) | ok | LIVE_NOT_MODERATOR, LIVE_SELF_ACTION |
| DELETE | /live/streams/:id/bans/:userId | user (staff of the stream) | – | ok (also lifts a kick) | LIVE_NOT_MODERATOR |
| POST | /live/streams/:id/mutes | user (staff of the stream) | { userId, reason?, durationMinutes? } (default 10 minutes) | ok | LIVE_NOT_MODERATOR |
| DELETE | /live/streams/:id/mutes/:userId | user (staff of the stream) | – | ok | LIVE_NOT_MODERATOR |
Moderation only reaches someone ranked lower (host > co-host > moderator > viewer), and never the host.
When someone is banned or kicked, they get stream:kicked. Their sockets in this process leave the room at once. Their sockets on other replicas leave on their next heartbeat, which is answered with LIVE_KICKED. Joining again is refused with LIVE_KICKED until the kick ends, or with LIVE_BANNED for a ban.
Session, viewers and quick actions
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /live/streams/:id/session | user (same checks as entry) | – | StreamSession | entry errors, LIVE_KICKED |
| GET | /live/streams/:id/viewers | user | cursor?, limit? | page of { userId, displayName, avatarAssetId, avatarUrl, role, isWatching, lastJoinedAt }, most recent joiners first | LIVE_STREAM_NOT_FOUND |
| POST | /live/streams/:id/reactions | user (joined) | { reaction, count? } (1 to 20 batched taps) | 202 { accepted } | LIVE_NOT_LIVE, LIVE_BANNED, LIVE_MEMBER_NOT_FOUND |
| PUT / DELETE | /live/streams/:id/follow | user | – | { profileId, isFollowing } (follows the creator) | LIVE_SELF_ACTION |
| POST | /live/streams/:id/funding | user, idempotency key | { amount: { amountMinor, currency }, method, message?, isAnonymous? } | 201 { payment } | LIVE_FUNDING_AMOUNT_INVALID, LIVE_NOT_LIVE, LIVE_SELF_ACTION, LIVE_BANNED |
StreamSession is what the stream screen renders from. Patches apply on top of it:
- Stream:
streamId,title,status,visibility,access,category,coverAssetId,scheduledStartAt,startedAt,channel. - Sync:
version,serverTime. links:{ url, appUrl }.host:{ userId, profileId, displayName, handle, avatarAssetId, avatarUrl, uid }.cohosts:[{ userId, displayName, avatarAssetId, avatarUrl, role, uid }]. Eachuidmaps a remote Agora track to a person.you:{ userId, role, uid, mutedUntil, isFollowingHost, hasTicket, canPublish, canModerate }.stats: same shape asstream:stats.recentViewers: up to 12 people.recentComments: up to 30, oldest first.reactions:[{ code, emoji }].fundingPresets.features:{ isChatEnabled, isGiftingEnabled, isFundingEnabled, isRecordingEnabled }.limits:{ chatMessagesPer10s, reactionsPerSecond, reactionBatchMax, heartbeatIntervalSeconds, viewerTimeoutSeconds }.
Versioning. version only moves forward. It is bumped on any stream-wide change: status, settings, or the co-host and moderator line-up. Emits that change the session carry the new version. If a client sees a gap, or a heartbeat answers resync: true, it fetches stream:session again.
Funding. A custom amount may run from a fifth of the smallest preset to fifty times the largest. Payment goes through the funding module, attributed to the stream. The funding module reports each settled payment back through LiveApi.recordFunding. That counts it in stats.funds once per payment and emits fund:received.
Reactions. The emoji set is fixed: heart ❤️, fire 🔥, clap 👏, laugh 😂, wow 😮, hundred 💯.
- Each person may send up to 20 taps per second. Taps beyond that are dropped, not refused.
- Taps are counted in Valkey. About every
LIVE_REACTION_FLUSH_MS(default 1 s) they go to the room as onereaction:burstper stream, never one emit per tap. - Running totals are written to Postgres every minute and when the stream ends.
Joining from a link
Anyone can open a stream from a link. The preview routes are public, and they don't need a signed-in caller.
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /live/streams/:id/preview | public (rate-limited per IP) | currency?, invite? | LivePreview | LIVE_STREAM_NOT_FOUND, LIVE_INVITE_REQUIRED (private stream without an invite), invite errors |
| GET | /live/shares/:code | public | currency? | LivePreview, and the open is counted | LIVE_SHARE_NOT_FOUND |
| GET | /live/invites/:code | public | currency? | LivePreview for the invite's stream (links is the invite link) | LIVE_INVITE_INVALID, LIVE_INVITE_EXPIRED, LIVE_INVITE_USED_UP |
| POST | /live/streams/:id/entry | optional (guests rate-limited per IP and per X-Device-Id) | { inviteCode? } | EntryResult | see below |
LivePreview holds only what's safe for guests:
- Stream:
streamId,title,category,coverAssetId,status,visibility,scheduledStartAt,startedAt,viewerCount,access. creator:{ profileId, displayName, handle, avatarAssetId, avatarUrl }.price: in thecurrencyasked for when the stream is sold in it, else the first listed. AlsopricesandhasReplay.links: the stream link, or the invite link when opened from one.join:{ action, links }.actionis one ofwatch,replay,wait,sign_in,buy_ticket,invite_required,unavailable.linksis where the button goes: the stream, the ticket page (live/:id/ticket), the replay (live/:id/replay), or sign-in.
EntryResult is one of:
{ mode: "live", as: "member" | "guest", credentials: RtcCredentials, refreshAfterSeconds }: call entry again beforerefreshAfterSecondspasses.{ mode: "replay", links, replay: ReplayView }: the stream has ended, and its replay is open to this viewer.
The rules, in order (pure, in join/engine.ts):
| Case | Result |
|---|---|
| Host, co-host or moderator | In while scheduled or live. Once ended, the replay. |
| Private stream, no invite | LIVE_INVITE_REQUIRED. A signed-in person admitted once by an invite needs no code again. |
| Ended | The replay if it exists and the viewer may watch it. A guest facing a locked replay gets LIVE_SIGN_IN_REQUIRED (sign_in). Otherwise LIVE_REPLAY_LOCKED or LIVE_NOT_LIVE. |
| Guest on a ticketed stream | LIVE_TICKET_REQUIRED, whose open action deep-links to live/:id/ticket. |
Guest, LIVE_GUEST_VIEWING=false | LIVE_SIGN_IN_REQUIRED (sign_in, deep link sign-in) |
| Guest on a free, live stream | An audience token. The guest uid is stable per stream and device, in the upper half of Agora's uid space. The TTL is LIVE_GUEST_TOKEN_TTL_SECONDS (default 600 s). Guests count as viewers while their token lasts. |
| Banned, kicked or blocked | LIVE_BANNED, LIVE_KICKED (wait) |
| Ticketed, no ticket | LIVE_TICKET_REQUIRED (open → ticket page) |
| Scheduled | LIVE_NOT_LIVE |
| Full | LIVE_CAPACITY_REACHED |
Chat, reactions, gifts, funding, follow and posting to moments need an account. Guests get LIVE_SIGN_IN_REQUIRED, whose sign_in action deep-links to sign-in. The socket namespace itself needs sign-in.
Visibility:
publicstreams are listed.unlistedstreams are kept out of discovery, but anyone with the link may watch.privatestreams open only through an invite. Their page and preview refuse everyone else, and they can't be posted to moments.
Invite links
The host manages invite links for unlisted and private streams. A link can have a label, an expiry (default 72 hours, at most 30 days, or null for never) and a use limit. Each person or guest device counts once per link. Someone who already used a link gets back in while it's still valid, even after its uses run out.
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| POST | /live/streams/:id/invites | user (host) | { label?, expiresInHours?, maxUses? } | 201 InviteLinkView | LIVE_NOT_HOST, LIVE_INVITE_LIMIT (20 live links), LIVE_INVALID_TRANSITION |
| GET | /live/streams/:id/invites | user (host) | cursor?, limit? | page of InviteLinkView, newest first | LIVE_NOT_HOST |
| POST | /live/invite-links/:inviteId/rotate | user (host) | – | InviteLinkView with a new code. The old code stops working; people already admitted stay admitted. | LIVE_INVITE_INVALID |
| POST | /live/invite-links/:inviteId/reset | user (host) | { expiresInHours?, maxUses? } | InviteLinkView: uses back to 0 with a fresh expiry, and a revoked link is reopened | LIVE_INVITE_INVALID |
| DELETE | /live/invite-links/:inviteId | user (host) | – | ok (revoked) | LIVE_INVITE_INVALID |
InviteLinkView fields: id, streamId, code, label, links (live/invite/:code), state (active, expired, used_up, revoked), expiresAt, maxUses, useCount, rotatedAt, createdAt.
To join on an invite, pass inviteCode to POST /entry. Opening live/invite/:code previews the stream.
Sharing
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| POST | /live/streams/:id/share | optional | { channel? } (copy_link, moments, whatsapp, instagram, x, facebook, telegram, tiktok, sms, email, other) | 201 { streamId, channel, code, links: { url, appUrl }, text, invite } | LIVE_STREAM_NOT_FOUND, LIVE_INVITE_REQUIRED (a private stream, for anyone but the host), LIVE_INVALID_TRANSITION |
| GET | /live/streams/:id/share/moment | optional | – | LiveSharePayload (preview, not tracked) | PROFILE_NOT_FOUND, LIVE_INVITE_REQUIRED (not public) |
| POST | /live/streams/:id/share/moment | user | { caption? } | 201 { momentId, payload } | PROFILE_NOT_FOUND, LIVE_INVITE_REQUIRED (not public), LIVE_INVALID_TRANSITION |
A signed-in sharer gets one tracked link per channel: live/<id>?s=<code>. Each share adds to stats.shares, and each open of GET /live/shares/:code adds to the link's open_count and the stream's share-open total. Guests get the plain link, untracked.
For a private stream, the host's share sheet carries an invite link: the newest one that still works, or a new 72-hour one. For an unlisted stream, the host's sheet also offers the current invite in invite, when there is one.
LiveSharePayload is what the moments module stores and renders: the creator's face, and a tap that opens the stream. Fields:
type: "live_share",liveStreamId,title,status,scheduledStartAt,coverAssetIdcreator:{ profileId, displayName, handle, avatarAssetId, avatarUrl }joinUrl,joinAppUrl
A stream can be shared while scheduled or live. Once ended, it can be shared only if it has a ready replay.
Chat and gifts
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /live/streams/:id/messages | optional (ticket holders only for ticketed streams) | cursor?, limit? | page of ChatMessage, newest first | LIVE_TICKET_REQUIRED |
| POST | /live/streams/:id/messages | user (joined) | { body, replyToMessageId? } | 201 ChatMessage | LIVE_NOT_LIVE, LIVE_CHAT_DISABLED, LIVE_MUTED, LIVE_BANNED, LIVE_CHAT_RATE_LIMITED, LIVE_MEMBER_NOT_FOUND |
| DELETE | /live/streams/:id/messages/:messageId | user (author or staff of the stream) | – | ok | LIVE_MESSAGE_NOT_FOUND, LIVE_NOT_MODERATOR |
| GET | /live/gifts | optional | platform? (ios | android) | [GiftCatalogueItem] with prices per currency, storePriceTierId and storeProductId |
| GET | /live/streams/:id/gifts | optional | cursor?, limit? | page of GiftView (sender hidden when anonymous) | – |
| POST | /live/streams/:id/gifts | user, idempotency key | { giftCode, quantity?, currency, method, message?, isAnonymous? } | 201 { giftId, payment } | LIVE_NOT_LIVE, LIVE_GIFTING_DISABLED, LIVE_GIFT_NOT_FOUND, LIVE_GIFT_CURRENCY_UNAVAILABLE, LIVE_STORE_SINGLE_ITEM, LIVE_STORE_NOT_AVAILABLE, LIVE_STORE_TIER_INVALID, LIVE_SELF_ACTION, LIVE_BANNED |
Gifts are paid through Payments, with purpose live_gift and fee kind live_gift. The host's profile receives 100% of the net amount. Once the payment settles, a gift chat line is stored, stats.gifts goes up, and gift:sent is emitted.
Socket namespace /live
Connect with auth: { token }. Commands are acknowledged with { ok, data | error }, and every quick action is also a REST route.
| Command | Payload | Ack | Notes |
|---|---|---|---|
stream:join | { streamId } | { session: StreamSession } | Same checks as /entry. Joins room live:<id>. Use it to rejoin after a drop as well. |
stream:session | { streamId } | StreamSession | Resync. Needs a prior join. |
stream:leave | { streamId } | { viewerCount } | |
stream:heartbeat | { streamId, version? } | { viewerCount, version, resync, serverTime } | Send every 20 to 30 s. Without one, a viewer drops out of the count after 60 s. A removed member gets LIVE_KICKED and is taken out of the room. |
chat:send | { streamId, body, replyToMessageId? } | ChatMessage | Same rules as the HTTP route. |
reaction:send | { streamId, reaction, count? } | { accepted } | Batch taps on the client. |
fund:send | { streamId, amount, method, message?, isAnonymous?, idempotencyKey } | { id, status, checkoutUrl } | The idempotency key is 8 to 128 printable characters. |
creator:follow | { streamId, follow? } | { profileId, isFollowing } | |
stream:share | { streamId, channel? } | the same as POST /share | |
cohost:promote / cohost:demote | { streamId, userId } | { ok: true } | Host only; a co-host may demote themselves. |
member:kick | { streamId, userId, reason?, durationMinutes? } | { ok: true } | Staff of the stream. |
member:mute | { streamId, userId, reason?, durationMinutes? } | { ok: true } | Staff of the stream. |
| Emit (server → client) | Payload | Room |
|---|---|---|
stream:started | stream:ended | stream:cancelled | { streamId, startedAt | endedAt } | live:<id> |
stream:updated | { streamId, version }: settings changed, so resync | live:<id> |
stream:stats | { streamId, version, serverTime, viewers, peakViewers, reactions, reactionsByType, gifts, funds, shares } | live:<id>, every LIVE_STATS_INTERVAL_MS (default 5 s) while live, sent by one replica only |
stream:kicked | { streamId, reason, until } (until null: for the rest of the stream) | user:<id> |
chat:sent | ChatMessage { id, streamId, userId, kind, body, replyToMessageId, role, createdAt } | live:<id> |
chat:deleted | { streamId, messageId } | live:<id> |
reaction:burst | { streamId, counts: { heart?: n, ... }, total } | live:<id> |
fund:received | { streamId, amount, senderUserId } | live:<id> |
gift:sent | { streamId, giftId, giftCode, quantity, senderUserId, message } | live:<id> |
member:added | { streamId, version, member: { userId, displayName, avatarAssetId, avatarUrl, role, uid } } | live:<id> |
member:removed | { streamId, version, userId, role } | live:<id> |
member:banned | { streamId, userId } | live:<id> |
member:muted | { streamId, userId, mutedUntil } | live:<id> |
cohost:updated | { streamId, version, cohosts: [...] } | live:<id> |
cohost:promoted | { streamId, credentials: RtcCredentials } (a publisher token) | user:<id> |
cohost:demoted | { streamId }: unpublish now | user:<id> |
cohost:invited | { streamId, inviteId, inviterUserId } | user:<invitee> |
Staff moderation
Staff tokens with the reports:moderate permission.
| Method | Path | Body / query | Response | Errors |
|---|---|---|---|---|
| GET | /staff/live/streams | status?, creatorProfileId?, cursor?, limit? | page of HostStreamView, newest first, every visibility | ACCESS_DENIED |
| GET | /staff/live/streams/:id | – | HostStreamView plus hostUserId, members: { staff, cohosts, moderators, viewers, banned }, gifts: { count, totals: [{ amountMinor, currency, count }] }, reportsCount (0 when no reports port is wired) | LIVE_STREAM_NOT_FOUND |
| POST | /staff/live/streams/:id/end | { reason } | ok | LIVE_NOT_LIVE |
| POST | /staff/live/streams/:id/hide | { reason } | ok | LIVE_STREAM_NOT_FOUND |
- End: the stream ends, which emits
live.stream.endedandstream:ended. Sockets on this replica leave the room at once. Replay finalisation runs as usual. - Hide: sets the visibility to
private, so the stream drops out of discovery and only invites and its own staff reach it. It also emitsstream:updated. - Both: write an audit record (
live.stream.ended_by_stafforlive.stream.hidden_by_staff, with the reason) and notify the host with typelive.moderated. Both happen in one transaction.
Notifications sent
| Type | When | Audience |
|---|---|---|
live.started | When the stream goes live | The host's followers, ticket holders and people with a reminder. The fan-out runs in a job. |
live.starting_soon | 15 minutes before the scheduled start | The host's followers, ticket holders and people with a reminder |
live.ticket_issued | When a ticket is issued (also emailed, template live.ticket) | The buyer |
live.gift_received | When a gift settles | The host |
live.cohost_invited | When a co-host invite is sent | The invitee |
live.moderated | When staff end or hide a stream (high priority, with the reason) | The host |
Notification taps open appUrl (<APP_URL_SCHEME>://live/<id>). Emails and shares use url (<DEEP_LINK_BASE_URL>/live/<id>).
Account privacy
| Event | Behaviour |
|---|---|
identity.user.deleted | Scheduled streams are cancelled (normal cancellation, so tickets refund). Reminders, co-host invites and memberships are deleted; chat messages lose author and text; gift messages cleared; shares anonymised. Tickets, orders and gifts are kept as payment records. |
identity.user.deactivated | Public scheduled/live streams become unlisted (held in live_deactivation_holds). |
identity.user.reactivated | Held streams get their visibility back. |
| Data export | Section live: streams hosted, ticket orders, tickets, gifts sent, chat, reminders, memberships. |
Additions for the native apps
GET /live/categoriesreturns[{ code, label, sortOrder }], the active entries of the staff settinglive.categories. A stream'scategorymust be one of them (LIVE_CATEGORY_UNKNOWN).- Stream views carry
host { profileId, displayName, handle, avatarUrl, isVerified },coverUrlandhasReplay. List rows carryviewerfor a signed-in caller. GET /me/live/reminders: scheduled streams the caller asked to be reminded of, soonest first.GET /live/streams?status=ended&hasReplay=trueandGET /profiles/:profileId/replayslist replays.GET /live/streams/:id/viewersaddsmeta.total(everyone who joined) andmeta.watching(there now).- Chat lines carry
author { displayName, handle, avatarUrl }(null for system lines and anonymous gifts) andisPinned.gift:sentaddsgiftName,iconUrl,animationKey,amountandsender;fund:receivedaddssenderandmessage. The gift catalogue addsiconUrl. - Pinned chat: host, co-hosts and moderators
PUT/DELETE /live/streams/:id/messages/:messageId/pin(orPUT /live/streams/:id/pinned-message { messageId },GETandDELETEthere), or socketchat:pin { streamId, messageId }andchat:unpin { streamId }. One line per stream: pinning another unpins the first. The room hearschat:pinned { streamId, message }andchat:unpinned { streamId, messageId }; the session carriespinnedMessage. - Funding presets on streams follow
GET /funding/presets.
Gift goal, staff catalogue, viewers
- Create or
PATCHa stream withgiftGoal { amountMinor, currency } | null(currency must have funding presets,LIVE_GOAL_CURRENCY_UNAVAILABLE). Views and the session carrygiftGoal { goal, raised, progressBps, reachedAt } | null, whereraisedis settled gifts and fan funding in that currency.stream:statscarriesgoal;goal:reached { streamId, goal }is sent once. - Staff edit gifts:
GET /staff/live/gifts,POST /staff/live/gifts { code, name, tier, prices[], ...optional, reason },PATCH /staff/live/gifts/:code { ..., reason },PUT /staff/live/gifts/:code/prices { prices, reason }(settings:manage, audited). AstorePriceTierIdmust be an activelive_gifttier at one of the gift's prices. - Replay ready notifications reach followers, ticket holders and reminder holders.
Gift goal and staff gift catalogue
giftGoal: { amountMinor, currency } | nullonPOST/PATCH /live/streams; the currency must have funding presets (LIVE_GOAL_CURRENCY_UNAVAILABLE). Streams and sessions carrygiftGoal { goal, raised, progressBps, reachedAt } | null;raisedis settled gifts plus live funding in that currency.stream:statscarriesgoal, and the room hearsgoal:reached { streamId, goal }once.live.replay_readyalso goes to ticket holders and reminder holders.- Staff (
settings:manage):GET /staff/live/gifts,POST /staff/live/gifts { code, name, tier, prices[], ... , reason },PATCH /staff/live/gifts/:code,PUT /staff/live/gifts/:code/prices { prices, reason }. AstorePriceTierIdmust be an activelive_gifttier at one of the prices. Audited.