Post
/api/v1/channels.rename
Change the name of a channel. Permission required: edit-room
Changelog
Version | Description |
---|---|
0.48.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
"roomId": "WDuJLFkjwk6L7LdFC",
"name": "newName"
}
object
roomId
string Required
The channel's ID.
name
string Required
The new name of the channel. It can not be the same as the current name.
Responses
200
OK
Success
{
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "new-name",
"t": "c",
"usernames": [
"testing1"
],
"msgs": 4,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "testing1"
},
"ts": "2016-12-09T15:08:58.042Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2016-12-09T15:57:44.686Z"
},
"success": true
}
object
channel
object
_id
string
name
string
t
string
usernames
Array of string
string
msgs
integer
u
object
_id
string
username
string
ts
string
ro
boolean
sysMes
boolean
_updatedAt
string
success
boolean
400
Bad Request
No permission
{
"success": false,
"error": "Editing room is not allowed [error-action-not-allowed]",
"errorType": "error-action-not-allowed",
"details": {
"method": "saveRoomSettings",
"action": "Editing_room"
}
}
object
success
boolean
error
string
errorType
string
details
object
method
string
action
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string