Add a session to memory
curl --request PATCH \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/memory \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "session-001"
}
'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/memory"
payload = { "sessionId": "session-001" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sessionId: 'session-001'})
};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": "<string>"
}{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Memory
Add a session to memory
Add the session identified by sessionId to the configured memory service; success returns JSON null
PATCH
/
apps
/
{app_name}
/
users
/
{user_id}
/
memory
Add a session to memory
curl --request PATCH \
--url http://localhost:8000/apps/{app_name}/users/{user_id}/memory \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "session-001"
}
'import requests
url = "http://localhost:8000/apps/{app_name}/users/{user_id}/memory"
payload = { "sessionId": "session-001" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sessionId: 'session-001'})
};
fetch('http://localhost:8000/apps/{app_name}/users/{user_id}/memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": "<string>"
}{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Configure a memory backend first and provide a valid
A successful response is JSON
sessionId under the same application and user. An unconfigured memory service returns 400; a missing session returns 404
This operation sends session events to the configured memory service for storage or processing. Future retrieval can use that content. Confirm that the session data is appropriate for the selected backend before submitting it
null, indicating that the ingestion call completed. It does not return extracted memories or guarantee a match in subsequent retrievalAuthorizations
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
Body
application/json
Session ID
Response
Successful response
Last modified on September 19, 2026