[{"data":1,"prerenderedAt":924},["ShallowReactive",2],{"docs-nav":3,"docs-\u002Fdocs\u002Fapi\u002Fsend":70},[4,10,14,19,23,26,29,33,36,40,43,47,50,54,58,62,66],{"title":5,"path":6,"order":7,"section":8,"group":9},"Concepts","\u002Fdocs\u002Fapi\u002Fconcepts",1,"api",null,{"title":11,"path":12,"order":7,"section":13,"group":9},"Introduction","\u002Fdocs","general",{"title":15,"path":16,"order":7,"section":17,"group":18},"Usage","\u002Fdocs\u002Fsdk\u002Fusage","sdk","Script",{"title":20,"path":21,"order":22,"section":8,"group":9},"\u002Fv1\u002Fme","\u002Fdocs\u002Fapi\u002Fme",2,{"title":24,"path":25,"order":22,"section":13,"group":9},"Getting started","\u002Fdocs\u002Fgetting-started",{"title":24,"path":27,"order":22,"section":17,"group":28},"\u002Fdocs\u002Fsdk\u002Fpackage","Package",{"title":30,"path":31,"order":32,"section":8,"group":9},"\u002Fv1\u002Fsubscribe","\u002Fdocs\u002Fapi\u002Fsubscribe",3,{"title":34,"path":35,"order":32,"section":17,"group":28},"Browser client","\u002Fdocs\u002Fsdk\u002Fpackage\u002Fclient",{"title":37,"path":38,"order":39,"section":8,"group":9},"\u002Fv1\u002Funsubscribe","\u002Fdocs\u002Fapi\u002Funsubscribe",4,{"title":41,"path":42,"order":39,"section":17,"group":28},"Server client","\u002Fdocs\u002Fsdk\u002Fpackage\u002Fserver",{"title":44,"path":45,"order":46,"section":8,"group":9},"\u002Fv1\u002Fevents","\u002Fdocs\u002Fapi\u002Fevents",5,{"title":48,"path":49,"order":46,"section":17,"group":28},"Types","\u002Fdocs\u002Fsdk\u002Fpackage\u002Ftypes",{"title":51,"path":52,"order":53,"section":8,"group":9},"\u002Fv1\u002Fsend","\u002Fdocs\u002Fapi\u002Fsend",6,{"title":55,"path":56,"order":57,"section":8,"group":9},"\u002Fv1\u002Fbroadcasts","\u002Fdocs\u002Fapi\u002Fbroadcasts",7,{"title":59,"path":60,"order":61,"section":8,"group":9},"\u002Fv1\u002Fgroups","\u002Fdocs\u002Fapi\u002Fgroups",8,{"title":63,"path":64,"order":65,"section":8,"group":9},"\u002Fv1\u002Fsubscribers","\u002Fdocs\u002Fapi\u002Fsubscribers",9,{"title":67,"path":68,"order":69,"section":8,"group":9},"Webhooks","\u002Fdocs\u002Fapi\u002Fwebhooks",10,{"id":71,"title":51,"apiModule":9,"body":72,"description":916,"extension":917,"generated":918,"group":9,"meta":919,"navigation":920,"order":53,"path":52,"section":8,"seo":921,"stem":922,"__hash__":923},"docs\u002Fdocs\u002Fapi\u002Fsend.md",{"type":73,"value":74,"toc":913},"minimark",[75,82,92,99,110,116,122,127,419,426,516,521,588,593,646,651,700,715,724,759,768,773,876,909],[76,77,79],"h1",{"id":78},"v1send",[80,81,51],"code",{},[83,84,85,86,91],"p",{},"Bearer auth. See ",[87,88,90],"a",{"href":89},"\u002Fdocs\u002Fapi\u002Fconcepts#authentication","Concepts → Authentication",".",[93,94,96],"h2",{"id":95},"post-v1send",[80,97,98],{},"POST \u002Fv1\u002Fsend",[83,100,101,105,106,109],{},[102,103,104],"strong",{},"What it does:"," Creates a broadcast and queues it for asynchronous fan-out. Returns immediately with a ",[80,107,108],{},"broadcast_id"," — actual delivery happens in the background.",[83,111,112,115],{},[102,113,114],{},"When to use it:"," Whenever you want to send a push. This is the main \"do work\" endpoint.",[83,117,118,121],{},[102,119,120],{},"Authentication:"," Bearer.",[83,123,124],{},[102,125,126],{},"Request body:",[128,129,130,149],"table",{},[131,132,133],"thead",{},[134,135,136,140,143,146],"tr",{},[137,138,139],"th",{},"Field",[137,141,142],{},"Type",[137,144,145],{},"Required",[137,147,148],{},"Description",[150,151,152,169,184,199,231,259,278,315,358,388],"tbody",{},[134,153,154,160,163,166],{},[155,156,157],"td",{},[80,158,159],{},"target",[155,161,162],{},"object",[155,164,165],{},"yes",[155,167,168],{},"Discriminated union — see below.",[134,170,171,176,179,181],{},[155,172,173],{},[80,174,175],{},"notification.title",[155,177,178],{},"string (1–256 chars)",[155,180,165],{},[155,182,183],{},"Notification title — visible to the user.",[134,185,186,191,194,196],{},[155,187,188],{},[80,189,190],{},"notification.body",[155,192,193],{},"string (1–2048 chars)",[155,195,165],{},[155,197,198],{},"Notification body.",[134,200,201,206,209,212],{},[155,202,203],{},[80,204,205],{},"notification.icon",[155,207,208],{},"string",[155,210,211],{},"no",[155,213,214,215,218,219,222,223,226,227,230],{},"Small icon shown alongside the notification. Either an HTTPS URL (≤ 2048 chars, used as-is) or a base64 ",[80,216,217],{},"data:image\u002Fpng|jpeg|webp"," URL (≤ 256 KB) we host for you and serve from ",[80,220,221],{},"litepush.dev\u002Fcdn\u002Ficons",". ",[102,224,225],{},"Must be square (1:1)"," — non-square icons are rejected. Available on ",[102,228,229],{},"every plan",". If omitted, the project's default icon (set in the dashboard) is used.",[134,232,233,238,240,242],{},[155,234,235],{},[80,236,237],{},"notification.image",[155,239,208],{},[155,241,211],{},[155,243,244,247,248,251,252,255,256,91],{},[102,245,246],{},"Hobby+ only."," Large banner image shown below the body on platforms that support it (Chrome desktop\u002FAndroid). Same formats as ",[80,249,250],{},"icon"," — an HTTPS URL (≤ 2048 chars) or a base64 ",[80,253,254],{},"data:image\u002F*"," URL (≤ 1 MB) we host for you. Sending it on a Free plan returns ",[80,257,258],{},"403 image_requires_upgrade",[134,260,261,266,269,271],{},[155,262,263],{},[80,264,265],{},"notification.url",[155,267,268],{},"string (URL, ≤ 2048 chars)",[155,270,211],{},[155,272,273,274,277],{},"URL to open when the user clicks. Defaults to ",[80,275,276],{},"\u002F"," (your site root) when omitted.",[134,279,280,285,288,290],{},[155,281,282],{},[80,283,284],{},"ttl",[155,286,287],{},"number (seconds, 0–2 419 200)",[155,289,211],{},[155,291,292,295,296,299,300,303,304,310,311,314],{},[102,293,294],{},"Every plan."," How long the push service keeps trying to deliver while the device is offline. ",[80,297,298],{},"0"," = deliver only if the device is connected right now; larger values survive longer offline windows. Defaults to ",[102,301,302],{},"86 400 (24 hours)",". Max is 4 weeks. Maps to the ",[87,305,309],{"href":306,"rel":307},"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc8030#section-5.2",[308],"nofollow","RFC 8030"," ",[80,312,313],{},"TTL"," header.",[134,316,317,322,324,326],{},[155,318,319],{},[80,320,321],{},"urgency",[155,323,208],{},[155,325,211],{},[155,327,328,330,331,334,335,334,338,341,342,345,346,348,349,351,352,354,355,314],{},[102,329,294],{}," Delivery priority hint: ",[80,332,333],{},"very-low",", ",[80,336,337],{},"low",[80,339,340],{},"normal",", or ",[80,343,344],{},"high",". The push service uses it to trade battery against promptness — ",[80,347,344],{}," wakes an idle device sooner; ",[80,350,333],{}," defers until it's charging\u002Fon Wi-Fi. Defaults to ",[80,353,340],{},". Maps to the ",[80,356,357],{},"Urgency",[134,359,360,365,372,374],{},[155,361,362],{},[80,363,364],{},"topic",[155,366,367,368,371],{},"string (≤ 32 chars, ",[80,369,370],{},"A–Z a–z 0–9 _ -",")",[155,373,211],{},[155,375,376,378,379,310,381,384,385,314],{},[102,377,294],{}," Collapse key. A newer broadcast with the same ",[80,380,364],{},[102,382,383],{},"replaces"," an older, still-undelivered one in the push gateway — so an offline device that comes back online wakes to only the latest (e.g. a live score, an unread count). Omit it for no collapsing. Maps to the ",[80,386,387],{},"Topic",[134,389,390,395,398,400],{},[155,391,392],{},[80,393,394],{},"scheduled_at",[155,396,397],{},"number (Unix ms)",[155,399,211],{},[155,401,402,405,406,409,410,413,414,91],{},[102,403,404],{},"Plus+ only."," Schedule the broadcast for a future time instead of sending now. Must be in the future and within 90 days. The push budget is reserved at fire time (so it counts against the send month), and delivery fires within ~5 minutes of the scheduled time. Returns ",[80,407,408],{},"202"," with ",[80,411,412],{},"{ broadcast_id, scheduled_at }",". Cancel before it fires with ",[87,415,416],{"href":56},[80,417,418],{},"DELETE \u002Fv1\u002Fbroadcasts\u002F:id",[83,420,421],{},[102,422,423,425],{},[80,424,159],{}," shapes:",[128,427,428,441],{},[131,429,430],{},[134,431,432,435,438],{},[137,433,434],{},"Shape",[137,436,437],{},"Effect",[137,439,440],{},"Behavior when nothing matches",[150,442,443,459,488],{},[134,444,445,450,453],{},[155,446,447],{},[80,448,449],{},"{ \"type\": \"all\" }",[155,451,452],{},"Every active subscriber in the project.",[155,454,455,456,91],{},"If no subscribers exist, broadcast is accepted with ",[80,457,458],{},"delivered: 0",[134,460,461,466,473],{},[155,462,463],{},[80,464,465],{},"{ \"type\": \"user\", \"external_id\": \"user_42\" }",[155,467,468,469,472],{},"Every subscriber whose ",[80,470,471],{},"external_id"," matches — covers users with multiple devices.",[155,474,475,476,409,478,480,481,483,484,487],{},"Returns ",[80,477,408],{},[80,479,108],{},". Audience is ",[80,482,298],{},"; no pushes delivered. ",[102,485,486],{},"This is intentional"," — the user may not have subscribed yet, or may subscribe to a second device later. The broadcast row stays as a record of intent.",[134,489,490,495,502],{},[155,491,492],{},[80,493,494],{},"{ \"type\": \"group\", \"group_id\": \"grp_xxx\" }",[155,496,497,498,91],{},"All members of one named group. See ",[87,499,500],{"href":60},[80,501,59],{},[155,503,504,505,508,509,512,513,515],{},"A non-existent or wrong-project ",[80,506,507],{},"group_id"," returns ",[80,510,511],{},"404 group_not_found"," before the broadcast is created — no silent zero-audience send. An existing group with no members sends to no one and returns ",[80,514,408],{}," normally.",[83,517,518],{},[102,519,520],{},"Example — broadcast to everyone:",[522,523,528],"pre",{"className":524,"code":525,"language":526,"meta":527,"style":527},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fsend \\\n  -H \"Authorization: Bearer lpk_live_xxxxxxxx\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"target\": { \"type\": \"all\" },\n    \"notification\": {\n      \"title\": \"New post on the blog\",\n      \"body\": \"We just shipped Web Push support — read more\",\n      \"url\": \"https:\u002F\u002Fmyblog.com\u002Fposts\u002Fweb-push\"\n    }\n  }'\n","sh","",[80,529,530,537,542,547,552,557,562,567,572,577,582],{"__ignoreMap":527},[531,532,534],"span",{"class":533,"line":7},"line",[531,535,536],{},"curl -X POST https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fsend \\\n",[531,538,539],{"class":533,"line":22},[531,540,541],{},"  -H \"Authorization: Bearer lpk_live_xxxxxxxx\" \\\n",[531,543,544],{"class":533,"line":32},[531,545,546],{},"  -H \"Content-Type: application\u002Fjson\" \\\n",[531,548,549],{"class":533,"line":39},[531,550,551],{},"  -d '{\n",[531,553,554],{"class":533,"line":46},[531,555,556],{},"    \"target\": { \"type\": \"all\" },\n",[531,558,559],{"class":533,"line":53},[531,560,561],{},"    \"notification\": {\n",[531,563,564],{"class":533,"line":57},[531,565,566],{},"      \"title\": \"New post on the blog\",\n",[531,568,569],{"class":533,"line":61},[531,570,571],{},"      \"body\": \"We just shipped Web Push support — read more\",\n",[531,573,574],{"class":533,"line":65},[531,575,576],{},"      \"url\": \"https:\u002F\u002Fmyblog.com\u002Fposts\u002Fweb-push\"\n",[531,578,579],{"class":533,"line":69},[531,580,581],{},"    }\n",[531,583,585],{"class":533,"line":584},11,[531,586,587],{},"  }'\n",[83,589,590],{},[102,591,592],{},"Example — broadcast to one user (e.g. transactional):",[522,594,596],{"className":524,"code":595,"language":526,"meta":527,"style":527},"curl -X POST https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fsend \\\n  -H \"Authorization: Bearer lpk_live_xxxxxxxx\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"target\": { \"type\": \"user\", \"external_id\": \"user_42\" },\n    \"notification\": {\n      \"title\": \"Order shipped\",\n      \"body\": \"Your order #4912 is on its way.\",\n      \"url\": \"https:\u002F\u002Fshop.example.com\u002Forders\u002F4912\"\n    }\n  }'\n",[80,597,598,602,606,610,614,619,623,628,633,638,642],{"__ignoreMap":527},[531,599,600],{"class":533,"line":7},[531,601,536],{},[531,603,604],{"class":533,"line":22},[531,605,541],{},[531,607,608],{"class":533,"line":32},[531,609,546],{},[531,611,612],{"class":533,"line":39},[531,613,551],{},[531,615,616],{"class":533,"line":46},[531,617,618],{},"    \"target\": { \"type\": \"user\", \"external_id\": \"user_42\" },\n",[531,620,621],{"class":533,"line":53},[531,622,561],{},[531,624,625],{"class":533,"line":57},[531,626,627],{},"      \"title\": \"Order shipped\",\n",[531,629,630],{"class":533,"line":61},[531,631,632],{},"      \"body\": \"Your order #4912 is on its way.\",\n",[531,634,635],{"class":533,"line":65},[531,636,637],{},"      \"url\": \"https:\u002F\u002Fshop.example.com\u002Forders\u002F4912\"\n",[531,639,640],{"class":533,"line":69},[531,641,581],{},[531,643,644],{"class":533,"line":584},[531,645,587],{},[83,647,648],{},[102,649,650],{},"Example — time-sensitive alert that collapses an earlier one:",[522,652,654],{"className":524,"code":653,"language":526,"meta":527,"style":527},"curl -X POST https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fsend \\\n  -H \"Authorization: Bearer lpk_live_xxxxxxxx\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"target\": { \"type\": \"user\", \"external_id\": \"user_42\" },\n    \"notification\": { \"title\": \"Score: 2–1\", \"body\": \"United just scored.\" },\n    \"urgency\": \"high\",\n    \"ttl\": 600,\n    \"topic\": \"match-1234\"\n  }'\n",[80,655,656,660,664,668,672,676,681,686,691,696],{"__ignoreMap":527},[531,657,658],{"class":533,"line":7},[531,659,536],{},[531,661,662],{"class":533,"line":22},[531,663,541],{},[531,665,666],{"class":533,"line":32},[531,667,546],{},[531,669,670],{"class":533,"line":39},[531,671,551],{},[531,673,674],{"class":533,"line":46},[531,675,618],{},[531,677,678],{"class":533,"line":53},[531,679,680],{},"    \"notification\": { \"title\": \"Score: 2–1\", \"body\": \"United just scored.\" },\n",[531,682,683],{"class":533,"line":57},[531,684,685],{},"    \"urgency\": \"high\",\n",[531,687,688],{"class":533,"line":61},[531,689,690],{},"    \"ttl\": 600,\n",[531,692,693],{"class":533,"line":65},[531,694,695],{},"    \"topic\": \"match-1234\"\n",[531,697,698],{"class":533,"line":69},[531,699,587],{},[83,701,702,703,706,707,710,711,714],{},"Here ",[80,704,705],{},"urgency: \"high\""," asks the push service to wake the device promptly, ",[80,708,709],{},"ttl: 600"," drops the update if it can't be delivered within 10 minutes (a stale score is worse than none), and ",[80,712,713],{},"topic: \"match-1234\""," means the next score update for the same match replaces this one instead of stacking.",[83,716,717],{},[102,718,719,720,723],{},"Success — ",[80,721,722],{},"202 Accepted",":",[522,725,729],{"className":726,"code":727,"language":728,"meta":527,"style":527},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"broadcast_id\": \"bdc_01HXM...\" }\n","json",[80,730,731],{"__ignoreMap":527},[531,732,733,737,740,743,746,748,750,754,756],{"class":533,"line":7},[531,734,736],{"class":735},"sMK4o","{",[531,738,739],{"class":735}," \"",[531,741,108],{"class":742},"spNyl",[531,744,745],{"class":735},"\"",[531,747,723],{"class":735},[531,749,739],{"class":735},[531,751,753],{"class":752},"sfazB","bdc_01HXM...",[531,755,745],{"class":735},[531,757,758],{"class":735}," }\n",[83,760,761,763,764,767],{},[80,762,408],{}," not ",[80,765,766],{},"200"," because fan-out is asynchronous. The broadcast row in the dashboard updates with delivered \u002F failed counts as the queue consumer works through subscribers.",[83,769,770],{},[102,771,772],{},"Errors:",[774,775,776,803,821,830,835,841,849,856,871],"ul",{},[777,778,779,782,783,786,787,789,790,334,792,794,795,797,798,800,801,91],"li",{},[80,780,781],{},"400"," (validation) — body shape wrong, title\u002Fbody empty, target type unknown, a ",[80,784,785],{},"user"," target's ",[80,788,471],{}," over 256 chars or containing characters outside ",[80,791,370],{},[80,793,284],{}," out of range (0–2 419 200), ",[80,796,321],{}," not one of the four levels, or ",[80,799,364],{}," over 32 chars \u002F containing characters outside ",[80,802,370],{},[777,804,805,808,809,812,813,816,817,820],{},[80,806,807],{},"400 invalid_icon"," \u002F ",[80,810,811],{},"400 invalid_image"," — a ",[80,814,815],{},"data:"," URL icon\u002Fimage was malformed, empty, an unsupported type (not PNG\u002FJPEG\u002FWebP), or over its size cap (icon 256 KB, image 1 MB). ",[80,818,819],{},"invalid_icon"," is also returned when the icon isn't square (1:1).",[777,822,823,826,827,829],{},[80,824,825],{},"400 invalid_scheduled_at"," — ",[80,828,394],{}," is in the past or more than 90 days out.",[777,831,832,91],{},[80,833,834],{},"401 invalid_api_key",[777,836,837,840],{},[80,838,839],{},"403 monthly_push_limit_reached"," — sending this broadcast would push your account past its plan cap. Returned with the cap and the broadcast's estimated audience in the message.",[777,842,843,826,846,848],{},[80,844,845],{},"403 scheduling_requires_upgrade",[80,847,394],{}," was supplied on a plan below Plus.",[777,850,851,826,853,855],{},[80,852,258],{},[80,854,237],{}," was supplied on the Free plan (Hobby+ only).",[777,857,858,826,860,863,864,867,868,870],{},[80,859,511],{},[80,861,862],{},"target.type"," is ",[80,865,866],{},"group"," but the ",[80,869,507],{}," doesn't exist in this project.",[777,872,873,91],{},[80,874,875],{},"429 rate_limited",[877,878,879],"blockquote",{},[83,880,881,882,884,885,888,889,891,892,894,895,898,899,901,902,905,906,908],{},"A ",[80,883,866],{}," target with a bad ID is rejected up-front with ",[80,886,887],{},"404",". A ",[80,890,785],{}," target whose ",[80,893,471],{}," has no active subscribers is ",[102,896,897],{},"not"," an error — it returns ",[80,900,408],{}," with zero deliveries, because sending to a user who hasn't subscribed yet (or subscribes later) is a legitimate transactional pattern. Watch the broadcast's ",[80,903,904],{},"delivered"," count (dashboard or ",[80,907,904],{}," webhook) to confirm reach.",[910,911,912],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":527,"searchDepth":22,"depth":22,"links":914},[915],{"id":95,"depth":22,"text":98},"Trigger a broadcast — immediate or scheduled. Targets all subscribers, a group, or one user.","md",false,{},true,{"title":51,"description":916},"docs\u002Fapi\u002Fsend","YtZfaqJiOHEbTYTNXVLWyQPg5MdlFfD0zZHSYzl7Lww",1780560203630]