{"uid":"cap_R3L2vjMnzFapTGmEbJD5v","slug":"2s-pub-sub-create-topic-4536c15f","name":"2s Pub/Sub Create Topic","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/create-topic","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"name":{"type":"string","description":"Topic name, 1-64 chars of [A-Za-z0-9._:-]. e.g. \"price-alerts\"."}}},"responseSchema":{"type":"json","schema":{"type":"object","required":["ok","items","total","source"],"properties":{"ok":{"enum":[true],"type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["topicId","name"],"properties":{"name":{"type":"string"},"topicId":{"type":"string"}},"additionalProperties":false}},"total":{"type":"integer","nullable":true,"description":"Total matching rows upstream; null when unknown."},"source":{"type":"object","required":["provider","url","license"],"properties":{"url":{"type":"string"},"license":{"type":"string"},"provider":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},"example":{"ok":true,"items":[{"name":"example","topicId":"example"}],"total":1,"source":{"url":"example","license":"example","provider":"example"}}},"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_9a9oh2BsBwXNlb288SodF","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":"Creates a named pub/sub topic on the 2s agent infrastructure platform, returning a topicId for subsequent publishing and subscribing.","exampleAgentPrompt":"Create a new pub/sub topic called 'price-alerts' on 2s so my agents can start publishing and subscribing to price change events.","exampleUseCases":[{"title":"Price alert event bus setup","prompt":"Set up a pub/sub topic named 'price-alerts' so my trading agents can broadcast price threshold events to each other in real time."},{"title":"Order processing pipeline channel","prompt":"Create a new pub/sub topic called 'order-events' on 2s so I can wire up my fulfillment agents to listen for new orders as they come in."},{"title":"Agent health monitoring bus","prompt":"I need a pub/sub topic named 'agent-heartbeats' to let my fleet of AI agents publish status pings that a monitoring agent can subscribe to."}],"resultDescription":"Returns a JSON object with ok: true, an items array containing the created topic's topicId and name, a total count, and a source object with provider, URL, and license metadata.","failureModes":["Invalid topic name (must be 1-64 chars of [A-Za-z0-9._:-]) returns an error response","Duplicate topic name may return an error or an existing topic depending on platform behavior","Payment failure via x402 if USDC balance is insufficient","Network timeout or 5xx if the 2s platform is temporarily unavailable"],"whenToPreferThis":"Use this endpoint when you need to provision a named pub/sub topic as part of building an event-driven agent pipeline on the 2s platform. It is the first step before publishing messages or subscribing to a channel. Prefer this over general-purpose message brokers when you are already using 2s for other agent infrastructure (storage, queues, watchers) and want pay-per-call pricing with no signup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:53:52.476Z","isFirstParty":false}