openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: analyze description: Eye conjunctiva analysis for anemia detection - name: records description: Stored anemia screening records paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /analyze: post: operationId: analyzeConjunctiva tags: [analyze] summary: Analyze eye conjunctiva for anemia description: Accepts a base64-encoded image and returns anemia screening results with segmentation bounding box requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AnalyzeRequest" responses: "200": description: Analysis result content: application/json: schema: $ref: "#/components/schemas/AnalyzeResult" "400": description: Bad request content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /records: get: operationId: listAnalysisRecords tags: [records] summary: List stored anemia screening records description: Returns records saved by the API after successful analysis responses: "200": description: Stored records content: application/json: schema: type: object properties: records: type: array items: $ref: "#/components/schemas/AnalysisRecord" required: - records components: schemas: HealthStatus: type: object properties: status: type: string required: - status AnalyzeRequest: type: object properties: patient: $ref: "#/components/schemas/PatientData" image: type: string description: Base64-encoded image data (without data URI prefix) mimeType: type: string description: MIME type of the image default: image/jpeg required: - patient - image PatientData: type: object properties: dni: type: string fullName: type: string age: type: integer minimum: 0 maximum: 120 sex: type: string enum: [F, M, O] phone: type: string district: type: string required: - dni - fullName - age - sex BoundingBox: type: object description: Normalized bounding box of the conjunctiva region (0-1000 coordinate system) properties: yMin: type: number xMin: type: number yMax: type: number xMax: type: number required: - yMin - xMin - yMax - xMax AnalyzeResult: type: object properties: recordId: type: string description: Saved record identifier conjunctivaDetected: type: boolean colorDescription: type: string hasAnemia: type: boolean nullable: true confidence: type: number minimum: 0 maximum: 100 recommendation: type: string boundingBox: $ref: "#/components/schemas/BoundingBox" nullable: true description: Bounding box of the conjunctiva region, null if not detected dominantHex: type: string nullable: true description: Dominant color of the conjunctiva as hex string (e.g. "#E57373") required: - conjunctivaDetected - colorDescription - confidence - recommendation AnalysisRecord: type: object properties: id: type: string createdAt: type: string format: date-time patient: $ref: "#/components/schemas/PatientData" image: type: object properties: mimeType: type: string required: - mimeType result: $ref: "#/components/schemas/AnalyzeResult" required: - id - createdAt - patient - image - result ErrorResponse: type: object properties: error: type: string required: - error