Delete a chat session
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.ninjachat.ai/api/v1/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.ninjachat.ai/api/v1/sessions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://www.ninjachat.ai/api/v1/sessions/{id} \
--header 'Authorization: Bearer <token>'{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Legacy (supported)
Delete a chat session
Supported compatibility surface — kept working indefinitely, but not the path for new integrations. Modern equivalent: client-side message history on POST /responses.
DELETE
/
sessions
/
{id}
Delete a chat session
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.ninjachat.ai/api/v1/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.ninjachat.ai/api/v1/sessions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://www.ninjachat.ai/api/v1/sessions/{id} \
--header 'Authorization: Bearer <token>'{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}