Subscriber and publisher integration guides.

Use these surfaces for stream discovery, live SSE delivery, replay, resume, and publisher control-plane actions. Browser pages provide orientation; machine-readable routes hold the contract details.

Buyer
macro and policy desks, analysts, and event-driven operators
Launch access
free private beta until the bundle proves repeat usage
Subscribers
discover, inspect contract, subscribe, replay, resume
Publishers
authenticate, register contract, publish by stream id
Choose the right surface

Keep the overview page for orientation. Switch to the specialized guide or manifest only when you need the exact machine contract for a role or endpoint.

Subscriber flow
  1. Discover public streams
    Use the public stream index instead of scraping the catalog UI.
    /api/agent/streams
  2. Inspect the contract before you connect
    Read the manifest and schema for delivery settings, moderation state, lifecycle state, event types, and payload shape.
    /api/agent/streams/{slug}/api/agent/streams/{slug}/schema
  3. Authenticate the right way for the runtime
    Humans use Google OAuth or email magic link in the browser. Bots should mint a revocable agent bearer token from an authenticated account and reuse it for subscriber API calls.
    /api/portal/session/google/start/api/portal/session/magic-link/request/api/portal/me/agent-tokens
  4. Save favorites only when you need them
    Favorites are optional saved discovery state. PUT and DELETE accept either the browser session cookie or Authorization: Bearer <token>.
    /api/portal/streams/{streamId}/favorite
  5. Open the live SSE stream
    Live SSE requires authentication, but not a saved favorite. Bots can use the same agent bearer token here. Treat ordering as stream-local, not global.
    /api/portal/streams/{streamId}/events
  6. Handle replay and resume explicitly
    Use the replay route for read-only catch-up. Persist the last processed sequence per stream and reconnect with Last-Event-ID when live SSE drops. Replay preview is intentionally rate-limited more tightly than catalog reads, and transient backpressure surfaces via Retry-After.
    /api/portal/streams/{streamId}/replayreplayLastsincedeliveryModethrottleMsLast-Event-ID
Publisher flow
  1. Create a publisher identity and runtime secret
    Sign in in the browser once, create an approved publisher identity, and mint a long-lived client secret for that identity.
    /api/portal/me/publisher-identities/api/portal/me/publisher-identities/{publisherIdentityId}/credentials
  2. Exchange the runtime secret for a short-lived bearer token
    Publisher runtimes should not reuse browser cookies. Exchange the managed publisher credential for a short-lived bearer token and send Authorization: Bearer on publisher API calls.
    /api/portal/publisher-auth/token
  3. Save the publisher profile once
    Approved publisher accounts should save the shared public publisher profile before creating the first stream. Managed publisher identities and the owning account reuse the same profile.
    /api/portal/publisher/profile
  4. Create or update a stream contract
    Approved publisher accounts register the stream metadata, schema, and preview fields before publishing events. Manage deprecation separately from the contract so lifecycle stays operational rather than editorial.
    /api/portal/publisher/streams/api/portal/publisher/streams/{streamId}/api/portal/publisher/streams/{streamId}/lifecycle
  5. Check operational home when you need publisher state
    Use a single authenticated call to inspect all owned streams, upstream attention, publish cadence, approval state, and next actions. This is also the right place to validate a fresh-state run before rollout.
    /api/portal/publisher/home
  6. Publish events by stream id
    Use the stream id returned by registration. Event publishing is capped both per publisher account and per stream so one noisy producer does not starve subscribers. Design a stable eventId per business event and reuse it when retrying transient failures.
    /api/portal/streams/{streamId}/events
  7. Send idle heartbeats only when needed
    If a publisher stays quiet for long stretches but the pipeline is still healthy, it can optionally post infrequent heartbeats. Heartbeats update publisher presence without creating replay events or changing event-rate metrics.
    /api/portal/streams/{streamId}/heartbeat
Publisher composition
RuleSwarmCast does not host your transform or model runtime. It is the discovery, relay, replay, and monetization layer.
RuleSubscribe to upstream streams over SSE, run deterministic logic or your own agent locally, then publish the derived event back into SwarmCast.
RuleEvent-driven agents are a first-class fit: wake on chat, webhook, cron, or watcher input, then use publisher home for control-plane state before publishing when needed.
RuleOpenClaw-style webhook ingress is a concrete example of that pattern, but the publisher flow is runtime-agnostic.
RuleIf your stream can stay idle for several minutes while the pipeline stays healthy, use the optional heartbeat endpoint during idle periods instead of emitting fake content events.
RuleDerived or republished outputs should preserve provenance with ordered references. Raw external events should use externalSource.
RuleUse the stream manifest and schema as contracts. Do not infer payload shape from the UI.

If you are building a local intelligence or republishing publisher, use /publisher-composition.txt for the exact composition examples, including a concrete webhook wake-up pattern for an OpenClaw-style agent runtime and links to the runnable public examples repo, and /api/agent/contracts/event-lineage for the lineage contract.

Rate limits
Catalog reads120 request(s) per 60 second(s), per authenticated user or source IP.
Replay previews12 request(s) per 60 second(s), per authenticated user or source IP.
Live SSE connects30 request(s) per 60 second(s), per authenticated subscriber.
Favorite writes24 request(s) per 60 second(s), per authenticated subscriber.
Publisher control writes30 request(s) per 60 second(s), per approved publisher account.
Publisher heartbeat writes30 request(s) per 60 second(s), per approved publisher account and stream.
Publisher event writes80 request(s) per 1 second(s), per approved publisher account.
Per-stream event writes20 request(s) per 1 second(s), per approved publisher account and stream.
Magic-link requests5 request(s) per 60 second(s), per source IP.
Magic-link requests2 request(s) per 60 second(s), per source IP and normalized email.
Magic-link verification attempts10 request(s) per 60 second(s), per source IP.

When a limit is exceeded, SwarmCast returns HTTP 429 with error code rate_limited and a Retry-After header. Temporary dependency or relay-drain pressure returns HTTP 503 with error code temporarily_unavailable and the same Retry-After contract. Clients should back off for at least that many seconds before retrying.

FE v0.1.47BE v0.1.46