删除会话
curl --request DELETE \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}会话
删除会话
删除指定应用和用户的会话,成功返回 JSON null
DELETE
/
apps
/
{app_name}
/
users
/
{user_id}
/
sessions
/
{session_id}
删除会话
curl --request DELETE \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}此操作会删除指定应用和用户的会话及其会话历史,本接口不提供恢复操作。删除前保存需要保留的状态和事件,并确认会话标识
200 和 JSON null,不是 204。删除会话不能撤销此前工具已经完成的外部操作最后修改于 2026年9月19日