Upload

Endpoints

Upload Endpoint

Upload documents for processing and conversion to FHIR format.

Overview

The Upload endpoint supports two mutually exclusive modes:

  • Direct upload — Send files via multipart/form-data. Once uploaded, you receive a unique file_id that can be used with the Convert endpoint.
  • URL ingest — Provide a presigned S3 URL via application/json. The platform fetches the file from the URL and stores it, returning a file_id.

Endpoint Details

URL: POST /api/v1/upload Content-Type: multipart/form-data (direct upload) or application/json (URL ingest)

Request Parameters

Headers

HeaderTypeRequiredDescription
X-Client-IdstringYesClient ID from the API keys
X-Client-SecretstringYesClient secret from the API keys
Content-TypestringYesmultipart/form-data for direct upload or application/json for URL ingest

Mode 1: Direct Upload (multipart/form-data)

ParameterTypeRequiredDescription
filefileYesThe document to upload
file_typestringYesType of file: pdf, ccda, or csv

Mode 2: URL Ingest (application/json)

ParameterTypeRequiredDescription
presigned_urlstringYesHTTPS presigned S3 URL to fetch the file from
file_typestringYesType of file: pdf, ccda, or csv

Supported File Types

  • PDF files (.pdf) — Medical documents, reports, forms
  • CCDA files (.xml) — Consolidated Clinical Document Architecture files
  • CSV files (.csv) — Comma-separated values data files
  • Maximum file size (direct upload): 50MB per file

Request Examples

Direct Upload

URL Ingest

Response Format

Success Response (200 OK)

Response Fields

FieldTypeDescription
messagestringSuccess message
file_idstringUnique identifier for the uploaded file in the format {uuid}.{ext}

Status and Error Codes

HTTP CodeMessage
200File uploaded successfully
400file_type is required and must be one of: pdf, ccda, csv
400file_type must be one of: pdf, ccda, csv
400Uploaded file must include a filename with a permitted extension
400Multipart upload requires form fields: file, file_type
400Multipart upload must include only file and file_type fields
400Invalid JSON body
400JSON body must be an object
400JSON ingest requires presigned_url and file_type
400presigned_url must be HTTPS and use an allowed S3 host
400File content does not match declared file_type
400Password-protected PDFs are not supported.
400Uploaded file is not a valid PDF
400Uploaded file is empty
400CSV must be valid UTF-8
400CSV must contain a header row and at least one data row
401Unauthorized (missing or invalid authentication)
403Insufficient permissions
413File exceeds maximum direct upload size of 50MB
429Too many requests. For more details, visit the page Rate Limits
500Internal server error
504API gateway Timeout

Best Practices

  1. File Validation: Validate file type and size before uploading
  2. Security: Keep your client credentials secure
  3. Choose the right mode: Use direct upload for files under 50MB. Use URL ingest for larger files already stored on S3
  4. Set file_type correctly: Ensure the file_type value matches the actual content of your file to avoid validation errors

Next Steps

After successful upload, use the returned file_id to: