API Endpoints
Health Checks
GET /healthy
Simple health check returning {"status": "healthy"}.
Response:
{
"status": "healthy"
}GET /health
Detailed health check with database connectivity status.
Response:
{
"status": "healthy",
"database": "connected"
}Diagnosis Endpoints
POST /api/diagnosis
Combined diagnosis endpoint used by the Physician Portal. Accepts a skin image and collected anamnesis (questionnaire answers), runs image validation and ML inference, and returns a full diagnosis result.
Request: multipart/form-data
image(file, required): JPEG or PNG skin imageanamnesis(string, required): JSON-encoded anamnesis object (questionnaire answers)
Response:
{
"predictions": [
{ "disease": "Psoriasis", "probability": 0.85, "confidence": "high" },
{ "disease": "Eczema", "probability": 0.10, "confidence": "low" }
],
"red_flags": {
"hasRedFlags": false,
"flags": [],
"urgency": "low"
},
"image_validity": {
"isValid": true,
"score": 0.94,
"issues": []
}
}Error Responses:
400 Bad Request- Invalid image type or anamnesis JSON422 Unprocessable Entity- Validation error in anamnesis fields502 Bad Gateway- AI service unavailable
POST /api/ai/next_question
Get the next adaptive questionnaire question based on answers collected so far.
Request Body: AnamnesisRequest (partial — answers accumulated so far)
Response: NextQuestionResponse
{
"questionId": "symptom_duration",
"questionText": "How long have you had this symptom?",
"questionType": "radio",
"fieldName": "duration",
"options": ["<1 week", "1-4 weeks", ">1 month"],
"isComplete": false
}questionType values: camera, bool, radio, checkbox, number, text
fieldName is the key used when submitting the final anamnesis.
When isComplete is true, the portal moves to image review and submission.