Leave Group

Prev Next
Post
/api/v1/groups.leave

Leave a private channel. Leave a private channel. If a group owner is leaving, they must set another owner before leaving the group. Permission required: leave-p

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
object
roomId
string

The group ID that you want to leave.

ExampleByehQjC44FwMeiLbX
Responses
200

OK

Success
{
  "group": {
    "_id": "ByehQjC44FwMeiLbX",
    "name": "invite-me",
    "t": "p",
    "usernames": [
      "testing2"
    ],
    "msgs": 0,
    "u": {
      "_id": "aobEdbYhXfu5hkeqG",
      "username": "testing1"
    },
    "ts": "2016-12-09T15:08:58.042Z",
    "ro": false,
    "sysMes": true,
    "_updatedAt": "2016-12-09T15:22:40.656Z"
  },
  "success": true
}
Expand All
object
group
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

Example 1
{
  "success": false,
  "error": "You are the last owner. Please set new owner before leaving the room. [error-you-are-last-owner]",
  "errorType": "error-you-are-last-owner",
  "details": {
    "method": "leaveRoom"
  }
}
Example 2
{
  "success": false,
  "error": "The parameter \"roomId\" or \"roomName\" is required [error-room-param-not-provided]",
  "errorType": "error-room-param-not-provided"
}
Expand All
object
success
boolean
error
string
errorType
string
details
object
method
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string