[{"data":1,"prerenderedAt":784},["ShallowReactive",2],{"navigation":3,"/docs/api":50,"/docs/api-surround":779},[4,23],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","/docs/getting-started","1.docs/1.getting-started/1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","/docs/getting-started/installation","1.docs/1.getting-started/2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Usage Guide","/docs/getting-started/usage","1.docs/1.getting-started/3.usage","i-lucide-sliders",false,{"title":24,"path":25,"stem":26,"children":27,"icon":29},"API Overview","/docs/api","1.docs/2.api/1.index",[28,30,35,40,45],{"title":24,"path":25,"stem":26,"icon":29},"i-lucide-server-cog",{"title":31,"path":32,"stem":33,"icon":34},"Agents","/docs/api/agents","1.docs/2.api/2.agents","i-lucide-bot",{"title":36,"path":37,"stem":38,"icon":39},"Messages","/docs/api/messages","1.docs/2.api/3.messages","i-lucide-mail",{"title":41,"path":42,"stem":43,"icon":44},"Threads","/docs/api/threads","1.docs/2.api/4.threads","i-lucide-git-branch",{"title":46,"path":47,"stem":48,"icon":49},"Webhooks","/docs/api/webhooks","1.docs/2.api/5.webhooks","i-lucide-webhook",{"id":51,"title":24,"body":52,"description":773,"extension":774,"meta":775,"navigation":776,"path":25,"seo":777,"stem":26,"__hash__":778},"docs/1.docs/2.api/1.index.md",{"type":53,"value":54,"toc":762},"minimark",[55,73,78,85,95,98,104,108,115,184,191,195,430,433,437,486,490,563,568,705,709,731,735,758],[56,57,58,59,63,64,68,69,72],"p",{},"The Sendook API is a single Cloudflare Worker. Every route is JSON-in / JSON-out, every request authenticates with a ",[60,61,62],"code",{},"Bearer"," token, and there are exactly two kinds of token: the ",[65,66,67],"strong",{},"master key"," and the ",[65,70,71],{},"per-agent API key",".",[74,75,77],"h2",{"id":76},"base-url","Base URL",[56,79,80,81,84],{},"The Worker is reached at whatever route is configured in ",[60,82,83],{},"wrangler.jsonc",". For the hosted deployment that's:",[86,87,93],"pre",{"className":88,"code":90,"language":91,"meta":92},[89],"language-text","https://api.sendook.com\n","text","",[60,94,90],{"__ignoreMap":92},[56,96,97],{},"For local development:",[86,99,102],{"className":100,"code":101,"language":91,"meta":92},[89],"http://localhost:8787\n",[60,103,101],{"__ignoreMap":92},[74,105,107],{"id":106},"authentication","Authentication",[56,109,110,111,114],{},"Every protected route reads ",[60,112,113],{},"Authorization: Bearer \u003Ctoken>",". There are two acceptable token kinds:",[116,117,118,134],"table",{},[119,120,121],"thead",{},[122,123,124,128,131],"tr",{},[125,126,127],"th",{},"Token kind",[125,129,130],{},"Where it comes from",[125,132,133],{},"What it can do",[135,136,137,163],"tbody",{},[122,138,139,143,150],{},[140,141,142],"td",{},"Master key",[140,144,145,146,149],{},"The ",[60,147,148],{},"MASTER_KEY"," Worker secret.",[140,151,152,155,156,155,159,162],{},[60,153,154],{},"POST /agents",", ",[60,157,158],{},"GET /agents",[60,160,161],{},"DELETE /agents/:id",", plus everything the per-agent key can do (for any agent).",[122,164,165,168,173],{},[140,166,167],{},"Per-agent API key",[140,169,170,171,72],{},"Returned exactly once by ",[60,172,154],{},[140,174,175,176,179,180,183],{},"All ",[60,177,178],{},"/agents/:id/*"," routes for ",[65,181,182],{},"its own"," agent. Cannot create or list agents.",[56,185,186,187,190],{},"The agents directory is keyed on a SHA-256 HMAC of the per-agent key (peppered with ",[60,188,189],{},"API_KEY_HASH_PEPPER","). The plain key is never stored.",[74,192,194],{"id":193},"route-map","Route map",[116,196,197,213],{},[119,198,199],{},[122,200,201,204,207,210],{},[125,202,203],{},"Method",[125,205,206],{},"Path",[125,208,209],{},"Auth",[125,211,212],{},"Description",[135,214,215,236,253,271,286,303,319,335,351,367,383,398,414],{},[122,216,217,222,227,230],{},[140,218,219],{},[60,220,221],{},"GET",[140,223,224],{},[60,225,226],{},"/health",[140,228,229],{},"none",[140,231,232,235],{},[60,233,234],{},"{ ok: true, version }"," for liveness probes.",[122,237,238,242,247,250],{},[140,239,240],{},[60,241,221],{},[140,243,244],{},[60,245,246],{},"/me",[140,248,249],{},"per-agent",[140,251,252],{},"Returns the agent identified by the bearer token.",[122,254,255,260,265,268],{},[140,256,257],{},[60,258,259],{},"POST",[140,261,262],{},[60,263,264],{},"/agents",[140,266,267],{},"master",[140,269,270],{},"Create a new agent. Returns the per-agent API key once.",[122,272,273,277,281,283],{},[140,274,275],{},[60,276,221],{},[140,278,279],{},[60,280,264],{},[140,282,267],{},[140,284,285],{},"List every non-tombstoned agent.",[122,287,288,292,297,300],{},[140,289,290],{},[60,291,221],{},[140,293,294],{},[60,295,296],{},"/agents/:id",[140,298,299],{},"master / agent's own key",[140,301,302],{},"Get a single agent.",[122,304,305,310,314,316],{},[140,306,307],{},[60,308,309],{},"DELETE",[140,311,312],{},[60,313,296],{},[140,315,267],{},[140,317,318],{},"Tombstone the agent and purge its DO storage.",[122,320,321,325,330,332],{},[140,322,323],{},[60,324,259],{},[140,326,327],{},[60,328,329],{},"/agents/:id/messages/send",[140,331,299],{},[140,333,334],{},"Send an email from the agent.",[122,336,337,341,346,348],{},[140,338,339],{},[60,340,221],{},[140,342,343],{},[60,344,345],{},"/agents/:id/messages",[140,347,299],{},[140,349,350],{},"List the agent's messages (newest first).",[122,352,353,357,362,364],{},[140,354,355],{},[60,356,221],{},[140,358,359],{},[60,360,361],{},"/agents/:id/threads/:threadId",[140,363,299],{},[140,365,366],{},"Get one thread plus its messages in order.",[122,368,369,373,378,380],{},[140,370,371],{},[60,372,259],{},[140,374,375],{},[60,376,377],{},"/agents/:id/webhooks",[140,379,299],{},[140,381,382],{},"Create a webhook subscription. Returns the secret once.",[122,384,385,389,393,395],{},[140,386,387],{},[60,388,221],{},[140,390,391],{},[60,392,377],{},[140,394,299],{},[140,396,397],{},"List the agent's webhooks (no secrets).",[122,399,400,404,409,411],{},[140,401,402],{},[60,403,309],{},[140,405,406],{},[60,407,408],{},"/agents/:id/webhooks/:webhookId",[140,410,299],{},[140,412,413],{},"Delete one webhook.",[122,415,416,420,425,427],{},[140,417,418],{},[60,419,221],{},[140,421,422],{},[60,423,424],{},"/agents/:id/webhooks/:webhookId/attempts",[140,426,299],{},[140,428,429],{},"List delivery attempts for one webhook (last 100).",[56,431,432],{},"Agent ids are 12 lowercase alphanumeric chars. UUIDs in webhook ids and thread ids use the standard 8-4-4-4-12 form.",[74,434,436],{"id":435},"request-format","Request format",[438,439,440,454,467],"ul",{},[441,442,443,444,447,448,450,451,453],"li",{},"All bodies are JSON; ",[60,445,446],{},"Content-Type: application/json"," is required for ",[60,449,259],{},"/",[60,452,309],{}," with a body.",[441,455,456,457,460,461,463,464,72],{},"Body size caps are enforced in ",[65,458,459],{},"UTF-8 bytes",", not UTF-16 chars: 4 KiB for ",[60,462,154],{},", 4 KiB for webhook create, 1 MiB for ",[60,465,466],{},"POST .../messages/send",[441,468,145,469,471,472,475,476,450,478,481,482,485],{},[60,470,466],{}," body validates with Zod: addresses are real email addresses, ",[60,473,474],{},"subject"," ≤ 998 chars, ",[60,477,91],{},[60,479,480],{},"html"," non-empty when present, recipients ≤ 50 total, attachments ≤ 10 with each ",[60,483,484],{},"data"," ≤ ~5 MiB raw and a strict base64 character set.",[74,487,489],{"id":488},"response-format","Response format",[438,491,492,511,525,540],{},[441,493,494,495,498,499,502,503,506,507,510],{},"Success uses ",[60,496,497],{},"200 OK"," (read), ",[60,500,501],{},"201 Created"," (create), ",[60,504,505],{},"202 Accepted"," (send queued / message persisted), ",[60,508,509],{},"204 No Content"," (delete).",[441,512,513,516,517,519,520,524],{},[60,514,515],{},"502 Bad Gateway"," is returned for ",[60,518,466],{}," when ",[521,522,523],"em",{},"every"," recipient was rejected (the per-recipient outcomes are still in the body).",[441,526,527,528,531,532,535,536,539],{},"Errors return ",[60,529,530],{},"application/json"," with ",[60,533,534],{},"{ \"error\": \"\u003Cmessage>\" }"," and, for Zod failures, an additional ",[60,537,538],{},"details"," array of issues.",[441,541,542,543,546,547,550,551,554,555,558,559,562],{},"Error status codes follow HTTP conventions: ",[60,544,545],{},"400"," for validation, ",[60,548,549],{},"401"," for missing/bad bearer, ",[60,552,553],{},"403"," for cross-agent access, ",[60,556,557],{},"404"," for unknown id (or tombstoned agent), ",[60,560,561],{},"500"," for unexpected.",[564,565,567],"h3",{"id":566},"example-error","Example error",[86,569,573],{"className":570,"code":571,"language":572,"meta":92,"style":92},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"error\": \"invalid request body\",\n  \"details\": [\n    { \"code\": \"invalid_type\", \"expected\": \"string\", \"path\": [\"subject\"] }\n  ]\n}\n","json",[60,574,575,584,612,626,693,699],{"__ignoreMap":92},[576,577,580],"span",{"class":578,"line":579},"line",1,[576,581,583],{"class":582},"sMK4o","{\n",[576,585,587,590,594,597,600,603,607,609],{"class":578,"line":586},2,[576,588,589],{"class":582},"  \"",[576,591,593],{"class":592},"spNyl","error",[576,595,596],{"class":582},"\"",[576,598,599],{"class":582},":",[576,601,602],{"class":582}," \"",[576,604,606],{"class":605},"sfazB","invalid request body",[576,608,596],{"class":582},[576,610,611],{"class":582},",\n",[576,613,615,617,619,621,623],{"class":578,"line":614},3,[576,616,589],{"class":582},[576,618,538],{"class":592},[576,620,596],{"class":582},[576,622,599],{"class":582},[576,624,625],{"class":582}," [\n",[576,627,629,632,634,637,639,641,643,646,648,651,653,656,658,660,662,665,667,669,671,674,676,678,681,683,685,687,690],{"class":578,"line":628},4,[576,630,631],{"class":582},"    {",[576,633,602],{"class":582},[576,635,60],{"class":636},"sBMFI",[576,638,596],{"class":582},[576,640,599],{"class":582},[576,642,602],{"class":582},[576,644,645],{"class":605},"invalid_type",[576,647,596],{"class":582},[576,649,650],{"class":582},",",[576,652,602],{"class":582},[576,654,655],{"class":636},"expected",[576,657,596],{"class":582},[576,659,599],{"class":582},[576,661,602],{"class":582},[576,663,664],{"class":605},"string",[576,666,596],{"class":582},[576,668,650],{"class":582},[576,670,602],{"class":582},[576,672,673],{"class":636},"path",[576,675,596],{"class":582},[576,677,599],{"class":582},[576,679,680],{"class":582}," [",[576,682,596],{"class":582},[576,684,474],{"class":605},[576,686,596],{"class":582},[576,688,689],{"class":582},"]",[576,691,692],{"class":582}," }\n",[576,694,696],{"class":578,"line":695},5,[576,697,698],{"class":582},"  ]\n",[576,700,702],{"class":578,"line":701},6,[576,703,704],{"class":582},"}\n",[74,706,708],{"id":707},"cors","CORS",[56,710,711,714,715,718,719,722,723,726,727,730],{},[60,712,713],{},"OPTIONS"," preflights and the ",[60,716,717],{},"Access-Control-Allow-Origin"," header are emitted only when the request ",[60,720,721],{},"Origin"," matches one of the comma-separated values in the ",[60,724,725],{},"ALLOWED_ORIGINS"," Worker var. Anything else is silently denied — the browser sees no CORS headers and rejects the request. Set ",[60,728,729],{},"ALLOWED_ORIGINS=*"," to allow any origin (only do this for self-hosted deployments behind another auth layer).",[74,732,734],{"id":733},"resources","Resources",[438,736,737,743,748,753],{},[441,738,739,742],{},[740,741,31],"a",{"href":32}," — agent CRUD with the master key.",[441,744,745,747],{},[740,746,36],{"href":37}," — send and list per-agent.",[441,749,750,752],{},[740,751,41],{"href":42}," — fetch one conversation.",[441,754,755,757],{},[740,756,46],{"href":47}," — subscribe to events, inspect attempts.",[759,760,761],"style",{},"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}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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);}",{"title":92,"searchDepth":586,"depth":586,"links":763},[764,765,766,767,768,771,772],{"id":76,"depth":586,"text":77},{"id":106,"depth":586,"text":107},{"id":193,"depth":586,"text":194},{"id":435,"depth":586,"text":436},{"id":488,"depth":586,"text":489,"children":769},[770],{"id":566,"depth":614,"text":567},{"id":707,"depth":586,"text":708},{"id":733,"depth":586,"text":734},"How to authenticate with the Sendook Worker, request and response formats, and the route map.","md",{},{"icon":29},{"title":24,"description":773},"FD_dBK9Bh9Ojg7MnG3xYs7RbWy2a3MTRSr9UYh58HOg",[780,782],{"title":18,"path":19,"stem":20,"description":781,"icon":21,"children":-1},"The everyday workflows for sending, receiving, threading, and webhook delivery.",{"title":31,"path":32,"stem":33,"description":783,"icon":34,"children":-1},"Create, read, list, and tombstone agent mailboxes (master key required).",1778700750587]