---
# System prepended metadata

title: Bulk Import Example

---

# Bulk Import Example

---
### Start a submission with an import manifest

```mermaid
sequenceDiagram
    participant DataSender as Data Sender

    box Data Recipient
        participant ImportEndpoint as data endpoint
        participant ImportStatus as status endpoint
    end

    DataSender->>ImportEndpoint: POST Import Manifest
    ImportEndpoint-->>DataSender: Status URL Header
```

**Request** 
```
POST https://server.com/$bulk-submit
```
```json
{
  "submitter": {
    "system": "http://hrsa.gov/grant-number",
    "value": "H80CS12345" 
  },
  "submissionId": "a15eea1f-1605-4303-989f-542d3a7962d8",
  "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_1",
  "transactionTime": "2025-01-01T00:00:00Z",
  "outputOrganizedBy": "Patient",
  "output" : [{
    "url" : "https://example.com/output/file_1.ndjson"
  },{
    "url" : "https://example.com/output/file_2.ndjson",
    "continuesInFile": "https://example.com/output/file_3.ndjson"
  },{
    "url" : "https://example.com/output/file_3.ndjson"
  }]
}
```

**Response**

```
Status: 202 Accepted
Content-Location: http://server.com/import-status/123456
```

---
### Optional status check

```mermaid
sequenceDiagram
    participant DataSender as Data Sender

    box Data Recipient
        participant ImportEndpoint as  data endpoint
        participant ImportStatus as status endpoint
    end

    DataSender->>ImportStatus: Ping Status Endpoint
    ImportStatus-->>DataSender: Optional Partial Export Manifest
```

**Request**
```
GET http://server.com/import-status/123456
```

**Response**

```
Status: 202 Accepted
```
```json
{
  "extension": {
    "submissionId": "a15eea1f-1605-4303-989f-542d3a7962d8"
  },
  "transactionTime": "2025-01-01T00:00:00Z",
  "output" : [{
    "extension": {
      //tie to manifest - should this also tie to one or more files?
      "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_1",
    },
    "url" : "https://example.com/output/validation_errors_1.ndjson"
  }]
}
```

---
### Final import manifest of the submission
```mermaid
sequenceDiagram
    participant DataSender as Data Sender

    box Data Recipient
        participant ImportEndpoint as  data endpoint
        participant ImportStatus as status endpoint
    end

    DataSender->>ImportEndpoint: Import Manifest
    ImportEndpoint-->>DataSender: Status URL
```

**Request**
```
POST https://server.com/$bulk-submit
```
```json
{
  "submitter": {
    "system": "http://hrsa.gov/grant-number",
    "value": "H80CS12345" 
  },
  "submissionId": "a15eea1f-1605-4303-989f-542d3a7962d8",
  "submissionStatus": {
    "system": "http://hl7.org/fhir/uv/bulkdata/ValueSet/submission-status",
    "code": "complete"
  },
  "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_2",
  "transactionTime": "2025-01-01T00:00:00Z",
  "outputOrganizedBy": "Patient",
  "output" : [{
    "url" : "https://example.com/output/file_4.ndjson"
  },{
    "url" : "https://example.com/output/file_5.ndjson"
  }]
}
```

**Response**

```
Status: 202 Accepted
Content-Location: http://server.com/import-status/123456
```

---
### Status check
```mermaid
sequenceDiagram
    participant DataSender as Data Sender

    box Data Recipient
        participant ImportEndpoint as  data endpoint
        participant ImportStatus as status endpoint
    end

    DataSender->>ImportStatus: Ping Status Endpoint
    ImportStatus-->>DataSender: Complete Export Manifest
```

**Request**
```
GET http://server.com/import-status/123456
```

**Response**
```
Status: 200 OK
```
```json
{
  "extension": {
  "submissionId": "a15eea1f-1605-4303-989f-542d3a7962d8"
  },
  "transactionTime": "2025-01-01T00:00:00Z",
  "output" : [{
    "extension": {
        "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_1",
    },
    "url" : "https://example.com/output/validation_errors_1.ndjson"
  }],
  "link": [{
    "relation": "next",
    "url": "http://server.com/import-status/123456/manifest-2.json"
  }]
}
```

---
### Manifest page request
```mermaid
sequenceDiagram
    participant DataSender as Data Sender

    box Data Recipient
        participant ImportEndpoint as  data endpoint
        participant ImportStatus as status endpoint
    end

    DataSender->>ImportStatus: GET Manifest Page
    ImportStatus-->>DataSender: Complete Export Manifest Page
```

**Request**
```
GET http://server.com/import-status/123456/manifest-2.json
```

**Response** 
```
Status: 200 OK
```
```json
{
  "extension": {
  "submissionId": "a15eea1f-1605-4303-989f-542d3a7962d8"
  },
  "transactionTime": "2025-01-01T00:00:00Z",
  "output" : [{
    "extension": {
      "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_2",
    },
    "url" : "https://example.com/output/validation_errors_2.ndjson"
  },{
    "extension": {
      "manifestId": "3556d214-c6e2-42e6-a7f7-89690f7a40bb_1",
    },
    "url" : "https://example.com/output/import_errors_1.ndjson"
  }]
}
```