CRM Event Webhook

Send raw lead events. Hashing, matching and dispatch happen server-side.

Endpoint

POST /webhooks/crm-event
Host: mc3-meta-leadform-sync.xvak3803014.workers.dev
Authorization: Bearer <token>
Content-Type: application/json

Body

FieldType
eventenumrequired - contacted · qualified · scheduled · purchase
emailstringraw; required if no phone
phonestringraw, any format
namestringoptional
lead_idstringoptional, your record id
sourcestringoptional; google is stored, not dispatched
valuenumberpurchase only, PLN (default 14575)
occurred_atstringoptional ISO 8601

Example

curl -X POST https://mc3-meta-leadform-sync.xvak3803014.workers.dev/webhooks/crm-event \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"event":"qualified","email":"lead@example.com","phone":"48555123456","source":"facebook"}'

{ "ok": true, "metaEvent": "Qualified", "route": "meta", "enriched": true }

Responses

Code
200accepted (or skipped - duplicate / non-dispatched source)
400invalid JSON or unknown event
403missing or invalid token
422no email and no phone

Notes

Idempotent per (lead, event) - safe to retry.
Raw fields over HTTPS only; hashed before dispatch.
campaign_id and click id are resolved server-side - no need to send them.