Medical text formatter


Formats text aligned to medical standards. The model will receive a raw text and will return the formatted text following medical conventions.

Below we will describe the entire process that allows the successful completion of text formatting.

Request description

Endpoint: /api/v1/medical-text-formatter
Method: POST

{
  "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 structure

type IMedicalTextFormatterRequest = {
  text: string; // Raw text to be formatted according to medical standards
  language?: string; // Language of the input text. Supported values: "es", "en", "pt", "pt-PT", "pt-BR", and "ca". If omitted, language will be automatically detected from the content.
  preserve_case?: boolean; // Whether to preserve the original case of the text. Default is false.
};

Responses

Correct response

Successful request

Describe the characteristics of a satisfactory response

200

Input example:

{
  "text": "presión arterial 120/80, 38 grados de temperatura y se aprecia enrojecimiento en la parte trasera del brazo",
  "language": "es",
  "preserve_case": false
}
Response example:
{
  "formatted_text": "Presión arterial 120/80, 38°C de temperatura y se aprecia enrojecimiento en la parte trasera del brazo.",
  "message": null,
  "request_id": "7ed08fbf-1fa0-4d95-a88c-d0d52320bf64"
}
Response structure
interface IMedicalTextFormatterResponse {
  formatted_text: string; // The input text formatted according to medical standards
  message: string | null; // Additional message or information about the formatting process, if applicable
  request_id: string; // Unique identifier for the request, useful for tracking and debugging purposes
}

Wrong responses

Unauthorized request

Describes the response when the request is not authorized


401

Response body

type GenericTextFormatterResponseType = {
  message: string;
};


Forbidden request

Describes the response when the API Key is not allowed to consume this service


403

Response body

type GenericTextFormatterResponseType = {
  message: string;
};

Remember that to consume this service, the API Key must have the permission: MEDICAL-TEXT-FORMATTER

Validation error

Describe the features of a validation error

422

Response body

type TextFormatterResponseType = {
  statusCode: number;
  message: string;
  error: string;
  details: {
    errorCode: string;
    message: string;
    requestId: string;
    timestamp: string;
  };
};