Public Upload Analysis File
curl --request POST \
--url https://public-api.salu.com.vc/dev/routes/v0/analysis/files \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"analysis_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_base64": "<string>"
}
'import requests
url = "https://public-api.salu.com.vc/dev/routes/v0/analysis/files"
payload = {
"analysis_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_base64": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
analysis_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
file_base64: '<string>'
})
};
fetch('https://public-api.salu.com.vc/dev/routes/v0/analysis/files', 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://public-api.salu.com.vc/dev/routes/v0/analysis/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'analysis_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'file_base64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://public-api.salu.com.vc/dev/routes/v0/analysis/files"
payload := strings.NewReader("{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.salu.com.vc/dev/routes/v0/analysis/files")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.salu.com.vc/dev/routes/v0/analysis/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_path": "<string>",
"mimetype": "<string>",
"document_type": "DISABILITY_MEDICAL_REPORT"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Analysis
Upload Analysis File
POST
/
v0
/
analysis
/
files
Public Upload Analysis File
curl --request POST \
--url https://public-api.salu.com.vc/dev/routes/v0/analysis/files \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"analysis_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_base64": "<string>"
}
'import requests
url = "https://public-api.salu.com.vc/dev/routes/v0/analysis/files"
payload = {
"analysis_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_base64": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
analysis_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
file_base64: '<string>'
})
};
fetch('https://public-api.salu.com.vc/dev/routes/v0/analysis/files', 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://public-api.salu.com.vc/dev/routes/v0/analysis/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'analysis_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'file_base64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://public-api.salu.com.vc/dev/routes/v0/analysis/files"
payload := strings.NewReader("{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.salu.com.vc/dev/routes/v0/analysis/files")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.salu.com.vc/dev/routes/v0/analysis/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"analysis_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"file_base64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"file_path": "<string>",
"mimetype": "<string>",
"document_type": "DISABILITY_MEDICAL_REPORT"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Attaches a document to an existing analysis (e.g. a report for a
PCD analysis). It is the companion step to
POST /v0/analysis/disability.Overview
- Method:
POST - Path:
/v0/analysis/files - OperationId:
public_upload_analysis_file_v0_analysis_files_post - Authentication:
x-api-keyheader
Main fields
| Field | Required | Meaning |
|---|---|---|
analysis_id | yes | Identifier (UUID) of the analysis to attach the file to. |
name | yes | File name (with extension). |
document_type | yes | Document type. For a PCD analysis, use DISABILITY_MEDICAL_REPORT (input medical report) or DISABILITY_CLASSIFICATION (disability classification, produced after review). |
mime_type | yes | Declared MIME type (enum). |
file_base64 | yes | Binary file content encoded in base64. |
The file content goes inline in the body, in base64 — not
multipart/form-data. Make
sure mime_type matches the actual file content. The actual file is limited to roughly
4 MB (the request goes through API Gateway + Lambda, capped at 6 MB, and base64 inflates
the payload by ~33%).Error codes
Besides422 (invalid fields, including a document_type outside the accepted enum):
| Code | Situation |
|---|---|
404 | analysis_id does not exist within the API key’s scope. |
413 | File larger than the supported limit (~4 MB actual size). |
Request example
curl -X POST "https://public-api.salu.com.vc/dev/routes/v0/analysis/files" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: $SALU_PUBLIC_API_KEY" \
--data '{
"analysis_id": "ANALYSIS_UUID",
"name": "report.pdf",
"document_type": "DISABILITY_MEDICAL_REPORT",
"mime_type": "application/pdf",
"file_base64": "JVBERi0xLjQK..."
}'
Authorizations
Body
application/json
Document types specifically for analysis workflows.
Available options:
DISABILITY_MEDICAL_REPORT, DISABILITY_CLASSIFICATION, MEDICAL_CERTIFICATE Available options:
application/pdf, image/jpeg, image/png, image/jpeg Conteúdo binário do arquivo codificado em base64.
Response
Successful Response
Identificador interno do arquivo no storage.
Document types specifically for analysis workflows.
Available options:
DISABILITY_MEDICAL_REPORT, DISABILITY_CLASSIFICATION, MEDICAL_CERTIFICATE