Delete a session
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": {}
}
]
}Sessions
Delete a session
Delete the session for the application and user; success returns JSON null
DELETE
/
apps
/
{app_name}
/
users
/
{user_id}
/
sessions
/
{session_id}
Delete a session
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": {}
}
]
}This operation deletes the session and its history for the specified application and user. This endpoint provides no restore operation. Preserve any state and events you need, and confirm the session identifier first
200 with JSON null, rather than 204. Deleting a session does not undo external actions already completed by toolsAuthorizations
Optional locally without a gateway; cloud deployments use the Runtime API key or user-pool JWT required by that deployment, never the model API key
Path Parameters
Application name; harness_agent for the CLI deployment
User ID
Session ID
Response
Successful response
Last modified on September 19, 2026