Convert

Endpoints

Convert Endpoint

Convert uploaded files to structured clinical data.

Overview

The Convert endpoint allows you to trigger the conversion of uploaded documents to structured clinical data. This endpoint processes files that have been previously uploaded via the Upload endpoint.

Endpoint Details

URL: POST /api/v1/convert Content-Type: application/json

Request Parameters

Headers

HeaderTypeRequiredDescription
X-Client-IdstringYesClient ID from the API keys
X-Client-SecretstringYesClient secret from the API keys
Content-TypestringYesMust be application/json

Request Body

ParameterTypeRequiredDescription
file_idstringYes*Unique identifier of the uploaded file
presigned_urlstringYes*The fully-qualified, time-limited URL (such as an S3 presigned URL) to securely access and download the source file to be converted. The URL must be accessible by the platform and valid for the duration of processing.
file_typestringYesType of file: pdf or ccda (C-CDA, Consolidated Clinical Document Architecture)
callback_urlstringNoWebhook URL for job completion notifications
process_configobjectYesConfiguration for the processing type
output_configobjectYesConfiguration for the output format and enrichments

**Either file_id or presigned_url is required.

Process Config

ParameterTypeRequiredDescription
tasksarray of stringsYesA one-item list containing the processing type to run

Processing types - tasks is a one-item list naming the type to run:

TypeInputOutputDescription
clinical_extractionpdf, ccdafhir or jsonExtract structured clinical data from the document.
dephipdfpdf (presigned URL only)De-identify a PDF by removing protected health information (PHI).

A dephi result is a binary PDF, delivered only through a presigned URL. At request time, set output_config.presigned to true or omit it (false is invalid), then retrieve the file from the Results endpoint with presigned=true.

Output Config

ParameterTypeRequiredDefaultDescription
formatstringYes-Output format for the result. Accepted values: fhir, json, pdf
include_bboxbooleanNot requiredfalseWhether to include bounding box coordinates for extracted entities. Incurs additional cost when enabled.
presignedbooleanNot requiredfalseIf true, the webhook callback includes a presigned download URL instead of the result in the body. If false or omitted, the structured result is returned inline (default).
result_ttlintegerNot required5 (minutes)When presigned is true, controls how long the presigned result URL in the success webhook callback remains valid. Integer minutes in the inclusive range 1 to 15. When omitted, the default is five minutes.

Request Examples

1. Using file_id

2. Using presigned_url

Use this method when you want to convert a file directly from a time-limited URL (e.g., an S3 presigned URL) without a prior upload step. Setting presigned: true in output_config returns a presigned download URL in the result instead of inline FHIR JSON.

3. Dephi (de-identification)

Submit a dephi request to de-identify a PDF - it removes protected health information (PHI) and returns a de-identified PDF. Retrieve the result from the Results endpoint with presigned=true.

Response Format

Success Response (200 OK)

Response Fields

FieldTypeDescription
messagestringSuccess message
job_idstringUnique identifier for the conversion job
file_idstringUnique identifier for the uploaded file

Status and Error Codes

HTTP CodeMessage
200Conversion job started successfully
400File ID is required
400File type is required
400File type {file_type} is not supported. Supported types: {supported_types}
400File size is too large.
400File has more than 20 pages
400File type mismatch
400File not found
400File validation failed
400Insufficient credits. Please contact support to upgrade your plan.
400result_ttl must be an integer between 1 and 15 minutes
401X-Client-Id and X-Client-Secret are not valid
404File with ID {file_id} was not found
429Too many requests. For more details, visit the page Rate Limits
500Internal error, Please try again later.
503Conversion service is currently unavailable. Please try again later.
503Failed to submit conversion job to processing service
504API gateway timeout

Best Practices

  1. File Validation: Ensure the file_id exists and is valid before conversion
  2. Callback URLs: Use HTTPS for webhook URLs and ensure they’re publicly accessible
  3. Security: Keep your client credentials secure
  4. Bounding Boxes: Only enable include_bbox when your application requires coordinate data, as it incurs additional processing cost.

Next Steps

After successful conversion request, use the returned job_id to: