Skip to content

Remove someone from a conversation

POST
/chats/{chat}/users/{user}/kick
curl --request POST \
--url https://chat.work.optidata.cloud/api/chats/36/users/5/kick \
--header 'Authorization: Bearer <token>'

Removes a participant and posts a system message. Requires the caller to administer the conversation. The removed user keeps read access to the messages exchanged before the removal.

chat
required
integer format: int64

Numeric id of the conversation.

user
required
integer format: int64

Numeric id of the user.

The participant was removed.

Media typeapplication/json

Always an empty array.

Array
0
Examples
Exampleempty
[]

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures — and a few permission denials — use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not a participant of the conversation, or lacks the role the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given conversation.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}