[{"data":1,"prerenderedAt":616},["ShallowReactive",2],{"docs-nav":3,"content-query-WseiD7GLR0":265},[4,8,11,14,17,21,25,29,32,36,40,44,48,52,56,60,63,67,71,75,79,83,87,91,95,99,103,107,111,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262],{"_path":5,"title":6,"order":7},"/docs/getting-started","Getting Started",1,{"_path":9,"title":10,"order":7},"/docs/views/grid","Grid View",{"_path":12,"title":13,"order":7},"/docs/api/server","Server API",{"_path":15,"title":16,"order":7},"/docs/self-hosting/all-in-one","All-in-One Setup",{"_path":18,"title":19,"order":20},"/docs/core-concepts","Core Concepts",10,{"_path":22,"title":23,"order":24},"/docs/crdt","What is a CRDT?",11,{"_path":26,"title":27,"order":28},"/docs/api/client-http","Client HTTP API",2,{"_path":30,"title":31,"order":28},"/docs/self-hosting/separate-containers","Separate Containers Setup",{"_path":33,"title":34,"order":35},"/docs/interface-overview","Interface Overview",20,{"_path":37,"title":38,"order":39},"/docs/global-search","Global Search",22,{"_path":41,"title":42,"order":43},"/docs/filters","Filters",24,{"_path":45,"title":46,"order":47},"/docs/sorting","Sorting",25,{"_path":49,"title":50,"order":51},"/docs/tagging-and-selection","Tagging & Selection",26,{"_path":53,"title":54,"order":55},"/docs/quick-view","Quick View",28,{"_path":57,"title":58,"order":59},"/docs/api/cli","CLI",3,{"_path":61,"title":62,"order":59},"/docs/self-hosting/remote-access-tailscale","Remote Access with Tailscale",{"_path":64,"title":65,"order":66},"/docs/block-actions","Block Actions",30,{"_path":68,"title":69,"order":70},"/docs/deleting-blocks","Deleting Blocks & Trash",32,{"_path":72,"title":73,"order":74},"/docs/self-hosting","Self-Hosting",4,{"_path":76,"title":77,"order":78},"/docs/managing-heaps","Managing Heaps",40,{"_path":80,"title":81,"order":82},"/docs/file-scanning","File Scanning & Importing",42,{"_path":84,"title":85,"order":86},"/docs/storage-management","Storage Management",44,{"_path":88,"title":89,"order":90},"/docs/daily-notes","Daily Notes & Calendar",46,{"_path":92,"title":93,"order":94},"/docs/api","API",5,{"_path":96,"title":97,"order":98},"/docs/views","Views",60,{"_path":100,"title":101,"order":102},"/docs/authentication","Authentication & User Management",70,{"_path":104,"title":105,"order":106},"/docs/licenses-privacy","Licenses & Privacy",72,{"_path":108,"title":109,"order":110},"/docs/faq","FAQ",80,{"_path":112,"title":113,"order":114},"/docs/changelog","Changelog",99,{"_path":116,"title":117},"/docs/changelog/v16.16.37","v16.16.37",{"_path":119,"title":120},"/docs/changelog/v16.16.38","v16.16.38",{"_path":122,"title":123},"/docs/changelog/v16.11.0","v16.11.0",{"_path":125,"title":126},"/docs/changelog/v16.16.29","v16.16.29",{"_path":128,"title":129},"/docs/changelog/v16.16.28","v16.16.28",{"_path":131,"title":132},"/docs/changelog/v16.16.1","v16.16.1",{"_path":134,"title":135},"/docs/changelog/v16.10.0","v16.10.0",{"_path":137,"title":138},"/docs/changelog/v16.16.8","v16.16.8",{"_path":140,"title":141},"/docs/changelog/v16.7.0","v16.7.0",{"_path":143,"title":144},"/docs/changelog/v16.16.14","v16.16.14",{"_path":146,"title":147},"/docs/changelog/v16.16.7","v16.16.7",{"_path":149,"title":150},"/docs/changelog/v16.16.36","v16.16.36",{"_path":152,"title":153},"/docs/changelog/v16.16.32","v16.16.32",{"_path":155,"title":156},"/docs/changelog/v16.16.41","v16.16.41",{"_path":158,"title":159},"/docs/changelog/v16.6.0","v16.6.0",{"_path":161,"title":162},"/docs/changelog/v16.16.4","v16.16.4",{"_path":164,"title":165},"/docs/changelog/v16.16.0","v16.16.0",{"_path":167,"title":168},"/docs/changelog/v16.16.40","v16.16.40",{"_path":170,"title":171},"/docs/changelog/v16.16.20","v16.16.20",{"_path":173,"title":174},"/docs/changelog/v16.16.16","v16.16.16",{"_path":176,"title":177},"/docs/changelog/v16.16.25","v16.16.25",{"_path":179,"title":180},"/docs/changelog/v16.16.17","v16.16.17",{"_path":182,"title":183},"/docs/changelog/v16.17.8","v16.17.8",{"_path":185,"title":186},"/docs/changelog/v16.16.33","v16.16.33",{"_path":188,"title":189},"/docs/changelog/v16.16.22","v16.16.22",{"_path":191,"title":192},"/docs/changelog/v16.16.23","v16.16.23",{"_path":194,"title":195},"/docs/changelog/v16.16.35","v16.16.35",{"_path":197,"title":198},"/docs/changelog/v16.16.24","v16.16.24",{"_path":200,"title":201},"/docs/changelog/v16.16.5","v16.16.5",{"_path":203,"title":204},"/docs/changelog/v16.16.11","v16.16.11",{"_path":206,"title":207},"/docs/changelog/v16.16.27","v16.16.27",{"_path":209,"title":210},"/docs/changelog/v16.16.19","v16.16.19",{"_path":212,"title":213},"/docs/changelog/v16.16.13","v16.16.13",{"_path":215,"title":216},"/docs/changelog/v16.16.3","v16.16.3",{"_path":218,"title":219},"/docs/changelog/v16.9.0","v16.9.0",{"_path":221,"title":222},"/docs/changelog/v16.16.43","v16.16.43",{"_path":224,"title":225},"/docs/changelog/v16.16.2","v16.16.2",{"_path":227,"title":228},"/docs/changelog/v16.16.18","v16.16.18",{"_path":230,"title":231},"/docs/changelog/v16.16.30","v16.16.30",{"_path":233,"title":234},"/docs/changelog/v16.16.21","v16.16.21",{"_path":236,"title":237},"/docs/changelog/v16.16.26","v16.16.26",{"_path":239,"title":240},"/docs/changelog/v16.16.6","v16.16.6",{"_path":242,"title":243},"/docs/changelog/v16.16.31","v16.16.31",{"_path":245,"title":246},"/docs/changelog/v16.16.39","v16.16.39",{"_path":248,"title":249},"/docs/changelog/v16.16.34","v16.16.34",{"_path":251,"title":252},"/docs/changelog/v16.16.12","v16.16.12",{"_path":254,"title":255},"/docs/changelog/v16.8.0","v16.8.0",{"_path":257,"title":258},"/docs/changelog/v16.16.10","v16.16.10",{"_path":260,"title":261},"/docs/changelog/v16.16.9","v16.16.9",{"_path":263,"title":264},"/docs/changelog/v16.16.15","v16.16.15",{"_path":26,"_dir":266,"_draft":267,"_partial":267,"_locale":268,"title":27,"description":269,"order":28,"body":270,"_type":610,"_id":611,"_source":612,"_file":613,"_stem":614,"_extension":615},"api",false,"","Local HTTP API exposed by the Electron desktop app.",{"type":271,"children":272,"toc":600},"root",[273,281,287,294,299,304,313,318,324,329,341,346,355,360,369,374,380,393,404,409,415,420,448,453,459,468,477,486,492,503,509,514,519,576,582,587],{"type":274,"tag":275,"props":276,"children":278},"element","h1",{"id":277},"client-http-api",[279],{"type":280,"value":27},"text",{"type":274,"tag":282,"props":283,"children":284},"p",{},[285],{"type":280,"value":286},"The client HTTP API is a local automation surface exposed by the Electron desktop app. It is not the same thing as the remote server API. This allows you to create local automations that can import data like a webclipper or import script.",{"type":274,"tag":288,"props":289,"children":291},"h2",{"id":290},"availability",[292],{"type":280,"value":293},"Availability",{"type":274,"tag":282,"props":295,"children":296},{},[297],{"type":280,"value":298},"This API is Desktop-only for obvious reasons, a port to mobile is possible but not yet implemented because of the lack of useful benefits compared to the server API on low spec mobile devices.",{"type":274,"tag":282,"props":300,"children":301},{},[302],{"type":280,"value":303},"In the app, enable it under:",{"type":274,"tag":282,"props":305,"children":306},{},[307],{"type":274,"tag":308,"props":309,"children":310},"strong",{},[311],{"type":280,"value":312},"Settings → Local API",{"type":274,"tag":282,"props":314,"children":315},{},[316],{"type":280,"value":317},"When enabled, the main process starts a localhost HTTP server and generates a per-installation token.",{"type":274,"tag":288,"props":319,"children":321},{"id":320},"host-port-and-discovery",[322],{"type":280,"value":323},"Host, Port, and Discovery",{"type":274,"tag":282,"props":325,"children":326},{},[327],{"type":280,"value":328},"The API binds to:",{"type":274,"tag":330,"props":331,"children":335},"pre",{"className":332,"code":334,"language":280,"meta":268},[333],"language-text","127.0.0.1\n",[336],{"type":274,"tag":337,"props":338,"children":339},"code",{"__ignoreMap":268},[340],{"type":280,"value":334},{"type":274,"tag":282,"props":342,"children":343},{},[344],{"type":280,"value":345},"The default port is:",{"type":274,"tag":330,"props":347,"children":350},{"className":348,"code":349,"language":280,"meta":268},[333],"19532\n",[351],{"type":274,"tag":337,"props":352,"children":353},{"__ignoreMap":268},[354],{"type":280,"value":349},{"type":274,"tag":282,"props":356,"children":357},{},[358],{"type":280,"value":359},"If that port is already taken, the app falls back to a random free port and writes the actual port to a discovery file:",{"type":274,"tag":330,"props":361,"children":364},{"className":362,"code":363,"language":280,"meta":268},[333],"~/.heaper/api.json\n",[365],{"type":274,"tag":337,"props":366,"children":367},{"__ignoreMap":268},[368],{"type":280,"value":363},{"type":274,"tag":282,"props":370,"children":371},{},[372],{"type":280,"value":373},"The discovery file contains the current port, process ID, and startup time. The CLI reads this file to find the local API automatically.",{"type":274,"tag":288,"props":375,"children":377},{"id":376},"authentication",[378],{"type":280,"value":379},"Authentication",{"type":274,"tag":282,"props":381,"children":382},{},[383,385,391],{"type":280,"value":384},"All endpoints except ",{"type":274,"tag":337,"props":386,"children":388},{"className":387},[],[389],{"type":280,"value":390},"GET /api/health",{"type":280,"value":392}," require:",{"type":274,"tag":330,"props":394,"children":399},{"className":395,"code":397,"language":398,"meta":268},[396],"language-bash","Authorization: Bearer \u003Clocal-api-token>\n","bash",[400],{"type":274,"tag":337,"props":401,"children":402},{"__ignoreMap":268},[403],{"type":280,"value":397},{"type":274,"tag":282,"props":405,"children":406},{},[407],{"type":280,"value":408},"You can copy or regenerate the token from the same Local API settings panel.",{"type":274,"tag":288,"props":410,"children":412},{"id":411},"safety-model",[413],{"type":280,"value":414},"Safety Model",{"type":274,"tag":282,"props":416,"children":417},{},[418],{"type":280,"value":419},"This API is designed for local tooling, not remote exposure:",{"type":274,"tag":421,"props":422,"children":423},"ul",{},[424,430,435],{"type":274,"tag":425,"props":426,"children":427},"li",{},[428],{"type":280,"value":429},"it listens on localhost only",{"type":274,"tag":425,"props":431,"children":432},{},[433],{"type":280,"value":434},"it uses a separate local API token, not the server JWT flow",{"type":274,"tag":425,"props":436,"children":437},{},[438,440,446],{"type":280,"value":439},"the raw SQL endpoint only allows ",{"type":274,"tag":337,"props":441,"children":443},{"className":442},[],[444],{"type":280,"value":445},"SELECT",{"type":280,"value":447}," statements, edits are all going through the crdt's in the client to sync seamlessly with the server.",{"type":274,"tag":282,"props":449,"children":450},{},[451],{"type":280,"value":452},"If you expose this port beyond localhost yourself, you are responsible for the security boundary.",{"type":274,"tag":288,"props":454,"children":456},{"id":455},"quick-start-with-curl",[457],{"type":280,"value":458},"Quick Start with curl",{"type":274,"tag":330,"props":460,"children":463},{"className":461,"code":462,"language":398,"meta":268},[396],"curl http://127.0.0.1:19532/api/health\n",[464],{"type":274,"tag":337,"props":465,"children":466},{"__ignoreMap":268},[467],{"type":280,"value":462},{"type":274,"tag":330,"props":469,"children":472},{"className":470,"code":471,"language":398,"meta":268},[396],"curl http://127.0.0.1:19532/api/heaps \\\n  -H 'Authorization: Bearer \u003Clocal-api-token>'\n",[473],{"type":274,"tag":337,"props":474,"children":475},{"__ignoreMap":268},[476],{"type":280,"value":471},{"type":274,"tag":330,"props":478,"children":481},{"className":479,"code":480,"language":398,"meta":268},[396],"curl http://127.0.0.1:19532/api/search?q=notes \\\n  -H 'Authorization: Bearer \u003Clocal-api-token>'\n",[482],{"type":274,"tag":337,"props":483,"children":484},{"__ignoreMap":268},[485],{"type":280,"value":480},{"type":274,"tag":288,"props":487,"children":489},{"id":488},"quick-start-with-fetch",[490],{"type":280,"value":491},"Quick Start with fetch",{"type":274,"tag":330,"props":493,"children":498},{"className":494,"code":496,"language":497,"meta":268},[495],"language-js","const token = process.env.HEAPER_TOKEN;\n\nconst res = await fetch('http://127.0.0.1:19532/api/heaps', {\n  headers: {\n    Authorization: `Bearer ${token}`,\n  },\n});\n\nconst heaps = await res.json();\nconsole.log(heaps);\n","js",[499],{"type":274,"tag":337,"props":500,"children":501},{"__ignoreMap":268},[502],{"type":280,"value":496},{"type":274,"tag":288,"props":504,"children":506},{"id":505},"data-model-notes",[507],{"type":280,"value":508},"Data Model Notes",{"type":274,"tag":282,"props":510,"children":511},{},[512],{"type":280,"value":513},"This API reads from the local desktop app data store, including local workspace, block, relation, file, thumbnail, and app tables. It is intended for developer tooling and inspection, not as a stable public cloud API.",{"type":274,"tag":282,"props":515,"children":516},{},[517],{"type":280,"value":518},"Useful endpoints include:",{"type":274,"tag":421,"props":520,"children":521},{},[522,531,540,549,558,567],{"type":274,"tag":425,"props":523,"children":524},{},[525],{"type":274,"tag":337,"props":526,"children":528},{"className":527},[],[529],{"type":280,"value":530},"GET /api/heaps",{"type":274,"tag":425,"props":532,"children":533},{},[534],{"type":274,"tag":337,"props":535,"children":537},{"className":536},[],[538],{"type":280,"value":539},"GET /api/heaps/:id/blocks",{"type":274,"tag":425,"props":541,"children":542},{},[543],{"type":274,"tag":337,"props":544,"children":546},{"className":545},[],[547],{"type":280,"value":548},"GET /api/blocks/:id",{"type":274,"tag":425,"props":550,"children":551},{},[552],{"type":274,"tag":337,"props":553,"children":555},{"className":554},[],[556],{"type":280,"value":557},"GET /api/search",{"type":274,"tag":425,"props":559,"children":560},{},[561],{"type":274,"tag":337,"props":562,"children":564},{"className":563},[],[565],{"type":280,"value":566},"POST /api/query",{"type":274,"tag":425,"props":568,"children":569},{},[570],{"type":274,"tag":337,"props":571,"children":573},{"className":572},[],[574],{"type":280,"value":575},"POST /api/blocks",{"type":274,"tag":288,"props":577,"children":579},{"id":578},"reference",[580],{"type":280,"value":581},"Reference",{"type":274,"tag":282,"props":583,"children":584},{},[585],{"type":280,"value":586},"Use the generated route reference for the exact local endpoint inventory:",{"type":274,"tag":421,"props":588,"children":589},{},[590],{"type":274,"tag":425,"props":591,"children":592},{},[593],{"type":274,"tag":594,"props":595,"children":597},"a",{"href":596},"/docs/api/client-http-reference",[598],{"type":280,"value":599},"Client HTTP API Reference",{"title":268,"searchDepth":28,"depth":28,"links":601},[602,603,604,605,606,607,608,609],{"id":290,"depth":28,"text":293},{"id":320,"depth":28,"text":323},{"id":376,"depth":28,"text":379},{"id":411,"depth":28,"text":414},{"id":455,"depth":28,"text":458},{"id":488,"depth":28,"text":491},{"id":505,"depth":28,"text":508},{"id":578,"depth":28,"text":581},"markdown","content:docs:api:client-http.md","content","docs/api/client-http.md","docs/api/client-http","md",1777640558090]