Skip to main content
DELETE
/
cases
/
cases
/
{case_id}
Delete Case
curl --request DELETE \
  --url https://api.example.com/cases/cases/{case_id}
{
  "message": "<string>",
  "404 Not Found": {},
  "400 Bad Request": {},
  "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 delete

Response

message
string
Success message confirming the deletion

Example Request

curl -X DELETE "https://api.medmitra.com/cases/cases/12345" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "message": "Case deleted successfully"
}

Error Responses

404 Not Found
error
Case with the specified ID was not found or does not belong to the user
{
  "detail": "Case not found"
}
400 Bad Request
error
Invalid request or Supabase client error
{
  "detail": "Error message describing the issue"
}
500 Internal Server Error
error
Server error during deletion operation
{
  "detail": "Internal server error: {error details}"
}

Notes

  • This operation is permanent and cannot be undone
  • Deleting a case will also delete:
    • All associated file records
    • All AI-generated insights
    • All related metadata
  • You must be the owner of the case (user_id must match) to delete it
  • Files stored in cloud storage may require separate cleanup

Warning

This is a destructive operation. Ensure you have proper backups or export important data before deleting a case.

Build docs developers (and LLMs) love