API ReferenceapiaiPOST /v1/extract/bloodwork

POST /v1/extract/bloodwork

Service: ai · operationId: (none)

Interim OCR + structured biomarker extraction for uploaded bloodwork PDFs/images

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "requested_by": {
      "type": "string",
      "minLength": 1
    },
    "mime_type": {
      "type": "string",
      "enum": [
        "application/pdf",
        "image/jpeg",
        "image/png"
      ]
    },
    "file_base64": {
      "type": "string",
      "minLength": 1
    },
    "vendor_hint": {
      "type": "string",
      "minLength": 1
    },
    "drawn_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "brand_id",
    "requested_by",
    "mime_type",
    "file_base64"
  ]
}

Responses

200 Structured biomarkers extracted

{
  "type": "object",
  "properties": {
    "lab_vendor": {
      "type": [
        "string",
        "null"
      ]
    },
    "collected_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "biomarkers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "number"
          },
          "unit": {
            "type": "string"
          },
          "reference_range": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "value",
          "unit",
          "reference_range"
        ]
      }
    }
  },
  "required": [
    "lab_vendor",
    "collected_at",
    "biomarkers"
  ]
}

400 Invalid extraction input or malformed model output

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

412 Extraction provider not configured

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

502 Extraction provider error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://ai.platform.loop.health/v1/extract/bloodwork \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'