{
  "name": "LinkBit — Slack shorten (webhook)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "linkbit-shorten",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "b2c3d4e5-0001-4000-8000-000000000001",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "webhookId": "linkbit-shorten"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://linkbit.live/api/v1/links",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "slk_YOUR_API_KEY"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"destination\": {{ JSON.stringify($json.body.destination || $json.destination) }},\n  \"slug\": {{ ($json.body.slug || $json.slug) ? JSON.stringify($json.body.slug || $json.slug) : \"null\" }},\n  \"note\": {{ ($json.body.note || $json.note) ? JSON.stringify($json.body.note || $json.note) : \"null\" }},\n  \"utm_source\": {{ ($json.body.utm_source || $json.utm_source) ? JSON.stringify($json.body.utm_source || $json.utm_source) : \"null\" }},\n  \"utm_medium\": {{ ($json.body.utm_medium || $json.utm_medium) ? JSON.stringify($json.body.utm_medium || $json.utm_medium) : \"null\" }},\n  \"utm_campaign\": {{ ($json.body.utm_campaign || $json.utm_campaign) ? JSON.stringify($json.body.utm_campaign || $json.utm_campaign) : \"null\" }}\n}",
        "options": {}
      },
      "id": "b2c3d4e5-0001-4000-8000-000000000002",
      "name": "Shorten URL",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [280, 0],
      "notesInFlow": true,
      "notes": "Replace slk_YOUR_API_KEY. POST JSON: { \"destination\": \"https://...\" }. Optional: slug, note, utm_*."
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"ok\": true,\n  \"shortUrl\": {{ JSON.stringify($json.shortUrl) }},\n  \"id\": {{ JSON.stringify($json.id) }},\n  \"destination\": {{ JSON.stringify($json.destination) }}\n}",
        "options": {}
      },
      "id": "b2c3d4e5-0001-4000-8000-000000000003",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [560, 0]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [[{ "node": "Shorten URL", "type": "main", "index": 0 }]]
    },
    "Shorten URL": {
      "main": [[{ "node": "Respond", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
