Webhooks
Cleos exposes inbound HTTP endpoints for integrations. These are called by external systems, not by staff JWT clients. Cron and AI proxy routes are internal and not documented here.
WhatsApp (Evolution API)
Evolution events
Receives Evolution API events (message delivery status, connection updates). Configure your Evolution instance to POST to this URL with a branchId query parameter identifying the clinic branch.
Query parameters
- Name
branchId- Type
- string
- Description
Required query parameter: branch UUID receiving the event.
The body is the Evolution event JSON (for example messages.update).
Request
curl -X POST "http://localhost:3000/api/integrations/whatsapp/webhook?branchId=BRANCH_UUID" \
-H "Content-Type: application/json" \
-d '{"event":"messages.update","data":[]}'
Response
{ "received": true }
Mailgun inbound (lab email)
Inbound email
Mailgun routes lab result emails to this endpoint. Add branchId to the Mailgun route URL. Mailgun signs requests with timestamp, token, and signature; Cleos verifies using MAILGUN_API_KEY.
Successful processing may create or update test results in the results inbox.
Request
curl -X POST "http://localhost:3000/api/integrations/mailgun/inbound?branchId=BRANCH_UUID" \
-F timestamp=1234567890 \
-F token=mailgun-token \
-F signature=computed-hmac \
-F subject="Lab results" \
-F body-plain="..."
Body scale kiosk
Kiosk upload
Body composition kiosks POST measurement batches directly to Cleos. Authenticate with the ingest key as query key or header x-bodyscale-ingest-key. The branch is resolved from the key configuration.
Returns plain text OK with status 200 even when the payload is empty (kiosk-friendly).
Request
curl -X POST "http://localhost:3000/api/integrations/bodyscale/webhook?key=INGEST_KEY" \
-H "Content-Type: application/json" \
-d '{"datas":[{"weightKg":70.5}]}'
OK