{
  "name": "Gary Club — Webhook → Create / Update Contact",
  "nodes": [
    {
      "parameters": {
        "content": "## ⚡ After import — 3 steps\n\n**1. Bind your credential**\nClick the **Upsert Contact** node → set **Credential for Header Auth** to your Gary Club Agency key.\n\n**2. Copy your webhook URL**\nClick the **Form Webhook** node to expand it. Copy the **Production URL** shown at the top. Paste it as the form's action URL (or in Zapier / Make / your backend).\n\n**3. Map your fields**\nThe HTTP Request body sends `email`, `first_name`, `last_name`, `phone`, and `source`. Add or remove keypairs to match your form's field names.\n\n📋 **Notes**\n- The endpoint is **idempotent on email + phone** — re-submitting the same contact updates it rather than duplicating.\n- All fields except `email` or `phone` are optional — pass at least one identifier.\n- `source` is free-form text stored on the contact for attribution.\n\n📚 Contacts docs: https://docs.gary.club/api/contacts",
        "height": 380,
        "width": 380,
        "color": 5
      },
      "id": "22000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-200, 80]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "gary-new-contact",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "22000000-0001-4000-8000-000000000001",
      "name": "Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300],
      "webhookId": "22000000-webhook-4000-8000-000000000001"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://agency.gary.club/api/public/v1/crm/contacts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            { "name": "email", "value": "={{ $json.body.email }}" },
            { "name": "first_name", "value": "={{ $json.body.first_name }}" },
            { "name": "last_name", "value": "={{ $json.body.last_name }}" },
            { "name": "phone", "value": "={{ $json.body.phone }}" },
            { "name": "source", "value": "n8n_form" }
          ]
        },
        "options": {}
      },
      "id": "22000000-0002-4000-8000-000000000002",
      "name": "Upsert Contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ ok: true, contact_id: $json.id }) }}",
        "options": { "responseCode": 200 }
      },
      "id": "22000000-0003-4000-8000-000000000003",
      "name": "Respond 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [740, 300]
    }
  ],
  "connections": {
    "Form Webhook": { "main": [[{ "node": "Upsert Contact", "type": "main", "index": 0 }]] },
    "Upsert Contact": { "main": [[{ "node": "Respond 200", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "gary-club-api" }]
}
