[{"data":1,"prerenderedAt":1258},["ShallowReactive",2],{"content-query-7NqWOve9EA":3,"content-query-W4RtfFQaoh":1058,"content-query-yP1cWMns5L":1083,"content-query-M5aWdXgQKx":1087,"content-query-eJ9XWy0CGH":1094,"content-query-UP87PRcOMw":1107,"content-query-7VgBfxLOWV":1111,"content-query-Z6fTkbgt1D":1133,"content-query-9giMhwHrGj":1140,"content-query-j8GGVgf9na":1147,"content-query-G03kJtQzJS":1160,"content-query-1mvwAKmUBq":1179,"content-query-zRSmsuVl55":1202,"content-query-MsdmgXewTK":1206,"content-query-No6iPTj4EO":1213,"content-query-BMhIInEJl2":1223},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"intro":9,"type":10,"layout":11,"tags":12,"body":15,"_type":1051,"_id":1052,"_source":1053,"_file":1054,"_stem":1055,"_extension":1056,"sitemap":1057},"/docs/tutorials/email/api","email",false,"","Email to API","Convert inbound email into an API request — Webhook Relay parses each message to JSON and a transform POSTs it to your API in the shape it expects.","tutorial","doc",[13,14],"Email","Webhook Forwarding",{"type":16,"children":17,"toc":1045},"root",[18,26,56,63,68,88,93,98,544,557,563,573,591,601,619,636,642,678,832,837,865,983,995,1008,1014,1027,1039],{"type":19,"tag":20,"props":21,"children":22},"element","p",{},[23],{"type":24,"value":25},"text","You have an API — or an app behind one — and a steady stream of inbound email you'd like to ingest as structured requests: support tickets, order confirmations, server alerts, form notifications, customer replies. The usual options are unappealing: run and secure an SMTP server, or poll an IMAP mailbox on a timer and parse raw MIME yourself. Both are infrastructure you don't want to own.",{"type":19,"tag":20,"props":27,"children":28},{},[29,38,40,46,48,54],{"type":19,"tag":30,"props":31,"children":35},"a",{"href":32,"rel":33},"https://webhookrelay.com",[34],"nofollow",[36],{"type":24,"value":37},"Webhook Relay",{"type":24,"value":39}," can ",{"type":19,"tag":30,"props":41,"children":43},{"href":42},"/docs/email",[44],{"type":24,"value":45},"receive emails as webhooks",{"type":24,"value":47}," instead. You get a unique address, every message sent to it is parsed into JSON, and a small ",{"type":19,"tag":49,"props":50,"children":51},"strong",{},[52],{"type":24,"value":53},"transform",{"type":24,"value":55}," reshapes that JSON into exactly the request your API expects — body, headers and auth — before it's POSTed to your endpoint.",{"type":19,"tag":57,"props":58,"children":60},"h2",{"id":59},"how-it-works",[61],{"type":24,"value":62},"How it works",{"type":19,"tag":20,"props":64,"children":65},{},[66],{"type":24,"value":67},"The whole path is a single hop with a transform in the middle:",{"type":19,"tag":69,"props":70,"children":73},"pre",{"className":71,"code":72,"language":24,"meta":7,"style":7},"language-text shiki shiki-themes github-dark","inbound email  ──▶  Webhook Relay (parse + transform)  ──▶  POST to your API (public or behind a firewall)\n",[74],{"type":19,"tag":75,"props":76,"children":77},"code",{"__ignoreMap":7},[78],{"type":19,"tag":79,"props":80,"children":83},"span",{"class":81,"line":82},"line",1,[84],{"type":19,"tag":79,"props":85,"children":86},{},[87],{"type":24,"value":72},{"type":19,"tag":20,"props":89,"children":90},{},[91],{"type":24,"value":92},"When an email hits your Webhook Relay address it's parsed into a structured JSON document and POSTed to the bucket's outputs. Your API expects its own request shape — not Webhook Relay's parsed-email shape — so the transform converts one into the other in flight, and can attach the headers and bearer token your endpoint requires.",{"type":19,"tag":20,"props":94,"children":95},{},[96],{"type":24,"value":97},"The parsed email looks like this:",{"type":19,"tag":69,"props":99,"children":103},{"className":100,"code":101,"language":102,"meta":7,"style":7},"language-json shiki shiki-themes github-dark","{\n  \"from\": \"jon@example.com\",\n  \"from_name\": \"Jon Snow\",\n  \"recipient\": \"\u003Cuuid>@in.webhookrelay-mail.com\",\n  \"to\": [\"\u003Cuuid>@in.webhookrelay-mail.com\"],\n  \"cc\": [],\n  \"subject\": \"Order #4821 confirmed\",\n  \"date\": \"Fri, 26 Jun 2026 11:27:41 +0400\",\n  \"message_id\": \"\u003Cabc123@mail.example.com>\",\n  \"text\": \"plain body\",\n  \"html\": \"\u003Cp>html body\u003C/p>\",\n  \"headers\": {},\n  \"spf\": \"pass\",\n  \"dkim\": \"pass\",\n  \"dmarc\": \"pass\",\n  \"attachments\": [\n    { \"name\": \"invoice.pdf\", \"content_type\": \"application/pdf\", \"size\": 48213, \"content\": \"\u003Cbase64>\", \"truncated\": false }\n  ]\n}\n","json",[104],{"type":19,"tag":75,"props":105,"children":106},{"__ignoreMap":7},[107,116,142,164,186,209,223,245,267,289,311,333,347,369,390,411,425,526,535],{"type":19,"tag":79,"props":108,"children":109},{"class":81,"line":82},[110],{"type":19,"tag":79,"props":111,"children":113},{"style":112},"--shiki-default:#E1E4E8",[114],{"type":24,"value":115},"{\n",{"type":19,"tag":79,"props":117,"children":119},{"class":81,"line":118},2,[120,126,131,137],{"type":19,"tag":79,"props":121,"children":123},{"style":122},"--shiki-default:#79B8FF",[124],{"type":24,"value":125},"  \"from\"",{"type":19,"tag":79,"props":127,"children":128},{"style":112},[129],{"type":24,"value":130},": ",{"type":19,"tag":79,"props":132,"children":134},{"style":133},"--shiki-default:#9ECBFF",[135],{"type":24,"value":136},"\"jon@example.com\"",{"type":19,"tag":79,"props":138,"children":139},{"style":112},[140],{"type":24,"value":141},",\n",{"type":19,"tag":79,"props":143,"children":145},{"class":81,"line":144},3,[146,151,155,160],{"type":19,"tag":79,"props":147,"children":148},{"style":122},[149],{"type":24,"value":150},"  \"from_name\"",{"type":19,"tag":79,"props":152,"children":153},{"style":112},[154],{"type":24,"value":130},{"type":19,"tag":79,"props":156,"children":157},{"style":133},[158],{"type":24,"value":159},"\"Jon Snow\"",{"type":19,"tag":79,"props":161,"children":162},{"style":112},[163],{"type":24,"value":141},{"type":19,"tag":79,"props":165,"children":167},{"class":81,"line":166},4,[168,173,177,182],{"type":19,"tag":79,"props":169,"children":170},{"style":122},[171],{"type":24,"value":172},"  \"recipient\"",{"type":19,"tag":79,"props":174,"children":175},{"style":112},[176],{"type":24,"value":130},{"type":19,"tag":79,"props":178,"children":179},{"style":133},[180],{"type":24,"value":181},"\"\u003Cuuid>@in.webhookrelay-mail.com\"",{"type":19,"tag":79,"props":183,"children":184},{"style":112},[185],{"type":24,"value":141},{"type":19,"tag":79,"props":187,"children":189},{"class":81,"line":188},5,[190,195,200,204],{"type":19,"tag":79,"props":191,"children":192},{"style":122},[193],{"type":24,"value":194},"  \"to\"",{"type":19,"tag":79,"props":196,"children":197},{"style":112},[198],{"type":24,"value":199},": [",{"type":19,"tag":79,"props":201,"children":202},{"style":133},[203],{"type":24,"value":181},{"type":19,"tag":79,"props":205,"children":206},{"style":112},[207],{"type":24,"value":208},"],\n",{"type":19,"tag":79,"props":210,"children":212},{"class":81,"line":211},6,[213,218],{"type":19,"tag":79,"props":214,"children":215},{"style":122},[216],{"type":24,"value":217},"  \"cc\"",{"type":19,"tag":79,"props":219,"children":220},{"style":112},[221],{"type":24,"value":222},": [],\n",{"type":19,"tag":79,"props":224,"children":226},{"class":81,"line":225},7,[227,232,236,241],{"type":19,"tag":79,"props":228,"children":229},{"style":122},[230],{"type":24,"value":231},"  \"subject\"",{"type":19,"tag":79,"props":233,"children":234},{"style":112},[235],{"type":24,"value":130},{"type":19,"tag":79,"props":237,"children":238},{"style":133},[239],{"type":24,"value":240},"\"Order #4821 confirmed\"",{"type":19,"tag":79,"props":242,"children":243},{"style":112},[244],{"type":24,"value":141},{"type":19,"tag":79,"props":246,"children":248},{"class":81,"line":247},8,[249,254,258,263],{"type":19,"tag":79,"props":250,"children":251},{"style":122},[252],{"type":24,"value":253},"  \"date\"",{"type":19,"tag":79,"props":255,"children":256},{"style":112},[257],{"type":24,"value":130},{"type":19,"tag":79,"props":259,"children":260},{"style":133},[261],{"type":24,"value":262},"\"Fri, 26 Jun 2026 11:27:41 +0400\"",{"type":19,"tag":79,"props":264,"children":265},{"style":112},[266],{"type":24,"value":141},{"type":19,"tag":79,"props":268,"children":270},{"class":81,"line":269},9,[271,276,280,285],{"type":19,"tag":79,"props":272,"children":273},{"style":122},[274],{"type":24,"value":275},"  \"message_id\"",{"type":19,"tag":79,"props":277,"children":278},{"style":112},[279],{"type":24,"value":130},{"type":19,"tag":79,"props":281,"children":282},{"style":133},[283],{"type":24,"value":284},"\"\u003Cabc123@mail.example.com>\"",{"type":19,"tag":79,"props":286,"children":287},{"style":112},[288],{"type":24,"value":141},{"type":19,"tag":79,"props":290,"children":292},{"class":81,"line":291},10,[293,298,302,307],{"type":19,"tag":79,"props":294,"children":295},{"style":122},[296],{"type":24,"value":297},"  \"text\"",{"type":19,"tag":79,"props":299,"children":300},{"style":112},[301],{"type":24,"value":130},{"type":19,"tag":79,"props":303,"children":304},{"style":133},[305],{"type":24,"value":306},"\"plain body\"",{"type":19,"tag":79,"props":308,"children":309},{"style":112},[310],{"type":24,"value":141},{"type":19,"tag":79,"props":312,"children":314},{"class":81,"line":313},11,[315,320,324,329],{"type":19,"tag":79,"props":316,"children":317},{"style":122},[318],{"type":24,"value":319},"  \"html\"",{"type":19,"tag":79,"props":321,"children":322},{"style":112},[323],{"type":24,"value":130},{"type":19,"tag":79,"props":325,"children":326},{"style":133},[327],{"type":24,"value":328},"\"\u003Cp>html body\u003C/p>\"",{"type":19,"tag":79,"props":330,"children":331},{"style":112},[332],{"type":24,"value":141},{"type":19,"tag":79,"props":334,"children":336},{"class":81,"line":335},12,[337,342],{"type":19,"tag":79,"props":338,"children":339},{"style":122},[340],{"type":24,"value":341},"  \"headers\"",{"type":19,"tag":79,"props":343,"children":344},{"style":112},[345],{"type":24,"value":346},": {},\n",{"type":19,"tag":79,"props":348,"children":350},{"class":81,"line":349},13,[351,356,360,365],{"type":19,"tag":79,"props":352,"children":353},{"style":122},[354],{"type":24,"value":355},"  \"spf\"",{"type":19,"tag":79,"props":357,"children":358},{"style":112},[359],{"type":24,"value":130},{"type":19,"tag":79,"props":361,"children":362},{"style":133},[363],{"type":24,"value":364},"\"pass\"",{"type":19,"tag":79,"props":366,"children":367},{"style":112},[368],{"type":24,"value":141},{"type":19,"tag":79,"props":370,"children":372},{"class":81,"line":371},14,[373,378,382,386],{"type":19,"tag":79,"props":374,"children":375},{"style":122},[376],{"type":24,"value":377},"  \"dkim\"",{"type":19,"tag":79,"props":379,"children":380},{"style":112},[381],{"type":24,"value":130},{"type":19,"tag":79,"props":383,"children":384},{"style":133},[385],{"type":24,"value":364},{"type":19,"tag":79,"props":387,"children":388},{"style":112},[389],{"type":24,"value":141},{"type":19,"tag":79,"props":391,"children":393},{"class":81,"line":392},15,[394,399,403,407],{"type":19,"tag":79,"props":395,"children":396},{"style":122},[397],{"type":24,"value":398},"  \"dmarc\"",{"type":19,"tag":79,"props":400,"children":401},{"style":112},[402],{"type":24,"value":130},{"type":19,"tag":79,"props":404,"children":405},{"style":133},[406],{"type":24,"value":364},{"type":19,"tag":79,"props":408,"children":409},{"style":112},[410],{"type":24,"value":141},{"type":19,"tag":79,"props":412,"children":414},{"class":81,"line":413},16,[415,420],{"type":19,"tag":79,"props":416,"children":417},{"style":122},[418],{"type":24,"value":419},"  \"attachments\"",{"type":19,"tag":79,"props":421,"children":422},{"style":112},[423],{"type":24,"value":424},": [\n",{"type":19,"tag":79,"props":426,"children":428},{"class":81,"line":427},17,[429,434,439,443,448,453,458,462,467,471,476,480,485,489,494,498,503,507,512,516,521],{"type":19,"tag":79,"props":430,"children":431},{"style":112},[432],{"type":24,"value":433},"    { ",{"type":19,"tag":79,"props":435,"children":436},{"style":122},[437],{"type":24,"value":438},"\"name\"",{"type":19,"tag":79,"props":440,"children":441},{"style":112},[442],{"type":24,"value":130},{"type":19,"tag":79,"props":444,"children":445},{"style":133},[446],{"type":24,"value":447},"\"invoice.pdf\"",{"type":19,"tag":79,"props":449,"children":450},{"style":112},[451],{"type":24,"value":452},", ",{"type":19,"tag":79,"props":454,"children":455},{"style":122},[456],{"type":24,"value":457},"\"content_type\"",{"type":19,"tag":79,"props":459,"children":460},{"style":112},[461],{"type":24,"value":130},{"type":19,"tag":79,"props":463,"children":464},{"style":133},[465],{"type":24,"value":466},"\"application/pdf\"",{"type":19,"tag":79,"props":468,"children":469},{"style":112},[470],{"type":24,"value":452},{"type":19,"tag":79,"props":472,"children":473},{"style":122},[474],{"type":24,"value":475},"\"size\"",{"type":19,"tag":79,"props":477,"children":478},{"style":112},[479],{"type":24,"value":130},{"type":19,"tag":79,"props":481,"children":482},{"style":122},[483],{"type":24,"value":484},"48213",{"type":19,"tag":79,"props":486,"children":487},{"style":112},[488],{"type":24,"value":452},{"type":19,"tag":79,"props":490,"children":491},{"style":122},[492],{"type":24,"value":493},"\"content\"",{"type":19,"tag":79,"props":495,"children":496},{"style":112},[497],{"type":24,"value":130},{"type":19,"tag":79,"props":499,"children":500},{"style":133},[501],{"type":24,"value":502},"\"\u003Cbase64>\"",{"type":19,"tag":79,"props":504,"children":505},{"style":112},[506],{"type":24,"value":452},{"type":19,"tag":79,"props":508,"children":509},{"style":122},[510],{"type":24,"value":511},"\"truncated\"",{"type":19,"tag":79,"props":513,"children":514},{"style":112},[515],{"type":24,"value":130},{"type":19,"tag":79,"props":517,"children":518},{"style":122},[519],{"type":24,"value":520},"false",{"type":19,"tag":79,"props":522,"children":523},{"style":112},[524],{"type":24,"value":525}," }\n",{"type":19,"tag":79,"props":527,"children":529},{"class":81,"line":528},18,[530],{"type":19,"tag":79,"props":531,"children":532},{"style":112},[533],{"type":24,"value":534},"  ]\n",{"type":19,"tag":79,"props":536,"children":538},{"class":81,"line":537},19,[539],{"type":19,"tag":79,"props":540,"children":541},{"style":112},[542],{"type":24,"value":543},"}\n",{"type":19,"tag":20,"props":545,"children":546},{},[547,549,555],{"type":24,"value":548},"See the full ",{"type":19,"tag":30,"props":550,"children":552},{"href":551},"/docs/email/payload",[553],{"type":24,"value":554},"payload reference",{"type":24,"value":556}," for every field.",{"type":19,"tag":57,"props":558,"children":560},{"id":559},"setup",[561],{"type":24,"value":562},"Setup",{"type":19,"tag":20,"props":564,"children":565},{},[566,571],{"type":19,"tag":49,"props":567,"children":568},{},[569],{"type":24,"value":570},"1. Create a bucket.",{"type":24,"value":572}," This is the container that ties an input to its outputs.",{"type":19,"tag":20,"props":574,"children":575},{},[576,581,583,589],{"type":19,"tag":49,"props":577,"children":578},{},[579],{"type":24,"value":580},"2. Add an email input.",{"type":24,"value":582}," Webhook Relay gives you back a unique address of the form ",{"type":19,"tag":75,"props":584,"children":586},{"className":585},[],[587],{"type":24,"value":588},"\u003Cuuid>@in.webhookrelay-mail.com",{"type":24,"value":590},". Anything sent there is parsed and forwarded to the bucket's outputs.",{"type":19,"tag":20,"props":592,"children":593},{},[594,599],{"type":19,"tag":49,"props":595,"children":596},{},[597],{"type":24,"value":598},"3. Add your API as the output.",{"type":24,"value":600}," Point the bucket's output at your endpoint's URL. Static headers and auth can be set on the output itself, or in the transform below — whichever you prefer.",{"type":19,"tag":20,"props":602,"children":603},{},[604,609,611,617],{"type":19,"tag":49,"props":605,"children":606},{},[607],{"type":24,"value":608},"4. Attach a transform.",{"type":24,"value":610}," Add the ",{"type":19,"tag":30,"props":612,"children":614},{"href":613},"/docs/webhooks/functions",[615],{"type":24,"value":616},"transform function",{"type":24,"value":618}," below so the parsed email is reshaped into your API's schema before delivery.",{"type":19,"tag":20,"props":620,"children":621},{},[622,627,629,634],{"type":19,"tag":49,"props":623,"children":624},{},[625],{"type":24,"value":626},"5. Send a test email.",{"type":24,"value":628}," Email your ",{"type":19,"tag":75,"props":630,"children":632},{"className":631},[],[633],{"type":24,"value":588},{"type":24,"value":635}," address from any client. Within a second or two the request reaches your API. If it doesn't, open the request log in your dashboard to see exactly what was received and delivered.",{"type":19,"tag":57,"props":637,"children":639},{"id":638},"the-transform",[640],{"type":24,"value":641},"The transform",{"type":19,"tag":20,"props":643,"children":644},{},[645,647,652,654,660,662,668,670,676],{"type":24,"value":646},"Webhook Relay ",{"type":19,"tag":30,"props":648,"children":649},{"href":613},[650],{"type":24,"value":651},"functions",{"type":24,"value":653}," hand you the incoming request body as a string in ",{"type":19,"tag":75,"props":655,"children":657},{"className":656},[],[658],{"type":24,"value":659},"r.body",{"type":24,"value":661},". Parse it, build your API's request, and write it back with ",{"type":19,"tag":75,"props":663,"children":665},{"className":664},[],[666],{"type":24,"value":667},"r.setBody()",{"type":24,"value":669}," and ",{"type":19,"tag":75,"props":671,"children":673},{"className":672},[],[674],{"type":24,"value":675},"r.setHeader()",{"type":24,"value":677},":",{"type":19,"tag":69,"props":679,"children":683},{"className":680,"code":681,"language":682,"meta":7,"style":7},"language-js shiki shiki-themes github-dark","const e = JSON.parse(r.body);\nr.setBody(JSON.stringify({ sender: e.from, title: e.subject, body: e.text, received_at: e.date }));\nr.setHeader(\"Authorization\", \"Bearer YOUR_API_TOKEN\");\nr.setHeader(\"Content-Type\", \"application/json\");\n","js",[684],{"type":19,"tag":75,"props":685,"children":686},{"__ignoreMap":7},[687,727,764,799],{"type":19,"tag":79,"props":688,"children":689},{"class":81,"line":82},[690,696,701,706,711,716,722],{"type":19,"tag":79,"props":691,"children":693},{"style":692},"--shiki-default:#F97583",[694],{"type":24,"value":695},"const",{"type":19,"tag":79,"props":697,"children":698},{"style":122},[699],{"type":24,"value":700}," e",{"type":19,"tag":79,"props":702,"children":703},{"style":692},[704],{"type":24,"value":705}," =",{"type":19,"tag":79,"props":707,"children":708},{"style":122},[709],{"type":24,"value":710}," JSON",{"type":19,"tag":79,"props":712,"children":713},{"style":112},[714],{"type":24,"value":715},".",{"type":19,"tag":79,"props":717,"children":719},{"style":718},"--shiki-default:#B392F0",[720],{"type":24,"value":721},"parse",{"type":19,"tag":79,"props":723,"children":724},{"style":112},[725],{"type":24,"value":726},"(r.body);\n",{"type":19,"tag":79,"props":728,"children":729},{"class":81,"line":118},[730,735,740,745,750,754,759],{"type":19,"tag":79,"props":731,"children":732},{"style":112},[733],{"type":24,"value":734},"r.",{"type":19,"tag":79,"props":736,"children":737},{"style":718},[738],{"type":24,"value":739},"setBody",{"type":19,"tag":79,"props":741,"children":742},{"style":112},[743],{"type":24,"value":744},"(",{"type":19,"tag":79,"props":746,"children":747},{"style":122},[748],{"type":24,"value":749},"JSON",{"type":19,"tag":79,"props":751,"children":752},{"style":112},[753],{"type":24,"value":715},{"type":19,"tag":79,"props":755,"children":756},{"style":718},[757],{"type":24,"value":758},"stringify",{"type":19,"tag":79,"props":760,"children":761},{"style":112},[762],{"type":24,"value":763},"({ sender: e.from, title: e.subject, body: e.text, received_at: e.date }));\n",{"type":19,"tag":79,"props":765,"children":766},{"class":81,"line":144},[767,771,776,780,785,789,794],{"type":19,"tag":79,"props":768,"children":769},{"style":112},[770],{"type":24,"value":734},{"type":19,"tag":79,"props":772,"children":773},{"style":718},[774],{"type":24,"value":775},"setHeader",{"type":19,"tag":79,"props":777,"children":778},{"style":112},[779],{"type":24,"value":744},{"type":19,"tag":79,"props":781,"children":782},{"style":133},[783],{"type":24,"value":784},"\"Authorization\"",{"type":19,"tag":79,"props":786,"children":787},{"style":112},[788],{"type":24,"value":452},{"type":19,"tag":79,"props":790,"children":791},{"style":133},[792],{"type":24,"value":793},"\"Bearer YOUR_API_TOKEN\"",{"type":19,"tag":79,"props":795,"children":796},{"style":112},[797],{"type":24,"value":798},");\n",{"type":19,"tag":79,"props":800,"children":801},{"class":81,"line":166},[802,806,810,814,819,823,828],{"type":19,"tag":79,"props":803,"children":804},{"style":112},[805],{"type":24,"value":734},{"type":19,"tag":79,"props":807,"children":808},{"style":718},[809],{"type":24,"value":775},{"type":19,"tag":79,"props":811,"children":812},{"style":112},[813],{"type":24,"value":744},{"type":19,"tag":79,"props":815,"children":816},{"style":133},[817],{"type":24,"value":818},"\"Content-Type\"",{"type":19,"tag":79,"props":820,"children":821},{"style":112},[822],{"type":24,"value":452},{"type":19,"tag":79,"props":824,"children":825},{"style":133},[826],{"type":24,"value":827},"\"application/json\"",{"type":19,"tag":79,"props":829,"children":830},{"style":112},[831],{"type":24,"value":798},{"type":19,"tag":20,"props":833,"children":834},{},[835],{"type":24,"value":836},"That's the complete bridge: the email is mapped field-for-field onto your API's schema and authenticated with your token.",{"type":19,"tag":20,"props":838,"children":839},{},[840,842,847,849,855,857,863],{"type":24,"value":841},"The same function is the place to ",{"type":19,"tag":49,"props":843,"children":844},{},[845],{"type":24,"value":846},"drop",{"type":24,"value":848}," messages you don't want. Inspect any parsed field and short-circuit with ",{"type":19,"tag":75,"props":850,"children":852},{"className":851},[],[853],{"type":24,"value":854},"r.setResponseStatus()",{"type":24,"value":856}," plus an early ",{"type":19,"tag":75,"props":858,"children":860},{"className":859},[],[861],{"type":24,"value":862},"return",{"type":24,"value":864}," so the request never reaches your endpoint:",{"type":19,"tag":69,"props":866,"children":868},{"className":680,"code":867,"language":682,"meta":7,"style":7},"const e = JSON.parse(r.body);\nif (e.dmarc !== \"pass\") {\n  r.setResponseStatus(202);\n  return; // discard spoofed mail — never hits your API\n}\n",[869],{"type":19,"tag":75,"props":870,"children":871},{"__ignoreMap":7},[872,903,931,957,976],{"type":19,"tag":79,"props":873,"children":874},{"class":81,"line":82},[875,879,883,887,891,895,899],{"type":19,"tag":79,"props":876,"children":877},{"style":692},[878],{"type":24,"value":695},{"type":19,"tag":79,"props":880,"children":881},{"style":122},[882],{"type":24,"value":700},{"type":19,"tag":79,"props":884,"children":885},{"style":692},[886],{"type":24,"value":705},{"type":19,"tag":79,"props":888,"children":889},{"style":122},[890],{"type":24,"value":710},{"type":19,"tag":79,"props":892,"children":893},{"style":112},[894],{"type":24,"value":715},{"type":19,"tag":79,"props":896,"children":897},{"style":718},[898],{"type":24,"value":721},{"type":19,"tag":79,"props":900,"children":901},{"style":112},[902],{"type":24,"value":726},{"type":19,"tag":79,"props":904,"children":905},{"class":81,"line":118},[906,911,916,921,926],{"type":19,"tag":79,"props":907,"children":908},{"style":692},[909],{"type":24,"value":910},"if",{"type":19,"tag":79,"props":912,"children":913},{"style":112},[914],{"type":24,"value":915}," (e.dmarc ",{"type":19,"tag":79,"props":917,"children":918},{"style":692},[919],{"type":24,"value":920},"!==",{"type":19,"tag":79,"props":922,"children":923},{"style":133},[924],{"type":24,"value":925}," \"pass\"",{"type":19,"tag":79,"props":927,"children":928},{"style":112},[929],{"type":24,"value":930},") {\n",{"type":19,"tag":79,"props":932,"children":933},{"class":81,"line":144},[934,939,944,948,953],{"type":19,"tag":79,"props":935,"children":936},{"style":112},[937],{"type":24,"value":938},"  r.",{"type":19,"tag":79,"props":940,"children":941},{"style":718},[942],{"type":24,"value":943},"setResponseStatus",{"type":19,"tag":79,"props":945,"children":946},{"style":112},[947],{"type":24,"value":744},{"type":19,"tag":79,"props":949,"children":950},{"style":122},[951],{"type":24,"value":952},"202",{"type":19,"tag":79,"props":954,"children":955},{"style":112},[956],{"type":24,"value":798},{"type":19,"tag":79,"props":958,"children":959},{"class":81,"line":166},[960,965,970],{"type":19,"tag":79,"props":961,"children":962},{"style":692},[963],{"type":24,"value":964},"  return",{"type":19,"tag":79,"props":966,"children":967},{"style":112},[968],{"type":24,"value":969},"; ",{"type":19,"tag":79,"props":971,"children":973},{"style":972},"--shiki-default:#6A737D",[974],{"type":24,"value":975},"// discard spoofed mail — never hits your API\n",{"type":19,"tag":79,"props":977,"children":978},{"class":81,"line":188},[979],{"type":19,"tag":79,"props":980,"children":981},{"style":112},[982],{"type":24,"value":543},{"type":19,"tag":20,"props":984,"children":985},{},[986,988,994],{"type":24,"value":987},"Only the messages you actually want make the trip. For coarser control, pair this with the From-address allowlist in ",{"type":19,"tag":30,"props":989,"children":991},{"href":990},"/docs/email/filtering-and-policy",[992],{"type":24,"value":993},"filtering and policy",{"type":24,"value":715},{"type":19,"tag":20,"props":996,"children":997},{},[998,1000,1006],{"type":24,"value":999},"Outputs aren't limited to public URLs. With the relay agent, Webhook Relay can ",{"type":19,"tag":30,"props":1001,"children":1003},{"href":1002},"/webhooks",[1004],{"type":24,"value":1005},"deliver to a server behind a firewall",{"type":24,"value":1007}," or on localhost with no public IP — useful for internal services and local development. Failed deliveries are retried, so a brief outage on your side doesn't drop email.",{"type":19,"tag":57,"props":1009,"children":1011},{"id":1010},"get-started",[1012],{"type":24,"value":1013},"Get started",{"type":19,"tag":20,"props":1015,"children":1016},{},[1017,1019,1025],{"type":24,"value":1018},"Turning inbound mail into API requests is one case of a broader pattern: ",{"type":19,"tag":30,"props":1020,"children":1022},{"href":1021},"/email-to-webhook",[1023],{"type":24,"value":1024},"Email to Webhook",{"type":24,"value":1026},". Once an email is JSON, you can route it anywhere a webhook can go.",{"type":19,"tag":20,"props":1028,"children":1029},{},[1030,1037],{"type":19,"tag":30,"props":1031,"children":1034},{"href":1032,"rel":1033},"https://my.webhookrelay.com/register",[34],[1035],{"type":24,"value":1036},"Create a free Webhook Relay account",{"type":24,"value":1038},", add an email input, and start ingesting inbound email as clean API requests in a few minutes.",{"type":19,"tag":1040,"props":1041,"children":1042},"style",{},[1043],{"type":24,"value":1044},"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);}",{"title":7,"searchDepth":144,"depth":144,"links":1046},[1047,1048,1049,1050],{"id":59,"depth":118,"text":62},{"id":559,"depth":118,"text":562},{"id":638,"depth":118,"text":641},{"id":1010,"depth":118,"text":1013},"markdown","content:docs:tutorials:email:api.md","content","docs/tutorials/email/api.md","docs/tutorials/email/api","md",{"loc":4},[1059,1062,1065,1068,1071,1074,1077,1080],{"_path":1060,"title":1061},"/docs/installation/cli","CLI",{"_path":1063,"title":1064},"/docs/installation/docker","Docker container",{"_path":1066,"title":1067},"/docs/installation/docker-compose","Docker Compose",{"_path":1069,"title":1070},"/docs/installation/kubernetes","Kubernetes",{"_path":1072,"title":1073},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":1075,"title":1076},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":1078,"title":1079},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":1081,"title":1082},"/docs/installation/behind-proxy","HTTP proxy configuration",[1084],{"_path":1085,"title":1086},"/docs/webhooks/internal/localhost","Receiving webhooks on localhost",[1088,1091],{"_path":1089,"title":1090},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":1092,"title":1093},"/docs/webhooks/public/multiple-destination-urls","Multiple destinations",[1095,1098,1101,1104],{"_path":1096,"title":1097},"/docs/webhooks/auth/username-password","Username and password",{"_path":1099,"title":1100},"/docs/webhooks/auth/hmac","HMAC",{"_path":1102,"title":1103},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":1105,"title":1106},"/docs/webhooks/auth/http-method","Auth using request method",[1108],{"_path":1109,"title":1110},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",[1112,1115,1118,1121,1124,1127,1130],{"_path":1113,"title":1114},"/docs/service-connections","Service Connections",{"_path":1116,"title":1117},"/docs/service-connections/aws_s3","AWS S3",{"_path":1119,"title":1120},"/docs/service-connections/aws_sns","AWS SNS",{"_path":1122,"title":1123},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":1125,"title":1126},"/docs/service-connections/azure","Azure",{"_path":1128,"title":1129},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":1131,"title":1132},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",[1134,1136,1138],{"_path":42,"title":1135},"Receive emails as webhooks",{"_path":551,"title":1137},"Email webhook payload",{"_path":990,"title":1139},"Sender filtering & policy",[1141,1144],{"_path":1142,"title":1143},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":1145,"title":1146},"/docs/tunnels/regions","Regions",[1148,1151,1154,1157],{"_path":1149,"title":1150},"/docs/account/account-management","Account management",{"_path":1152,"title":1153},"/docs/account/mfa","Multi-factor authentication (MFA)",{"_path":1155,"title":1156},"/docs/account/team","Teams and sub-accounts",{"_path":1158,"title":1159},"/docs/account/billing-and-subscriptions","Billing & subscriptions",[1161,1164,1167,1170,1173,1176],{"_path":1162,"title":1163},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":1165,"title":1166},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":1168,"title":1169},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":1171,"title":1172},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":1174,"title":1175},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":1177,"title":1178},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",[1180,1183,1184,1187,1190,1193,1196,1199],{"_path":1181,"title":1182},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":4,"title":8},{"_path":1185,"title":1186},"/docs/tutorials/email/database","Email to Database",{"_path":1188,"title":1189},"/docs/tutorials/email/discord","Email to Discord",{"_path":1191,"title":1192},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":1194,"title":1195},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":1197,"title":1198},"/docs/tutorials/email/notion","Email to Notion",{"_path":1200,"title":1201},"/docs/tutorials/email/slack","Email to Slack",[1203],{"_path":1204,"title":1205},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",[1207,1210],{"_path":1208,"title":1209},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":1211,"title":1212},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",[1214,1217,1220],{"_path":1215,"title":1216},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":1218,"title":1219},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":1221,"title":1222},"/docs/tutorials/edge/node-red","Node-RED",[1224,1227,1230,1233,1236,1239,1242,1245,1248,1251,1253,1256],{"_path":1225,"title":1226},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":1228,"title":1229},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":1231,"title":1232},"/docs/webhooks/functions/modify-request","Read, write request data",{"_path":1234,"title":1235},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":1237,"title":1238},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":1240,"title":1241},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":1243,"title":1244},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":1246,"title":1247},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":1249,"title":1250},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":1252,"title":1205},"/docs/webhooks/functions/big-query",{"_path":1254,"title":1255},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":613,"title":1257},"Functions",1782718126717]