Skip to main content
GET
/
cases
/
all_cases
Get All Cases
curl --request GET \
  --url https://api.example.com/cases/all_cases
{
  "cases": [
    {
      "cases[].case_id": "<string>",
      "cases[].user_id": "<string>",
      "cases[].patient_name": "<string>",
      "cases[].patient_age": 123,
      "cases[].patient_gender": "<string>",
      "cases[].case_summary": "<string>",
      "cases[].status": "<string>",
      "cases[].created_at": "<string>",
      "cases[].updated_at": "<string>"
    }
  ],
  "400 Bad Request": {},
  "500 Internal Server Error": {}
}

Authentication

This endpoint requires authentication. Include the user ID as a query parameter.

Query Parameters

user_id
string
required
The ID of the authenticated user (doctor) whose cases to retrieve

Response

cases
array
Array of case objects belonging to the user
cases[].case_id
string
Unique UUID identifier for the case
cases[].user_id
string
ID of the doctor who created the case
cases[].patient_name
string
Patient’s full name
cases[].patient_age
integer
Patient’s age in years
cases[].patient_gender
string
Patient’s gender
cases[].case_summary
string
Case summary or doctor’s notes
cases[].status
string
Current status of the case (e.g., “pending”, “analyzing”, “completed”)
cases[].created_at
string
ISO 8601 timestamp when the case was created
cases[].updated_at
string
ISO 8601 timestamp when the case was last updated

Example Request

curl -X GET "https://api.medmitra.com/cases/all_cases?user_id=b8acad4b-4944-4d66-b405-de70886e7248" \
  -H "Content-Type: application/json"

Example Response

{
  "cases": [
    {
      "case_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "user_id": "b8acad4b-4944-4d66-b405-de70886e7248",
      "patient_name": "John Doe",
      "patient_age": 45,
      "patient_gender": "male",
      "case_summary": "Patient presents with chest pain and shortness of breath",
      "status": "completed",
      "created_at": "2026-03-04T10:30:00Z",
      "updated_at": "2026-03-04T11:45:00Z"
    },
    {
      "case_id": "b2c3d4e5-6789-01bc-def0-2345678901bc",
      "user_id": "b8acad4b-4944-4d66-b405-de70886e7248",
      "patient_name": "Jane Smith",
      "patient_age": 32,
      "patient_gender": "female",
      "case_summary": "Follow-up appointment for diabetes management",
      "status": "analyzing",
      "created_at": "2026-03-03T14:20:00Z",
      "updated_at": "2026-03-03T14:20:00Z"
    }
  ]
}

Error Responses

400 Bad Request
error
Invalid request or Supabase client error
{
  "detail": "Error message describing the issue"
}
500 Internal Server Error
error
Server error during data retrieval
{
  "detail": "Internal server error: {error details}"
}

Notes

  • The endpoint returns all cases created by the specified user
  • Cases are returned in the order they were created in the database
  • Use the Get Case by ID endpoint to retrieve detailed information including files and AI insights for a specific case

Build docs developers (and LLMs) love