Vasanth TT
Vasanth TT

Reputation: 33

Unable to recreate deleted channel

Using graph API, I am unable to recreate the deleted channel.

Using Microsoft Team windows client, I have deleted a channel. Then, I tried to recreate with the same name and that seems working. But when I tried the same scenario using graph API, I get "Channel name already existed" error.

Example

Delete API:

DELETE https://graph.microsoft.com/v1.0/teams/<groupid>/channels/<ABCchannelid>

Create API:

POST https://graph.microsoft.com/v1.0/teams/<groupid>/channels
{
  "displayName": "ABC",
  "description": "desc"
}

Response

{
  "error": {
    "code": "BadRequest",
    "message": "Channel name already existed, please use other name",
    "innerError": {
      "request-id": "guid",
      "date": "2019-12-19T09:01:40"
    }
  }
}

Upvotes: 3

Views: 2173

Answers (2)

Abhijit
Abhijit

Reputation: 541

@vasanth TT - When any channel is deleted, Teams holds the data for several weeks in order to allow Team Owner to recover the deleted channel. During that time one can not create new channel with the same name within the same team. You can create channel with the same name in different team but not in the same team where it was previously created

Upvotes: 0

Hilton Giesenow
Hilton Giesenow

Reputation: 10844

When you "Delete" a Channel or a Team, it's not immediately permanently deleted, it goes into a "temporary" deleted state so that it can be restored if it was deleted by accident. This means you can:

  1. Restore the channel, if you want it back as it was
  2. "Recreate" the Channel, if you really don't want the original one, but using a roundabout way - you need to Restore the channel as above, then rename it to a useless name (e.g. "asdfgh" or whatever), THEN delete it, and you can then create a new channel with the original desired name. There's more on this approach here.

Obviously (1) is the easiest, if you just want the channel back.

Please don't forget to mark this as the correct answer if it helps you.

Upvotes: 0

Related Questions