{ "name": "Outlevo: Webhook to a do-not-contact entry", "nodes": [ { "id": "18046113-43c0-412b-8a88-6faf5ee5065d", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -360 ], "parameters": { "content": "## How to set it up\n\n**Credentials** (n8n asks for each on first open):\n- **Form webhook secret**: a Header Auth credential with a header name and a long random value; your form or tool sends the same header.\n- **Outlevo API key**: a Header Auth credential, name `Authorization`, value `Bearer olv_live_…` (Settings → API keys in Outlevo).\n\n**API key scopes**: `compliance:write`.\n\nPost JSON like {\"email\": \"name@company.com\"} or {\"domain\": \"company.com\"} with the header you set in the Header Auth credential.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "430edefc-2e47-4ec6-ad6f-9a60839489a1", "name": "Block webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [ 0, 0 ], "parameters": { "httpMethod": "POST", "path": "outlevo-block", "authentication": "headerAuth", "responseMode": "onReceived", "options": {} }, "webhookId": "9503050f-964c-436b-b729-b0d5dc92815e", "credentials": { "httpHeaderAuth": { "id": "", "name": "Form webhook secret (a header of your choice)" } } }, { "id": "c5477fe4-6580-467e-9a56-b0818dbec7b2", "name": "Email or domain", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 240, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// An email address blocks that person; a domain blocks the whole company. Rows with neither are skipped.\nreturn $input.all().flatMap((item) => {\n const f = item.json.body || {};\n const keys = Object.keys(f);\n const val = (re) => { const k = keys.find((x) => re.test(x.toLowerCase()) && String(f[x] ?? '').trim()); return k ? String(f[k]).trim().toLowerCase() : ''; };\n const email = val(/e-?mail/);\n if (/^[^@\\s]+@[^@\\s]+\\.[a-z]{2,}$/.test(email)) return [{ json: { email } }];\n const m = val(/domain|website|\\bsite\\b/).match(/^(?:[a-z]+:\\/\\/)?(?:www\\.)?([a-z0-9-]+(?:\\.[a-z0-9-]+)*\\.[a-z]{2,63})(?:[/:?#]|$)/);\n return m ? [{ json: { domain: m[1] } }] : [];\n});\n" } }, { "id": "20efb768-27cf-4eeb-8eae-12dc37de8f7c", "name": "Block in Outlevo", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 480, 0 ], "parameters": { "method": "POST", "url": "=https://api.outlevo.com/v1/suppressions", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Idempotency-Key", "value": "={{ ('webhook-block-' + ($json.email || $json.domain)).slice(0, 200) }}" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify($json.email ? { email: $json.email } : { domain: $json.domain }) }}", "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } } ], "connections": { "Block webhook": { "main": [ [ { "node": "Email or domain", "type": "main", "index": 0 } ] ] }, "Email or domain": { "main": [ [ { "node": "Block in Outlevo", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }