Skip to content

chats.deleteChat

DELETE
/v1/chats/{chatId}
curl --request DELETE \
--url https://example.com/v1/chats/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "commandKey": "example" }'

Deletes the history of a direct Chat, a channel Chat or a live Chat. It stops the running Turn and cancels the work that the Chat gave away first. The next message starts an empty Chat.

chatId
required
string
>= 1 characters
Media typeapplication/json
object
commandKey
required
string
>= 1 characters <= 128 characters

Example generated

{
"commandKey": "example"
}

Success

Media typeapplication/json
object
executionId
required
string
>= 1 characters <= 128 characters
commandKey
required
string
>= 1 characters <= 128 characters
sequence
required
integer
<= 9007199254740991

Example generated

{
"executionId": "example",
"commandKey": "example",
"sequence": 1
}

ChatModelInvalid | OrganizationRequired

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ChatModelInvalid
reason
required
string
Allowed values: provider-not-found model-not-found unsupported-option missing
message
required
string

Example

{
"_tag": "ChatModelInvalid",
"reason": "provider-not-found"
}

AuthenticationRequired

Media typeapplication/json
object
_tag
required
string
Allowed values: AuthenticationRequired

Example

{
"_tag": "AuthenticationRequired"
}

ExecutionForbidden | @nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ExecutionForbidden

Example

{
"_tag": "ExecutionForbidden"
}

ChatNotFound | ExecutionNotFound

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ChatNotFound
chat
required
string

Example

{
"_tag": "ChatNotFound"
}

ChatConflict | ExecutionConflict | ExecutionKeyConflict | @nmnmcc/ability/Authorizer/Pending

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ChatConflict
message
required
string

Example

{
"_tag": "ChatConflict"
}

RateLimited

Media typeapplication/json
object
_tag
required
string
Allowed values: RateLimited
retryAfterSeconds
required
integer
>= -9007199254740991 <= 9007199254740991

Example

{
"_tag": "RateLimited"
}

ChatStorageUnavailable | ExecutionUnavailable | AuthenticationUnavailable | RequestFailed

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ChatStorageUnavailable

Example

{
"_tag": "ChatStorageUnavailable"
}