Skip to main content

Pagination and Results

List requests return one page at a time. Pass nextCursor from one page as cursor to get the next.

curl -s \
"https://api.amorphous.health/v1/data-engine/batches?limit=50&status=completed" \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"object": "list",
"data": [],
"hasMore": true,
"nextCursor": "opaque"
}
FieldDescription
objectAlways list
dataItems on this page
hasMoretrue when another page exists
nextCursorCursor for the next page. null on the last page

The Link header carries the next page URL with rel="next".

Parameters​

ParameterDefaultDescription
limit50Page size, 1 to 100
cursorNonenextCursor from the previous page

Keep the same filters while you page. Changing a filter starts a new list.

RequestFilterValues
GET /v1/data-engine/batchesstatuspending, processing, completed, cancelled
GET /v1/data-engine/batchesexternalReferenceExact match
GET .../documentsstatusA document status
GET .../entitiestypeAn entity type, such as Condition

Conditional Requests​

GET on a batch returns an ETag. Send it back as If-None-Match, and an unchanged batch returns 304.

Entity Object​

{
"object": "data_engine.entity",
"id": "11111111-1111-4111-8111-111111111111",
"type": "Condition",
"text": "type 2 diabetes mellitus",
"confidence": "high",
"polarity": "positive",
"subject": "patient",
"codes": [
{
"system": "http://snomed.info/sct",
"code": "44054006",
"display": "Type 2 diabetes mellitus"
}
],
"attributes": { "clinicalStatus": "active" },
"span": { "start": 48, "end": 74 }
}
FieldDescription
idEntity ID
typeFHIR resource type, such as Condition or Medication
textText as written in the note
confidencehigh, medium, or low. null when not assessed
polarityWhether the finding is present, such as positive
subjectWho the finding is about, such as patient
codesCodes, each with system, code, and display
attributesDetails specific to the entity type, such as clinicalStatus
spanstart and end character offsets in the extracted text

If a document has the same content as an earlier one, it returns that document's entities.

Enum Values​

Enum values defined by this API are lowercase snake_case, such as succeeded, pipeline_failed, and high. Values from external standards keep their own case: type uses FHIR resource names, and codes are returned as issued.

Results Stream​

GET /v1/data-engine/batches/{batchId}/results streams one JSON line per document as application/x-ndjson. It is available once the batch is completed; before that it returns 409.

{"documentId":"...","externalReference":"note-8842","status":"succeeded","entities":[]}
FieldDescription
documentIdDocument ID
externalReferenceYour reference for the document
statussucceeded, failed, or cancelled
entitiesEntity objects. Empty unless status is succeeded