Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Migrate Platform Event Definitions with Metadata API

Deploy and retrieve platform event definitions from your sandbox and production org as part of your app’s development life cycle.

The CustomObject metadata type represents a platform event.

Platform event names are appended with __e. The file that contains the platform event definition has the suffix .object. Platform events are stored in the objects folder.

Example

Here is a definition of a platform event with a number field and two text fields.

The eventType field specifies the platform event volume. Only the HighVolume value is supported. The StandardVolume value is deprecated. If you create a platform event with the StandardVolume event type, you get an error.

This package.xml manifest file references the previous event definition. The name of the referenced event is Low_Ink__e.

Retrieve Platform Events

To retrieve all platform events, in addition to custom objects defined in your org, use the wildcard character (*) for the <members> element, as follows.

To retrieve or deploy triggers associated to a platform event, use the ApexTrigger metadata type. For more information about how to use Metadata API and its types, see the Metadata API Developer Guide.