{
  "name": "Kapzio · Formulaire Typeform / Google Forms → Kapzio",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "formulaire-vers-kapzio",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "8c2e3d4f-2b1f-4d66-8b62-1b1c7e7f0001",
      "name": "Réponse au formulaire",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "webhookId": "formulaire-vers-kapzio"
    },
    {
      "parameters": {
        "jsCode": "// Typeform : form_response.answers ; autre source : champs à plat (email, nom, societe, telephone…)\nconst body = $json.body || {};\nconst r = body.form_response;\nif (!r) return [{ json: { ...body, source: body.source || 'Formulaire' } }];\nconst a = r.answers || [];\nconst by = (t) => a.find((x) => x.type === t);\nconst texts = a.filter((x) => x.type === 'text' || x.type === 'short_text').map((x) => x.text);\nreturn [{ json: {\n  email: by('email')?.email,\n  phone: by('phone_number')?.phone_number,\n  contact_name: texts[0],\n  company_name: texts[1],\n  source: 'Typeform',\n  data: { typeform_form_id: r.form_id, typeform_token: r.token },\n} }];"
      },
      "id": "8c2e3d4f-2b1f-4d66-8b62-1b1c7e7f0002",
      "name": "Préparer le prospect",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [240, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://app.kapzio.com/api/v1/leads",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": { "timeout": 20000 }
      },
      "id": "8c2e3d4f-2b1f-4d66-8b62-1b1c7e7f0003",
      "name": "Créer dans Kapzio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 0],
      "notes": "Identifiant « Header Auth » : nom Authorization, valeur « Bearer kz_live_… » (clé API du projet)."
    }
  ],
  "connections": {
    "Réponse au formulaire": { "main": [[{ "node": "Préparer le prospect", "type": "main", "index": 0 }]] },
    "Préparer le prospect": { "main": [[{ "node": "Créer dans Kapzio", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "meta": { "templateCredsSetupCompleted": false },
  "tags": []
}
