{
  "name": "Webhook Input-Validation API",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "submit",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "f1000000-1111-4a01-8b01-000000000001",
      "name": "POST /submit",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -360,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "cond-email-present",
              "leftValue": "={{ $json.body.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "f2000000-2222-4b02-9c02-000000000002",
      "name": "Has email?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -140,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a-status-ok",
              "name": "status",
              "value": "accepted",
              "type": "string"
            },
            {
              "id": "a-email-ok",
              "name": "email",
              "value": "={{ $json.body.email }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "f3000000-3333-4c03-ad03-000000000003",
      "name": "Build OK",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        80,
        -100
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a-status-err",
              "name": "error",
              "value": "email is required",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "f4000000-4444-4d04-be04-000000000004",
      "name": "Build Error",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        80,
        120
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "f5000000-5555-4e05-cf05-000000000005",
      "name": "Respond 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        300,
        -100
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 400
        }
      },
      "id": "f6000000-6666-4f06-da06-000000000006",
      "name": "Respond 400",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        300,
        120
      ]
    }
  ],
  "connections": {
    "POST /submit": {
      "main": [
        [
          {
            "node": "Has email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has email?": {
      "main": [
        [
          {
            "node": "Build OK",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Build Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build OK": {
      "main": [
        [
          {
            "node": "Respond 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Error": {
      "main": [
        [
          {
            "node": "Respond 400",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "api"
    }
  ]
}