[{"data":1,"prerenderedAt":1166},["ShallowReactive",2],{"docs-nav-all":3,"developer-nav-en":133,"developer-doc-en-/developers/webhooks/quick-start":168,"developer-related-en":1146},[4,9,14,18,22,26,30,34,37,40,44,47,50,54,58,61,65,69,72,75,78,82,86,90,93,96,99,102,105,108,112,116,120,123,126,130],{"path":5,"title":6,"section":7,"order":8},"/docs/agents","CLAUDE.md — Документация продукта (content/docs/)","",100,{"path":10,"title":11,"section":12,"order":13},"/docs/analytics/content","Разбор контента","analytics",2,{"path":15,"title":16,"section":12,"order":17},"/docs/analytics/metrics","Шпаргалка метрик: как читать цифры",3,{"path":19,"title":20,"section":12,"order":21},"/docs/analytics/notifications","Уведомления",5,{"path":23,"title":24,"section":12,"order":25},"/docs/analytics/overview","Аналитика: обзор",1,{"path":27,"title":28,"section":12,"order":29},"/docs/analytics/refresh","Обновление аккаунтов",4,{"path":31,"title":32,"section":33,"order":13},"/docs/assistant/effective-prompts","Как писать запросы ассистенту","assistant",{"path":35,"title":36,"section":33,"order":25},"/docs/assistant/overview","ИИ-ассистент",{"path":38,"title":39,"section":33,"order":17},"/docs/assistant/telegram","Макси в Telegram",{"path":41,"title":42,"section":43,"order":25},"/docs/automations/funnels","Воронки в Instagram","automations",{"path":45,"title":46,"section":43,"order":17},"/docs/automations/results","Результаты воронок и лиды",{"path":48,"title":49,"section":43,"order":13},"/docs/automations/telegram","Воронка в Telegram",{"path":51,"title":52,"section":53,"order":25},"/docs/collaboration/team","Команда и пространства","collaboration",{"path":55,"title":56,"section":57,"order":13},"/docs/creators/account-setup","Создание аккаунтов","creators",{"path":59,"title":60,"section":57,"order":17},"/docs/creators/formats","Форматы контента",{"path":62,"title":63,"section":57,"order":64},"/docs/creators/getting-started","Как стартовать",0,{"path":66,"title":67,"section":57,"order":68},"/docs/creators/payouts","Выплаты",6,{"path":70,"title":71,"section":57,"order":25},"/docs/creators/platform-guide","Как пользоваться платформой",{"path":73,"title":74,"section":57,"order":21},"/docs/creators/posting-rules","Правила работы",{"path":76,"title":77,"section":57,"order":29},"/docs/creators/publishing","Как выкладывать ролики",{"path":79,"title":80,"section":57,"order":81},"/docs/creators/termination","Пауза и завершение работы",7,{"path":83,"title":84,"section":85,"order":25},"/docs/getting-started/dashboard","Главная","getting-started",{"path":87,"title":88,"section":89,"order":29},"/docs/guides/agency","Я веду клиентов","guides",{"path":91,"title":92,"section":89,"order":17},"/docs/guides/beat-competitors","Я бренд, продвигаю продукт",{"path":94,"title":95,"section":89,"order":21},"/docs/guides/catch-trends","Ловлю тренды раньше",{"path":97,"title":98,"section":89,"order":64},"/docs/guides/getting-started","С чего начать",{"path":100,"title":101,"section":89,"order":13},"/docs/guides/track-results","Уже снимаю, хочу расти",{"path":103,"title":104,"section":89,"order":25},"/docs/guides/what-to-film","Хочу понять, что залетит",{"path":106,"title":107,"section":85,"order":64},"/docs","Что такое Viralmaxing",{"path":109,"title":110,"section":111,"order":13},"/docs/reference/billing","Оплата и подписка","reference",{"path":113,"title":114,"section":115,"order":64},"/docs/research/idea-search","Поиск идей","idea-search",{"path":117,"title":118,"section":119,"order":13},"/docs/scenarios/brand","Бренд","scenarios",{"path":121,"title":122,"section":119,"order":25},"/docs/scenarios/plan","План и сценарии",{"path":124,"title":125,"section":119,"order":17},"/docs/scenarios/teleprompter","Телесуфлёр",{"path":127,"title":128,"section":129,"order":64},"/docs/settings/accounts","Подключение аккаунтов","settings",{"path":131,"title":132,"section":129,"order":13},"/docs/settings/integrations","Интеграции",[134,138,142,145,148,151,155,158,161,165],{"path":135,"title":136,"section":137,"order":64},"/developers","Developer documentation","start",{"path":139,"title":140,"section":141,"order":25},"/developers/mcp/quick-start","MCP quick start","mcp",{"path":143,"title":144,"section":141,"order":29},"/developers/mcp/skills","Viralmaxing skills for agents",{"path":146,"title":147,"section":141,"order":17},"/developers/mcp/troubleshooting","MCP troubleshooting",{"path":149,"title":150,"section":141,"order":13},"/developers/mcp/verification","Verify the connection",{"path":152,"title":153,"section":154,"order":13},"/developers/rest/authentication","REST API authentication","rest",{"path":156,"title":157,"section":154,"order":17},"/developers/rest/first-request","Your first REST request",{"path":159,"title":160,"section":154,"order":25},"/developers/rest/quick-start","REST API quick start",{"path":162,"title":163,"section":164,"order":13},"/developers/webhooks/events","Webhook events and the request body","webhooks",{"path":166,"title":167,"section":164,"order":25},"/developers/webhooks/quick-start","Webhooks: leads into your CRM",{"id":169,"title":167,"appRoutes":170,"body":171,"description":1135,"extension":1136,"hideAppLink":1137,"icon":1138,"locale":1139,"meta":1140,"navigation":418,"order":25,"path":166,"related":1141,"section":164,"seo":1142,"seoTitle":1143,"stem":1144,"updatedDate":1143,"__hash__":1145},"developerDocsEn/developers/webhooks/quick-start.md",[],{"type":172,"value":173,"toc":1127},"minimark",[174,178,182,187,210,237,240,244,255,328,335,339,353,371,376,907,912,1012,1017,1074,1078,1081,1094,1098,1108,1112,1115,1123],[175,176,167],"h1",{"id":177},"webhooks-leads-into-your-crm",[179,180,181],"p",{},"Viralmaxing sends every lead of a workspace's funnels as a POST request to your address: who wrote the code word, under which reel, what they answered in the form, whether they qualified and whether they paid. A receiver takes about 10 minutes: one address per workspace, a JSON body, an HMAC-SHA256 signature and retries on failure.",[183,184,186],"h2",{"id":185},"_1-set-the-address","1. Set the address",[179,188,189,190,195,196,200,201,205,206,209],{},"Open ",[191,192,194],"a",{"href":193},"/settings/integrations?category=leads","Settings → Integrations → «Leads»"," and press ",[197,198,199],"strong",{},"«Set the address»",". Paste the ",[202,203,204],"code",{},"https://"," address of your receiver and save: a signing secret like ",[202,207,208],{},"whsec_…"," appears. Keep it in your receiver's environment:",[211,212,216],"pre",{"className":213,"code":214,"language":215,"meta":7,"style":7},"language-bash shiki shiki-themes github-light github-dark","export VIRALMAXING_WEBHOOK_SECRET='whsec_...'\n","bash",[202,217,218],{"__ignoreMap":7},[219,220,222,226,230,233],"span",{"class":221,"line":25},"line",[219,223,225],{"class":224},"szBVR","export",[219,227,229],{"class":228},"sVt8B"," VIRALMAXING_WEBHOOK_SECRET",[219,231,232],{"class":224},"=",[219,234,236],{"class":235},"sZZnC","'whsec_...'\n",[179,238,239],{},"There is one address per workspace: the leads of every funnel go there, and new funnels send leads right away. Need a separate CRM? Use a separate workspace.",[183,241,243],{"id":242},"_2-receive-the-request","2. Receive the request",[179,245,246,247,250,251,254],{},"Every event is a ",[202,248,249],{},"POST"," with an ",[202,252,253],{},"application/json"," body and three headers:",[256,257,258,271],"table",{},[259,260,261],"thead",{},[262,263,264,268],"tr",{},[265,266,267],"th",{},"Header",[265,269,270],{},"What it holds",[272,273,274,288,318],"tbody",{},[262,275,276,282],{},[277,278,279],"td",{},[202,280,281],{},"X-Viralmaxing-Signature",[277,283,284,287],{},[202,285,286],{},"t=\u003CUnix seconds>,v1=\u003Chex>",": the signature, see step 3",[262,289,290,295],{},[277,291,292],{},[202,293,294],{},"X-Viralmaxing-Event",[277,296,297,298,301,302,301,305,301,308,301,311,314,315],{},"the event: ",[202,299,300],{},"lead.created",", ",[202,303,304],{},"lead.answered",[202,306,307],{},"lead.qualified",[202,309,310],{},"order.paid",[202,312,313],{},"order.refunded"," or ",[202,316,317],{},"test",[262,319,320,325],{},[277,321,322],{},[202,323,324],{},"X-Viralmaxing-Delivery",[277,326,327],{},"the delivery id; the same on every retry of the event",[179,329,330,331,334],{},"The body and every event with an example are on the ",[191,332,333],{"href":162},"Events"," page.",[183,336,338],{"id":337},"_3-verify-the-signature","3. Verify the signature",[179,340,341,344,345,348,349,352],{},[202,342,343],{},"v1"," is HMAC-SHA256 of ",[202,346,347],{},"\"\u003Ct>.\u003Cbody>\""," under your secret, in hex. Take the body exactly as the bytes arrived, before parsing JSON. Drop requests whose ",[202,350,351],{},"t"," is older than 5 minutes: a captured request can't be replayed later, and a fresh timestamp won't match the signature.",[179,354,355,356,359,360,301,363,366,367,370],{},"Test vector: secret ",[202,357,358],{},"whsec_test",", body ",[202,361,362],{},"{\"event\":\"test\"}",[202,364,365],{},"t=1700000000"," give ",[202,368,369],{},"v1=21d2d3606ebbdbf9307ee15e83085df2b83c83dd87cc2e6d2ea6b1cb61afdc3c",".",[179,372,373],{},[197,374,375],{},"Node.js (Express)",[211,377,381],{"className":378,"code":379,"language":380,"meta":7,"style":7},"language-js shiki shiki-themes github-light github-dark","import crypto from 'node:crypto';\nimport express from 'express';\n\nconst app = express();\nconst secret = process.env.VIRALMAXING_WEBHOOK_SECRET;\n\napp.post('/viralmaxing', express.raw({ type: 'application/json' }), (req, res) => {\n  const parts = Object.fromEntries(\n    (req.get('X-Viralmaxing-Signature') ?? '').split(',').map((part) => part.split('=')),\n  );\n\n  if (!/^\\d+$/.test(parts.t ?? '') || Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) {\n    return res.sendStatus(400);\n  }\n\n  const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.`).update(req.body).digest('hex');\n  const given = Buffer.from(parts.v1 ?? '');\n  if (given.length !== expected.length || !crypto.timingSafeEqual(given, Buffer.from(expected))) {\n    return res.sendStatus(401);\n  }\n\n  const event = JSON.parse(req.body);\n  // event.lead.id is the lead key, req.get('X-Viralmaxing-Delivery') the repeat key\n  res.sendStatus(204);\n});\n","js",[202,382,383,400,414,420,439,456,460,507,527,588,594,599,679,699,705,710,769,793,832,848,853,858,879,886,901],{"__ignoreMap":7},[219,384,385,388,391,394,397],{"class":221,"line":25},[219,386,387],{"class":224},"import",[219,389,390],{"class":228}," crypto ",[219,392,393],{"class":224},"from",[219,395,396],{"class":235}," 'node:crypto'",[219,398,399],{"class":228},";\n",[219,401,402,404,407,409,412],{"class":221,"line":13},[219,403,387],{"class":224},[219,405,406],{"class":228}," express ",[219,408,393],{"class":224},[219,410,411],{"class":235}," 'express'",[219,413,399],{"class":228},[219,415,416],{"class":221,"line":17},[219,417,419],{"emptyLinePlaceholder":418},true,"\n",[219,421,422,425,429,432,436],{"class":221,"line":29},[219,423,424],{"class":224},"const",[219,426,428],{"class":427},"sj4cs"," app",[219,430,431],{"class":224}," =",[219,433,435],{"class":434},"sScJk"," express",[219,437,438],{"class":228},"();\n",[219,440,441,443,446,448,451,454],{"class":221,"line":21},[219,442,424],{"class":224},[219,444,445],{"class":427}," secret",[219,447,431],{"class":224},[219,449,450],{"class":228}," process.env.",[219,452,453],{"class":427},"VIRALMAXING_WEBHOOK_SECRET",[219,455,399],{"class":228},[219,457,458],{"class":221,"line":68},[219,459,419],{"emptyLinePlaceholder":418},[219,461,462,465,468,471,474,477,480,483,486,489,493,495,498,501,504],{"class":221,"line":81},[219,463,464],{"class":228},"app.",[219,466,467],{"class":434},"post",[219,469,470],{"class":228},"(",[219,472,473],{"class":235},"'/viralmaxing'",[219,475,476],{"class":228},", express.",[219,478,479],{"class":434},"raw",[219,481,482],{"class":228},"({ type: ",[219,484,485],{"class":235},"'application/json'",[219,487,488],{"class":228}," }), (",[219,490,492],{"class":491},"s4XuR","req",[219,494,301],{"class":228},[219,496,497],{"class":491},"res",[219,499,500],{"class":228},") ",[219,502,503],{"class":224},"=>",[219,505,506],{"class":228}," {\n",[219,508,510,513,516,518,521,524],{"class":221,"line":509},8,[219,511,512],{"class":224},"  const",[219,514,515],{"class":427}," parts",[219,517,431],{"class":224},[219,519,520],{"class":228}," Object.",[219,522,523],{"class":434},"fromEntries",[219,525,526],{"class":228},"(\n",[219,528,530,533,536,538,541,543,546,549,552,555,557,560,562,565,568,571,573,575,578,580,582,585],{"class":221,"line":529},9,[219,531,532],{"class":228},"    (req.",[219,534,535],{"class":434},"get",[219,537,470],{"class":228},[219,539,540],{"class":235},"'X-Viralmaxing-Signature'",[219,542,500],{"class":228},[219,544,545],{"class":224},"??",[219,547,548],{"class":235}," ''",[219,550,551],{"class":228},").",[219,553,554],{"class":434},"split",[219,556,470],{"class":228},[219,558,559],{"class":235},"','",[219,561,551],{"class":228},[219,563,564],{"class":434},"map",[219,566,567],{"class":228},"((",[219,569,570],{"class":491},"part",[219,572,500],{"class":228},[219,574,503],{"class":224},[219,576,577],{"class":228}," part.",[219,579,554],{"class":434},[219,581,470],{"class":228},[219,583,584],{"class":235},"'='",[219,586,587],{"class":228},")),\n",[219,589,591],{"class":221,"line":590},10,[219,592,593],{"class":228},"  );\n",[219,595,597],{"class":221,"line":596},11,[219,598,419],{"emptyLinePlaceholder":418},[219,600,602,605,608,611,614,617,620,623,625,627,629,632,634,636,638,641,644,647,650,653,656,658,661,664,667,670,673,676],{"class":221,"line":601},12,[219,603,604],{"class":224},"  if",[219,606,607],{"class":228}," (",[219,609,610],{"class":224},"!",[219,612,613],{"class":235},"/",[219,615,616],{"class":224},"^",[219,618,619],{"class":427},"\\d",[219,621,622],{"class":224},"+$",[219,624,613],{"class":235},[219,626,370],{"class":228},[219,628,317],{"class":434},[219,630,631],{"class":228},"(parts.t ",[219,633,545],{"class":224},[219,635,548],{"class":235},[219,637,500],{"class":228},[219,639,640],{"class":224},"||",[219,642,643],{"class":228}," Math.",[219,645,646],{"class":434},"abs",[219,648,649],{"class":228},"(Date.",[219,651,652],{"class":434},"now",[219,654,655],{"class":228},"() ",[219,657,613],{"class":224},[219,659,660],{"class":427}," 1000",[219,662,663],{"class":224}," -",[219,665,666],{"class":434}," Number",[219,668,669],{"class":228},"(parts.t)) ",[219,671,672],{"class":224},">",[219,674,675],{"class":427}," 300",[219,677,678],{"class":228},") {\n",[219,680,682,685,688,691,693,696],{"class":221,"line":681},13,[219,683,684],{"class":224},"    return",[219,686,687],{"class":228}," res.",[219,689,690],{"class":434},"sendStatus",[219,692,470],{"class":228},[219,694,695],{"class":427},"400",[219,697,698],{"class":228},");\n",[219,700,702],{"class":221,"line":701},14,[219,703,704],{"class":228},"  }\n",[219,706,708],{"class":221,"line":707},15,[219,709,419],{"emptyLinePlaceholder":418},[219,711,713,715,718,720,723,726,728,731,734,737,739,742,745,747,749,752,754,756,759,762,764,767],{"class":221,"line":712},16,[219,714,512],{"class":224},[219,716,717],{"class":427}," expected",[219,719,431],{"class":224},[219,721,722],{"class":228}," crypto.",[219,724,725],{"class":434},"createHmac",[219,727,470],{"class":228},[219,729,730],{"class":235},"'sha256'",[219,732,733],{"class":228},", secret).",[219,735,736],{"class":434},"update",[219,738,470],{"class":228},[219,740,741],{"class":235},"`${",[219,743,744],{"class":228},"parts",[219,746,370],{"class":235},[219,748,351],{"class":228},[219,750,751],{"class":235},"}.`",[219,753,551],{"class":228},[219,755,736],{"class":434},[219,757,758],{"class":228},"(req.body).",[219,760,761],{"class":434},"digest",[219,763,470],{"class":228},[219,765,766],{"class":235},"'hex'",[219,768,698],{"class":228},[219,770,772,774,777,779,782,784,787,789,791],{"class":221,"line":771},17,[219,773,512],{"class":224},[219,775,776],{"class":427}," given",[219,778,431],{"class":224},[219,780,781],{"class":228}," Buffer.",[219,783,393],{"class":434},[219,785,786],{"class":228},"(parts.v1 ",[219,788,545],{"class":224},[219,790,548],{"class":235},[219,792,698],{"class":228},[219,794,796,798,801,804,807,810,812,815,818,821,824,827,829],{"class":221,"line":795},18,[219,797,604],{"class":224},[219,799,800],{"class":228}," (given.",[219,802,803],{"class":427},"length",[219,805,806],{"class":224}," !==",[219,808,809],{"class":228}," expected.",[219,811,803],{"class":427},[219,813,814],{"class":224}," ||",[219,816,817],{"class":224}," !",[219,819,820],{"class":228},"crypto.",[219,822,823],{"class":434},"timingSafeEqual",[219,825,826],{"class":228},"(given, Buffer.",[219,828,393],{"class":434},[219,830,831],{"class":228},"(expected))) {\n",[219,833,835,837,839,841,843,846],{"class":221,"line":834},19,[219,836,684],{"class":224},[219,838,687],{"class":228},[219,840,690],{"class":434},[219,842,470],{"class":228},[219,844,845],{"class":427},"401",[219,847,698],{"class":228},[219,849,851],{"class":221,"line":850},20,[219,852,704],{"class":228},[219,854,856],{"class":221,"line":855},21,[219,857,419],{"emptyLinePlaceholder":418},[219,859,861,863,866,868,871,873,876],{"class":221,"line":860},22,[219,862,512],{"class":224},[219,864,865],{"class":427}," event",[219,867,431],{"class":224},[219,869,870],{"class":427}," JSON",[219,872,370],{"class":228},[219,874,875],{"class":434},"parse",[219,877,878],{"class":228},"(req.body);\n",[219,880,882],{"class":221,"line":881},23,[219,883,885],{"class":884},"sJ8bj","  // event.lead.id is the lead key, req.get('X-Viralmaxing-Delivery') the repeat key\n",[219,887,889,892,894,896,899],{"class":221,"line":888},24,[219,890,891],{"class":228},"  res.",[219,893,690],{"class":434},[219,895,470],{"class":228},[219,897,898],{"class":427},"204",[219,900,698],{"class":228},[219,902,904],{"class":221,"line":903},25,[219,905,906],{"class":228},"});\n",[179,908,909],{},[197,910,911],{},"Python (Flask)",[211,913,917],{"className":914,"code":915,"language":916,"meta":7,"style":7},"language-python shiki shiki-themes github-light github-dark","import hashlib, hmac, json, os, time\nfrom flask import Flask, abort, request\n\nsecret = os.environ[\"VIRALMAXING_WEBHOOK_SECRET\"].encode()\napp = Flask(__name__)\n\n@app.post(\"/viralmaxing\")\ndef viralmaxing():\n    header = request.headers.get(\"X-Viralmaxing-Signature\", \"\")\n    parts = dict(part.split(\"=\", 1) for part in header.split(\",\") if \"=\" in part)\n    t = parts.get(\"t\", \"\")\n    if not t.isdigit() or abs(time.time() - int(t)) > 300:\n        abort(400)\n    body = request.get_data()\n    expected = hmac.new(secret, t.encode() + b\".\" + body, hashlib.sha256).hexdigest()\n    if not hmac.compare_digest(expected, parts.get(\"v1\", \"\")):\n        abort(401)\n    event = json.loads(body)\n    return \"\", 204\n","python",[202,918,919,924,929,933,938,943,947,952,957,962,967,972,977,982,987,992,997,1002,1007],{"__ignoreMap":7},[219,920,921],{"class":221,"line":25},[219,922,923],{},"import hashlib, hmac, json, os, time\n",[219,925,926],{"class":221,"line":13},[219,927,928],{},"from flask import Flask, abort, request\n",[219,930,931],{"class":221,"line":17},[219,932,419],{"emptyLinePlaceholder":418},[219,934,935],{"class":221,"line":29},[219,936,937],{},"secret = os.environ[\"VIRALMAXING_WEBHOOK_SECRET\"].encode()\n",[219,939,940],{"class":221,"line":21},[219,941,942],{},"app = Flask(__name__)\n",[219,944,945],{"class":221,"line":68},[219,946,419],{"emptyLinePlaceholder":418},[219,948,949],{"class":221,"line":81},[219,950,951],{},"@app.post(\"/viralmaxing\")\n",[219,953,954],{"class":221,"line":509},[219,955,956],{},"def viralmaxing():\n",[219,958,959],{"class":221,"line":529},[219,960,961],{},"    header = request.headers.get(\"X-Viralmaxing-Signature\", \"\")\n",[219,963,964],{"class":221,"line":590},[219,965,966],{},"    parts = dict(part.split(\"=\", 1) for part in header.split(\",\") if \"=\" in part)\n",[219,968,969],{"class":221,"line":596},[219,970,971],{},"    t = parts.get(\"t\", \"\")\n",[219,973,974],{"class":221,"line":601},[219,975,976],{},"    if not t.isdigit() or abs(time.time() - int(t)) > 300:\n",[219,978,979],{"class":221,"line":681},[219,980,981],{},"        abort(400)\n",[219,983,984],{"class":221,"line":701},[219,985,986],{},"    body = request.get_data()\n",[219,988,989],{"class":221,"line":707},[219,990,991],{},"    expected = hmac.new(secret, t.encode() + b\".\" + body, hashlib.sha256).hexdigest()\n",[219,993,994],{"class":221,"line":712},[219,995,996],{},"    if not hmac.compare_digest(expected, parts.get(\"v1\", \"\")):\n",[219,998,999],{"class":221,"line":771},[219,1000,1001],{},"        abort(401)\n",[219,1003,1004],{"class":221,"line":795},[219,1005,1006],{},"    event = json.loads(body)\n",[219,1008,1009],{"class":221,"line":834},[219,1010,1011],{},"    return \"\", 204\n",[179,1013,1014],{},[197,1015,1016],{},"PHP",[211,1018,1022],{"className":1019,"code":1020,"language":1021,"meta":7,"style":7},"language-php shiki shiki-themes github-light github-dark","\u003C?php\n$secret = getenv('VIRALMAXING_WEBHOOK_SECRET');\n$body = file_get_contents('php://input');\nparse_str(str_replace(',', '&', $_SERVER['HTTP_X_VIRALMAXING_SIGNATURE'] ?? ''), $parts);\n$t = $parts['t'] ?? '';\nif (!ctype_digit($t) || abs(time() - (int) $t) > 300) { http_response_code(400); exit; }\n$expected = hash_hmac('sha256', $t . '.' . $body, $secret);\nif (!hash_equals($expected, $parts['v1'] ?? '')) { http_response_code(401); exit; }\n$event = json_decode($body, true);\nhttp_response_code(204);\n","php",[202,1023,1024,1029,1034,1039,1044,1049,1054,1059,1064,1069],{"__ignoreMap":7},[219,1025,1026],{"class":221,"line":25},[219,1027,1028],{},"\u003C?php\n",[219,1030,1031],{"class":221,"line":13},[219,1032,1033],{},"$secret = getenv('VIRALMAXING_WEBHOOK_SECRET');\n",[219,1035,1036],{"class":221,"line":17},[219,1037,1038],{},"$body = file_get_contents('php://input');\n",[219,1040,1041],{"class":221,"line":29},[219,1042,1043],{},"parse_str(str_replace(',', '&', $_SERVER['HTTP_X_VIRALMAXING_SIGNATURE'] ?? ''), $parts);\n",[219,1045,1046],{"class":221,"line":21},[219,1047,1048],{},"$t = $parts['t'] ?? '';\n",[219,1050,1051],{"class":221,"line":68},[219,1052,1053],{},"if (!ctype_digit($t) || abs(time() - (int) $t) > 300) { http_response_code(400); exit; }\n",[219,1055,1056],{"class":221,"line":81},[219,1057,1058],{},"$expected = hash_hmac('sha256', $t . '.' . $body, $secret);\n",[219,1060,1061],{"class":221,"line":509},[219,1062,1063],{},"if (!hash_equals($expected, $parts['v1'] ?? '')) { http_response_code(401); exit; }\n",[219,1065,1066],{"class":221,"line":529},[219,1067,1068],{},"$event = json_decode($body, true);\n",[219,1070,1071],{"class":221,"line":590},[219,1072,1073],{},"http_response_code(204);\n",[183,1075,1077],{"id":1076},"_4-answer-and-dont-double-up","4. Answer and don't double up",[179,1079,1080],{},"A 2xx answer is a delivery: answer fast and do the heavy work after answering. If your receiver didn't answer within 10 seconds, answered 5xx or 429, the event is retried in 1 minute, 10 minutes, 1 hour and 10 hours, five attempts in all. Other 4xx answers and redirects are not retried: we don't follow redirects, use the final address.",[179,1082,1083,1084,1086,1087,301,1090,1093],{},"A retry carries the same ",[202,1085,324],{}," and the same body with a new signature. Remember delivery ids and answer 2xx to one you've already handled. Private network addresses are refused: IPs from private ranges, names without a dot and the ",[202,1088,1089],{},".local",[202,1091,1092],{},".internal"," zones.",[183,1095,1097],{"id":1096},"_5-check-it","5. Check it",[179,1099,1100,1101,1104,1105,1107],{},"Press ",[197,1102,1103],{},"«Test»"," on the card: a ",[202,1106,317],{}," event with a sample lead goes out at once and its answer code shows next to the button. Below it is the log of the last 30 deliveries with the funnel, the answer code or reason and the number of attempts.",[183,1109,1111],{"id":1110},"build-the-receiver-with-an-ai-agent","Build the receiver with an AI agent",[179,1113,1114],{},"Copy this into Claude, Cursor or Codex and add where the leads should go:",[211,1116,1121],{"className":1117,"code":1119,"language":1120,"meta":7},[1118],"language-text","Build an HTTPS endpoint POST /viralmaxing that receives Viralmaxing webhooks.\n\n- The body is JSON; read the raw bytes before parsing.\n\n- The signature is in X-Viralmaxing-Signature: \"t=\u003Cunix>,v1=\u003Chex>\". v1 = HMAC-SHA256(secret, \"\u003Ct>.\u003Craw body>\") in hex.\n  The secret is in VIRALMAXING_WEBHOOK_SECRET. Compare in constant time.\n  Answer 400 if t is older than 300 seconds and 401 if the signature doesn't match.\n\n- Test vector: secret whsec_test, t=1700000000, body {\"event\":\"test\"} →\n  v1=21d2d3606ebbdbf9307ee15e83085df2b83c83dd87cc2e6d2ea6b1cb61afdc3c. Write a test for it.\n\n- X-Viralmaxing-Delivery is the repeat key: acknowledge an id you've handled with 204 and don't handle it again.\n\n- The event is in X-Viralmaxing-Event and the event field: lead.created, lead.answered, lead.qualified, order.paid, order.refunded, test.\n  Join one person's events by lead.id. Form answers are lead.answers[] with field, type, question, answer.\n  The funnel is automation.id and automation.name, the reel is reel.url.\n\n- Answer 204 at once and write to the CRM after answering.\n\n- The full contract: https://viralmaxing.com/developers/webhooks/events\n\nPut the leads into: \u003Cyour CRM, sheet or database>.\n","text",[202,1122,1119],{"__ignoreMap":7},[1124,1125,1126],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":7,"searchDepth":13,"depth":13,"links":1128},[1129,1130,1131,1132,1133,1134],{"id":185,"depth":13,"text":186},{"id":242,"depth":13,"text":243},{"id":337,"depth":13,"text":338},{"id":1076,"depth":13,"text":1077},{"id":1096,"depth":13,"text":1097},{"id":1110,"depth":13,"text":1111},"Receive the leads of every funnel in a workspace at your own address, verify the signature and drop repeats.","md",false,"lucide:send","en",{},[162,159],{"title":167,"description":1135},null,"developers/webhooks/quick-start","EZvjxy5LtxUHjpUcwV61dsJwymiQyvnRMraR5v8iGD0",[1147,1149,1151,1153,1155,1157,1159,1161,1163,1165],{"path":135,"title":136,"description":1148},"Connect Viralmaxing to AI agents through MCP or to applications through the REST API.",{"path":139,"title":140,"description":1150},"Add the Viralmaxing MCP server, sign in through the browser, and give the agent its first safe request.",{"path":143,"title":144,"description":1152},"Five ready-made skills and the connector in one command: npx skills add Viralmaxing/skill.",{"path":146,"title":147,"description":1154},"Checks for missing tools, repeated sign-in, incorrect workspace data, and authorization errors.",{"path":149,"title":150,"description":1156},"Check the tool list, current workspace, and data access without changing anything in the workspace.",{"path":152,"title":153,"description":1158},"How to send, store, rotate, and revoke an API key without exposing it.",{"path":156,"title":157,"description":1160},"Verify a key with cURL or server-side JavaScript and handle common API responses.",{"path":159,"title":160,"description":1162},"Create an API key, store it in an environment variable, and make the first request.",{"path":162,"title":163,"description":1164},"Six events, the body fields and an example of each: new lead, form answers, qualified lead, payment, refund and test.",{"path":166,"title":167,"description":1135},1795328213030]