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"
}
| Field | Description |
|---|---|
object | Always list |
data | Items on this page |
hasMore | true when another page exists |
nextCursor | Cursor for the next page. null on the last page |
The Link header carries the next page URL with rel="next".
Parameters
| Parameter | Default | Description |
|---|---|---|
limit | 50 | Page size, 1 to 100 |
cursor | None | nextCursor from the previous page |
Keep the same filters while you page. Changing a filter starts a new list.
| Request | Filter | Values |
|---|---|---|
GET /v1/data-engine/batches | status | pending, processing, completed, cancelled |
GET /v1/data-engine/batches | externalReference | Exact match |
GET .../documents | status | A document status |
GET .../entities | type | An 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 }
}
| Field | Description |
|---|---|
id | Entity ID |
type | FHIR resource type, such as Condition or Medication |
text | Text as written in the note |
confidence | high, medium, or low. null when not assessed |
polarity | Whether the finding is present, such as positive |
subject | Who the finding is about, such as patient |
codes | Codes, each with system, code, and display |
attributes | Details specific to the entity type, such as clinicalStatus |
span | start 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":[]}
| Field | Description |
|---|---|
documentId | Document ID |
externalReference | Your reference for the document |
status | succeeded, failed, or cancelled |
entities | Entity objects. Empty unless status is succeeded |