v1

latestOpenAPI 3.0.3MIT2026-07-17403684.7 KB
Case

Upserts multiple cases

post/cases/batchUpsert

Request body

Example request

{
  "cases": [
    {
      "caseReference": {
        "sourceId": "5ef22491937717c3331c3729",
        "sourceUrl": "https://api.covid19india.org/raw_data7.json"
      },
      "demographics": {
        "ethnicity": "Asian",
        "occupation": "Epidemiologist"
      },
      "location": {
        "country": "CR",
        "administrativeAreaLevel1": "Any province in Costa Rica",
        "administrativeAreaLevel2": "Any canton in Costa Rica",
        "administrativeAreaLevel3": "Any district in Costa Rica",
        "place": "Boston Children's Hospital",
        "name": "Lyon, Auvergne-Rhône-Alpes, France"
      },
      "events": [
        {
          "name": "confirmed",
          "dateRange": {
            "start": "06/20/2020",
            "end": "06/20/2020"
          }
        },
        {
          "name": "outcome",
          "value": "Death"
        },
        {
          "name": "icuAdmission",
          "dateRange": {
            "start": "06/20/2020",
            "end": "06/25/2020"
          },
          "value": "Yes"
        }
      ],
      "symptoms": {
        "status": "Symptomatic",
        "values": [
          "Headache",
          "Vomiting"
        ]
      },
      "preexistingConditions": {
        "hasPreexistingConditions": true,
        "values": [
          "acatalasia",
          "pleuropneumonia"
        ]
      },
      "transmission": {
        "routes": [
          "Oral",
          "Air-borne"
        ],
        "places": [
          "Airplane",
          "Bus",
          "Gym"
        ],
        "linkedCaseIds": [
          "5f3a99d615246c7402ac07d3"
        ]
      },
      "travelHistory": {
        "traveledPrior30Days": true,
        "travel": {
          "dateRange": {
            "start": "02/18/2020",
            "end": "02/20/2020"
          },
          "location": {
            "name": "Peru"
          },
          "purpose": "Business",
          "methods": [
            "Plane",
            "Ferry",
            "Train"
          ]
        }
      },
      "genomeSequences": [
        {
          "repositoryUrl": "https://www.ncbi.nlm.nih.gov/nuccore/AY242057.1",
          "sequenceId": "AY242057.1",
          "sequenceName": "Danio rerio foxi one (foo) gene, complete cds",
          "sequenceLength": 2074
        }
      ],
      "pathogens": [
        {
          "name": "Brucellosis"
        }
      ],
      "revisionMetadata": {
        "creationMetadata": {
          "curator": "foo@bar.com"
        },
        "editMetadata": {
          "curator": "foo@bar.com"
        }
      },
      "variant": {
        "name": "B.1.351"
      },
      "vaccines": [
        {
          "name": "AstraZeneca",
          "batch": "PV12345"
        }
      ]
    }
  ]
}

Response

OK

phase'GEOCODE' | 'VALIDATE' | 'UPSERT'

The last operation completed by the server

numCreatednumber required

The number of cases created by the request.

numUpdatednumber required

The number of cases modified by the request. Note that this only includes cases that are actually modified by the batch upsert. If a case is included in the batch upsert request, but contains no changes compared to the currently stored case, it won't be counted.

Example response

{
  "errors": [
    {
      "message": "Cannot parse age"
    }
  ]
}