Use Invite Token

Prev Next
Post
/api/v1/useInviteToken

Uses an invite token to join a channel or room.

This endpoint also checks whether the user is banned from the target room before allowing them to use the invite link. A banned user must be unbanned first before they can join via an invite token.

Changelog

Version Change
8.4.0 Added ban check — banned users can no longer join via invite token
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
Use Invite Token
{
  "token": "R4VDXJ9KJZB8M2QW"
}
object
token
string Required

The invite token to use.

Responses
200

OK

Success Example
{
  "room": {
    "_id": "sN9KJZX2aX7aXqB2a",
    "name": "general",
    "topic": "General discussion"
  },
  "success": true
}
Expand All
object
room
object

The room information.

_id
string
name
string
topic
string
success
boolean
400

Bad Request

User Is Banned
{
  "success": false,
  "error": "User is banned from this room",
  "errorType": "error-user-is-banned"
}
Invalid Token
{
  "success": false,
  "error": "Invalid invite token",
  "errorType": "error-invalid-token"
}
Token Expired
{
  "success": false,
  "error": "Invite token has expired",
  "errorType": "error-invite-token-expired"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

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