Skip to main content
PUT
/
cases
/
cases
/
{case_id}
Update Case
curl --request PUT \
  --url https://api.example.com/cases/cases/{case_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "patient_name": "<string>",
  "patient_age": 123,
  "case_summary": "<string>",
  "status": "<string>"
}
'
{
  "message": "<string>",
  "case": {
    "case.case_id": 123,
    "case.user_id": "<string>",
    "case.patient_name": "<string>",
    "case.patient_age": 123,
    "case.patient_gender": "<string>",
    "case.case_summary": "<string>",
    "case.status": "<string>",
    "case.created_at": "<string>",
    "case.updated_at": "<string>"
  },
  "400 Bad Request": {},
  "404 Not Found": {},
  "500 Internal Server Error": {}
}

Authentication

This endpoint requires authentication. The user_id is automatically retrieved from the authenticated session.

Path Parameters

case_id
integer
required
The unique identifier of the case to update

Request Body

All fields are optional. Only include the fields you want to update.
patient_name
string
Updated patient name
patient_age
integer
Updated patient age in years
case_summary
string
Updated case summary or doctor’s notes
status
string
Updated case status (e.g., “pending”, “analyzing”, “completed”, “archived”)

Response

message
string
Success message confirming the update
case
object
The updated case object with all current values
case.case_id
integer
Unique identifier for the case
case.user_id
string
ID of the doctor who owns the case
case.patient_name
string
Updated patient name
case.patient_age
integer
Updated patient age
case.patient_gender
string
Patient gender (unchanged)
case.case_summary
string
Updated case summary
case.status
string
Updated case status
case.created_at
string
Original creation timestamp
case.updated_at
string
Timestamp of the latest update

Example Request

curl -X PUT "https://api.medmitra.com/cases/cases/12345" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "case_summary": "Patient shows improvement after initial treatment. Follow-up recommended.",
    "status": "completed"
  }'

Example Response

{
  "message": "Case updated successfully",
  "case": {
    "case_id": 12345,
    "user_id": "b8acad4b-4944-4d66-b405-de70886e7248",
    "patient_name": "John Doe",
    "patient_age": 45,
    "patient_gender": "male",
    "case_summary": "Patient shows improvement after initial treatment. Follow-up recommended.",
    "status": "completed",
    "created_at": "2026-03-04T10:30:00Z",
    "updated_at": "2026-03-04T15:20:00Z"
  }
}

Error Responses

400 Bad Request
error
Invalid request data or no data provided for update
{
  "detail": "No data provided for update"
}
Or:
{
  "detail": "Supabase client error message"
}
404 Not Found
error
Case with the specified ID was not found
{
  "detail": "Case not found"
}
500 Internal Server Error
error
Server error during update operation
{
  "detail": "Internal server error: {error details}"
}

Notes

  • Only fields included in the request body will be updated
  • Fields with null values are excluded from the update
  • The updated_at timestamp is automatically set to the current time
  • You must be the owner of the case (user_id must match) to update it
  • Patient gender cannot be updated through this endpoint

Build docs developers (and LLMs) love