Define a Platform Event object in Setup with the required fields, and note its API name ending in __e
From an external system, publish events by POSTing to /services/data/vXX.0/sobjects/<EventName__e> with a JSON body containing the event field values — treat it like a standard sObject insert
For batch publishing, use the Composite API sObject collection endpoint to insert up to 200 event records in a single request
To subscribe, open a CometD connection and subscribe to /event/<EventName__e>; implement replayId persistence identically to CDC subscriptions
Process the event payload — fields are nested under the sobject key in the CometD message data envelope
Monitor publishing limits: Platform Events count against the org's daily API request limit and have a separate high-volume event allocation — check System Overview in Setup to avoid throttling
Known gotchas
Platform Events published via Apex in a trigger are only committed when the transaction commits — if the transaction rolls back, the events are discarded even if the publish call succeeded within the transaction
Standard-volume Platform Events have a 250,000 events/day limit by default; exceeding it silently drops events rather than returning an error to the publisher
CometD subscriptions to Platform Events from external systems must re-subscribe after each Salesforce server-side maintenance window; the advisory channel /meta/connect returning a 503 is the signal to reconnect
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp