chats.deleteChat
DELETE
/v1/chats/{chatId}
const url = 'https://example.com/v1/chats/example';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"commandKey":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”chatId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
commandKey
required
string
Example generated
{ "commandKey": "example"}Responses
Section titled “Responses”Success
Media typeapplication/json
object
executionId
required
string
commandKey
required
string
sequence
required
integer
Example generated
{ "executionId": "example", "commandKey": "example", "sequence": 1}ChatModelInvalid | OrganizationRequired
AuthenticationRequired
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "AuthenticationRequired"}ExecutionForbidden | @nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin
ChatNotFound | ExecutionNotFound
ChatConflict | ExecutionConflict | ExecutionKeyConflict | @nmnmcc/ability/Authorizer/Pending
RateLimited
Media typeapplication/json
object
_tag
required
string
retryAfterSeconds
required
integer
Example
{ "_tag": "RateLimited"}ChatStorageUnavailable | ExecutionUnavailable | AuthenticationUnavailable | RequestFailed