Kloudless Blog

Kloudless Unified APIs enable you to code once and integrate many

We are all in unprecedented times. Due to the outbreak of COVID-19, commonly referred to as the Coronavirus, many of us are sheltered in place and doing our best to keep up on our lives and work in a time where normalcy is a foreign word. Those of us in the tech industry are blessed to be able to remotely perform our work duties, but our heart aches for those out there that have had their careers and livelihood upended. As a company with offices on 2 separate continents, we know the effect that this pandemic has had on the world at large, and we wish all of you out there the best in navigating these troubled times. 

Because of the strange time we find ourselves in, we wanted to put together a recurring series of articles aimed at tackling some of the questions we get regarding the tools and APIs that have been thrust into the forefront of all of our daily lives. The Quarantine Chronicles series will cover tech questions and guides regarding many of the programs some of you out there are being forced to learn quickly, or use daily.

Without further ado, let’s head into another entry of this series with a simple look into how you can go about deleting a channel in Slack through the Slack API.

What is Slack?

Originally launched in 2013, Slack began as an internal tool for Stewart Butterfield’s company Tiny Speck during the development of Glitch, an online game. The name acts as a backronym for “Searchable Log of All Conversation and Knowledge,” and quickly gained footing as a popular communication and chat client prior to the emergence of some of its newer competitors, such as Discord or MS Teams. Slack enjoys a simple and easy to navigate UI that makes it a very good choice for correspondence with other employees in an organization.

Slack is enjoying a massive spike in popularity at the moment, due in no small part to the shelter in place guidelines we all find ourselves in at the moment. It was quite popular in the tech circles prior to the current situation we are in, but we’ve seen a massive increase in the use of Slack by schools and non-tech businesses in recent months.

Deleting a Channel Through the Slack API

If you’ve ever used the Web UI or standalone app for Slack, you’ve probably had to delete a channel before. As long as you created the channel, you’re free at any time to delete or archive the channel for future use.

However, the official Slack API seems to be missing any built-in methods to delete channels, leading to quite a bit of frustration online from web developers looking to build that functionality into their bots or web apps. There is, however, a channel.archive method to archive channels, but that doesn’t entirely delete the channel.

Thankfully, there are a handful of undocumented methods within the Slack API and channel.delete happens to be supported, even if you can find no mention of it in the official API docs. In fact, the following GitHub repository was made to document all of the undocumented methods within the Slack API and is an exceptionally good asset for those of you working with the API.

Keep in mind, the token used will have to have the correct admin or owner rights to delete the channel just like within the Web UI, but as long as the user is granted permission to delete the channel, the following code will work. All you’ll need is the name of the channel and a legitimate token and that’s it!


We hope that you found this edition of the Quarantine Chronicles helpful, and we look forward to bringing you more tips and guides to make your shelter in place as stress-free and accommodating as possible. We may all be social distancing, but in these trying times, we hope to try to bring people together as best we can.

We hope you and everyone you care about are safe and well, and we wish you the best going forward. To reach out with any ideas for topics on future editions of the Quarantine Chronicles, please contact us at hello@kloudless.com


Share this article:

Let’s get started. Start building for free today.