Webhooks allow your application to receive real-time HTTP notifications when specific events occur in the Invox Medical platform. Instead of polling for updates, your server will be called automatically with the relevant event data.
Every webhook payload includes a requestSignature field (when the organization has credentials configured). This signature allows you to verify that the request was genuinely sent by Invox Medical and has not been tampered with.
Take the fields in the fixed order of the Signature string of the event (each event page lists it), never in the order they arrive in the JSON. eventName and requestSignature are not part of it.
For each field, in that order:
If it is absent or null: empty string "", in its position.
If it is an object or an array: compact JSON (no spaces), without escaping non-ASCII characters.
Any other type (string, number, boolean): its text.
Each function receives the parsed payload and the signatureOrder of the event: the list of fields of its Signature string, without API_KEY (for OnMedicalReportFinished, choose the general or the SOFT Integration order by origin).
TypeScript
import { createHmac } from "node:crypto";
function generateSignature(
payload: Record<string, unknown>,
signatureOrder: string[],
apiKey: string,
secretKey: string,
): string {
const values = signatureOrder.map((field) => {
const value = payload[field];
if (value === undefined || value === null) return "";
return typeof value === "object" ? JSON.stringify(value) : String(value);
});
values.push(apiKey);
return createHmac("sha256", secretKey)
.update(values.join("|"))
.digest("base64");
}
C#
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
// payload: the received body, e.g. JsonDocument.Parse(body).RootElement
public static string GenerateSignature(
JsonElement payload,
IReadOnlyList<string> signatureOrder,
string apiKey,
string secretKey)
{
var values = signatureOrder.Select(field =>
{
if (!payload.TryGetProperty(field, out var value)) return "";
return value.ValueKind switch
{
JsonValueKind.Null or JsonValueKind.Undefined => "",
JsonValueKind.String => value.GetString() ?? "",
_ => value.GetRawText(),
};
}).ToList();
values.Add(apiKey);
var dataToSign = string.Join("|", values);
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey));
var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));
return Convert.ToBase64String(hash);
}
Java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class WebhookSignature {
private static final ObjectMapper mapper = new ObjectMapper();
// payload: the received body, e.g. mapper.readValue(body, Map.class)
public static String generateSignature(
Map<String, Object> payload,
List<String> signatureOrder,
String apiKey,
String secretKey) throws Exception {
List<String> values = new ArrayList<>();
for (String field : signatureOrder) {
Object value = payload.get(field);
if (value == null) {
values.add("");
} else if (value instanceof Map || value instanceof List) {
values.add(mapper.writeValueAsString(value));
} else {
values.add(String.valueOf(value));
}
}
values.add(apiKey);
String dataToSign = String.join("|", values);
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(
secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] hash = mac.doFinal(
dataToSign.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(hash);
}
}
Python
import hmac
import hashlib
import base64
import json
def generate_signature(
payload: dict,
signature_order: list,
api_key: str,
secret_key: str,
) -> str:
values = []
for field in signature_order:
value = payload.get(field)
if value is None:
values.append("")
elif isinstance(value, bool):
values.append("true" if value else "false")
elif isinstance(value, (dict, list)):
values.append(
json.dumps(value, separators=(",", ":"), ensure_ascii=False)
)
else:
values.append(str(value))
values.append(api_key)
data_to_sign = "|".join(values)
signature = hmac.new(
secret_key.encode("utf-8"),
data_to_sign.encode("utf-8"),
hashlib.sha256,
).digest()
return base64.b64encode(signature).decode("utf-8")
Critical: the order is fixed and every field of it counts. The signature string always follows the order of the Signature string of each event, not the order in which the keys arrive, and a field that is absent keeps its position as "".
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
// payload: the received body, e.g. JsonDocument.Parse(body).RootElement
public static bool VerifyWebhookSignature(
JsonElement payload,
IReadOnlyList<string> signatureOrder,
string apiKey,
string secretKey)
{
var receivedSignature =
payload.TryGetProperty("requestSignature", out var signature)
&& signature.ValueKind == JsonValueKind.String
? signature.GetString() ?? ""
: "";
var values = signatureOrder.Select(field =>
{
if (!payload.TryGetProperty(field, out var value)) return "";
return value.ValueKind switch
{
JsonValueKind.Null or JsonValueKind.Undefined => "",
JsonValueKind.String => value.GetString() ?? "",
_ => value.GetRawText(),
};
}).ToList();
values.Add(apiKey);
var dataToSign = string.Join("|", values);
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey));
var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));
var computedSignature = Convert.ToBase64String(hash);
return CryptographicOperations.FixedTimeEquals(
Encoding.UTF8.GetBytes(computedSignature),
Encoding.UTF8.GetBytes(receivedSignature));
}
Java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.*;
public class WebhookVerifier {
private static final ObjectMapper mapper = new ObjectMapper();
// payload: the received body, e.g. mapper.readValue(body, Map.class)
public static boolean verifyWebhookSignature(
Map<String, Object> payload,
List<String> signatureOrder,
String apiKey,
String secretKey) throws Exception {
String receivedSignature =
String.valueOf(payload.getOrDefault("requestSignature", ""));
List<String> values = new ArrayList<>();
for (String field : signatureOrder) {
Object value = payload.get(field);
if (value == null) {
values.add("");
} else if (value instanceof Map || value instanceof List) {
values.add(mapper.writeValueAsString(value));
} else {
values.add(String.valueOf(value));
}
}
values.add(apiKey);
String dataToSign = String.join("|", values);
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(
secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] hash = mac.doFinal(
dataToSign.getBytes(StandardCharsets.UTF_8));
String computedSignature = Base64.getEncoder().encodeToString(hash);
return MessageDigest.isEqual(
computedSignature.getBytes(StandardCharsets.UTF_8),
receivedSignature.getBytes(StandardCharsets.UTF_8));
}
}
Python
import hmac
import hashlib
import base64
import json
def verify_webhook_signature(
payload: dict,
signature_order: list,
api_key: str,
secret_key: str,
) -> bool:
received_signature = str(payload.get("requestSignature") or "")
values = []
for field in signature_order:
value = payload.get(field)
if value is None:
values.append("")
elif isinstance(value, bool):
values.append("true" if value else "false")
elif isinstance(value, (dict, list)):
values.append(
json.dumps(value, separators=(",", ":"), ensure_ascii=False)
)
else:
values.append(str(value))
values.append(api_key)
data_to_sign = "|".join(values)
computed = hmac.new(
secret_key.encode("utf-8"),
data_to_sign.encode("utf-8"),
hashlib.sha256,
).digest()
computed_signature = base64.b64encode(computed).decode("utf-8")
return hmac.compare_digest(
computed_signature.encode("utf-8"),
received_signature.encode("utf-8"),
)
Do not rebuild the string by walking the payload you received: take each field of the event's Signature string by name, so an optional field that is missing from the JSON still occupies its position as "". The order of the keys in the received JSON does not matter.
OnTranscriptionFinished received without userId and consultationSessionId (they are optional, so the sender leaves them out of the JSON):
{
"eventName": "OnTranscriptionFinished",
"organizationId": "org-1234",
"timestamp": "2026-03-31T19:06:58.667Z",
"transcription": "WEBVTT\n\n00:00:00.000 --> 00:00:03.000\nHello, how are you feeling today?"
}
Its Signature string is organizationId|userId|timestamp|consultationSessionId|transcription|API_KEY. The two absent fields are signed as "", so the string to sign has two empty positions (the line breaks of the transcription are real line breaks):
org-1234||2026-03-31T19:06:58.667Z||WEBVTT
00:00:00.000 --> 00:00:03.000
Hello, how are you feeling today?|test-api-key
With apiKeytest-api-key and secretKeytest-secret-key, the signature is: