{ "openapi": "3.1.0", "info": { "title": "RikY2", "version": "", "description": "", "contact": { "name": "Lazarus IT", "url": "https://lazarus-ai.atlassian.net/servicedesk/customer/portal/8", "email": "support@lazarusai.com" }, "termsOfService": "https://www.lazarusai.com/legal", "license": { "name": "Get Lazarus", "url": "https://emvnha23ura.typeform.com/lazarus-rikai?typeform-source=dashboard.lazarusai.com" }, "summary": "" }, "paths": { "/rikai/custom/riky2": { "post": { "tags": [ "Requests" ], "summary": "Document input, JSON response", "description": "Make a request to RikY2 and receive JSON response data.\n\n#### File upload options\nWe support requests with Content-Type `application/json` or `multipart/form-data`.\n- `[application/json]` **inputURL** link to file\n- `[application/json]` **base64** base64 encoded file data\n- `[multipart/form-data]` **file** upload local file from browser", "operationId": "post_riky2", "parameters": [ { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIRequestBody" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/RikAIFileRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIResponse" } } } }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "413": { "$ref": "#/components/responses/413" }, "429": { "$ref": "#/components/responses/429" }, "521": { "$ref": "#/components/responses/521" }, "522": { "$ref": "#/components/responses/522" } } } }, "/rikai/ocr/riky2": { "post": { "tags": [ "Requests" ], "summary": "OCR input, JSON response", "description": "Make a request to RikY2 by providing OCR results as input, receive JSON response data. This method skips the OCR process that typically precedes RikY2 calls. It is ideal for asking multiple questions of the same document.", "operationId": "post_ocr_riky2", "parameters": [ { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIOCRRequestBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIResponse" } } } }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "413": { "$ref": "#/components/responses/413" }, "429": { "$ref": "#/components/responses/429" }, "521": { "$ref": "#/components/responses/521" }, "522": { "$ref": "#/components/responses/522" } } } }, "/rikai/zip/riky2": { "post": { "tags": [ "Requests" ], "summary": "Document input, ZIP file response", "description": "Make a request to RikY2 and receive response data in a ZIP file.\n To process your request asynchronously, include the `async` query parameter. To receive the model output, use either a `webhook` or an `outputURL`:\n- **`webhook` (Recommended)**: Receives a [JSON response](/../../models/rikai/webhook-examples) by default.\n- `outputURL`: Receives a [ZIP file](../../outputurl) for each document in the request. If the `returnJSON` parameter is set to true, a JSON file will be provided instead.\n\n#### File upload options\nWe only support requests with Content-Type `application/json` at this endpoint.\n- `[application/json]` **inputURL** link to file\n- `[application/json]` **base64** base64 encoded file data\n\n", "operationId": "post_zip_riky2", "parameters": [ { "name": "async", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "async", "description": "Runs request asynchronously" }, "description": "Runs request asynchronously" }, { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ZipRequestBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ZipResponse" } } } }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "413": { "$ref": "#/components/responses/413" }, "429": { "$ref": "#/components/responses/429" }, "521": { "$ref": "#/components/responses/521" }, "522": { "$ref": "#/components/responses/522" } } } }, "/rikai/bulk/riky2": { "post": { "tags": [ "Requests" ], "summary": "Bulk file upload", "description": "Upload 1 or more files to RikY2 for asynchronous processing. To receive the model output, use either a `webhook` or an `outputURL`:\n- **`webhook` (Recommended)**: Receives a [JSON response](/../../models/rikai/webhook-examples) by default.\n- `outputURL`: Receives a [ZIP file](../../outputurl) for each document in the request. If the `returnJSON` parameter is set to true, a JSON file will be provided instead.\n\n\n#### File upload options\nWe only support requests with Content-Type `application/json` at this endpoint.\n- `[application/json]` **inputURL** link to file\n- `[application/json]` **base64** base64 encoded file data\n\n", "operationId": "post_bulk_riky2", "parameters": [ { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkRequestBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkResponse" } } } }, "207": { "$ref": "#/components/responses/207" }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "413": { "$ref": "#/components/responses/413" }, "429": { "$ref": "#/components/responses/429" } } } }, "/rikai/chat/riky2": { "post": { "tags": [ "Requests" ], "summary": "Chat, no file input, JSON response", "description": "Make a RikY2 request using prompt as context. No document upload.", "operationId": "post_chat_riky2", "parameters": [ { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIChatRequestBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RikAIResponse" } } } }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "413": { "$ref": "#/components/responses/413" }, "429": { "$ref": "#/components/responses/429" }, "521": { "$ref": "#/components/responses/521" }, "522": { "$ref": "#/components/responses/522" } } } }, "/rikai/zip/async/{statusId}": { "get": { "tags": [ "Requests" ], "summary": "Get async request status", "description": "Retrieves the status of an asynchronous request to `/rikai/zip/riky2?async=True` or `/rikai/bulk/riky2`. Identifiable by `statusId`.", "operationId": "get_async_status", "parameters": [ { "name": "statusId", "in": "path", "required": true, "schema": { "type": "string", "title": "statusId", "description": "Status ID" }, "description": "Status ID" }, { "name": "orgId", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "orgId", "description": "Organization ID" }, "description": "Organization ID" }, { "name": "authKey", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_]+$", "title": "authKey", "description": "Authentication key" }, "description": "Authentication key" }, { "name": "apiVersion", "in": "header", "required": false, "schema": { "type": "string", "title": "apiVersion", "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." }, "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncStatusResponse" } } } }, "400": { "$ref": "#/components/responses/400" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "429": { "$ref": "#/components/responses/429" }, "521": { "$ref": "#/components/responses/521" } } } } }, "webhooks": { "async-request-submitted": { "post": { "tags": [ "Webhook Responses" ], "summary": "Async Request Submitted", "description": "When an asynchronous request is submitted at a `/bulk` endpoint, we'll send a POST request for each individual request in the submission with this data to the `webhook` provided in your request body.", "operationId": "webhook_post_async_request_submitted", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmittedWebhook" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } }, "async-request-running": { "post": { "tags": [ "Webhook Responses" ], "summary": "Async Request Running", "description": "When an asynchronous request begins processing, we'll send a POST request with this data to the `webhook` provided in your request body.", "operationId": "webhook_post_async_request_running", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunningWebhook" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } }, "async-request-failed": { "post": { "tags": [ "Webhook Responses" ], "summary": "Async Request Failed", "description": "When an asynchronous request fails during processing, we'll send a POST request with this data, including an error message, to the webhook provided in your request body.", "operationId": "webhook_post_async_request_failed", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncWebhookError" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } }, "async-request-output-url-warning": { "post": { "tags": [ "Webhook Responses" ], "summary": "Async Request OutputURL Failure Warning", "description": "When our PUT request to your `outputURL` fails, we'll send a POST request with this warning message to the webhook provided in your request body. Results will be posted to this webhook in a separate request.", "operationId": "webhook_post_async_request_output_url_warning", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WarningWebhook" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } }, "request-succeeded": { "post": { "tags": [ "Webhook Responses" ], "summary": "Request Succeeded", "description": "When a request completes successfully, we'll send a POST request with full response data to the webhook provided in your request body.", "operationId": "webhook_post_request_succeeded", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessWebhook" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } }, "request-succeeded-truncated-response": { "post": { "tags": [ "Webhook Responses" ], "summary": "Request Succeeded Truncated", "description": "When a request completes successfully and your request body includes `webhookSendFull: False`, we'll send a POST request with truncated response data to the webhook provided in your request body.", "operationId": "webhook_post_request_succeeded_truncated", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessWebhookShort" } } }, "required": true }, "responses": { "200": { "description": "Our API expects a 200 status code response to our webhook requests" } } } } }, "components": { "schemas": { "Answer": { "properties": { "answer": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "Model's answer to the question asked." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "The question asked." }, "confidence": { "type": "number", "description": "Answer confidence score ranging from 0 to 1." }, "context": { "type": "string", "description": "Where in the document the answer was found." }, "translated": { "type": "string", "description": "Translated answer if the `language` field was included in the request" }, "translatedContext": { "type": "string", "description": "Translated context if the `language` field was included in the request" } }, "type": "object", "required": [ "answer", "question" ], "title": "Answer" }, "AsyncStatusResponse": { "properties": { "model": { "type": "string", "description": "Model used by the request identified by the status ID." }, "status": { "$ref": "#/components/schemas/StatusEnum", "description": "Status of the request." }, "documentId": { "description": "Document ID of the model request identified by the status ID. Document ID is the value of `fileId` if it is supplied in the model request; otherwise, a random UUID is generated.", "type": "string" }, "error": { "description": "Additional error details about the failure of the model request identified by status ID, if available.", "type": "object" }, "apiVersion": { "description": "API version passed into the header of this status request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "code": { "description": "Response code. Possible values are `200`, `400`, `401`, `403`, `404`, `413`, `521`, and `522`.", "type": "integer" }, "id": { "type": "string", "description": "Response ID for this status request. This is not an identifier of the model request being checked by the status ID." }, "message": { "description": "Status message.", "type": "string" }, "startTime": { "type": "integer", "description": "Start time for this status request, recorded in epoch (Unix timestamp, ms) format. This is not the start time of the model request being checked by status ID." }, "endTime": { "type": "integer", "description": "End time for this status request, recorded in epoch (Unix timestamp, ms) format. This is not the end time of the model request being checked by status ID." } }, "type": "object", "required": [], "title": "AsyncStatusResponse" }, "AsyncWebhookError": { "properties": { "status": { "description": "Status of the request.", "type": "string" }, "code": { "description": "Response code. The possible error codes you may receive at your webhook upon failure are `400`, `401`, `403`, `404`, `413`, `521`, and `522`. See this [guide](/../../models/Rikai/webhook-error-codes) for descriptions of all the error codes.", "type": "integer" }, "message": { "description": "Status message.", "type": "string" }, "error": { "description": "Present only when the request fails. Contains details about the error.", "type": "object" }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" }, "organization": { "description": "Organization ID.", "type": "string" }, "provider": { "type": "string", "description": "lazarus", "default": "lazarus" }, "startTime": { "description": "Request start time recorded in epoch (Unix timestamp) format.", "type": "integer" }, "endTime": { "description": "Request end time recorded in epoch (Unix timestamp) format.", "type": "integer" } }, "additionalProperties": true, "type": "object", "title": "AsyncWebhookError", "required": [] }, "BulkBase64Request": { "properties": { "base64": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "Base64 encoded string for the file from which data will be extracted. If the value is an array of base64 strings, you receive an individual response for each string." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "fileId": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "outputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL where resulting [ZIP file](../../outputurl) or JSON can be sent. Must be open to PUT requests." }, "outputURLHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the PUT request to the output URL." }, "returnJSON": { "type": "boolean", "description": "Specifies the format of the response sent to `outputURL`. When set to true, a JSON response is sent to the `outputURL`. Set to false to send a ZIP file instead.", "default": true } }, "type": "object", "required": [ "base64", "question", "webhook" ], "title": "BulkBase64Request", "examples": [ { "base64": "YOUR_BASE64_ENCODED_FILE", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": "YOUR_WEBHOOK_URL", "settings": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "outputURL": null, "outputURLHeaders": null, "returnJSON": true, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "BulkRequestBody": { "oneOf": [ { "$ref": "#/components/schemas/BulkURLRequest" }, { "$ref": "#/components/schemas/BulkBase64Request" } ], "title": "BulkRequestBody", "required": [], "properties": {} }, "BulkResponse": { "properties": { "message": { "type": "string", "description": "Status message." }, "model": { "type": "string", "description": "Model used to process the document." }, "statusId": { "additionalProperties": true, "type": "object", "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint." }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "endTime": { "type": "integer", "description": "Request end time recorded in epoch (Unix timestamp) format." }, "failedRequests": { "items": {}, "type": "array", "description": "File requests that failed to queue." }, "id": { "type": "string", "description": "Response ID" }, "metadata": { "additionalProperties": true, "type": "object", "description": "JSON from the request `metadata` field." }, "startTime": { "type": "integer", "description": "Request start time recorded in epoch (Unix timestamp) format." }, "status": { "$ref": "#/components/schemas/StatusEnum", "description": "Status of the request." }, "warning": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "description": "Warnings such as webhook failure." } }, "type": "object", "required": [], "title": "BulkResponse" }, "BulkURLRequest": { "properties": { "inputURL": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "URL for the file to extract data from: Must be a PDF, JPEG, JPG, PNG, HEIC, SVG, TIFF, TIF, TXT, or GIF." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "fileId": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "outputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL where resulting [ZIP file](../../outputurl) or JSON can be sent. Must be open to PUT requests." }, "outputURLHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the PUT request to the output URL." }, "returnJSON": { "type": "boolean", "description": "Specifies the format of the response sent to `outputURL`. When set to true, a JSON response is sent to the `outputURL`. Set to false to send a ZIP file instead.", "default": true } }, "type": "object", "required": [ "inputURL", "question", "webhook" ], "title": "BulkURLRequest", "examples": [ { "inputURL": "https://firebasestorage.googleapis.com/v0/b/lazarus-apis-testing.appspot.com/o/examples%2FSample%20Form.pdf?alt=media&token=5b537052-ea54-4be4-9d36-9620ee994c1c", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": "YOUR_WEBHOOK_URL", "settings": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "outputURL": null, "outputURLHeaders": null, "returnJSON": true, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "InputOutputSFTP": { "properties": { "inputURL": { "$ref": "#/components/schemas/SFTP", "description": "SFTP server authentication info for the `inputURL`." }, "outputURL": { "$ref": "#/components/schemas/SFTP", "description": "SFTP server authentication info for the `outputURL`." } }, "type": "object", "title": "InputOutputSFTP", "required": [] }, "OutputURLFailureWarning": { "properties": { "message": { "type": "string", "description": "Status message." }, "url": { "type": "string", "description": "URL where resulting [ZIP file](../../outputurl) or JSON can be sent. Must be open to PUT requests." }, "code": { "description": "Response code. The possible error codes you may receive at your webhook upon failure are `400`, `401`, `403`, `404`, `413`, `521`, and `522`. See this [guide](/../../models/Rikai/webhook-error-codes) for descriptions of all the error codes.", "type": "integer" }, "error": { "description": "Present only when the request fails. Contains details about the error.", "type": "object" }, "field": { "type": "string", "description": "Name of the field causing an error.", "default": "outputURL" } }, "type": "object", "required": [ "message", "url" ], "title": "OutputURLFailureWarning" }, "RikAIBase64Request": { "properties": { "base64": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "Base64 encoded string for the file from which data will be extracted. If the value is an array of base64 strings, each string will be combined into one PDF before getting run through the model." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "ocr": { "description": "OCR data for the document (entire response from [OCR endpoint (version: 2)](../../ocr/ocr_v2), [example here](https://lazarus-ai.atlassian.net/wiki/external/YmIwNDNmNWZmNzhhNGYwNDg3MjBlNmFhOTgwMzAwNjc)). If included, we do not run OCR on the document and use these results instead. Only OCR data obtained from the Lazarus OCR endpoint (include version: 2 in the header) is supported as input.", "type": "object" }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false } }, "type": "object", "required": [ "base64", "question" ], "title": "RikAIBase64Request", "examples": [ { "base64": "YOUR_BASE64_ENCODED_FILE", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "ocr": null, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "RikAIChatRequestBody": { "properties": { "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false } }, "type": "object", "title": "RikAIChatRequestBody", "required": [ "question" ] }, "RikAIFileRequest": { "properties": { "file": { "type": "string", "format": "binary", "description": "File to upload: Must be a PDF, JPEG, JPG, PNG, SVG, HEIC, TIFF, TIF, TXT or GIF." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false } }, "type": "object", "required": [ "file", "question" ], "title": "RikAIFileRequest" }, "RikAIOCRRequestBody": { "properties": { "ocr": { "description": "OCR data for the document (entire response from [OCR endpoint (version: 2)](../../ocr/ocr_v2), [example here](https://lazarus-ai.atlassian.net/wiki/external/YmIwNDNmNWZmNzhhNGYwNDg3MjBlNmFhOTgwMzAwNjc)). Only OCR data obtained from the Lazarus OCR endpoint (include version: 2 in the header) is supported as input.", "type": "object" }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false } }, "type": "object", "required": [ "ocr", "question" ], "title": "RikAIOCRRequestBody" }, "RikAIRequestBody": { "oneOf": [ { "$ref": "#/components/schemas/RikAIURLRequest" }, { "$ref": "#/components/schemas/RikAIBase64Request" } ], "title": "RikAIRequestBody", "required": [], "properties": {} }, "RikAIResponse": { "properties": { "model": { "type": "string", "description": "Model used to process the document." }, "pages": { "type": "integer", "description": "Number of pages in the document." }, "questions": { "description": "Number of questions asked.", "type": "integer" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "baseModel": { "description": "Base model used during data extraction.", "type": "string" }, "data": { "items": { "$ref": "#/components/schemas/Answer" }, "type": "array", "description": "Question and answer data for each question asked in the request." }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "endTime": { "type": "integer", "description": "Request end time recorded in epoch (Unix timestamp) format." }, "id": { "type": "string", "description": "Response ID" }, "language": { "type": "string", "description": "Language results are translated into." }, "metadata": { "additionalProperties": true, "type": "object", "description": "JSON from the request `metadata` field." }, "ocrResults": { "description": "OCR results from the document. Returned only if `returnOCR` was set to true in the request.", "type": "object" }, "settings": { "additionalProperties": true, "type": "object", "description": "JSON containing any custom user settings specified in the request." }, "startTime": { "type": "integer", "description": "Request start time recorded in epoch (Unix timestamp) format." }, "status": { "$ref": "#/components/schemas/StatusEnum", "description": "Status of the request." } }, "type": "object", "required": [], "title": "RikAIResponse" }, "RikAIURLRequest": { "properties": { "inputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL for the file to extract data from: Must be a PDF, JPEG, JPG, PNG, HEIC, SVG, TIFF, TIF, TXT, or GIF." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "ocr": { "description": "OCR data for the document (entire response from [OCR endpoint (version: 2)](../../ocr/ocr_v2), [example here](https://lazarus-ai.atlassian.net/wiki/external/YmIwNDNmNWZmNzhhNGYwNDg3MjBlNmFhOTgwMzAwNjc)). If included, we do not run OCR on the document and use these results instead. Only OCR data obtained from the Lazarus OCR endpoint (include version: 2 in the header) is supported as input.", "type": "object" }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false } }, "type": "object", "required": [ "inputURL", "question" ], "title": "RikAIURLRequest", "examples": [ { "inputURL": "https://firebasestorage.googleapis.com/v0/b/lazarus-apis-testing.appspot.com/o/examples%2FSample%20Form.pdf?alt=media&token=5b537052-ea54-4be4-9d36-9620ee994c1c", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "ocr": null, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "RunningWebhook": { "properties": { "status": { "description": "Status of the request.", "type": "string" }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" }, "organization": { "description": "Organization ID.", "type": "string" }, "provider": { "type": "string", "description": "lazarus", "default": "lazarus" }, "startTime": { "description": "Request start time recorded in epoch (Unix timestamp) format.", "type": "integer" } }, "type": "object", "title": "RunningWebhook", "required": [] }, "SFTP": { "properties": { "user": { "type": "string", "description": "SFTP username." }, "password": { "type": "string", "description": "SFTP password. Either `password` or `privateKey` are required." }, "privateKey": { "type": "string", "description": "Base64 encoded SFTP private key. Either `password` or `privateKey` are required." }, "privateKeyPassphrase": { "type": "string", "description": "Optional passphrase to use if private key is protected." } }, "type": "object", "required": [ "user" ], "title": "SFTP" }, "StatusEnum": { "type": "string", "enum": [ "SUCCESS", "SUBMITTED", "FAILURE", "AUTH_FAILURE", "RUNNING" ], "title": "StatusEnum", "required": [], "properties": {} }, "SubmittedWebhook": { "properties": { "status": { "description": "Status of the request.", "type": "string" }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" }, "organization": { "description": "Organization ID.", "type": "string" }, "provider": { "type": "string", "description": "lazarus", "default": "lazarus" } }, "type": "object", "title": "SubmittedWebhook", "required": [] }, "SuccessWebhook": { "properties": { "status": { "description": "Status of the request.", "type": "string" }, "code": { "description": "`200` response code.", "type": "integer" }, "data": { "items": { "$ref": "#/components/schemas/Answer" }, "type": "array", "description": "Question and answer data for each question asked in the request." }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" }, "baseModel": { "description": "Base model used during data extraction.", "type": "string" }, "questions": { "description": "Number of questions asked.", "type": "integer" }, "pages": { "description": "Number of pages in the document.", "type": "integer" }, "settings": { "description": "JSON containing any custom user settings specified in the request.", "type": "object" }, "language": { "description": "Language results are translated into.", "type": "string" }, "organization": { "description": "Organization ID.", "type": "string" }, "provider": { "type": "string", "description": "lazarus", "default": "lazarus" }, "startTime": { "description": "Request start time recorded in epoch (Unix timestamp) format.", "type": "integer" }, "endTime": { "description": "Request end time recorded in epoch (Unix timestamp) format.", "type": "integer" }, "ocrResults": { "description": "OCR results from the document. Returned only if `returnOCR` was set to true in the request.", "type": "object" } }, "type": "object", "required": [ "data" ], "title": "SuccessWebhook" }, "SuccessWebhookShort": { "properties": { "status": { "description": "Status of the request.", "type": "string" }, "code": { "description": "Response code. Possible values are `200`, `400`, `401`, `403`, `404`, `413`, `521`, and `522`.", "type": "integer" }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" }, "organization": { "description": "Organization ID.", "type": "string" }, "provider": { "type": "string", "description": "lazarus", "default": "lazarus" }, "startTime": { "description": "Request start time recorded in epoch (Unix timestamp) format.", "type": "integer" }, "endTime": { "description": "Request end time recorded in epoch (Unix timestamp) format.", "type": "integer" } }, "type": "object", "title": "SuccessWebhookShort", "required": [] }, "WarningWebhook": { "properties": { "warning": { "$ref": "#/components/schemas/OutputURLFailureWarning", "description": "Warnings such as outputURL failure." }, "statusId": { "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint.", "type": "string" }, "documentId": { "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated.", "type": "string" }, "id": { "description": "Response ID", "type": "string" }, "model": { "description": "Model used to process the document.", "type": "string" }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "metadata": { "description": "JSON from the request `metadata` field.", "type": "object" } }, "type": "object", "required": [ "warning" ], "title": "WarningWebhook" }, "ZipBase64Request": { "properties": { "base64": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "string" } ], "description": "Base64 encoded string for the file from which data will be extracted. If the value is an array of base64 strings, each string will be combined into one PDF before getting run through the model." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "bulkStartTime": { "type": "integer", "description": "Bulk request start time in Unix timestamp in milliseconds." }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "ocr": { "description": "OCR data for the document (entire response from [OCR endpoint (version: 2)](../../ocr/ocr_v2), [example here](https://lazarus-ai.atlassian.net/wiki/external/YmIwNDNmNWZmNzhhNGYwNDg3MjBlNmFhOTgwMzAwNjc)). If included, we do not run OCR on the document and use these results instead. Only OCR data obtained from the Lazarus OCR endpoint (include version: 2 in the header) is supported as input.", "type": "object" }, "outputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL where resulting [ZIP file](../../outputurl) or JSON can be sent. Must be open to PUT requests." }, "outputURLHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the PUT request to the output URL." }, "returnJSON": { "type": "boolean", "description": "Specifies the format of the response sent to `outputURL`. When set to true, a JSON response is sent to the `outputURL`. Set to false to send a ZIP file instead.", "default": true }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false }, "zipQueuedTime": { "type": "integer", "description": "Time when /zip is sent to task queue in Unix timestamp in milliseconds." } }, "type": "object", "required": [ "base64", "question", "webhook" ], "title": "ZipBase64Request", "examples": [ { "base64": "YOUR_BASE64_ENCODED_FILE", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "ocr": null, "outputURL": null, "outputURLHeaders": null, "returnJSON": true, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "ZipRequestBody": { "oneOf": [ { "$ref": "#/components/schemas/ZipURLRequest" }, { "$ref": "#/components/schemas/ZipBase64Request" } ], "title": "ZipRequestBody", "required": [], "properties": {} }, "ZipResponse": { "properties": { "code": { "type": "integer", "description": "Response code. Possible values are `200`, `400`, `401`, `403`, `404`, `413`, `521`, and `522`." }, "model": { "type": "string", "description": "Model used to process the document." }, "organization": { "type": "string", "description": "Organization ID." }, "pages": { "type": "integer", "description": "Number of pages in the document." }, "apiVersion": { "description": "API version used for the request. Defaults to the latest production version. To pin to a specific API version, please contact your Lazarus representative to receive the appropriate version header.", "type": "string" }, "documentId": { "type": "string", "description": "The unique identifier for the document. If `fileId` is supplied in the request, it is used as the `documentId`; otherwise, a random UUID is generated." }, "endTime": { "type": "integer", "description": "Request end time recorded in epoch (Unix timestamp) format." }, "id": { "type": "string", "description": "Response ID" }, "metadata": { "additionalProperties": true, "type": "object", "description": "JSON from the request `metadata` field." }, "questions": { "description": "Number of questions asked.", "type": "integer" }, "startTime": { "type": "integer", "description": "Request start time recorded in epoch (Unix timestamp) format." }, "status": { "$ref": "#/components/schemas/StatusEnum", "description": "Status of the request." }, "statusId": { "type": "string", "description": "A list of document IDs, each representing an uploaded file. Each ID is a randomly generated UUID. These IDs serve as input for retrieving the status of an asynchronous request via the `/rikai/zip/async/{statusId}` endpoint." }, "warning": { "additionalProperties": true, "type": "object", "description": "Warnings such as webhook failure." } }, "type": "object", "required": [], "title": "ZipResponse" }, "ZipURLRequest": { "properties": { "inputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL for the file to extract data from: Must be a PDF, JPEG, JPG, PNG, HEIC, SVG, TIFF, TIF, TXT, or GIF." }, "question": { "anyOf": [ { "type": "array" }, { "type": "string" } ], "description": "A string or list of strings containing the question(s) to be asked.", "examples": [ [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ] }, "webhook": { "type": "string", "pattern": " https?://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "Webhook URL to which status updates and JSON response will be sent. This is where you will receive the model output. \n[Click here](/../../models/rikai/webhook-examples) for an example of a webhook URL response." }, "webhookHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the POST requests to the webhook." }, "webhookSendFull": { "type": "boolean", "description": "Receive the full JSON response at the webhook URL upon request completion. Set to `false` to only receive request status.", "default": true }, "bulkStartTime": { "type": "integer", "description": "Bulk request start time in Unix timestamp in milliseconds." }, "fileId": { "type": "string", "description": "Custom ID for uploaded file, returned as `documentId` in the response. Requests with multiple files accept unique fileIds for each file. FileIds can be used to facilitate tracking, referencing, and managing input and output files efficiently.", "examples": [ "file1.pdf" ], "default": "UUID" }, "forceOCR": { "type": "boolean", "description": "Will rasterize a pdf. Set this parameter to `true` only if the input file is a fillable pdf.", "default": false }, "language": { "type": "string", "description": "A language code (e.g. 'EN') or the name of the language you wish to translate answers and explainability into. [List of supported codes.](../../../prompting-guide/faq/#supported-languages)" }, "metadata": { "additionalProperties": true, "type": "object", "description": "Custom JSON to be included in the returned response." }, "ocr": { "description": "OCR data for the document (entire response from [OCR endpoint (version: 2)](../../ocr/ocr_v2), [example here](https://lazarus-ai.atlassian.net/wiki/external/YmIwNDNmNWZmNzhhNGYwNDg3MjBlNmFhOTgwMzAwNjc)). If included, we do not run OCR on the document and use these results instead. Only OCR data obtained from the Lazarus OCR endpoint (include version: 2 in the header) is supported as input.", "type": "object" }, "outputURL": { "type": "string", "pattern": " (https?|s?ftp)://(?:www\\\\.)?[a-zA-Z0-9./:]+", "description": "URL where resulting [ZIP file](../../outputurl) or JSON can be sent. Must be open to PUT requests." }, "outputURLHeaders": { "additionalProperties": true, "type": "object", "description": "Request headers to include in the PUT request to the output URL." }, "returnJSON": { "type": "boolean", "description": "Specifies the format of the response sent to `outputURL`. When set to true, a JSON response is sent to the `outputURL`. Set to false to send a ZIP file instead.", "default": true }, "returnOCR": { "type": "boolean", "description": "Set to `true` to include OCR results in response.", "default": false }, "sftp": { "anyOf": [ { "$ref": "#/components/schemas/SFTP" }, { "$ref": "#/components/schemas/InputOutputSFTP" } ], "description": "SFTP authentication details. Required for SFTP URLs in `inputURL` or `outputURL`. Option to provide separate server authentication info for `inputURL` and `outputURL`." }, "staticIP": { "type": "boolean", "description": "Set to `true` for static IP for webhook and outputURL if they exist", "default": false }, "zipQueuedTime": { "type": "integer", "description": "Time when /zip is sent to task queue in Unix timestamp in milliseconds." } }, "type": "object", "required": [ "inputURL", "question", "webhook" ], "title": "ZipURLRequest", "examples": [ { "inputURL": "https://firebasestorage.googleapis.com/v0/b/lazarus-apis-testing.appspot.com/o/examples%2FSample%20Form.pdf?alt=media&token=5b537052-ea54-4be4-9d36-9620ee994c1c", "question": [ [ "What is the name of the patient?" ], [ "What is the first medication listed under Section C - Medical Information?", "What is its strength?" ] ], "webhook": null, "webhookHeaders": null, "webhookSendFull": true, "fileId": "file1.pdf", "forceBase64": false, "forceOCR": false, "language": "en", "metadata": null, "ocr": null, "outputURL": null, "outputURLHeaders": null, "returnJSON": true, "returnOCR": false, "sftp": null, "staticIP": false } ] }, "ErrorMessage": { "properties": { "status": { "allOf": [ { "$ref": "#/components/schemas/StatusEnum" } ], "description": "Status of the request." }, "message": { "type": "string", "description": "Error message." }, "id": { "type": "string", "description": "Response ID" }, "apiVersion": { "description": "API version used for request.", "type": "string" }, "startTime": { "description": "Request start time recorded in epoch (Unix timestamp) format.", "type": "integer" }, "endTime": { "description": "Request end time recorded in epoch (Unix timestamp) format.", "type": "integer" } }, "type": "object", "title": "ErrorMessage", "description": "Response when an error occurs." } }, "responses": { "207": { "description": "Bulk upload request failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Failed to queue request": { "value": { "status": "FAILURE", "message": "Failed to queue 2/5 file requests.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "400": { "description": "Bad request or failure to read. Request was invalid or we could not process your data.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Missing required field": { "value": { "status": "FAILURE", "message": "Request body is missing required field(s): question", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "403": { "description": "Unauthorized attempt. There was an issue with your credentials, model permissions or billing.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Invalid credentials": { "value": { "status": "AUTH_FAILURE", "message": "Invalid authentication", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "404": { "description": "Not found error. When a request references an invalid endpoint or resource.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Custom model not found": { "value": { "status": "FAILURE", "message": "Model id 'abc' is not valid.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "413": { "description": "Payload too large. The request payload or file size > 32MB and organization doesn't have 'big file' permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Payload too large": { "value": { "status": "FAILURE", "message": "[File was too large](../../../prompting-guide/faq/#what-if-i-encounter-an-error-indicating-my-file-is-too-large). Model could not process request.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "429": { "description": "Too many requests, rate limit exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Too many requests": { "value": { "status": "FAILURE", "message": "You have exceeded the rate limit. Please retry your request later.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "521": { "description": "An internal API error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Internal server error": { "value": { "status": "FAILURE", "message": "An internal error occurred. Please retry your request and report this to support@lazarusai.com.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } }, "522": { "description": "Model failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "Model failure": { "value": { "status": "FAILURE", "message": "A RikAI2 error occurred. Please report this to support@lazarusai.com.", "apiVersion": "YYYY-MM-DD", "id": "073b8e4c-3bc9-4105-8e3a-887a6aa7b4c5" } } } } } } } }, "servers": [ { "url": "https://api.lazarusai.com/api", "description": "" } ], "tags": [ { "name": "Requests", "description": "Requests for the Lazarus API" }, { "name": "Webhook Responses", "description": "Responses from the Lazarus API" } ] }