Skip to main content

PATCH /api/v1/session/

Updates session data by merging the provided data with existing session data. This endpoint allows you to add or modify fields in the session’s data store without replacing the entire session.

Path Parameters

session_id
string
required
The UUID of the session to update

Request Body

data
object
required
A JSON object containing the data to merge with the existing session data. Keys in this object will be added or updated in the session.

Response

message
string
Success message indicating the session was updated
sessionId
string
The UUID of the updated session

Example Request

curl -X PATCH http://localhost:8090/api/v1/session/550e8400-e29b-41d4-a716-446655440000 \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "customField": "customValue",
      "metadata": {
        "source": "manual",
        "version": "1.0"
      }
    }
  }'

Example Response

{
  "message": "Session updated successfully",
  "sessionId": "550e8400-e29b-41d4-a716-446655440000"
}

Error Responses

404
error
Session not found or update failed
{
  "detail": "Session 550e8400-e29b-41d4-a716-446655440000 not found or update failed"
}

Notes

  • The update operation merges the provided data with existing session data
  • Existing keys are overwritten, new keys are added
  • Nested objects are merged at the top level only
  • The session must exist before it can be updated

Build docs developers (and LLMs) love