{
  "nodes": [
    {
      "id": "9fdbfdc1-67f3-4c8b-861c-9e5840b002ec",
      "name": "Session",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        780,
        300
      ],
      "parameters": {
        "url": "https://api.fastmail.com/jmap/session",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "215d96fa-6bda-4e8c-884a-eb9a8db0838f",
      "name": "create random masked email",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "https://api.fastmail.com/.well-known/jmap\n\nhttps://api.fastmail.com/jmap/session",
      "position": [
        1280,
        300
      ],
      "parameters": {
        "url": "https://api.fastmail.com/jmap/api/",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"using\": [\n    \"urn:ietf:params:jmap:core\",\n    \"https://www.fastmail.com/dev/maskedemail\"\n  ],\n  \"methodCalls\": [\n    [\n      \"MaskedEmail/set\",\n      {\n        \"accountId\": \"{{ $('Session').item.json.primaryAccounts['https://www.fastmail.com/dev/maskedemail'] }}\",\n        \"create\": {\n          \"maskedEmailId1\": {\n            \"description\": \"{{ $json.description }}\",\n            \"state\": \"{{ $json.state }}\"\n          }\n        }\n      },\n      \"c1\"\n    ]\n  ]\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "237f6596-f8df-4c21-a2fa-44e935a72d56",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1800,
        300
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "6699eb83-a41e-44bc-b332-77e407fb3542",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        480
      ],
      "parameters": {
        "width": 1654.8203324571532,
        "height": 471.75430470511367,
        "content": "### \ud15c\ud50c\ub9bf \uc124\uba85\n\uc774 n8n \uc6cc\ud06c\ud50c\ub85c\uc6b0 \ud15c\ud50c\ub9bf\uc740 \uc6f9\ud6c5\uc5d0 \uc758\ud574 \ud2b8\ub9ac\uac70\ub418\uc5b4 Fastmail API\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \ud504\ub77c\uc774\ubc84\uc2dc\ub97c \uc911\uc2dc\ud558\ub294 \uc0ac\uc6a9\uc790\ub098 \ud14c\uc2a4\ud2b8 \ubaa9\uc801\uc73c\ub85c \uc77c\ud68c\uc6a9 \uc774\uba54\uc77c \uc8fc\uc18c\ub97c \uc0dd\uc131\ud558\ub294 \ub370 \ud2b9\ud788 \uc720\uc6a9\ud569\ub2c8\ub2e4.\n\n#### \uc6cc\ud06c\ud50c\ub85c\uc6b0 \uc138\ubd80 \uc0ac\ud56d:\n1. **\uc6f9\ud6c5 \ud2b8\ub9ac\uac70**: \uc6cc\ud06c\ud50c\ub85c\ub294 \ud2b9\uc815 \uc6f9\ud6c5\uc5d0 POST \uc694\uccad\uc744 \ubcf4\ub0b4 \uc2dc\uc791\ub429\ub2c8\ub2e4. \uc694\uccad \ubcf8\ubb38\uc5d0 `state`\uc640 `description`\uc744 \ud3ec\ud568\ud558\uc5ec \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c\uc758 \uc0c1\ud0dc\uc640 \uc124\uba85\uc744 \uc0ac\uc6a9\uc790 \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n2. **\uc138\uc158 \uac80\uc0c9**: \uc6cc\ud06c\ud50c\ub85c\ub294 Fastmail API\uc5d0 HTTP \uc694\uccad\uc744 \ubcf4\ub0b4 \uc138\uc158 \uc815\ubcf4\ub97c \uac80\uc0c9\ud569\ub2c8\ub2e4. \uc774 \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud6c4\uc18d \uc694\uccad\uc744 \uc778\uc99d\ud569\ub2c8\ub2e4.\n3. **\ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c \uc0dd\uc131**: \uac80\uc0c9\ub41c \uc138\uc158 \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6cc\ud06c\ud50c\ub85c\ub294 Fastmail\uc758 JMAP API\uc5d0 POST \uc694\uccad\uc744 \ubcf4\ub0b4 \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc6f9\ud6c5 \ud398\uc774\ub85c\ub4dc\uc5d0\uc11c \uc81c\uacf5\ub41c \uc0c1\ud0dc\uc640 \uc124\uba85\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.\n4. **\ucd9c\ub825 \uc900\ube44**: \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c\uc774 \uc131\uacf5\uc801\uc73c\ub85c \uc0dd\uc131\ub418\uba74 \uc6cc\ud06c\ud50c\ub85c\ub294 \uc774\uba54\uc77c \uc8fc\uc18c\ub97c \ucd94\ucd9c\ud558\uace0 \uc124\uba85\uc744 \ucca8\ubd80\ud558\uc5ec \ucd94\uac00 \ucc98\ub9ac\ub97c \uc704\ud574 \uc900\ube44\ud569\ub2c8\ub2e4.\n5. **\uc6f9\ud6c5 \uc751\ub2f5**: \ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc6cc\ud06c\ud50c\ub85c\ub294 \uc6d0\ub798 POST \uc694\uccad\uc5d0 \uc0c8\ub85c \uc0dd\uc131\ub41c \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c\uacfc \uadf8 \uc124\uba85\uc73c\ub85c \uc751\ub2f5\ud569\ub2c8\ub2e4.\n\n#### \uc694\uad6c \uc0ac\ud56d:\n- **Fastmail API \uc811\uadfc**: HTTP \ud5e4\ub354 \uc778\uc99d\uacfc \ud568\uaed8 \uad6c\uc131\ub41c \uc720\ud6a8\ud55c Fastmail API \uc790\uaca9 \uc99d\uba85\uc774 \ud544\uc694\ud569\ub2c8\ub2e4.\n- **\uad8c\ud55c \uc124\uc815**: \uc6f9\ud6c5\uc774 \uc778\ud130\ub137\uc5d0 \ub178\ucd9c\ub41c \uacbd\uc6b0 \uc624\uc6a9\uc744 \ubc29\uc9c0\ud558\uae30 \uc704\ud574 \uc120\ud0dd\uc801\uc73c\ub85c \uad8c\ud55c\uc744 \uc124\uc815\ud558\uc138\uc694.\n- **\ucee4\uc2a4\ud140 \uc6f9\ud6c5 \uc694\uccad**: `curl`\uacfc \uac19\uc740 \ub3c4\uad6c\ub098 macOS/iOS\uc5d0\uc11c \ub2e8\ucd95\ud0a4\ub97c \ub9cc\ub4e4\uc5b4 \ud544\uc694\ud55c JSON \ud398\uc774\ub85c\ub4dc\ub97c \ud3ec\ud568\ud55c POST \uc694\uccad\uc744 \uc6f9\ud6c5\uc5d0 \ubcf4\ub0b4\uc138\uc694. \uc608\ub97c \ub4e4\uc5b4:\n\n  ```\n  curl -X POST -H 'Content-Type: application/json' https://your-n8n-instance/webhook/87f9abd1-2c9b-4d1f-8c7f-2261f4698c3c -d '{\"state\": \"pending\", \"description\": \"my mega fancy masked email\"}'\n  ```\n\n\uc774 \ud15c\ud50c\ub9bf\uc740 \ud504\ub85c\uc81d\ud2b8\ub098 \uc6cc\ud06c\ud50c\ub85c\uc6b0\uc5d0 \ub9c8\uc2a4\ud0b9\ub41c \uc774\uba54\uc77c \uae30\ub2a5\uc744 \ud1b5\ud569\ud558\ub294 \uacfc\uc815\uc744 \uac04\uc18c\ud654\ud558\uba70, \ub2e4\uc591\ud55c \uc6a9\ub3c4\ub85c \ud655\uc7a5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "0c5d6d5a-ad0f-451e-9075-1009c8bf7212",
      "name": "get fields for creation",
      "type": "n8n-nodes-base.set",
      "position": [
        1000,
        300
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "870bb03d-c672-49d6-9652-5a0233b16eb2",
              "name": "state",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.state ?? \"pending\" }}"
            },
            {
              "id": "ac9b45a0-885f-48b2-b0ec-e38c79080045",
              "name": "description",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.description ?? \"Test via N8n\" }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "be7ba978-00d7-4fb1-9e1b-e3f83285e6fb",
      "name": "prepare output",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        300
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "19a09822-7ae0-4884-9192-c6e5bc3393a8",
              "name": "email",
              "type": "string",
              "value": "={{ $json.methodResponses[0][1].created.maskedEmailId1.email }}"
            },
            {
              "id": "ae8a1fe4-3010-4db8-aa88-f6074cae3006",
              "name": "desciption",
              "type": "string",
              "value": "={{ $('get fields for creation').item.json.description }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "dd014889-81eb-4a94-886e-4fe084c504ff",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        540,
        300
      ],
      "parameters": {
        "path": "createMaskedEmail",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Session": {
      "main": [
        [
          {
            "node": "get fields for creation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prepare output": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get fields for creation": {
      "main": [
        [
          {
            "node": "create random masked email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create random masked email": {
      "main": [
        [
          {
            "node": "prepare output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}