Upload Document
curl --request POST \
--url https://app.arahealth.io/api/v1/pub/records/document-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form referral='@example-file' \
--form referralSource=import requests
url = "https://app.arahealth.io/api/v1/pub/records/document-upload"
files = { "referral": ("example-file", open("example-file", "rb")) }
payload = { "referralSource": "" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('referral', '<string>');
form.append('referralSource', '');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.arahealth.io/api/v1/pub/records/document-upload', 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://app.arahealth.io/api/v1/pub/records/document-upload",
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=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.arahealth.io/api/v1/pub/records/document-upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.arahealth.io/api/v1/pub/records/document-upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.arahealth.io/api/v1/pub/records/document-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "SyntheticReferral-Breast-T1-01-10-04-2025-NA-009.pdf",
"status": "complete",
"record_id": "example_record_id_123"
}
],
"status_code": 200,
"message": "success"
}{
"error": "<string>",
"message": "<string>"
}{
"message": "Invalid API key",
"detail": "connection(localhost:27017[-3]) incomplete read of message header: read tcp [::1]:55900->[::1]:27017: use of closed network connection",
"status_code": 401
}{
"error": "<string>",
"message": "<string>"
}File Endpoints
Upload Document
Upload a medical referral document for processing
POST
/
api
/
v1
/
pub
/
records
/
document-upload
Upload Document
curl --request POST \
--url https://app.arahealth.io/api/v1/pub/records/document-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form referral='@example-file' \
--form referralSource=import requests
url = "https://app.arahealth.io/api/v1/pub/records/document-upload"
files = { "referral": ("example-file", open("example-file", "rb")) }
payload = { "referralSource": "" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('referral', '<string>');
form.append('referralSource', '');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.arahealth.io/api/v1/pub/records/document-upload', 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://app.arahealth.io/api/v1/pub/records/document-upload",
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=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.arahealth.io/api/v1/pub/records/document-upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.arahealth.io/api/v1/pub/records/document-upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.arahealth.io/api/v1/pub/records/document-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referral\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"referralSource\"\r\n\r\n\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "SyntheticReferral-Breast-T1-01-10-04-2025-NA-009.pdf",
"status": "complete",
"record_id": "example_record_id_123"
}
],
"status_code": 200,
"message": "success"
}{
"error": "<string>",
"message": "<string>"
}{
"message": "Invalid API key",
"detail": "connection(localhost:27017[-3]) incomplete read of message header: read tcp [::1]:55900->[::1]:27017: use of closed network connection",
"status_code": 401
}{
"error": "<string>",
"message": "<string>"
}Overview
Upload a medical referral document along with associated metadata for processing. This endpoint accepts multipart form data with the document file and related information.Endpoint
POST https://app.arahealth.io/api/v1/pub/records/document-upload
https://app.arahealth.io
Path: /api/v1/pub/records/document-upload
Method: POST
Request Parameters
Headers
Authorization(required) - Bearer token for authentication (format:Bearer ara_live_YOUR_API_KEY)
Form Data
referral(required) - The referral document file (PDF, image, etc.)referralSource(optional) - Source of the referral
Code Examples
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://app.arahealth.io/api/v1/pub/records/document-upload");
request.Headers.Add("Authorization", "Bearer ara_live_YOUR_API_KEY");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("/path/to/referral.pdf")), "referral", "referral.pdf");
content.Add(new StringContent(""), "referralSource");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
const formData = new FormData();
formData.append('referral', fileInput.files[0]);
formData.append('referralSource', '');
const response = await fetch('https://app.arahealth.io/api/v1/pub/records/document-upload', {
method: 'POST',
headers: {
'Authorization': 'Bearer ara_live_YOUR_API_KEY'
},
body: formData
});
const data = await response.json();
console.log(data);
import requests
url = "https://app.arahealth.io/api/v1/pub/records/document-upload"
headers = {
"Authorization": "Bearer ara_live_YOUR_API_KEY"
}
files = [
('referral', ('referral.pdf', open('/path/to/referral.pdf', 'rb'), 'application/pdf'))
]
data = {
"referralSource": ""
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
curl -X POST https://app.arahealth.io/api/v1/pub/records/document-upload \
-H "Authorization: Bearer ara_live_YOUR_API_KEY" \
-F "referral=@/path/to/referral.pdf" \
-F "referralSource="
Response
A successful upload returns a JSON object with the following structure:{
"data": [
{
"name": "XXXXSyntheticReferral-Breast-T1-03-10-04-2025-NA-008.docx.pdf",
"status": "complete",
"record_id": "692b56267a5069e2517787e5"
}
],
"status_code": 200,
"message": "success"
}
Response Fields
data- Array of uploaded document recordsname- Filename of the uploaded documentstatus- Processing status (complete,incomplete)record_id- Unique identifier for the uploaded record
status_code- HTTP status code (200 for success)message- Status message
Authorizations
Bearer token authentication using your Alto Health API key
Body
multipart/form-data
Multipart form data containing document and metadata
⌘I
