[{"data":1,"prerenderedAt":207},["ShallowReactive",2],{"doc-article-webhooks-webhook-events":3,"doc-siblings-webhooks":202},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"category":5,"order":10,"difficulty":11,"time_to_complete":12,"related":13,"code_curl":15,"code_node":16,"code_python":17,"code_go":18,"body":19,"_type":196,"_id":197,"_source":198,"_file":199,"_stem":200,"_extension":201},"\u002Fdeveloper\u002Fwebhooks\u002Fwebhook-events","webhooks",false,"","Webhook Events","Understand real-time webhook payload structures dispatched to your server upon customer activity.",1,"intermediate","5 minutes",[14],"\u002Fdocs\u002Fwebhooks\u002Fsignature-validation","# Simulate receiving a text message webhook locally\ncurl -X POST \"http:\u002F\u002Flocalhost:8080\u002Fwebhook\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-AISoule-Signature: sha256=MOCK_SIGNATURE\" \\\n  -d '{\n    \"event\": \"message.received\",\n    \"timestamp\": 1780369298,\n    \"data\": {\n      \"message_id\": \"msg_90a82b7194689c1\",\n      \"sender\": \"918856879188\",\n      \"type\": \"text\",\n      \"body\": \"Hi there! I need pricing info.\"\n    }\n  }'\n","\u002F\u002F Handle webhook POST body using Express\nconst express = require('express');\nconst app = express();\napp.use(express.json());\n\napp.post('\u002Fwebhook', (req, res) => {\n  const { event, data } = req.body;\n  console.log(`Received event: ${event}`);\n  \n  if (event === 'message.received') {\n    console.log(`Text from ${data.sender}: ${data.body}`);\n  }\n  res.sendStatus(200);\n});\n\napp.listen(8080);\n","# Handle webhook POST using Flask\nfrom flask import Flask, request, jsonify\napp = Flask(__name__)\n\n@app.route(\"\u002Fwebhook\", methods=[\"POST\"])\ndef handle_webhook():\n    payload = request.json\n    event = payload.get(\"event\")\n    data = payload.get(\"data\", {})\n    \n    print(f\"Event: {event}\")\n    if event == \"message.received\":\n        print(f\"Text: {data.get('body')} from {data.get('sender')}\")\n        \n    return \"\", 200\n\nif __name__ == \"__main__\":\n    app.run(port=8080)\n","\u002F\u002F Handle webhook POST in Go\npackage main\n\nimport (\n    \"encoding\u002Fjson\"\n    \"fmt\"\n    \"net\u002Fhttp\"\n)\n\ntype WebhookPayload struct {\n    Event string `json:\"event\"`\n    Data  struct {\n        MessageID string `json:\"message_id\"`\n        Sender    string `json:\"sender\"`\n        Body      string `json:\"body\"`\n    } `json:\"data\"`\n}\n\nfunc handleWebhook(w http.ResponseWriter, r *http.Request) {\n    var p WebhookPayload\n    json.NewDecoder(r.Body).Decode(&p)\n    \n    fmt.Printf(\"Received event: %s from %s\\n\", p.Event, p.Data.Sender)\n    w.WriteHeader(http.StatusOK)\n}\n\nfunc main() {\n    http.HandleFunc(\"\u002Fwebhook\", handleWebhook)\n    http.ListenAndServe(\":8080\", nil)\n}\n",{"type":20,"children":21,"toc":185},"root",[22,31,45,52,57,118,122,128,142,147,159,171,176],{"type":23,"tag":24,"props":25,"children":27},"element","h1",{"id":26},"webhook-events-payloads",[28],{"type":29,"value":30},"text","Webhook Events & Payloads",{"type":23,"tag":32,"props":33,"children":34},"p",{},[35,37,43],{"type":29,"value":36},"To build reactive integrations (like updating active tickets inside your CRM, sending transactional notifications, or triggering external automated sequences), you can subscribe to outbound ",{"type":23,"tag":38,"props":39,"children":40},"strong",{},[41],{"type":29,"value":42},"Webhooks",{"type":29,"value":44}," in your AISoule panel.",{"type":23,"tag":46,"props":47,"children":49},"h2",{"id":48},"active-event-types",[50],{"type":29,"value":51},"Active Event Types",{"type":23,"tag":32,"props":53,"children":54},{},[55],{"type":29,"value":56},"The AISoule event pipeline dispatches webhooks for the following events:",{"type":23,"tag":58,"props":59,"children":60},"ul",{},[61,74,85,96,107],{"type":23,"tag":62,"props":63,"children":64},"li",{},[65,72],{"type":23,"tag":66,"props":67,"children":69},"code",{"className":68},[],[70],{"type":29,"value":71},"message.received",{"type":29,"value":73},": A customer sends a new message to your WhatsApp number.",{"type":23,"tag":62,"props":75,"children":76},{},[77,83],{"type":23,"tag":66,"props":78,"children":80},{"className":79},[],[81],{"type":29,"value":82},"message.sent",{"type":29,"value":84},": Your message is pushed to Meta's servers.",{"type":23,"tag":62,"props":86,"children":87},{},[88,94],{"type":23,"tag":66,"props":89,"children":91},{"className":90},[],[92],{"type":29,"value":93},"message.delivered",{"type":29,"value":95},": The message is successfully received by the customer's mobile device.",{"type":23,"tag":62,"props":97,"children":98},{},[99,105],{"type":23,"tag":66,"props":100,"children":102},{"className":101},[],[103],{"type":29,"value":104},"message.read",{"type":29,"value":106},": The customer opens\u002Freads your message.",{"type":23,"tag":62,"props":108,"children":109},{},[110,116],{"type":23,"tag":66,"props":111,"children":113},{"className":112},[],[114],{"type":29,"value":115},"message.failed",{"type":29,"value":117},": The message delivery fails (e.g. invalid number, billing issue).",{"type":23,"tag":119,"props":120,"children":121},"hr",{},[],{"type":23,"tag":46,"props":123,"children":125},{"id":124},"payload-schemas",[126],{"type":29,"value":127},"Payload Schemas",{"type":23,"tag":129,"props":130,"children":132},"h3",{"id":131},"_1-message-received-messagereceived",[133,135,140],{"type":29,"value":134},"1. Message Received (",{"type":23,"tag":66,"props":136,"children":138},{"className":137},[],[139],{"type":29,"value":71},{"type":29,"value":141},")",{"type":23,"tag":32,"props":143,"children":144},{},[145],{"type":29,"value":146},"Fired when a customer initiates a text query:",{"type":23,"tag":148,"props":149,"children":154},"pre",{"className":150,"code":152,"language":153,"meta":7},[151],"language-json","{\n  \"event\": \"message.received\",\n  \"timestamp\": 1780369298,\n  \"data\": {\n    \"message_id\": \"msg_90a82b7194689c1\",\n    \"waba_number\": \"15550199999\",\n    \"sender\": \"918856879188\",\n    \"recipient\": \"15550199999\",\n    \"type\": \"text\",\n    \"body\": \"Hi there! I need pricing info.\"\n  }\n}\n","json",[155],{"type":23,"tag":66,"props":156,"children":157},{"__ignoreMap":7},[158],{"type":29,"value":152},{"type":23,"tag":129,"props":160,"children":162},{"id":161},"_2-message-read-receipt-messageread",[163,165,170],{"type":29,"value":164},"2. Message Read Receipt (",{"type":23,"tag":66,"props":166,"children":168},{"className":167},[],[169],{"type":29,"value":104},{"type":29,"value":141},{"type":23,"tag":32,"props":172,"children":173},{},[174],{"type":29,"value":175},"Fired when the double grey checkmarks turn blue:",{"type":23,"tag":148,"props":177,"children":180},{"className":178,"code":179,"language":153,"meta":7},[151],"{\n  \"event\": \"message.read\",\n  \"timestamp\": 1780369320,\n  \"data\": {\n    \"message_id\": \"msg_90a82b7194689c1\",\n    \"waba_number\": \"15550199999\",\n    \"sender\": \"15550199999\",\n    \"recipient\": \"918856879188\",\n    \"status\": \"read\"\n  }\n}\n",[181],{"type":23,"tag":66,"props":182,"children":183},{"__ignoreMap":7},[184],{"type":29,"value":179},{"title":7,"searchDepth":186,"depth":186,"links":187},2,[188,189],{"id":48,"depth":186,"text":51},{"id":124,"depth":186,"text":127,"children":190},[191,194],{"id":131,"depth":192,"text":193},3,"1. Message Received (message.received)",{"id":161,"depth":192,"text":195},"2. Message Read Receipt (message.read)","markdown","content:developer:webhooks:webhook-events.md","content","developer\u002Fwebhooks\u002Fwebhook-events.md","developer\u002Fwebhooks\u002Fwebhook-events","md",[203,206],{"_path":204,"title":205},"\u002Fdeveloper\u002Fwebhooks\u002Fsignature-validation","Signature Validation",{"_path":4,"title":8},1780423178117]