Appearance
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
| Kind | Entry |
|---|---|
| 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 /live | stream: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 link | live (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/email | live.starting_soon, live.started, live.ticket_issued (email live.ticket), live.gift_received, live.cohost_invited |
Flow
Schedule or go live:
POST /live/streams { profileId, title, scheduledStartAt | startNow, access: free|ticketed, prices?, capacity?, … }→scheduled(live.stream.scheduled, search index) orlive.Reminders: viewers
PUT …/reminder; a delayedlive.audience-notifyjob sendslive.starting_soon15 min before start to followers, ticket holders and reminder holders.Tickets:
POST …/tickets { currency, method }→{ orderId, payment, ticket: null }. When thelive_ticketpayment settles a ticket is issued once (live.ticket.issued,live.ticket_issued). Client pollsGET /me/live/tickets. Door check:POST …/tickets/verify { qrPayload }. A refund revokes the ticket (live.ticket.revoked).Go live: host
POST …/start→live→live.stream.started→live.startedfan-out job;live.recording-startif recording is on. Host joins Agora withpublisher-token.Open a link:
live/:id,live/:id?s=<code>orlive/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, andjoin.action(watch,replay,wait,sign_in,buy_ticket,invite_required,unavailable) with its link.Viewers:
POST …/entry { inviteCode? }→EntryResult:mode: "live": a member token, or a short guest token on free streams whenLIVE_GUEST_VIEWINGis on (rate-limited by IP andX-Device-Id; call again beforerefreshAfterSeconds).mode: "replay": once the stream has ended.
Ticketed without a ticket →
LIVE_TICKET_REQUIREDwith anopenaction tolive/:id/ticket. A private stream needs an invite. Members thenstream:join→StreamSession. Heartbeat every 20–30 s;resync: trueor a version gap →stream:session. Chat, reactions, gifts, funding and follow need sign-in (LIVE_SIGN_IN_REQUIRED,sign_in).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.
Co-hosts (≤ 10): invite (
cohost:invited, valid 10 min) → accept →cohost:promotedwith a publisher token; orcohost:promotestraight from the audience.cohost:demotedmeans unpublish now.Chat, reactions, gifts, funding:
chat:send;reaction:sendbatched toreaction:burst; giftsPOST …/gifts→ paymentlive_gift→gift:sent,live.gift.sent; funding via Fan funding →fund:received.stream:statsevery 5 s.Share:
POST …/share { channel }→ tracked link;POST …/share/moment { caption }posts a 24 h followers moment with the join link.End: host
POST …/end(orlive.maintenanceafter 12 h) →ended,live.stream.ended,stream:ended;live.recording-finalizebuilds the replay →live.replay.ready. Replay accessfree | ticket_holders | subscribers.Cancel while scheduled →
cancelled,live.stream.cancelled.
Exit states
| State | Code | Actions | Client next |
|---|---|---|---|
| Watching | — | — | Heartbeat |
| Not live yet / ended | LIVE_NOT_LIVE (open → replay when there is one) | as listed | Show schedule or replay |
| Sign-in needed (guest) | LIVE_SIGN_IN_REQUIRED | sign_in | Sign in, then retry |
| Invite needed / bad | LIVE_INVITE_REQUIRED, LIVE_INVITE_INVALID, LIVE_INVITE_EXPIRED, LIVE_INVITE_USED_UP, LIVE_INVITE_LIMIT | — | Ask the host |
| Ticket needed | LIVE_TICKET_REQUIRED | open (live/:id/ticket) | Buy ticket |
| Sold out / sales closed / owned | LIVE_TICKETS_SOLD_OUT, LIVE_TICKET_SALES_CLOSED, LIVE_TICKET_ALREADY_OWNED | — | — |
| Full | LIVE_CAPACITY_REACHED | — | — |
| Removed | LIVE_KICKED (wait), LIVE_BANNED, LIVE_MUTED | as listed | Leave the room |
| Chat | LIVE_CHAT_DISABLED, LIVE_CHAT_RATE_LIMITED (wait) | as listed | — |
| Gifts | LIVE_GIFTING_DISABLED, LIVE_GIFT_NOT_FOUND, LIVE_GIFT_CURRENCY_UNAVAILABLE, LIVE_SELF_ACTION | — | — |
| Co-host | LIVE_COHOST_LIMIT, LIVE_ALREADY_COHOST, LIVE_COHOST_INVITE_NOT_FOUND | — | — |
| Host only | LIVE_NOT_HOST, LIVE_NOT_MODERATOR, LIVE_INVALID_TRANSITION | — | — |
| Replay | LIVE_REPLAY_NOT_FOUND, LIVE_REPLAY_LOCKED (subscribe) | as listed | — |
| Agora down | LIVE_PROVIDER_UNAVAILABLE | retry | — |