Skip to content

Live stream ​

Who: creator (host), co-hosts and moderators; listener (viewer, ticket buyer); guest (signed out, from a link); system (reminders, recording, sweeps).

Entry points ​

KindEntry
REST (host)POST /live/streams, PATCH /live/streams/:id, GET /live/streams/:id/manage, POST /live/streams/:id/start, /end, /cancel, POST /live/streams/:id/publisher-token, PUT /live/streams/:id/replay/access, GET /me/live/profiles/:profileId/streams
REST (links, public)GET /live/streams/:id/preview, GET /live/shares/:code, GET /live/invites/:code, POST /live/streams/:id/entry (guests too)
REST (invites, host)POST/GET /live/streams/:id/invites, POST /live/invite-links/:inviteId/rotate, /reset, DELETE /live/invite-links/:inviteId
REST (viewer)GET /live/streams, GET /live/streams/:id, PUT/DELETE /live/streams/:id/reminder, GET /live/streams/:id/session, GET /live/streams/:id/viewers, GET /live/streams/:id/replay
REST (tickets)POST /live/streams/:id/tickets (Idempotency-Key), GET /me/live/tickets, GET /me/live/tickets/:ticketId, POST /live/streams/:id/tickets/verify
REST (co-hosts)POST /live/streams/:id/cohost-invites, GET /me/live/cohost-invites, POST /live/cohost-invites/:inviteId/accept, /decline, PUT/DELETE /live/streams/:id/cohosts/:userId, PUT/DELETE …/moderators/:userId, bans, kicks, mutes
REST (engage)GET/POST /live/streams/:id/messages, DELETE …/messages/:messageId, POST …/reactions, GET /live/gifts, GET/POST …/gifts, POST …/funding, PUT/DELETE …/follow, POST …/share, GET /live/shares/:code, GET/POST …/share/moment
Socket /livestream:join, stream:session, stream:leave, stream:heartbeat, chat:send, reaction:send, fund:send, creator:follow, stream:share, cohost:promote, cohost:demote, member:kick, member:mute
Deep linklive (live/:id, tracked with ?s=<code>), liveInvite (live/invite/:code), liveTicket (live/:id/ticket, from LIVE_TICKET_REQUIRED), liveReplay (live/:id/replay), signIn, studio
Push/emaillive.starting_soon, live.started, live.ticket_issued (email live.ticket), live.gift_received, live.cohost_invited

Flow ​

  1. Schedule or go live: POST /live/streams { profileId, title, scheduledStartAt | startNow, access: free|ticketed, prices?, capacity?, … } → scheduled (live.stream.scheduled, search index) or live.

  2. Reminders: viewers PUT …/reminder; a delayed live.audience-notify job sends live.starting_soon 15 min before start to followers, ticket holders and reminder holders.

  3. Tickets: POST …/tickets { currency, method } → { orderId, payment, ticket: null }. When the live_ticket payment settles a ticket is issued once (live.ticket.issued, live.ticket_issued). Client polls GET /me/live/tickets. Door check: POST …/tickets/verify { qrPayload }. A refund revokes the ticket (live.ticket.revoked).

  4. Go live: host POST …/start → live → live.stream.started → live.started fan-out job; live.recording-start if recording is on. Host joins Agora with publisher-token.

  5. Open a link: live/:id, live/:id?s=<code> or live/invite/:code → GET …/preview, /live/shares/:code (counts the open) or /live/invites/:code → LivePreview, safe for guests: title, creator card, status, viewer count, free or ticketed, a price in the requested currency, and join.action (watch, replay, wait, sign_in, buy_ticket, invite_required, unavailable) with its link.

  6. Viewers: POST …/entry { inviteCode? } → EntryResult:

    • mode: "live": a member token, or a short guest token on free streams when LIVE_GUEST_VIEWING is on (rate-limited by IP and X-Device-Id; call again before refreshAfterSeconds).
    • mode: "replay": once the stream has ended.

    Ticketed without a ticket → LIVE_TICKET_REQUIRED with an open action to live/:id/ticket. A private stream needs an invite. Members then stream:join → StreamSession. Heartbeat every 20–30 s; resync: true or a version gap → stream:session. Chat, reactions, gifts, funding and follow need sign-in (LIVE_SIGN_IN_REQUIRED, sign_in).

  7. Invites (unlisted and private):

    • The host creates links with an expiry and a use limit, then rotates (new code), resets (uses back to 0) or revokes them.
    • Uses are counted once per person or guest device. A signed-in person admitted once needs no code again.
    • The host's share sheet carries the invite link.
  8. Co-hosts (≤ 10): invite (cohost:invited, valid 10 min) → accept → cohost:promoted with a publisher token; or cohost:promote straight from the audience. cohost:demoted means unpublish now.

  9. Chat, reactions, gifts, funding: chat:send; reaction:send batched to reaction:burst; gifts POST …/gifts → payment live_gift → gift:sent, live.gift.sent; funding via Fan funding → fund:received. stream:stats every 5 s.

  10. Share: POST …/share { channel } → tracked link; POST …/share/moment { caption } posts a 24 h followers moment with the join link.

  11. End: host POST …/end (or live.maintenance after 12 h) → ended, live.stream.ended, stream:ended; live.recording-finalize builds the replay → live.replay.ready. Replay access free | ticket_holders | subscribers.

  12. Cancel while scheduled → cancelled, live.stream.cancelled.

Exit states ​

StateCodeActionsClient next
Watching——Heartbeat
Not live yet / endedLIVE_NOT_LIVE (open → replay when there is one)as listedShow schedule or replay
Sign-in needed (guest)LIVE_SIGN_IN_REQUIREDsign_inSign in, then retry
Invite needed / badLIVE_INVITE_REQUIRED, LIVE_INVITE_INVALID, LIVE_INVITE_EXPIRED, LIVE_INVITE_USED_UP, LIVE_INVITE_LIMIT—Ask the host
Ticket neededLIVE_TICKET_REQUIREDopen (live/:id/ticket)Buy ticket
Sold out / sales closed / ownedLIVE_TICKETS_SOLD_OUT, LIVE_TICKET_SALES_CLOSED, LIVE_TICKET_ALREADY_OWNED——
FullLIVE_CAPACITY_REACHED——
RemovedLIVE_KICKED (wait), LIVE_BANNED, LIVE_MUTEDas listedLeave the room
ChatLIVE_CHAT_DISABLED, LIVE_CHAT_RATE_LIMITED (wait)as listed—
GiftsLIVE_GIFTING_DISABLED, LIVE_GIFT_NOT_FOUND, LIVE_GIFT_CURRENCY_UNAVAILABLE, LIVE_SELF_ACTION——
Co-hostLIVE_COHOST_LIMIT, LIVE_ALREADY_COHOST, LIVE_COHOST_INVITE_NOT_FOUND——
Host onlyLIVE_NOT_HOST, LIVE_NOT_MODERATOR, LIVE_INVALID_TRANSITION——
ReplayLIVE_REPLAY_NOT_FOUND, LIVE_REPLAY_LOCKED (subscribe)as listed—
Agora downLIVE_PROVIDER_UNAVAILABLEretry—

Known gaps ​

  • Nobody is told when a replay is ready (M2).
  • Follow-from-live and share-to-moment write social and moments tables directly; follow notifications never fire (M3, I1).
  • Drops cannot schedule a listening-party stream (I15).
  • Tickets and live chat are not in the export or erased (I7, B3).

Plemuz API v2