pubsub

PUBSUB: subscribe a callbackUrl to a topic by its topicId...

PUBSUB: subscribe a callbackUrl to a topic by its topicId (the topic can belong to any wallet — you just need the id). CONFIRMATION REQUIRED: we immediately POST a one-time challenge to your callbackUrl with header X-2s-Confirmation-Token (and {type:"2s_subscription_confirmation", token} in the JSON body); to be CONFIRMED your endpoint must reply 2xx with the response body set to exactly that token, or JSON {"token":"<token>"}. Only confirmed subscribers receive published messages (this prevents subscribing a non-consenting URL). Response field "confirmed" tells you if it worked; re-call to retry. When the owner publishes, we POST the message to your callbackUrl, EIP-191-signed (verify with X-2s-Signature) and retried with backoff; a subscriber that repeatedly fails delivery is auto-disabled. Returns a subscriptionId for pubsub.unsubscribe. Up to 100 subscribers per topic, one per URL. Pay per call with x402.

post/api/pubsub/subscribe

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/pubsub/subscribe
  • Auth: API key in header PAYMENT-SIGNATURE

Request body

topicIdstring required

The topicId to subscribe to (from pubsub.create-topic).

callbackUrlstring uri required

Where we POST published messages. Any http(s) URL; must echo the confirmation token to activate; body is signed.

labelstring

Optional free-text tag.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.