Get Custom Channels and Channel Members

You can find which channels and channel members are set up in your Salesforce org by performing SOQL queries through Tooling API.

User Permissions Needed
To query PlatformEventChannel and PlatformEventChannelMember Tooling objects:View Setup and Configuration
To use REST with Tooling API:API Enabled

To perform SOQL queries, make a REST query call or use the Query Editor in the Developer Console with the Tooling API option selected. To make REST calls using Postman, set up Postman with the Salesforce Platform APIs collection. See Quick Start: Connect Postman to Salesforce in Trailhead.

Perform a GET request to this endpoint with the SOQL query appended.

1/services/data/v68.0/tooling/query?q=<query>

This query returns all the custom channels.

1SELECT Id, DeveloperName, ChannelType, MasterLabel FROM PlatformEventChannel

If you’re using Postman, expand Event Platform | Custom Channels, and then click List event channels.

Sample result:

Id: 0YLRM000000004m4AA

DeveloperName: FilteredChannel

ChannelType: data

MasterLabel: My Custom Filtered Channel

And this query returns all the channel members.

1SELECT Id, DeveloperName,EventChannel,FilterExpression, SelectedEntity FROM PlatformEventChannelMember

If you’re using Postman, expand Event Platform | Custom Channels, and then click List channel members.

Sample result (the SelectedEntity field references the ID of the custom platform event):

Id: 0v8RM0000004VAKYA2

DeveloperName: FilteredChannel_chn_AccountChangeEvent

EventChannel: 0YLRM000000004m4AA

FilterExpression

1Industry='Agriculture' AND NumberOfEmployees>1000

SelectedEntity: AccountChangeEvent