curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/ai/v1/ingest \
--header 'Content-Type: multipart/form-data' \
--form 'patientId=<string>' \
--form file='@example-file'import requests
url = "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "patientId": "<string>" }
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('patientId', '<string>');
form.append('file', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.{workspaceId}.clinia.cloud/ai/v1/ingest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{workspaceId}.clinia.cloud/ai/v1/ingest")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/ai/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"runId": "<string>",
"status": "started"
}{
"code": 400,
"type": "INVALID_ARGUMENT",
"message": "Invalid request parameters"
}{
"code": 401,
"type": "UNAUTHENTICATED",
"message": "Unauthenticated"
}{
"code": 403,
"type": "PERMISSION_DENIED",
"message": "Permission denied"
}{
"code": 413,
"type": "CONTENT_TOO_LARGE",
"message": "Payload too large"
}{
"code": 415,
"type": "UNSUPPORTED_MEDIA_TYPE",
"message": "Unsupported media type"
}{
"code": 500,
"type": "INTERNAL",
"message": "Internal Server Error"
}Start ingestion workflow
Ingest either an unstructured document (multipart/form-data) or a FHIR bundle (application/json).
Ingested unstructured documents are added to the patient record incrementally. Creating a summary for a given patient will use all ingested unstructured documents up to that point.
Ingested FHIR bundles replace the existing patient record: ingesting a new FHIR bundle will overwrite any previously ingested FHIR bundles for that patient, but will not affect previously ingested unstructured documents.
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/ai/v1/ingest \
--header 'Content-Type: multipart/form-data' \
--form 'patientId=<string>' \
--form file='@example-file'import requests
url = "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "patientId": "<string>" }
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('patientId', '<string>');
form.append('file', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.{workspaceId}.clinia.cloud/ai/v1/ingest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{workspaceId}.clinia.cloud/ai/v1/ingest"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{workspaceId}.clinia.cloud/ai/v1/ingest")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/ai/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"patientId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"runId": "<string>",
"status": "started"
}{
"code": 400,
"type": "INVALID_ARGUMENT",
"message": "Invalid request parameters"
}{
"code": 401,
"type": "UNAUTHENTICATED",
"message": "Unauthenticated"
}{
"code": 403,
"type": "PERMISSION_DENIED",
"message": "Permission denied"
}{
"code": 413,
"type": "CONTENT_TOO_LARGE",
"message": "Payload too large"
}{
"code": 415,
"type": "UNSUPPORTED_MEDIA_TYPE",
"message": "Unsupported media type"
}{
"code": 500,
"type": "INTERNAL",
"message": "Internal Server Error"
}Headers
The ID of the user making the request. Used to associate the request with a specific user.
Body
Response
Ingestion accepted
Ingestion workflows are async, this response only indicates how to poll the workflow status, not the status of the ingestion itself. Typically, ingesting unstructured documents can take several minutes, while ingesting structured FHIR bundles should complete within seconds (depending on size).
Was this page helpful?