Publish a Salesforce Platform Event from an external system and handle the subscriber response

domain: salesforce.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. Define a Platform Event object in Setup (MyEvent__e) with the required fields; note the full API name including the __e suffix.
  2. From an external system, POST to /services/data/vXX.0/sobjects/MyEvent__e/ with a JSON body containing the event's field values — treat it like a regular sObject insert.
  3. Confirm the response contains 'success': true and a generated ID; Platform Events do not truly persist as records, so the ID is ephemeral.
  4. Subscribers (Flows, Apex triggers on Platform Events, or external CometD clients) receive the event asynchronously; design for eventual delivery, not synchronous confirmation.
  5. For external subscribers, connect to /cometd/vXX.0/ using a CometD client, subscribe to /event/MyEvent__e, and supply the replayId -1 to receive new events or a stored replayId to replay from a checkpoint.
  6. Implement replayId persistence in the subscriber so that a restart replays any events missed during downtime, up to the 72-hour retention window.

Known gotchas

Related routes

Publish and subscribe to Salesforce Platform Events from an external system
developer.salesforce.com · 6 steps · unrated
Publish Salesforce Platform Events from Apex and subscribe to them in a Lightning component using the Streaming API
developer.salesforce.com · 6 steps · unrated
Subscribe to Salesforce Pub/Sub API events via gRPC to receive high-throughput Platform Events
developer.salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans