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",
"statusId": "cd091fd3-5bef-4b39-83f0-38fc5fe46544", // ID used to track the status of your request
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"id": "53f5eaf3-ecad-45bd-aa1d-24a3c9441be9",
"model": "Rikai2",
"apiVersion": "2025-07-24",
"metadata": {
"key": "val" // If metadata field is supplied in request body
},
"organization": "123", // Your orgId
"provider": "lazarus",
}
Since webhookSendFull
defaults to true
, the JSON response is received after the request has completed:
{
"status": "SUCCESS",
"code": 200,
"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."
}
],
"statusId": "cd091fd3-5bef-4b39-83f0-38fc5fe46544", // ID used to track the status of your request
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"id": "53f5eaf3-ecad-45bd-aa1d-24a3c9441be9",
"model": "Rikai2",
"apiVersion": "2025-07-24",
"metadata": {
"key": "val" // If metadata field is supplied in request body
},
"baseModel": "ocr2",
"questions": 1,
"pages": 1,
"settings": {
"advancedVision": true, // If any settings is supplied in request body
},
"language": "FI", // If language field is supplied in request body,
"organization": "123", // Your orgId
"provider": "lazarus",
"startTime": 1735707600000, // Unix timestamps in milliseconds
"endTime": 1735707660000,
"ocrResults": {
... // If returnOCR is set to true in request body
}
}
Setting WebhookSendFull to False
If you set webhookSendFull
to false
, the webhook
URL will not receive a JSON response.
{
"status": "SUCCESS",
"code": 200,
"statusId": "821c2155-5386-4b95-9ee3-59a14683225c, // ID used to track the status of your request
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"id": "41850807-c1e5-4132-b4d7-0142cf4ea244",
"model": "Rikai2",
"apiVersion": "2025-07-24",
"metadata": {
"key": "val" // If metadata field is supplied in request body
},
"organization": "123", // Your orgId
"provider": "lazarus",
"startTime": 1735707600000, // Unix timestamps in milliseconds
"endTime": 1735707660000,
}
Failed requests
If an async request failed, the webhook
URL will be notified.
{
"status": "FAILURE",
"code": 400,
"message": "There was an issue downloading your file from the URL.",
"error": {
"message": "inputURL is not valid."
},
"statusId": "821c2155-5386-4b95-9ee3-59a14683225c", // ID used to track the status of your request
"documentId": "PatientFile_1", // ID that fileId was set to in the request
"id": "41850807-c1e5-4132-b4d7-0142cf4ea244",
"model": "Rikai2",
"apiVersion": "2025-07-24",
"metadata": {
"key": "val" // If metadata field is supplied in request body
},
"organization": "123", // Your orgId
"provider": "lazarus",
"startTime": 1735707600000, // Unix timestamps in milliseconds
"endTime": 1735707660000,
}
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 webhookSendFull
is 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-07-24",
"documentId": "PatientFile_1"
}