Skip to content

Leave a conversation

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

Removes the caller from the conversation and posts a system message saying so. The caller keeps read access to the messages exchanged before they left, and to nothing after.

chat
required
integer format: int64

Numeric id of the conversation.

The caller left the conversation.

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."
}