curl --request POST \
--url https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chatId": "<string>",
"sessionSettings": {
"email": "<string>",
"externalId": "<string>",
"groups": [
"<string>"
],
"internalId": "<string>",
"publicDashboardId": "<string>",
"roles": [
"<string>"
],
"securityContext": {},
"userAttributes": [
"<unknown>"
]
}
}
'import requests
url = "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort"
payload = {
"chatId": "<string>",
"sessionSettings": {
"email": "<string>",
"externalId": "<string>",
"groups": ["<string>"],
"internalId": "<string>",
"publicDashboardId": "<string>",
"roles": ["<string>"],
"securityContext": {},
"userAttributes": ["<unknown>"]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '<string>',
sessionSettings: {
email: '<string>',
externalId: '<string>',
groups: ['<string>'],
internalId: '<string>',
publicDashboardId: '<string>',
roles: ['<string>'],
securityContext: {},
userAttributes: ['<unknown>']
}
})
};
fetch('https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '<string>',
'sessionSettings' => [
'email' => '<string>',
'externalId' => '<string>',
'groups' => [
'<string>'
],
'internalId' => '<string>',
'publicDashboardId' => '<string>',
'roles' => [
'<string>'
],
'securityContext' => [
],
'userAttributes' => [
'<unknown>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort"
payload := strings.NewReader("{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyAbort chat stream
Stops an in-progress chat stream — for example, when the user cancels a request or navigates away while the agent is still generating a response.
The abort URL is derived from the Chat API URL by replacing /stream-chat-state with /abort.
A successful cancellation is indicated solely by the 204 No Content status — the response has no body. Note that the aborted stream-chat-state request itself does not fail with an HTTP error: the streaming response already returned 200 OK when the stream opened, so treat this endpoint’s 204 as the confirmation that the stream was aborted.
curl --request POST \
--url https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chatId": "<string>",
"sessionSettings": {
"email": "<string>",
"externalId": "<string>",
"groups": [
"<string>"
],
"internalId": "<string>",
"publicDashboardId": "<string>",
"roles": [
"<string>"
],
"securityContext": {},
"userAttributes": [
"<unknown>"
]
}
}
'import requests
url = "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort"
payload = {
"chatId": "<string>",
"sessionSettings": {
"email": "<string>",
"externalId": "<string>",
"groups": ["<string>"],
"internalId": "<string>",
"publicDashboardId": "<string>",
"roles": ["<string>"],
"securityContext": {},
"userAttributes": ["<unknown>"]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '<string>',
sessionSettings: {
email: '<string>',
externalId: '<string>',
groups: ['<string>'],
internalId: '<string>',
publicDashboardId: '<string>',
roles: ['<string>'],
securityContext: {},
userAttributes: ['<unknown>']
}
})
};
fetch('https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '<string>',
'sessionSettings' => [
'email' => '<string>',
'externalId' => '<string>',
'groups' => [
'<string>'
],
'internalId' => '<string>',
'publicDashboardId' => '<string>',
'roles' => [
'<string>'
],
'securityContext' => [
],
'userAttributes' => [
'<unknown>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort"
payload := strings.NewReader("{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{accountName}/agents/{agentId}/chat/abort")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"<string>\",\n \"sessionSettings\": {\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"groups\": [\n \"<string>\"\n ],\n \"internalId\": \"<string>\",\n \"publicDashboardId\": \"<string>\",\n \"roles\": [\n \"<string>\"\n ],\n \"securityContext\": {},\n \"userAttributes\": [\n \"<unknown>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API key authentication. Send Authorization: Api-Key <YOUR_API_KEY>.
Body
Abort request identifying the chat thread to stop.
Response
Chat streaming was aborted successfully. The response has no body.