Newer Version Available
Migrate Platform Event Definitions with Metadata API
Example
The CustomObject metadata type represents platform events.
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.
Here is a definition of a sample platform event with a number field and two text fields.
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.