[{"data":1,"prerenderedAt":1655},["ShallowReactive",2],{"guide:getting-started":3},{"id":4,"title":5,"body":6,"date":1643,"description":1644,"extension":1645,"meta":1646,"navigation":453,"path":1647,"seo":1648,"stem":1649,"tags":1650,"updated":1653,"__hash__":1654},"guides\u002Fdocs\u002Fgetting-started.md","Getting Started",{"type":7,"value":8,"toc":1634},"minimark",[9,36,41,44,52,56,82,93,97,108,111,114,140,148,152,167,170,173,574,598,623,789,808,812,820,1185,1227,1237,1313,1320,1324,1337,1382,1406,1409,1570,1582,1586,1623,1630],[10,11,12,13,17,18,21,22,25,26,29,30,35],"p",{},"Wapito turns a WhatsApp number you already own into a REST API with webhooks. There are four\nthings between you and a working integration: a ",[14,15,16],"strong",{},"channel"," (one linked number), its ",[14,19,20],{},"token",",\na ",[14,23,24],{},"linked phone",", and a ",[14,27,28],{},"webhook"," so events reach you. This guide walks through all four in\nthe order they happen. Nothing here needs Meta approval, a message template or a business\nverification — and nothing here is official either, which is worth reading about in the\n",[31,32,34],"a",{"href":33},"\u002Fdocs\u002Fanti-ban-guide\u002F","anti-ban guide"," before you point real traffic at a number you care about.",[37,38,40],"h2",{"id":39},"before-you-start","Before you start",[10,42,43],{},"You need a phone with WhatsApp installed and a number you can afford to lose. The free Sandbox\nplan gives you one channel, 150 sent messages a day and 1,000 API requests a month, with webhooks\non, which is enough to build and test everything on this page. A card is not needed.",[10,45,46,47,51],{},"There is one base URL for everyone: ",[48,49,50],"code",{},"https:\u002F\u002Fapi.wapito.com\u002Fv1",". A sandbox channel uses the same\nhost with lower limits; there is no separate sandbox environment and nothing to switch when you\nupgrade.",[37,53,55],{"id":54},"_1-create-a-channel","1. Create a channel",[10,57,58,59,63,64,67,68,72,73,76,77,81],{},"Sign in at ",[31,60,62],{"href":61},"\u002Fapp\u002F","wapito.com\u002Fapp"," and choose ",[14,65,66],{},"New channel",". Give it a name — only you see it;\nit is how the channel is labelled in the dashboard. Under ",[69,70,71],"em",{},"Advanced"," you can pick the protocol\nengine. Leave it on ",[14,74,75],{},"GOWS"," unless a specific feature in the ",[31,78,80],{"href":79},"\u002Fdocs\u002Fapi\u002F","API reference"," says it\nneeds NOWEB; GOWS is the default because it is the steadier of the two for everyday messaging.",[10,83,84,85,88,89,92],{},"Choose ",[14,86,87],{},"Create",". The channel exists from that moment, with status ",[48,90,91],{},"created"," until a phone is\nlinked, and the dialog moves to its second step: the token.",[37,94,96],{"id":95},"_2-copy-the-token","2. Copy the token",[10,98,99,100,103,104,107],{},"The token is shown once, right there in the dialog, and stays visible on the channel's ",[14,101,102],{},"API","\ntab until you reload the page. It looks like ",[48,105,106],{},"wpt_"," followed by forty letters and digits. Copy it\ninto your secret store now: Wapito keeps only a hash, so after a reload the dashboard can show a\nmasked preview and offer to rotate, but never the token itself.",[10,109,110],{},"Close the dialog and you land on the channel page with five tabs: Connect, Settings, API, Logs\nand Usage.",[10,112,113],{},"Every request authenticates with that one token as a Bearer header. The token is bound to the\nchannel, which is why no request carries a channel id:",[115,116,121],"pre",{"className":117,"code":118,"language":119,"meta":120,"style":120},"language-http shiki shiki-themes github-light-default github-dark-default","Authorization: Bearer wpt_9f2c4a7b1de35086c4b2e7a0f3d8c1b6a9e2f5d4\n","http","",[48,122,123],{"__ignoreMap":120},[124,125,128,132,136],"span",{"class":126,"line":127},"line",1,[124,129,131],{"class":130},"sjgCt","Authorization",[124,133,135],{"class":134},"sjeE4",":",[124,137,139],{"class":138},"sSVrQ"," Bearer wpt_9f2c4a7b1de35086c4b2e7a0f3d8c1b6a9e2f5d4\n",[10,141,142,143,147],{},"Read ",[31,144,146],{"href":145},"\u002Fdocs\u002Fauthentication\u002F","Authentication"," for what a bad or rotated token returns and how to\nkeep the token out of logs and URLs.",[37,149,151],{"id":150},"_3-link-the-phone","3. Link the phone",[10,153,154,155,158,159,162,163,166],{},"Open the ",[14,156,157],{},"Connect"," tab. It opens on the pairing code, which is the recommended path: enter the\nphone number in international format and Wapito asks WhatsApp for an eight-character code that\nstays valid for about two minutes. On the phone go to ",[14,160,161],{},"Settings → Linked devices → Link a\ndevice",", tap ",[14,164,165],{},"Link with phone number instead",", and type the code.",[10,168,169],{},"If you would rather scan, the QR code is one link away on the same tab. It refreshes itself while\nyou look at it; the panel switches on its own the moment the phone confirms.",[10,171,172],{},"You can also drive this step from the API instead of the dashboard — useful when the phone belongs\nto a customer you are onboarding remotely:",[174,175,176,239,426],"code-group",{},[115,177,182],{"className":178,"code":179,"filename":180,"language":181,"meta":120,"style":120},"language-bash shiki shiki-themes github-light-default github-dark-default","curl -X POST https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code \\\n  -H \"Authorization: Bearer $WAPITO_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"phone\": \"+15557654321\"}'\n","curl","bash",[48,183,184,202,220,230],{"__ignoreMap":120},[124,185,186,189,193,196,199],{"class":126,"line":127},[124,187,180],{"class":188},"sTDnQ",[124,190,192],{"class":191},"sHrmB"," -X",[124,194,195],{"class":138}," POST",[124,197,198],{"class":138}," https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code",[124,200,201],{"class":134}," \\\n",[124,203,205,208,211,215,218],{"class":126,"line":204},2,[124,206,207],{"class":191},"  -H",[124,209,210],{"class":138}," \"Authorization: Bearer ",[124,212,214],{"class":213},"s4rv2","$WAPITO_TOKEN",[124,216,217],{"class":138},"\"",[124,219,201],{"class":134},[124,221,223,225,228],{"class":126,"line":222},3,[124,224,207],{"class":191},[124,226,227],{"class":138}," \"Content-Type: application\u002Fjson\"",[124,229,201],{"class":134},[124,231,233,236],{"class":126,"line":232},4,[124,234,235],{"class":191},"  -d",[124,237,238],{"class":138}," '{\"phone\": \"+15557654321\"}'\n",[115,240,245],{"className":241,"code":242,"filename":243,"language":244,"meta":120,"style":120},"language-javascript shiki shiki-themes github-light-default github-dark-default","const res = await fetch('https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.WAPITO_TOKEN}`,\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ phone: '+15557654321' }),\n});\nconst { code, expires_in } = await res.json();\nconsole.log(`Type ${code} into WhatsApp within ${expires_in} seconds`);\n","Node","javascript",[48,246,247,274,285,290,317,331,337,360,366,399],{"__ignoreMap":120},[124,248,249,252,255,258,261,265,268,271],{"class":126,"line":127},[124,250,251],{"class":134},"const",[124,253,254],{"class":191}," res",[124,256,257],{"class":134}," =",[124,259,260],{"class":134}," await",[124,262,264],{"class":263},"sbjLL"," fetch",[124,266,267],{"class":213},"(",[124,269,270],{"class":138},"'https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code'",[124,272,273],{"class":213},", {\n",[124,275,276,279,282],{"class":126,"line":204},[124,277,278],{"class":213},"  method: ",[124,280,281],{"class":138},"'POST'",[124,283,284],{"class":213},",\n",[124,286,287],{"class":126,"line":222},[124,288,289],{"class":213},"  headers: {\n",[124,291,292,295,298,301,304,307,309,312,315],{"class":126,"line":232},[124,293,294],{"class":213},"    Authorization: ",[124,296,297],{"class":138},"`Bearer ${",[124,299,300],{"class":213},"process",[124,302,303],{"class":138},".",[124,305,306],{"class":213},"env",[124,308,303],{"class":138},[124,310,311],{"class":191},"WAPITO_TOKEN",[124,313,314],{"class":138},"}`",[124,316,284],{"class":213},[124,318,320,323,326,329],{"class":126,"line":319},5,[124,321,322],{"class":138},"    'Content-Type'",[124,324,325],{"class":213},": ",[124,327,328],{"class":138},"'application\u002Fjson'",[124,330,284],{"class":213},[124,332,334],{"class":126,"line":333},6,[124,335,336],{"class":213},"  },\n",[124,338,340,343,346,348,351,354,357],{"class":126,"line":339},7,[124,341,342],{"class":213},"  body: ",[124,344,345],{"class":191},"JSON",[124,347,303],{"class":213},[124,349,350],{"class":263},"stringify",[124,352,353],{"class":213},"({ phone: ",[124,355,356],{"class":138},"'+15557654321'",[124,358,359],{"class":213}," }),\n",[124,361,363],{"class":126,"line":362},8,[124,364,365],{"class":213},"});\n",[124,367,369,371,374,376,379,382,385,388,390,393,396],{"class":126,"line":368},9,[124,370,251],{"class":134},[124,372,373],{"class":213}," { ",[124,375,48],{"class":191},[124,377,378],{"class":213},", ",[124,380,381],{"class":191},"expires_in",[124,383,384],{"class":213}," } ",[124,386,387],{"class":134},"=",[124,389,260],{"class":134},[124,391,392],{"class":213}," res.",[124,394,395],{"class":263},"json",[124,397,398],{"class":213},"();\n",[124,400,402,405,408,410,413,415,418,420,423],{"class":126,"line":401},10,[124,403,404],{"class":213},"console.",[124,406,407],{"class":263},"log",[124,409,267],{"class":213},[124,411,412],{"class":138},"`Type ${",[124,414,48],{"class":213},[124,416,417],{"class":138},"} into WhatsApp within ${",[124,419,381],{"class":213},[124,421,422],{"class":138},"} seconds`",[124,424,425],{"class":213},");\n",[115,427,432],{"className":428,"code":429,"filename":430,"language":431,"meta":120,"style":120},"language-python shiki shiki-themes github-light-default github-dark-default","import os\nimport requests\n\nres = requests.post(\n    \"https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code\",\n    headers={\"Authorization\": f\"Bearer {os.environ['WAPITO_TOKEN']}\"},\n    json={\"phone\": \"+15557654321\"},\n    timeout=(5, 30),\n)\nres.raise_for_status()\nprint(res.json())  # {\"code\": \"J7K2-QW31\", \"expires_in\": 120}\n","Python","python",[48,433,434,442,449,455,465,472,512,531,551,556,561],{"__ignoreMap":120},[124,435,436,439],{"class":126,"line":127},[124,437,438],{"class":134},"import",[124,440,441],{"class":213}," os\n",[124,443,444,446],{"class":126,"line":204},[124,445,438],{"class":134},[124,447,448],{"class":213}," requests\n",[124,450,451],{"class":126,"line":222},[124,452,454],{"emptyLinePlaceholder":453},true,"\n",[124,456,457,460,462],{"class":126,"line":232},[124,458,459],{"class":213},"res ",[124,461,387],{"class":134},[124,463,464],{"class":213}," requests.post(\n",[124,466,467,470],{"class":126,"line":319},[124,468,469],{"class":138},"    \"https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel\u002Fpairing-code\"",[124,471,284],{"class":213},[124,473,474,477,479,482,485,487,490,493,495,498,501,504,507,509],{"class":126,"line":333},[124,475,476],{"class":188},"    headers",[124,478,387],{"class":134},[124,480,481],{"class":213},"{",[124,483,484],{"class":138},"\"Authorization\"",[124,486,325],{"class":213},[124,488,489],{"class":134},"f",[124,491,492],{"class":138},"\"Bearer ",[124,494,481],{"class":134},[124,496,497],{"class":213},"os.environ[",[124,499,500],{"class":138},"'WAPITO_TOKEN'",[124,502,503],{"class":213},"]",[124,505,506],{"class":134},"}",[124,508,217],{"class":138},[124,510,511],{"class":213},"},\n",[124,513,514,517,519,521,524,526,529],{"class":126,"line":339},[124,515,516],{"class":188},"    json",[124,518,387],{"class":134},[124,520,481],{"class":213},[124,522,523],{"class":138},"\"phone\"",[124,525,325],{"class":213},[124,527,528],{"class":138},"\"+15557654321\"",[124,530,511],{"class":213},[124,532,533,536,538,540,543,545,548],{"class":126,"line":362},[124,534,535],{"class":188},"    timeout",[124,537,387],{"class":134},[124,539,267],{"class":213},[124,541,542],{"class":191},"5",[124,544,378],{"class":213},[124,546,547],{"class":191},"30",[124,549,550],{"class":213},"),\n",[124,552,553],{"class":126,"line":368},[124,554,555],{"class":213},")\n",[124,557,558],{"class":126,"line":401},[124,559,560],{"class":213},"res.raise_for_status()\n",[124,562,564,567,570],{"class":126,"line":563},11,[124,565,566],{"class":191},"print",[124,568,569],{"class":213},"(res.json())  ",[124,571,573],{"class":572},"sU953","# {\"code\": \"J7K2-QW31\", \"expires_in\": 120}\n",[10,575,576,577,580,581,584,585,588,589,594,595,597],{},"The status moves from ",[48,578,579],{},"pairing"," (or ",[48,582,583],{},"qr",") to ",[48,586,587],{},"connected",". Watch it with\n",[590,591],"endpoint-ref",{"label":592,"op":593,"tag":16},"GET \u002Fchannel","get-channel",", or subscribe to the ",[48,596,16],{},"\nwebhook event and stop polling — the dashboard itself reads the same state, so the two never\ndisagree:",[115,599,601],{"className":178,"code":600,"language":181,"meta":120,"style":120},"curl https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel \\\n  -H \"Authorization: Bearer $WAPITO_TOKEN\"\n",[48,602,603,612],{"__ignoreMap":120},[124,604,605,607,610],{"class":126,"line":127},[124,606,180],{"class":188},[124,608,609],{"class":138}," https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fchannel",[124,611,201],{"class":134},[124,613,614,616,618,620],{"class":126,"line":204},[124,615,207],{"class":191},[124,617,210],{"class":138},[124,619,214],{"class":213},[124,621,622],{"class":138},"\"\n",[115,624,627],{"className":625,"code":626,"language":395,"meta":120,"style":120},"language-json shiki shiki-themes github-light-default github-dark-default","{\n  \"id\": \"ch_01JRQ8F4X9N2K7YB3C5V6W8H0T\",\n  \"name\": \"Acme Support\",\n  \"status\": \"connected\",\n  \"phone\": \"15557654321\",\n  \"engine\": \"gows\",\n  \"plan\": \"sandbox\",\n  \"settings\": { \"send_delay_ms\": 1500, \"typing_simulation\": \"auto\", \"auto_read\": false, \"reject_calls\": true, \"include_raw\": false, \"proxy\": null },\n  \"webhooks_count\": 0\n}\n",[48,628,629,634,646,658,670,682,694,706,774,784],{"__ignoreMap":120},[124,630,631],{"class":126,"line":127},[124,632,633],{"class":213},"{\n",[124,635,636,639,641,644],{"class":126,"line":204},[124,637,638],{"class":130},"  \"id\"",[124,640,325],{"class":213},[124,642,643],{"class":138},"\"ch_01JRQ8F4X9N2K7YB3C5V6W8H0T\"",[124,645,284],{"class":213},[124,647,648,651,653,656],{"class":126,"line":222},[124,649,650],{"class":130},"  \"name\"",[124,652,325],{"class":213},[124,654,655],{"class":138},"\"Acme Support\"",[124,657,284],{"class":213},[124,659,660,663,665,668],{"class":126,"line":232},[124,661,662],{"class":130},"  \"status\"",[124,664,325],{"class":213},[124,666,667],{"class":138},"\"connected\"",[124,669,284],{"class":213},[124,671,672,675,677,680],{"class":126,"line":319},[124,673,674],{"class":130},"  \"phone\"",[124,676,325],{"class":213},[124,678,679],{"class":138},"\"15557654321\"",[124,681,284],{"class":213},[124,683,684,687,689,692],{"class":126,"line":333},[124,685,686],{"class":130},"  \"engine\"",[124,688,325],{"class":213},[124,690,691],{"class":138},"\"gows\"",[124,693,284],{"class":213},[124,695,696,699,701,704],{"class":126,"line":339},[124,697,698],{"class":130},"  \"plan\"",[124,700,325],{"class":213},[124,702,703],{"class":138},"\"sandbox\"",[124,705,284],{"class":213},[124,707,708,711,714,717,719,722,724,727,729,732,734,737,739,742,744,747,749,752,754,757,759,761,763,766,768,771],{"class":126,"line":362},[124,709,710],{"class":130},"  \"settings\"",[124,712,713],{"class":213},": { ",[124,715,716],{"class":130},"\"send_delay_ms\"",[124,718,325],{"class":213},[124,720,721],{"class":191},"1500",[124,723,378],{"class":213},[124,725,726],{"class":130},"\"typing_simulation\"",[124,728,325],{"class":213},[124,730,731],{"class":138},"\"auto\"",[124,733,378],{"class":213},[124,735,736],{"class":130},"\"auto_read\"",[124,738,325],{"class":213},[124,740,741],{"class":191},"false",[124,743,378],{"class":213},[124,745,746],{"class":130},"\"reject_calls\"",[124,748,325],{"class":213},[124,750,751],{"class":191},"true",[124,753,378],{"class":213},[124,755,756],{"class":130},"\"include_raw\"",[124,758,325],{"class":213},[124,760,741],{"class":191},[124,762,378],{"class":213},[124,764,765],{"class":130},"\"proxy\"",[124,767,325],{"class":213},[124,769,770],{"class":191},"null",[124,772,773],{"class":213}," },\n",[124,775,776,779,781],{"class":126,"line":368},[124,777,778],{"class":130},"  \"webhooks_count\"",[124,780,325],{"class":213},[124,782,783],{"class":191},"0\n",[124,785,786],{"class":126,"line":401},[124,787,788],{"class":213},"}\n",[790,791,794],"callout",{"type":792,"title":793},"info","Keep the phone on",[10,795,796,797,800,801,804,805,807],{},"A linked device is still a companion of the phone. The number keeps working while the phone is\noff for a while, but leave it switched off for days and WhatsApp will eventually drop the link;\nthe channel then reports ",[48,798,799],{},"disconnected"," and, if the session was cleared on the phone,\n",[48,802,803],{},"logged_out",". The dashboard shows both states, and the ",[48,806,16],{}," event carries them.",[37,809,811],{"id":810},"_4-send-your-first-message","4. Send your first message",[10,813,814,815,819],{},"Send a text to a number that already has a conversation with the linked phone — your own second\nnumber, or a colleague who messages you first. That matters more than it sounds: a brand-new\nchannel writing to strangers is exactly what the ",[31,816,818],{"href":817},"\u002Fdocs\u002Frate-limits\u002F","cold-send guard"," exists to\nslow down, and a first test that trips a limit teaches the wrong lesson.",[174,821,822,867,1037],{},[115,823,825],{"className":178,"code":824,"filename":180,"language":181,"meta":120,"style":120},"curl -X POST https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext \\\n  -H \"Authorization: Bearer $WAPITO_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"to\": \"+15551234567\", \"body\": \"Hello from Wapito 👋\"}'\n",[48,826,827,840,852,860],{"__ignoreMap":120},[124,828,829,831,833,835,838],{"class":126,"line":127},[124,830,180],{"class":188},[124,832,192],{"class":191},[124,834,195],{"class":138},[124,836,837],{"class":138}," https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext",[124,839,201],{"class":134},[124,841,842,844,846,848,850],{"class":126,"line":204},[124,843,207],{"class":191},[124,845,210],{"class":138},[124,847,214],{"class":213},[124,849,217],{"class":138},[124,851,201],{"class":134},[124,853,854,856,858],{"class":126,"line":222},[124,855,207],{"class":191},[124,857,227],{"class":138},[124,859,201],{"class":134},[124,861,862,864],{"class":126,"line":232},[124,863,235],{"class":191},[124,865,866],{"class":138}," '{\"to\": \"+15551234567\", \"body\": \"Hello from Wapito 👋\"}'\n",[115,868,870],{"className":241,"code":869,"filename":243,"language":244,"meta":120,"style":120},"const res = await fetch('https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.WAPITO_TOKEN}`,\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ to: '+15551234567', body: 'Hello from Wapito 👋' }),\n});\nif (!res.ok) throw new Error(JSON.stringify(await res.json()));\nconst message = await res.json();\nconsole.log(message.id, message.status); \u002F\u002F \"true_15551234567@s.whatsapp.net_3EB0…\" \"sent\"\n",[48,871,872,891,899,903,923,933,937,961,965,1008,1025],{"__ignoreMap":120},[124,873,874,876,878,880,882,884,886,889],{"class":126,"line":127},[124,875,251],{"class":134},[124,877,254],{"class":191},[124,879,257],{"class":134},[124,881,260],{"class":134},[124,883,264],{"class":263},[124,885,267],{"class":213},[124,887,888],{"class":138},"'https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext'",[124,890,273],{"class":213},[124,892,893,895,897],{"class":126,"line":204},[124,894,278],{"class":213},[124,896,281],{"class":138},[124,898,284],{"class":213},[124,900,901],{"class":126,"line":222},[124,902,289],{"class":213},[124,904,905,907,909,911,913,915,917,919,921],{"class":126,"line":232},[124,906,294],{"class":213},[124,908,297],{"class":138},[124,910,300],{"class":213},[124,912,303],{"class":138},[124,914,306],{"class":213},[124,916,303],{"class":138},[124,918,311],{"class":191},[124,920,314],{"class":138},[124,922,284],{"class":213},[124,924,925,927,929,931],{"class":126,"line":319},[124,926,322],{"class":138},[124,928,325],{"class":213},[124,930,328],{"class":138},[124,932,284],{"class":213},[124,934,935],{"class":126,"line":333},[124,936,336],{"class":213},[124,938,939,941,943,945,947,950,953,956,959],{"class":126,"line":339},[124,940,342],{"class":213},[124,942,345],{"class":191},[124,944,303],{"class":213},[124,946,350],{"class":263},[124,948,949],{"class":213},"({ to: ",[124,951,952],{"class":138},"'+15551234567'",[124,954,955],{"class":213},", body: ",[124,957,958],{"class":138},"'Hello from Wapito 👋'",[124,960,359],{"class":213},[124,962,963],{"class":126,"line":362},[124,964,365],{"class":213},[124,966,967,970,973,976,979,982,985,988,990,992,994,996,998,1001,1003,1005],{"class":126,"line":368},[124,968,969],{"class":134},"if",[124,971,972],{"class":213}," (",[124,974,975],{"class":134},"!",[124,977,978],{"class":213},"res.ok) ",[124,980,981],{"class":134},"throw",[124,983,984],{"class":134}," new",[124,986,987],{"class":263}," Error",[124,989,267],{"class":213},[124,991,345],{"class":191},[124,993,303],{"class":213},[124,995,350],{"class":263},[124,997,267],{"class":213},[124,999,1000],{"class":134},"await",[124,1002,392],{"class":213},[124,1004,395],{"class":263},[124,1006,1007],{"class":213},"()));\n",[124,1009,1010,1012,1015,1017,1019,1021,1023],{"class":126,"line":401},[124,1011,251],{"class":134},[124,1013,1014],{"class":191}," message",[124,1016,257],{"class":134},[124,1018,260],{"class":134},[124,1020,392],{"class":213},[124,1022,395],{"class":263},[124,1024,398],{"class":213},[124,1026,1027,1029,1031,1034],{"class":126,"line":563},[124,1028,404],{"class":213},[124,1030,407],{"class":263},[124,1032,1033],{"class":213},"(message.id, message.status); ",[124,1035,1036],{"class":572},"\u002F\u002F \"true_15551234567@s.whatsapp.net_3EB0…\" \"sent\"\n",[115,1038,1040],{"className":428,"code":1039,"filename":430,"language":431,"meta":120,"style":120},"import os\nimport requests\n\nres = requests.post(\n    \"https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext\",\n    headers={\"Authorization\": f\"Bearer {os.environ['WAPITO_TOKEN']}\"},\n    json={\"to\": \"+15551234567\", \"body\": \"Hello from Wapito 👋\"},\n    timeout=(5, 30),\n)\nres.raise_for_status()\nmessage = res.json()\nprint(message[\"id\"], message[\"status\"])\n",[48,1041,1042,1048,1054,1058,1066,1073,1103,1131,1147,1151,1155,1165],{"__ignoreMap":120},[124,1043,1044,1046],{"class":126,"line":127},[124,1045,438],{"class":134},[124,1047,441],{"class":213},[124,1049,1050,1052],{"class":126,"line":204},[124,1051,438],{"class":134},[124,1053,448],{"class":213},[124,1055,1056],{"class":126,"line":222},[124,1057,454],{"emptyLinePlaceholder":453},[124,1059,1060,1062,1064],{"class":126,"line":232},[124,1061,459],{"class":213},[124,1063,387],{"class":134},[124,1065,464],{"class":213},[124,1067,1068,1071],{"class":126,"line":319},[124,1069,1070],{"class":138},"    \"https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fmessages\u002Ftext\"",[124,1072,284],{"class":213},[124,1074,1075,1077,1079,1081,1083,1085,1087,1089,1091,1093,1095,1097,1099,1101],{"class":126,"line":333},[124,1076,476],{"class":188},[124,1078,387],{"class":134},[124,1080,481],{"class":213},[124,1082,484],{"class":138},[124,1084,325],{"class":213},[124,1086,489],{"class":134},[124,1088,492],{"class":138},[124,1090,481],{"class":134},[124,1092,497],{"class":213},[124,1094,500],{"class":138},[124,1096,503],{"class":213},[124,1098,506],{"class":134},[124,1100,217],{"class":138},[124,1102,511],{"class":213},[124,1104,1105,1107,1109,1111,1114,1116,1119,1121,1124,1126,1129],{"class":126,"line":339},[124,1106,516],{"class":188},[124,1108,387],{"class":134},[124,1110,481],{"class":213},[124,1112,1113],{"class":138},"\"to\"",[124,1115,325],{"class":213},[124,1117,1118],{"class":138},"\"+15551234567\"",[124,1120,378],{"class":213},[124,1122,1123],{"class":138},"\"body\"",[124,1125,325],{"class":213},[124,1127,1128],{"class":138},"\"Hello from Wapito 👋\"",[124,1130,511],{"class":213},[124,1132,1133,1135,1137,1139,1141,1143,1145],{"class":126,"line":362},[124,1134,535],{"class":188},[124,1136,387],{"class":134},[124,1138,267],{"class":213},[124,1140,542],{"class":191},[124,1142,378],{"class":213},[124,1144,547],{"class":191},[124,1146,550],{"class":213},[124,1148,1149],{"class":126,"line":368},[124,1150,555],{"class":213},[124,1152,1153],{"class":126,"line":401},[124,1154,560],{"class":213},[124,1156,1157,1160,1162],{"class":126,"line":563},[124,1158,1159],{"class":213},"message ",[124,1161,387],{"class":134},[124,1163,1164],{"class":213}," res.json()\n",[124,1166,1168,1170,1173,1176,1179,1182],{"class":126,"line":1167},12,[124,1169,566],{"class":191},[124,1171,1172],{"class":213},"(message[",[124,1174,1175],{"class":138},"\"id\"",[124,1177,1178],{"class":213},"], message[",[124,1180,1181],{"class":138},"\"status\"",[124,1183,1184],{"class":213},"])\n",[10,1186,1187,1190,1191,1194,1195,1198,1199,1202,1203,1206,1207,1210,1211,1214,1215,1218,1219,1222,1223,1226],{},[48,1188,1189],{},"to"," accepts ",[48,1192,1193],{},"+E.164",", bare digits, ",[48,1196,1197],{},"15551234567@s.whatsapp.net",", a group's ",[48,1200,1201],{},"@g.us"," id, an\n",[48,1204,1205],{},"@lid"," or a Channel's ",[48,1208,1209],{},"@newsletter"," id. The response is the message object — the same shape you\nwill later see as the ",[48,1212,1213],{},"data"," of a ",[48,1216,1217],{},"messages"," webhook event — with ",[48,1220,1221],{},"status: \"sent\"",". The call\nreturns as soon as the message is on the channel's send queue, which spaces sends about a second\nand a half apart with a little jitter so the number behaves like a person typing. Delivery and\nread receipts arrive later as ",[48,1224,1225],{},"messages.status"," events, not in this response.",[10,1228,1229,1230,1233,1234,1236],{},"If the response is a ",[48,1231,1232],{},"4xx",", the body is always the same envelope and the ",[48,1235,48],{}," is what you\nbranch on:",[115,1238,1240],{"className":625,"code":1239,"language":395,"meta":120,"style":120},"{\n  \"error\": {\n    \"code\": \"channel_not_connected\",\n    \"message\": \"The channel is not connected.\",\n    \"details\": { \"status\": \"pairing\" },\n    \"request_id\": \"req_01JRQ8F4X9N2K7YB3C5V6W8H0T\"\n  }\n}\n",[48,1241,1242,1246,1254,1266,1278,1294,1304,1309],{"__ignoreMap":120},[124,1243,1244],{"class":126,"line":127},[124,1245,633],{"class":213},[124,1247,1248,1251],{"class":126,"line":204},[124,1249,1250],{"class":130},"  \"error\"",[124,1252,1253],{"class":213},": {\n",[124,1255,1256,1259,1261,1264],{"class":126,"line":222},[124,1257,1258],{"class":130},"    \"code\"",[124,1260,325],{"class":213},[124,1262,1263],{"class":138},"\"channel_not_connected\"",[124,1265,284],{"class":213},[124,1267,1268,1271,1273,1276],{"class":126,"line":232},[124,1269,1270],{"class":130},"    \"message\"",[124,1272,325],{"class":213},[124,1274,1275],{"class":138},"\"The channel is not connected.\"",[124,1277,284],{"class":213},[124,1279,1280,1283,1285,1287,1289,1292],{"class":126,"line":319},[124,1281,1282],{"class":130},"    \"details\"",[124,1284,713],{"class":213},[124,1286,1181],{"class":130},[124,1288,325],{"class":213},[124,1290,1291],{"class":138},"\"pairing\"",[124,1293,773],{"class":213},[124,1295,1296,1299,1301],{"class":126,"line":333},[124,1297,1298],{"class":130},"    \"request_id\"",[124,1300,325],{"class":213},[124,1302,1303],{"class":138},"\"req_01JRQ8F4X9N2K7YB3C5V6W8H0T\"\n",[124,1305,1306],{"class":126,"line":339},[124,1307,1308],{"class":213},"  }\n",[124,1310,1311],{"class":126,"line":362},[124,1312,788],{"class":213},[10,1314,1315,1316,303],{},"Every code is listed, with its cause and fix, under ",[31,1317,1319],{"href":1318},"\u002Fdocs\u002Ferrors\u002F","error codes",[37,1321,1323],{"id":1322},"_5-receive-your-first-webhook","5. Receive your first webhook",[10,1325,1326,1327,1329,1330,1332,1333,1336],{},"Register an HTTPS endpoint and choose the events you want. Start with ",[48,1328,1217],{}," and\n",[48,1331,1225],{},"; add more later, or use ",[48,1334,1335],{},"*"," for everything:",[115,1338,1340],{"className":178,"code":1339,"language":181,"meta":120,"style":120},"curl -X POST https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fwebhooks \\\n  -H \"Authorization: Bearer $WAPITO_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Fhooks.example.com\u002Fwapito\", \"events\": [\"messages\", \"messages.status\"]}'\n",[48,1341,1342,1355,1367,1375],{"__ignoreMap":120},[124,1343,1344,1346,1348,1350,1353],{"class":126,"line":127},[124,1345,180],{"class":188},[124,1347,192],{"class":191},[124,1349,195],{"class":138},[124,1351,1352],{"class":138}," https:\u002F\u002Fapi.wapito.com\u002Fv1\u002Fwebhooks",[124,1354,201],{"class":134},[124,1356,1357,1359,1361,1363,1365],{"class":126,"line":204},[124,1358,207],{"class":191},[124,1360,210],{"class":138},[124,1362,214],{"class":213},[124,1364,217],{"class":138},[124,1366,201],{"class":134},[124,1368,1369,1371,1373],{"class":126,"line":222},[124,1370,207],{"class":191},[124,1372,227],{"class":138},[124,1374,201],{"class":134},[124,1376,1377,1379],{"class":126,"line":232},[124,1378,235],{"class":191},[124,1380,1381],{"class":138}," '{\"url\": \"https:\u002F\u002Fhooks.example.com\u002Fwapito\", \"events\": [\"messages\", \"messages.status\"]}'\n",[10,1383,1384,1385,1388,1389,972,1392,1395,1396,1401,1402,1405],{},"The ",[48,1386,1387],{},"201"," response is the only place the signing ",[48,1390,1391],{},"secret",[48,1393,1394],{},"whsec_…",") ever appears in full, so\nstore it next to the token. Then fire a synthetic event at your endpoint with\n",[590,1397],{"label":1398,"op":1399,"tag":1400},"POST \u002Fwebhooks\u002F{id}\u002Ftest","test-webhook","webhooks"," — it reports the\nstatus code your server answered, the round-trip time and the exact ",[48,1403,1404],{},"X-Wapito-Signature"," header\nthat was sent, so you can replay the verification locally before any real traffic arrives.",[10,1407,1408],{},"Now send yourself a message from another phone. Within a second or two your endpoint receives:",[115,1410,1412],{"className":625,"code":1411,"language":395,"meta":120,"style":120},"{\n  \"id\": \"evt_01JRQ8F4X9N2K7YB3C5V6W8H0T\",\n  \"event\": \"messages\",\n  \"channel_id\": \"ch_01JRQ8F4X9N2K7YB3C5V6W8H0T\",\n  \"timestamp\": 1789459200123,\n  \"api_version\": \"v1\",\n  \"data\": {\n    \"id\": \"false_15551234567@s.whatsapp.net_9F31A0C4D7E2B6081A55\",\n    \"chat_id\": \"15551234567@s.whatsapp.net\",\n    \"from\": \"15551234567\",\n    \"from_me\": false,\n    \"type\": \"text\",\n    \"text\": { \"body\": \"Hi! Got your message.\" }\n  }\n}\n",[48,1413,1414,1418,1429,1441,1452,1464,1476,1483,1495,1507,1519,1530,1542,1560,1565],{"__ignoreMap":120},[124,1415,1416],{"class":126,"line":127},[124,1417,633],{"class":213},[124,1419,1420,1422,1424,1427],{"class":126,"line":204},[124,1421,638],{"class":130},[124,1423,325],{"class":213},[124,1425,1426],{"class":138},"\"evt_01JRQ8F4X9N2K7YB3C5V6W8H0T\"",[124,1428,284],{"class":213},[124,1430,1431,1434,1436,1439],{"class":126,"line":222},[124,1432,1433],{"class":130},"  \"event\"",[124,1435,325],{"class":213},[124,1437,1438],{"class":138},"\"messages\"",[124,1440,284],{"class":213},[124,1442,1443,1446,1448,1450],{"class":126,"line":232},[124,1444,1445],{"class":130},"  \"channel_id\"",[124,1447,325],{"class":213},[124,1449,643],{"class":138},[124,1451,284],{"class":213},[124,1453,1454,1457,1459,1462],{"class":126,"line":319},[124,1455,1456],{"class":130},"  \"timestamp\"",[124,1458,325],{"class":213},[124,1460,1461],{"class":191},"1789459200123",[124,1463,284],{"class":213},[124,1465,1466,1469,1471,1474],{"class":126,"line":333},[124,1467,1468],{"class":130},"  \"api_version\"",[124,1470,325],{"class":213},[124,1472,1473],{"class":138},"\"v1\"",[124,1475,284],{"class":213},[124,1477,1478,1481],{"class":126,"line":339},[124,1479,1480],{"class":130},"  \"data\"",[124,1482,1253],{"class":213},[124,1484,1485,1488,1490,1493],{"class":126,"line":362},[124,1486,1487],{"class":130},"    \"id\"",[124,1489,325],{"class":213},[124,1491,1492],{"class":138},"\"false_15551234567@s.whatsapp.net_9F31A0C4D7E2B6081A55\"",[124,1494,284],{"class":213},[124,1496,1497,1500,1502,1505],{"class":126,"line":368},[124,1498,1499],{"class":130},"    \"chat_id\"",[124,1501,325],{"class":213},[124,1503,1504],{"class":138},"\"15551234567@s.whatsapp.net\"",[124,1506,284],{"class":213},[124,1508,1509,1512,1514,1517],{"class":126,"line":401},[124,1510,1511],{"class":130},"    \"from\"",[124,1513,325],{"class":213},[124,1515,1516],{"class":138},"\"15551234567\"",[124,1518,284],{"class":213},[124,1520,1521,1524,1526,1528],{"class":126,"line":563},[124,1522,1523],{"class":130},"    \"from_me\"",[124,1525,325],{"class":213},[124,1527,741],{"class":191},[124,1529,284],{"class":213},[124,1531,1532,1535,1537,1540],{"class":126,"line":1167},[124,1533,1534],{"class":130},"    \"type\"",[124,1536,325],{"class":213},[124,1538,1539],{"class":138},"\"text\"",[124,1541,284],{"class":213},[124,1543,1545,1548,1550,1552,1554,1557],{"class":126,"line":1544},13,[124,1546,1547],{"class":130},"    \"text\"",[124,1549,713],{"class":213},[124,1551,1123],{"class":130},[124,1553,325],{"class":213},[124,1555,1556],{"class":138},"\"Hi! Got your message.\"",[124,1558,1559],{"class":213}," }\n",[124,1561,1563],{"class":126,"line":1562},14,[124,1564,1308],{"class":213},[124,1566,1568],{"class":126,"line":1567},15,[124,1569,788],{"class":213},[10,1571,1572,1573,1576,1577,1581],{},"Answer with any ",[48,1574,1575],{},"2xx"," quickly and do the real work afterwards; Wapito retries anything else on a\nback-off schedule. The ",[31,1578,1580],{"href":1579},"\u002Fdocs\u002Fwebhooks\u002F","webhooks guide"," has the full event list, the envelope,\nthe signature check in Node, Python and PHP, and the retry table.",[37,1583,1585],{"id":1584},"where-to-go-next","Where to go next",[1587,1588,1589,1600,1607,1613],"ul",{},[1590,1591,1592,1595,1596,1599],"li",{},[31,1593,1594],{"href":817},"Rate limits and quotas"," — what each plan allows per minute, per day and\nper month, and what a ",[48,1597,1598],{},"429"," looks like.",[1590,1601,1602,1606],{},[31,1603,1605],{"href":1604},"\u002Fdocs\u002Fmedia\u002F","Sending and receiving media"," — images, documents, voice notes and the signed\nlinks inbound media arrives with.",[1590,1608,1609,1612],{},[31,1610,1611],{"href":33},"The anti-ban guide"," — read this before your first campaign, not after\nyour first ban.",[1590,1614,1615,1617,1618,1622],{},[31,1616,80],{"href":79}," — every endpoint with request and response examples and code in\ntwelve languages, or the ",[31,1619,1621],{"href":1620},"\u002Fdocs\u002Freference\u002F","interactive reference"," if you would rather click.",[790,1624,1627],{"type":1625,"ban-risk":1626},"warn","low",[10,1628,1629],{},"Reading your own chats and replying to people who wrote to you is the least exposed thing you can\ndo with the API, and it is where every integration should start. The guides that follow explain\neach control that kicks in before you can send faster.",[1631,1632,1633],"style",{},"html pre.shiki code .sjgCt, html code.shiki .sjgCt{--shiki-default:#116329;--shiki-dark:#7EE787}html pre.shiki code .sjeE4, html code.shiki .sjeE4{--shiki-default:#CF222E;--shiki-dark:#FF7B72}html pre.shiki code .sSVrQ, html code.shiki .sSVrQ{--shiki-default:#0A3069;--shiki-dark:#A5D6FF}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 .sTDnQ, html code.shiki .sTDnQ{--shiki-default:#953800;--shiki-dark:#FFA657}html pre.shiki code .sHrmB, html code.shiki .sHrmB{--shiki-default:#0550AE;--shiki-dark:#79C0FF}html pre.shiki code .s4rv2, html code.shiki .s4rv2{--shiki-default:#1F2328;--shiki-dark:#E6EDF3}html pre.shiki code .sbjLL, html code.shiki .sbjLL{--shiki-default:#8250DF;--shiki-dark:#D2A8FF}html pre.shiki code .sU953, html code.shiki .sU953{--shiki-default:#6E7781;--shiki-dark:#8B949E}",{"title":120,"searchDepth":204,"depth":204,"links":1635},[1636,1637,1638,1639,1640,1641,1642],{"id":39,"depth":204,"text":40},{"id":54,"depth":204,"text":55},{"id":95,"depth":204,"text":96},{"id":150,"depth":204,"text":151},{"id":810,"depth":204,"text":811},{"id":1322,"depth":204,"text":1323},{"id":1584,"depth":204,"text":1585},"2026-09-15","From signup to your first sent message: create a channel, link a number by QR or pairing code, issue a Bearer token and call the REST API.","md",{},"\u002Fdocs\u002Fgetting-started",{"title":5,"description":1644},"docs\u002Fgetting-started",[1651,1652,1217],"getting-started","channels",null,"T0fo6rlZfOcuMiDksjK-VolY5QdkZiPCvwYE4uU8z6o",1790464894220]