Rocket.chat: Add Channel Delete REST api Method to the docs

Created on 17 Jul 2017  路  8Comments  路  Source: RocketChat/Rocket.Chat

Rocket.Chat Version: 0.57.1
Running Instances: 1
DB Replicaset OpLog:
Node Version: 4.8.1

I am trying to delete a channel that was created, but cant seem to find a way to do it. The only way I have found in the docs is to use the Realtime API, but it is a little unclear about how to set this up. Is there another way to delete a channel, such as the Rest API at all? If not what steps do I need to take to setup the Realtime API?

Thanks.

api documentation

Most helpful comment

Closing this as you can delete groups and channels, however we are happy to accept pull requests on the documentation repository for adding these. I would advise a new issue be created on the documentation repository for this. https://github.com/RocketChat/Rocket.Chat.Docs

All 8 comments

Via Administration / Rooms

del_room_admin

Inside the channel

del_room

Is it possible to accomplish this with the REST API?

@graywolf336 Do we have a api method for deleting channels?

@MartinSchoeler Best place to look is the documentation and the code for the rest api: https://github.com/RocketChat/Rocket.Chat/tree/develop/packages/rocketchat-api/server/v1 https://rocket.chat/docs/developer-guides/rest-api/channels if you can't find it in either of those places, then it would appear not.

Have you tried "channels.delete"? Looking into "packages/rocketchat-api/server/v1/channels.js" there is a "channels.delete" possibility. Seems that the documentation for channels is not up to date. But I haven't tested it.

https://rocket.chat/docs/developer-guides/rest-api/channels

@jpotts-IIL just a quick test. This works with public channels, but not private rooms:

get token

curl https://your-rocket-chat/api/v1/login -d "username=yourusername&password=yourpass"

delete public channel

curl -H "X-Auth-Token: yourtoken" -H "X-User-Id: youruserid" \
-H "Content-type:application/json"  \
https://your-rocket-chat/api/v1/channels.delete -d '{ "roomName": "test1234" }'

Tested with 0.57.1. Anybody knows why it's not possible to delete a private rooms, even if logged in as admin.

@localguru For deleting private groups you have to use the groups methods https://rocket.chat/docs/developer-guides/rest-api/groups instead of the channel ones.

We need to add the delete api call to the docs, will change the title to reflect that

Closing this as you can delete groups and channels, however we are happy to accept pull requests on the documentation repository for adding these. I would advise a new issue be created on the documentation repository for this. https://github.com/RocketChat/Rocket.Chat.Docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djeber picture djeber  路  3Comments

amayer5125 picture amayer5125  路  3Comments

lunitic picture lunitic  路  3Comments

danpospisil picture danpospisil  路  3Comments

sta-szek picture sta-szek  路  3Comments