API reference
Send evidence. Release payment.
Two endpoints connect your data to an outcome contract.
Preview. Endpoints and fields may change. Sandbox keys on request.
- Authentication
- Bearer keys in the Authorization header; test and live keys are separate.
- Formats
- JSON in and out; clinical values map to HL7 FHIR Observations.
- Idempotency
- Send an Idempotency-Key on writes so a retry never commits twice.
POST/v1/evidence/ingest
Send a clinical measurement
Attach a lab value or device reading to a contract. Sanafin validates it against the contract's data rules and updates the contract state.
Request parameters
contract_id
string · The contract the evidence belongs to.
data_source
enum · lab_feed, device or ehr.
payload.biomarker
string · The measured value, e.g. HbA1c.
payload.fhir_reference
string · Optional FHIR Observation reference.
Example request · test mode
curl -X POST https://api.sanafin.tech/v1/evidence/ingest \
-H "Authorization: Bearer sf_test_..." \
-H "Content-Type: application/json" \
-d '{
"contract_id": "con_example_t2d",
"patient_id": "pat_example_001",
"data_source": "lab_feed",
"payload": {
"biomarker": "HbA1c",
"value": 6.9,
"unit": "percent",
"verified_by": "lab_example"
}
}'Response 200 OK
{
"status": "received",
"evidence_id": "ev_example_01",
"validation": { "schema_check": "passed" },
"contract_state": "pending_evaluation"
}Want sandbox keys? Email hello@sanafin.tech.