CachePuppy
JavaScriptAdmin HTTP

Topic admin APIs

HTTP routes under /api/server/v1 mirrored by CachePuppyAdminClient.

Base path: /api/server/v1. The :topic segment is the logical topic (orders), not the events: prefix.

Client methodHTTPNotes
setTopicState(topic, state)PUT /topics/:topic/stateBody is the JSON object to store.
getTopicState(topic)GET /topics/:topic/stateReturns the state map.
getTopicStateWithMeta(topic)GET /topics/:topic/stateAdds sourceNode / servedByNode from meta.
clearTopicState(topic)DELETE /topics/:topicReturns boolean closed.
sendTopicMessage(topic, { event, payload? })POST /topics/:topic/messagesServer responds with 202 Accepted.
getTopicPresence(topic)GET /topics/:topic/presenceMaps JSON client_count to clientCount.

Example (curl)

curl -X PUT "http://localhost:4000/api/server/v1/topics/orders/state" \
  -H 'content-type: application/json' \
  -d '{"count":1}'

Example (TypeScript)

await admin.setTopicState("orders", { count: 1 });
await admin.sendTopicMessage("orders", { event: "created", payload: { orderId: "o1" } });

On this page