{"uid":"cap_THLE0BuGmNm-MFAd0nJ65","slug":"2s-pubsub-subscribe-1f0ae16d","name":"2s PubSub Subscribe","description":"The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.","url":"https://2s.io/api/pubsub/subscribe","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"label":{"type":"string","maxLength":64,"description":"Optional free-text tag."},"topicId":{"type":"string","description":"The topicId to subscribe to (from pubsub.create-topic)."},"callbackUrl":{"type":"string","maxLength":2048,"description":"Where we POST published messages. Any http(s) URL; must echo the confirmation token to activate; body is signed."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jaW_nPUs2o5ehCdx2OoJG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Subscribe a callback URL to a pub/sub topic so that published messages are POSTed to your endpoint in real time","exampleAgentPrompt":"Subscribe my webhook at https://myapp.example.com/hooks/events to the topic ID topic_abc123 on 2s — tag it as 'order-updates' so I can track it, and make sure it echoes back the confirmation token to activate.","exampleUseCases":null,"resultDescription":"Returns a subscription record including a confirmation token that the callback URL must echo back to activate the subscription. Once confirmed, any messages published to the topic will be POSTed to the registered callback URL with a signed body.","failureModes":["topicId does not exist — 404 or error indicating unknown topic","callbackUrl is unreachable or does not echo the confirmation token — subscription remains inactive","callbackUrl exceeds 2048 character limit — validation error","label exceeds 64 character limit — validation error","malformed callbackUrl (non-http/https scheme) — validation error","insufficient USDC balance to cover $0.002 per-call fee — payment failure"],"whenToPreferThis":"Use this endpoint when you need to reactively receive messages published to a 2s.io pub/sub topic at a webhook endpoint rather than polling. Ideal for event-driven agent workflows where low-latency delivery to your server matters and you have a publicly reachable HTTP/HTTPS callback URL. Requires a topic created via pubsub.create-topic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:30:17.190Z","isFirstParty":false}