> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synthpop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Items

> Data Items are the payload of a Task: the files you upload, the outputs Synthpop produces, and the structured medical records it extracts.

Everything attached to a [Task](/concepts/tasks) — what you upload and what
Synthpop produces — is a **Data Item**, listed under `data_items` on
`TaskDetails`. A Data Item is one of three kinds (`file`, `json`, or `text`),
placed in a pipeline **group**, labelled with a semantic **tag**, and (for
documents Synthpop has read) carrying extracted **medical records**.

## The three kinds

The `data_type` field discriminates the shape:

<Tabs>
  <Tab title="file">
    An uploaded document or a produced file. The bytes are **not** inline — you
    fetch them through an [ephemeral download link](#downloading-files). File items
    may also carry a `data_format` and, for donated/aliased items, an `alias`.
  </Tab>

  <Tab title="json">
    Structured data in a `data` object (e.g. a request spec or a structured
    output). `data_format` may name the expected schema.
  </Tab>

  <Tab title="text">
    Plain text in a `data` string (e.g. a transcript or a note).
  </Tab>
</Tabs>

```json theme={null}
{
  "uuid": "0685bb22-f93d-7d65-8000-131db9c02849",
  "group": "inputs",
  "tag": "upload",
  "name": "referral-packet.pdf",
  "data_format": null,
  "created": "2026-07-15T08:24:15.571185Z",
  "medical_records": null,
  "data_type": "file"
}
```

## `group` — the processing stage

<ResponseField name="group" type="string" required>
  Where the item sits in the flow. `inputs` and `outputs` are present in every task
  type; some task types add **intermediate** groups. Use `group` to separate what
  you sent (`inputs`) from what Synthpop produced (`outputs`).
</ResponseField>

## `tag` — the semantic label

<ResponseField name="tag" type="string" required>
  What the item *is*, independent of where it sits. Examples: `upload`,
  `request-spec`, `clinical-notes`, `supporting-document`, `missing-items`. Tags are
  how you find a specific output within a group.
</ResponseField>

<Note>
  `group` and `tag` answer different questions. `group` is *where in the pipeline*
  (inputs / outputs / intermediate); `tag` is *what kind of content*. A single group
  holds many differently-tagged items.
</Note>

## Common fields

<ResponseField name="uuid" type="string (uuid)" required>
  Unique ID of the Data Item. Used in the download-link path for file items.
</ResponseField>

<ResponseField name="name" type="string | null">
  An optional friendly name, often derived from the file name.
</ResponseField>

<ResponseField name="data_format" type="string | null">
  Optional description of the data's format; for JSON items may identify the
  expected schema.
</ResponseField>

<ResponseField name="created" type="string (date-time)" required>
  When the Data Item was created or uploaded.
</ResponseField>

<ResponseField name="medical_records" type="MedicalRecord[] | null">
  The medical records Synthpop extracted from this item. See below.
</ResponseField>

## Medical records

When Synthpop reads a document, it returns what it found as **`medical_records`** —
an array of `MedicalRecord` objects on the Data Item.

<Warning>
  `medical_records` is distinct from `group`. `group` is the processing stage
  (inputs/outputs/intermediate) for the *whole Data Item*; `medical_records` is the
  list of structured records *extracted from* that item. They are unrelated fields
  — do not conflate them.
</Warning>

A single uploaded file (e.g. a multi-page packet) commonly yields several medical
records — an insurance card, a patient visit note, an order — each spanning a
different range of pages.

<ResponseField name="record_type" type="string" required>
  The kind of record, e.g. `insurance-card` or `patient-visit`.
</ResponseField>

<ResponseField name="sections" type="MedicalRecordSection[]" required>
  The parts of the document this record spans. Each section has a `start` and
  `length` (page numbers for PDFs; seconds for audio, where `length: null` means
  "to the end"), the extracted `content` (OCR text, form data, or transcript), and
  optional `fields`.
</ResponseField>

<ResponseField name="timestamp" type="string (date-time) | null">
  When the medical information was created — e.g. the date of a patient visit.
  This is **not** the upload or processing time.
</ResponseField>

<ResponseField name="fields" type="object | null">
  The aggregate of fields extracted across the record's sections.
</ResponseField>

<Expandable title="Example: a file item with an extracted medical record">
  ```json theme={null}
  {
    "uuid": "0685bb22-f93d-7d65-8000-131db9c02849",
    "group": "inputs",
    "tag": "upload",
    "name": "referral-packet.pdf",
    "data_type": "file",
    "created": "2026-07-15T08:24:15.571185Z",
    "medical_records": [
      {
        "id": 1,
        "record_type": "patient-visit",
        "timestamp": "2026-06-10T00:00:00Z",
        "sections": [
          {
            "start": 1,
            "length": 2,
            "content": "Patient presents for follow-up evaluation...",
            "fields": { "blood_pressure": "120/80" }
          }
        ],
        "fields": { "blood_pressure": "120/80" }
      }
    ]
  }
  ```
</Expandable>

## Downloading files

File Data Items do not include their bytes inline. To download one, request a
presigned URL:

```
GET /task/{task_uuid}/data_item/{data_item_uuid}/get_link
```

It returns a `GetDownloadLinkResponse` with a suggested `file_name` and a temporary
`url`.

<Warning>
  The download link is **ephemeral: it must be used within \~60 seconds**. Do not
  store it as a durable reference — request a fresh link each time you need the
  bytes.
</Warning>

## Where to go next

<CardGroup cols={2}>
  <Card title="Results" icon="clipboard-check" href="/concepts/results">
    How verdicts and issues reference the Task.
  </Card>

  <Card title="Tasks" icon="cube" href="/concepts/tasks">
    The resource these items belong to.
  </Card>
</CardGroup>
