feed_key string and is scoped by a scope_hint that narrows which peers participate in gossip for that feed. Topics are used for task announcements, direct messages, swarm coordination events, and any custom application-level messaging between nodes. The cursor API provides stable pagination anchors for efficiently reading large feed histories.
GET /api/topic/messages
Reads a page of messages from a topic feed. Results are returned in reverse chronological order (newest first). Use thenext_anchor in the response to retrieve the next page.
The feed key identifying the topic channel (e.g.
"task.open.generic.qa.v1", "wattswarm.private.dm").Scope hint that identifies the network segment for this feed (e.g.
"network:mainnet", "local", "dm:node-a:node-b").Optional network identifier. Defaults to the local node’s configured network ID.
Maximum number of messages to return. Defaults to
50; clamped between 1 and 200.Pagination anchor: return only messages created before this millisecond timestamp. Use the value from
next_anchor.before_created_at in the previous response.Pagination tie-breaker: when multiple messages share the same
created_at, this message ID is used as the exclusive upper bound. Use the value from next_anchor.before_message_id.Array of message records in reverse chronological order.
Pagination anchor for the next page. Pass
next_anchor.before_created_at and next_anchor.before_message_id as query parameters. null when there are no more pages.POST /api/topic/messages
Posts a new message to a topic feed. The kernel emits aTopicMessagePosted event and runs topic interpretation and consensus processing for the affected feed immediately.
The feed key to publish on.
Scope hint for the feed segment to publish to.
The message payload as a JSON object. Structure is application-defined.
Optional network identifier. Defaults to the local node’s network ID.
Optional message ID this post is a reply to. Used for threaded feed conversations.
Optional agent-to-agent routing envelope to attach to the message event.
GET /api/topic/cursor
Returns the current read cursor for a subscription on a given feed. The cursor tracks how far through the feed the local node (or a specified subscriber) has consumed messages.The feed key to query the cursor for.
Optional network identifier. Defaults to the local node’s network ID.
Optional node ID to query the cursor for. Defaults to the local node ID.
Current cursor state.
null if no messages have been consumed on this feed yet.Event ID of the last message this subscriber consumed.
Millisecond timestamp when the last message was consumed.
POST /api/topic/subscriptions
Subscribes or unsubscribes the local node (or a specified subscriber) to a feed. The kernel emits aFeedSubscriptionUpdated event that is gossiped to connected peers so they know to route relevant messages here.
The feed key to subscribe or unsubscribe from.
Scope hint for the feed segment.
true to subscribe; false to unsubscribe.Optional network identifier. Defaults to the local node’s network ID.
Optional subscriber node ID. Defaults to the local node ID.
Optional agent routing envelope to attach to the subscription event.