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)

POST/api/integrations/whatsapp/webhook

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

POST
/api/integrations/whatsapp/webhook
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)

POST/api/integrations/mailgun/inbound

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

POST
/api/integrations/mailgun/inbound
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

POST/api/integrations/bodyscale/webhook

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

POST
/api/integrations/bodyscale/webhook
curl -X POST "http://localhost:3000/api/integrations/bodyscale/webhook?key=INGEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"datas":[{"weightKg":70.5}]}'
OK

Was this page helpful?