{
    "name": "Leaply → CRM / Sheets (lead nou)",
    "flow": [
        {
            "id": 1,
            "module": "gateway:CustomWebHook",
            "version": 1,
            "parameters": {
                "hook": "",
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": { "x": 0, "y": 0 },
                "restore": {},
                "parameters": [
                    { "name": "hook", "type": "hook:gateway-webhook", "label": "Webhook (copiază URL-ul în Leaply → Setări & Plan → Integrare CRM)", "required": true }
                ],
                "interface": [
                    { "name": "event", "type": "text", "label": "Eveniment (lead.created / lead.updated / billing.upgraded)" },
                    { "name": "account_id", "type": "text", "label": "ID cont Leaply" },
                    { "name": "ts", "type": "date", "label": "Timestamp" },
                    {
                        "name": "data", "type": "collection", "label": "Date",
                        "spec": [
                            {
                                "name": "lead", "type": "collection", "label": "Lead",
                                "spec": [
                                    { "name": "name", "type": "text", "label": "Nume" },
                                    { "name": "phone", "type": "text", "label": "Telefon" },
                                    { "name": "source", "type": "text", "label": "Sursă" },
                                    { "name": "score", "type": "text", "label": "Scor (hot/warm/cold)" }
                                ]
                            },
                            {
                                "name": "conversation", "type": "collection", "label": "Conversație",
                                "spec": [
                                    { "name": "id", "type": "text", "label": "ID conversație" },
                                    { "name": "channel", "type": "text", "label": "Canal" },
                                    { "name": "status", "type": "text", "label": "Status (active/qualified/booked/lost)" }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "metadata": {
        "instant": true,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": { "orphans": [] },
        "zone": "eu1.make.com",
        "notes": [
            "Pasul 1: rulează scenariul o dată ca să obții URL-ul webhook-ului.",
            "Pasul 2: lipește URL-ul în Leaply → Setări & Plan → Integrare CRM (webhook) → Salvează.",
            "Pasul 3: adaugă după webhook modulele tale (HubSpot, Pipedrive, Google Sheets, Slack, Email).",
            "Semnătura HMAC (opțional): header X-Leaply-Signature = sha256=hex(hmac_sha256(secret, body))."
        ]
    }
}
