Skip to main content
Version: 2025-02-13

Webhook Examples

The webhook URL enables users to receive POST requests containing status updates and a JSON response. The content of the JSON response is determined by the webhookSendFull field, which is enabled by default (true).

Making a Request to /bulk Endpoints

The bulk endpoints are rikai/bulk/rikai2, rikai/bulk/rikai2-extract, and rikai/bulk/riky2.

After making a request to any of these endpoints, you will receive an initial "RUNNING" ping while the request is processing:

{
"status": "RUNNING",
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"statusId": "cd091fd3-5bef-4b39-83f0-38fc5fe46544", // ID used to track the status of your request
"model": "Rikai2"
"apiVersion": "2025-02-13",
"id": "53f5eaf3-ecad-45bd-aa1d-24a3c9441be9"
}

Since webhookSendFull defaults to true, the JSON response is received after the request has completed:

{
"pages": 1,
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"questions": 1,
"baseModel": "ocr2",
"model": "Rikai2",
"apiVersion": "2025-02-13",
"settings": {
"advancedVision": true
},
"statusId": "cd091fd3-5bef-4b39-83f0-38fc5fe46544", // ID used to track the status of your request
"data": [
{
"answer": "The patient's first name is Juan.",
"confidence": 0.8864418412881837, // Confidence score
"context": "The patient's first name, **Juan**, is explicitly stated in **Section A - Patient Information** of the form. Under the \"First Name\" field, the name \"Juan\" is handwritten. This section is located near the top of the document, and it is part of the required patient information for the prior authorization request. \n\nHere is the relevant excerpt from the form:\n\n- **Section A - Patient Information**\n - **First Name:** Juan\n - **Last Name:** Rodriguez\n\nThis is the basis for my answer.",
"question": "What is the patient's first name?",
"translated": "Potilaan etunimi on Juan."
}
],
"language": "FI",
"id": "53f5eaf3-ecad-45bd-aa1d-24a3c9441be9",
"status": "SUCCESS"
}

Setting WebhookSendFull to False

If you set webhookSendFull to false, the webhook URL will receive two status updates, one during processing and one when it has finished. You will not receive a JSON response.

{
"code": 200,
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"model": "Rikai2",
"organization": "123", // Your orgId
"status": "RUNNING",
"provider": "lazarus",
"apiVersion": "2025-02-13",
"id": "53f5eaf3-ecad-45bd-aa1d-24a3c9441be9",
"status": "RUNNING",
"statusId": "cd091fd3-5bef-4b39-83f0-38fc5fe46544", // ID used to track the status of your request

}

{
"code": 200,
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"model": "Rikai2",
"organization": "123", // Your orgId
"status": "SUCCESS",
"provider": "lazarus",
"apiVersion": "2025-02-13",
"id": "41850807-c1e5-4132-b4d7-0142cf4ea244",
"statusId": "821c2155-5386-4b95-9ee3-59a14683225c" // ID used to track the status of your request
}

Warning Message for OutputURL Failure

If the optional outputURL is invalid or unreachable, you will still receive status updates and the JSON response as usual. However, you will receive an additional POST request notifying you of the outputURL failure. This notification is sent regardless of whether webhookSendFullis set to true or false.

{
"warning": {
"message": "outputURL Failed.",
"field": "outputURL",
"url": "https://webhook.site", // Your webhook URL
"code": 404,
"error": "" // The error your webhook provider supplies
},
"id": "4acc6dcf-e03f-4f9f-915c-bdd75d7ee094",
"statusId": "cb03e064-1fc4-43c8-8528-8873f10aa3c8", // ID used to track the status of your request
"apiVersion": "2025-02-13",
"documentId": "PatientFile_1"
}