deleteChannelWithHttpInfo method

Future<Response> deleteChannelWithHttpInfo(
  1. String channelId
)

Delete a channel

Archives a channel. This will set the deleteAt to the current timestamp in the database. Soft deleted channels may not be accessible in the user interface. They can be viewed and unarchived in the System Console > User Management > Channels based on your license. Direct and group message channels cannot be deleted. As of server version 5.28, optionally use the permanent=true query parameter to permanently delete the channel for compliance reasons. To use this feature ServiceSettings.EnableAPIChannelDeletion must be set to true in the server's configuration. If you permanently delete a channel this action is not recoverable outside of a database backup. ##### Permissions delete_public_channel permission if the channel is public, delete_private_channel permission if the channel is private, or have manage_system permission.

Note: This method returns the HTTP Response.

Parameters:

  • String channelId (required): Channel GUID

Implementation

Future<Response> deleteChannelWithHttpInfo(
  String channelId,
) async {
  // ignore: prefer_const_declarations
  final path = r'/channels/{channel_id}'.replaceAll('{channel_id}', channelId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'DELETE',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}