listChannelsWithHttpInfo method
List group channels across connected chat providers.
Fan-out list. The Channels surface filters to channel-type conversations only (type: channel | private); for direct messages use /v1/direct-messages.
Note: This method returns the HTTP Response.
Parameters:
-
List<String> accountIds: Repeatable. Restrict to these connected-account row ids. Mutually orthogonal to
providers— when both are set the intersection is used. -
List<String> providers: Repeatable. Restrict to these provider ids (
gmail,outlook). -
String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
-
int limit:
-
String cursor: Provider-specific pagination cursor.
-
bool includeArchived:
-
List<String> types: Repeatable filter on
Channel.type. Defaults applied by the platform exclude DMs; passing this overrides.
Implementation
Future<Response> listChannelsWithHttpInfo({ List<String>? accountIds, List<String>? providers, String? xWorkspaceID, int? limit, String? cursor, bool? includeArchived, List<String>? types, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/channels';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (accountIds != null) {
queryParams.addAll(_queryParams('multi', 'accountIds', accountIds));
}
if (providers != null) {
queryParams.addAll(_queryParams('multi', 'providers', providers));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (cursor != null) {
queryParams.addAll(_queryParams('', 'cursor', cursor));
}
if (includeArchived != null) {
queryParams.addAll(_queryParams('', 'includeArchived', includeArchived));
}
if (types != null) {
queryParams.addAll(_queryParams('multi', 'types', types));
}
if (xWorkspaceID != null) {
headerParams[r'X-Workspace-ID'] = parameterToString(xWorkspaceID);
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}