Upload documents
To upload additional documents for clinical note generation, the following steps must be followed:
- Generate a pre-signed URL
- Upload the file to the generated URL
Below we will describe the functionality that allows you to generate these pre-signed URLs.
Request description
Important: we are able to upload files with the following mime types: text/plain and application/pdf
Endpoint: /v1/generate-signed-urls-for-documents
Method: POST
Remember: you can see the URL to consume this API in the Introduction section.
Header
{
"Content-Type": "application/json",
"Authorization": "Bearer <accessToken>"
}
Authorization: We'll pass the token obtained during the authentication process. You can reuse the generated tokens, as they have a 2-hour lifespan. Review this page: Credentials
To set the API version on a specific request, you can add a specific header named X-Invox-Medical-Api-Version with the value of the version you are targeting:
X-Invox-Medical-Api-Version: 2026-03-01
Payload example
{
"consultationSessionId": "mock-consultation-session-id",
"documents": [
{
"documentType": "PDF",
"documentName": "mock-document.pdf"
}
]
}
consultationSessionId must be a unique session ID associated with the clinical note generation process. You must generate it in your application before performing the request.Payload structure
export type PresignedUrlForDocumentsRequest = {
consultationSessionId: string;
documents: IDocumentPresignedUrlRequest[];
};
export interface IDocumentPresignedUrlRequest {
documentType: "PDF" | "TXT";
documentName: string;
}
Responses
Correct response
Successful request
Describe the characteristics of a satisfactory response
200
Response structure:
{
"documents": [
{
"documentId": "mock-document-id",
"documentType": "PDF",
"documentName": "mock-document.pdf",
"signedUrl": "https://mock-signed-url"
}
]
}
Response structure
type GeneratePresignUrlResponseType = {
documents: SignedUrlDocument[];
};
type SignedUrlDocument = {
documentId: string;
documentType: "PDF" | "TXT";
documentName: string;
signedUrl: string;
};
When you get the response with the generated signed URL, you can proceed to upload the document to the provided URL.
For each document, below is a Javascript example that performs this task:
fetch(presingUrl, {
method: "PUT",
headers: {
"Content-Type": "application/pdf", // or "text/plain" depending on the document type,
},
body: individualDocument as File,
})
.then((response) => {
if (response.ok) {
// implement logic for successfully request here
} else {
// implement logic for unsuccessfully request here
}
})
.catch((error) => {
// Implement the logic here when an exception occurs
});
Wrong responses
Unauthorized request
Describes the response when the request is not authorized
401
Response body
type GenerateReportResponseType = {
messsage: string;
};
Forbidden request
Describes the response when the API Key is not allowed to consume this service
403
Response body
type GenerateReportResponseType = {
messsage: string;
errorType: string;
};
GENERATE-REPORTInvalid request
Bad request
Describe the characteristics of a bad request
400
Response body
type GeneratePresignUrlResponseType = {
messsage: string
errorType: GENERATE_PRESIGNURL_ERROR_TYPE
}
enum GENERATE_PRESIGNURL_ERROR_TYPE {
INCONSISTENT_INPUT= 'inconsistentInput'
INVALID_REQUEST_BODY = 'invalidRequestBody'
INVALID_API_VERSION_FOR_ENDPOINT ='invalidApiVersionForEndpoint'
}