Add a Custom Platform Event in a New Channel Member

To add a platform event to the channel that you created, create a channel member.

Required Editions

User Permissions Needed
To create a PlatformEventChannel: Customize Application

Prerequisites:

  1. Send a POST request to this URI.
    /services/data/v65.0/tooling/sobjects/PlatformEventChannelMember
  2. If you’re using Postman, expand Event Platform | Custom Channels | Platform Event, and click Create channel member.
  3. Specify the channel in the eventChannel field and the event in the selectedEntity field. This example references a custom platform event, Carbon_Comparison__e. Use this example request body. In Postman, click Body, and replace the body with this JSON body.
    {
      "FullName": "Carbon_Comparison_Channel_chn_Carbon_Comparison_e",
      "Metadata": {
         "eventChannel": "Carbon_Comparison_Channel__chn",
         "selectedEntity": "Carbon_Comparison__e"
      }
    }
  4. Send the request. The response received looks similar to this response.
    {
      "id": "0v8RM0000000G3iYAE",
      "success": true,
      "errors": [],
      "warnings": [],
      "infos": []
    }

A channel (PlatformEventChannel) can have multiple channel members (PlatformEventChannelMember), which means that you can add multiple platform events to a channel. This example adds only one platform event, Carbon_Comparison__e. To add another event to the channel, create another PlatformEventChannelMember.