Post
/api/v1/im.blockUser
Blocks or unblocks the other user in a direct message room. This endpoint replaces the deprecated blockUser and unblockUser DDP methods.
Changelog
| Version | Description |
|---|---|
| 8.6.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
Block User
{
"roomId": "ByehQjC44FwMeiLbX",
"block": true
}Unblock User
{
"roomId": "ByehQjC44FwMeiLbX",
"block": false
}object
roomId
string Required
The direct message room ID.
block
boolean Required
Set to true to block the other user, or false to unblock them.
Responses
200
OK
Success
{
"success": true
}object
success
boolean
400
Bad Request
Invalid room
{
"success": false,
"error": "[invalid-channel]",
"errorType": "invalid-channel"
}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