Newer Version Available
Migrate Platform Event Definitions with Metadata API
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.