Skip to content
Clinic guideDevelopers
Open app
Overview
Introduction
Core concepts
Website embeds
Embeds overview
Consultation form
International enquiry form
PMS Connect
Overview
Quickstart
Authentication and conventions
Endpoints
Webhooks
Tiers
Testing
FAQ
API
API status and roadmap
Conventions
Security
Security and data handling

PMS Connect

Webhooks

Send Voxlera signed change notifications from your PMS, with signing samples in Node, Python, C# and PHP and a test vector.

Webhooks are optional. Without them Voxlera polls your API every 15 minutes. With them, a change shows up within seconds. Set "webhooks": true in GET /v1/capabilities if you send them.

#How it works

  1. The clinic connects your system in Voxlera in webhook mode.
  2. Voxlera shows a webhook URL and a signing secret after connecting. Give the URL and the secret to your system. Voxlera generates the secret; your system must accept it as a setting and must not create its own.
  3. When something changes, your system sends POST <webhook URL> with a signed JSON body.
  4. Voxlera verifies the signature, answers 202, and fetches the details itself through your API.

The secret can be rotated from the integration's settings in Voxlera; update it in your system when that happens.

On the demo PMS: connect in Voxlera, copy the webhook URL and the signing secret, then paste both on the sandbox's control page. A sandbox with no secret sends nothing and logs each event as refused (no_signing_secret).

#The request

http
POST /webhooks/pms-connect/abc123 HTTP/1.1
Content-Type: application/json
Voxlera-Signature: t=1700000000,v1=38877139021993b830af32feea6e18a8da83eb2f6e49ee50bd9e4cf4ca4d3789
Voxlera-Event-Id: evt_01HXYZ

{"id":"evt_01HXYZ","type":"appointment.updated","occurredAt":"2026-11-12T09:31:07+03:00","resource":{"kind":"appointment","id":"a_1"}}

Voxlera-Event-Id is optional. Voxlera does not read this header; send it for your own tracing (the body id is what counts).

The body is thin on purpose: an event id, a type, a time and a pointer to the resource. Never put patient details in it; Voxlera reads them from your API.

FieldMeaning
idUnique event id and the de-duplication key. Reuse the same id when you retry the same event.
typeOne of appointment.created, appointment.updated, appointment.cancelled, treatment.completed, patient.updated, doctor.updated.
occurredAtRFC 3339 timestamp with offset.
resource{ "kind": "appointment" | "treatment" | "patient" | "doctor", "id": "<id>" }, an id you also serve through the read operations.

#Voxlera's responses

Header names are case-insensitive. Voxlera answers immediately and processes the event asynchronously.

StatusBodyMeaningWhat to do
202{}Accepted. Also returned for a duplicate event id and for a well-formed but unknown event type (recorded and ignored, so a newer PMS does not break an older Voxlera).Done.
401{"error":"invalid_signature"}The signature is missing, malformed, stale or wrong.Fix the signing; see how Voxlera verifies. Do not retry unchanged.
400{"error":"invalid_event"}The body is not a valid event: invalid JSON, a body that is not an object, a missing, empty, non-string or over-long id, type, resource.kind or resource.id, or a missing resource. An unknown but well-formed type is not a 400 (see 202).Fix the payload. Do not retry unchanged.
404{"statusCode":404,"message":"Not Found"}The webhook URL is unknown, the integration is disconnected, or it is in API-only mode. A malformed integration id in the URL (not a UUID) is also a 404, with a different message.Check the URL and that the clinic connected in Webhook + API mode.
5xxanyA temporary failure on Voxlera's side.Retry.

Voxlera de-duplicates on the body id, per clinic. A retry must reuse the same body id; a new id for the same change is treated as a new event.

#How Voxlera verifies

Voxlera recomputes the HMAC over the raw bytes it received, compares it to your v1 value in constant time, and accepts a t within 300 seconds of its own clock. The usual causes of a 401:

  • Re-serialised JSON. You signed one string and sent another (different key order, spacing or encoding). Sign the exact bytes you send.
  • Clock skew. Your server's clock is more than 5 minutes off.
  • Wrong secret. Typically after the secret was rotated in Voxlera and not updated in your system.

#Retries

  • Retry on network errors, timeouts and 5xx, with backoff: for example after about 1 s, 5 s, 30 s, then every few minutes for up to 24 hours.
  • Sign every attempt again with a fresh t. A retry that reuses an old header is rejected once it is more than 5 minutes old.
  • Do not retry other 4xx responses, except 429.
  • A 10 second request timeout is plenty: Voxlera answers at once. Changes are normally picked up within about a minute.

#How events are batched

Voxlera does not fetch once per event. The first event schedules one refresh of the clinic about 30 seconds later; further events in that window add nothing, so a burst of changes is one refresh. If an event arrives while that refresh is already running, it is acknowledged (202) but does not schedule another one; the change is then picked up by the next regular poll, at most 15 minutes later.

#The signature

Voxlera-Signature is t=<unix seconds>,v1=<hex> where <hex> is the lowercase hex of

text
HMAC-SHA256(secret, "<t>.<raw body>")

Sign the exact bytes you send as the body, joined to the timestamp with a single .. Voxlera rejects timestamps more than 5 minutes (300 seconds) from its own clock, so keep your server's clock accurate and sign each attempt fresh.

#Test vector

Use this to check your code before you send anything:

InputValue
Secretwhsec_test
Timestamp t1700000000
Raw body{"a":1}
Headert=1700000000,v1=38877139021993b830af32feea6e18a8da83eb2f6e49ee50bd9e4cf4ca4d3789

#Signing samples

Each sample prints the header from the test vector above.

#Node.js

js
const crypto = require('node:crypto');

function signWebhook(secret, rawBody, timestamp = Math.floor(Date.now() / 1000)) {
  const mac = crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
  return `t=${timestamp},v1=${mac}`;
}

console.log(signWebhook('whsec_test', '{"a":1}', 1700000000));

#Python

python
import hashlib
import hmac
import time


def sign_webhook(secret: str, raw_body: str, timestamp: int | None = None) -> str:
    t = int(time.time()) if timestamp is None else timestamp
    mac = hmac.new(secret.encode(), f"{t}.{raw_body}".encode(), hashlib.sha256).hexdigest()
    return f"t={t},v1={mac}"


print(sign_webhook("whsec_test", '{"a":1}', 1700000000))

#C#

csharp
using System;
using System.Security.Cryptography;
using System.Text;

static string SignWebhook(string secret, string rawBody, long? timestamp = null)
{
    long t = timestamp ?? DateTimeOffset.UtcNow.ToUnixTimeSeconds();
    using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
    byte[] mac = hmac.ComputeHash(Encoding.UTF8.GetBytes($"{t}.{rawBody}"));
    return $"t={t},v1={Convert.ToHexString(mac).ToLowerInvariant()}";
}

Console.WriteLine(SignWebhook("whsec_test", "{\"a\":1}", 1700000000));

#PHP

php
<?php
function signWebhook(string $secret, string $rawBody, ?int $timestamp = null): string {
    $t = $timestamp ?? time();
    $mac = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
    return "t={$t},v1={$mac}";
}

echo signWebhook('whsec_test', '{"a":1}', 1700000000), "\n";

#Safety net

Webhooks only make things faster. Voxlera still polls every 15 minutes, so a dropped webhook delays a change by at most that long and never loses it. See the FAQ.

#Next

Testing: try your implementation against the hosted demo and the conformance checker.

PreviousEndpointsNextTiers