[{"data":1,"prerenderedAt":1305},["ShallowReactive",2],{"docs.index":3,"docs.page.\u002Fdocs\u002Fagents\u002Freference\u002Fauthentication":358},[4,20,26,33,43,52,59,65,71,76,82,89,95,100,104,111,115,119,123,132,137,141,147,152,157,163,170,177,183,189,193,199,205,211,217,222,226,230,236,242,247,252,256,260,265,271,277,283,287,294,299,305,310,314,318,322,328,333,338,343,347,353],{"path":5,"title":6,"navTitle":7,"seoTitle":8,"description":9,"type":10,"position":11,"updated":12,"release":13,"related":14,"plans":17},"\u002Fdocs\u002Faccount\u002Fbilling","Upgrade and manage billing","Billing",null,"Move a workspace onto Grove or Forest, understand how seats are charged, and what happens if a payment fails or you cancel.","how-to",2,"2026-09-29","public",[15,16],"\u002Fdocs\u002Faccount\u002Fplans-and-limits","\u002Fdocs\u002Fsharing\u002Finvite-people",[18,19],"grove","forest",{"path":21,"title":22,"navTitle":8,"seoTitle":8,"description":23,"type":24,"position":25,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Faccount","Account and billing","What each plan includes, how billing and seats work, managing your account, and how Treehouse keeps your files safe.","hub",7,{"path":15,"title":27,"navTitle":8,"seoTitle":8,"description":28,"type":29,"position":30,"updated":12,"release":13,"related":31,"plans":8},"Plans and limits","What Seedling, Grove and Forest include, how usage is counted, and what happens when a workspace reaches a limit.","reference",1,[5,16,32],"\u002Fdocs\u002Fsharing\u002Fshare-links",{"path":34,"title":35,"navTitle":8,"seoTitle":8,"description":36,"type":37,"position":38,"updated":12,"release":13,"related":39,"plans":8},"\u002Fdocs\u002Faccount\u002Fsecurity-and-privacy","Security and privacy","How Treehouse encrypts your files, who can see what in a workspace, and how keys, share links and HTML pages are kept in check.","concept",4,[40,32,41,42],"\u002Fdocs\u002Fagents\u002Fconnect\u002Fapi-keys","\u002Fdocs\u002Ffiles\u002Fprivate-files","\u002Fdocs\u002Ffiles\u002Fhtml-pages",{"path":44,"title":45,"navTitle":46,"seoTitle":8,"description":47,"type":10,"position":48,"updated":12,"release":13,"related":49,"plans":8},"\u002Fdocs\u002Faccount\u002Fyour-account","Manage your account","Your account","Create an account, sign in and out, reset a forgotten password, and move between the workspaces you belong to.",3,[50,51,34],"\u002Fdocs\u002Fget-started\u002Fquickstart","\u002Fdocs\u002Fsharing\u002Fcustomise-your-workspace",{"path":40,"title":53,"navTitle":54,"seoTitle":8,"description":55,"type":10,"position":38,"updated":12,"release":13,"related":56,"plans":8},"Manage API keys","API keys","Create a key for each agent, see which keys can reach your workspaces, and revoke the ones you no longer need.",[57,58,34],"\u002Fdocs\u002Fagents\u002Fconnect\u002Fclaude-code","\u002Fdocs\u002Fagents\u002Freference\u002Fauthentication",{"path":57,"title":60,"navTitle":8,"seoTitle":8,"description":61,"type":10,"position":11,"updated":12,"release":13,"related":62,"plans":8},"Connect Claude Code","Give Claude Code access to a workspace through your synced folder, the Treehouse MCP server, or both.",[63,40,64],"\u002Fdocs\u002Fagents\u002Fconnect\u002Fhow-agents-work","\u002Fdocs\u002Fplaybooks\u002Fwrite-your-agents-md",{"path":63,"title":66,"navTitle":67,"seoTitle":8,"description":68,"type":37,"position":30,"updated":12,"release":13,"related":69,"plans":8},"How agents work with Treehouse","How agents work","The two ways an agent can reach a workspace, what it can do there, and how its work shows up for everyone else.",[57,40,70],"\u002Fdocs\u002Fagents\u002Fhandbook",{"path":72,"title":73,"navTitle":74,"seoTitle":8,"description":75,"type":24,"position":30,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fagents\u002Fconnect","Connect an agent","Connect","Give Claude Code, Codex, Cursor or any other agent access to a workspace, with its own key when you want its work labelled.",{"path":77,"title":78,"navTitle":8,"seoTitle":8,"description":79,"type":10,"position":48,"updated":12,"release":13,"related":80,"plans":8},"\u002Fdocs\u002Fagents\u002Fconnect\u002Fother-agents","Connect other agents","Connection settings for Cursor, VS Code, Codex, Gemini CLI, Claude Desktop and any other MCP client.",[57,40,81],"\u002Fdocs\u002Fagents\u002Freference\u002Fmcp-server",{"path":70,"title":83,"navTitle":83,"seoTitle":84,"description":85,"type":24,"position":11,"updated":12,"release":13,"related":86,"plans":8},"Agent handbook","Agent handbook: how agents work in Treehouse","Written for agents. How to reach a Treehouse workspace, the rules that keep everyone's work safe, and the conventions the web app understands.",[81,87,88],"\u002Fdocs\u002Fagents\u002Fhandbook\u002Fversions-and-conflicts","\u002Fdocs\u002Fplaybooks\u002Freview-loop",{"path":87,"title":90,"navTitle":8,"seoTitle":8,"description":91,"type":37,"position":30,"updated":12,"release":13,"related":92,"plans":8},"Versions and conflicts","The concurrency contract every Treehouse client shares - version numbers, compare-and-swap writes, conflicted copies, deletes, moves and restores.",[93,94,81],"\u002Fdocs\u002Ffiles\u002Fconflicted-copies","\u002Fdocs\u002Fagents\u002Freference\u002Frest-api",{"path":96,"title":97,"navTitle":8,"seoTitle":98,"description":99,"type":24,"position":30,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fagents","Agents","Treehouse for agents","Everything an agent needs to work in a Treehouse workspace, and everything you need to connect one.",{"path":58,"title":101,"navTitle":8,"seoTitle":8,"description":102,"type":29,"position":30,"updated":12,"release":13,"related":103,"plans":8},"Authentication","How API keys work, what each kind of key can reach, the device authorisation flow the CLI and desktop app use, and how keys are revoked.",[40,81,94],{"path":105,"title":106,"navTitle":8,"seoTitle":8,"description":107,"type":29,"position":38,"updated":12,"release":13,"related":108,"plans":8},"\u002Fdocs\u002Fagents\u002Freference\u002Fchange-feed","Change feed","Read every change to a workspace in order with a cursor, so a script or agent can react to new and edited files.",[109,110,87],"\u002Fdocs\u002Fsharing\u002Factivity","\u002Fdocs\u002Fplaybooks\u002Froutines",{"path":112,"title":113,"navTitle":8,"seoTitle":8,"description":114,"type":24,"position":48,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fagents\u002Freference","API reference","The protocol reference - authentication, every MCP tool, the REST API and the change feed.",{"path":81,"title":116,"navTitle":8,"seoTitle":8,"description":117,"type":29,"position":11,"updated":12,"release":13,"related":118,"plans":8},"MCP server","Every tool the Treehouse MCP server exposes, with parameters, outputs, limits and the instructions it gives connected agents.",[57,77,87],{"path":94,"title":120,"navTitle":8,"seoTitle":8,"description":121,"type":29,"position":48,"updated":12,"release":13,"related":122,"plans":8},"REST API","Endpoints for reading, writing, moving, searching, sharing and commenting on workspace files over HTTP, with headers, status codes and examples.",[58,87,105],{"path":124,"title":125,"navTitle":126,"seoTitle":8,"description":127,"type":29,"position":128,"updated":12,"release":13,"related":129,"plans":8},"\u002Fdocs\u002Fdesktop\u002Fcli-reference","Sync CLI reference","Sync CLI","Every treehouse command and flag, the files and environment variables the CLI reads, and the safety rules it follows while syncing.",5,[130,131,105],"\u002Fdocs\u002Fdesktop\u002Fsync-with-the-cli","\u002Fdocs\u002Fdesktop\u002Fhow-sync-works",{"path":131,"title":133,"navTitle":8,"seoTitle":8,"description":134,"type":37,"position":11,"updated":12,"release":13,"related":135,"plans":8},"How sync works","What the sync engine does in the background, which files it skips, and how it protects your work when things go wrong.",[93,41,109,136],"\u002Fdocs\u002Fget-started\u002Fhow-treehouse-works",{"path":138,"title":139,"navTitle":8,"seoTitle":8,"description":140,"type":24,"position":128,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fdesktop","Desktop app and sync","Keep a folder on your computer in step with a workspace, using the Mac app or the sync CLI.",{"path":142,"title":143,"navTitle":8,"seoTitle":8,"description":144,"type":10,"position":30,"updated":12,"release":13,"related":145,"plans":8},"\u002Fdocs\u002Fdesktop\u002Finstall-the-desktop-app","Install the desktop app","Download Treehouse for Mac, sign in and pick a folder, and your workspace's files appear on your computer and stay in sync.",[131,146,130],"\u002Fdocs\u002Fdesktop\u002Fmanage-synced-folders",{"path":146,"title":148,"navTitle":8,"seoTitle":8,"description":149,"type":10,"position":48,"updated":12,"release":13,"related":150,"plans":8},"Manage synced folders","Check sync status, pause, move or stop syncing a folder, add another workspace, and sign out, all from the Treehouse icon in your menu bar.",[131,130,151],"\u002Fdocs\u002Fhelp\u002Ftroubleshooting",{"path":130,"title":153,"navTitle":154,"seoTitle":8,"description":155,"type":10,"position":38,"updated":12,"release":13,"related":156,"plans":8},"Sync a folder with the CLI","Sync with the CLI","Install the treehouse command-line tool to sync a folder on Windows, Linux, a server or any machine where the desktop app doesn't run.",[124,131,146],{"path":93,"title":158,"navTitle":8,"seoTitle":8,"description":159,"type":37,"position":160,"updated":12,"release":13,"related":161,"plans":8},"Conflicted copies","When two edits to the same file collide, Treehouse keeps both. Here's what a conflicted copy is, how to spot one and how to resolve it.",9,[162,131,87],"\u002Fdocs\u002Ffiles\u002Fversion-history",{"path":164,"title":165,"navTitle":166,"seoTitle":8,"description":167,"type":10,"position":11,"updated":12,"release":13,"related":168,"plans":8},"\u002Fdocs\u002Ffiles\u002Fcreate-and-edit","Create and edit files","Create and edit","Make new files and folders in the web app, edit markdown, code and HTML, and save your changes.",[169,93,162],"\u002Fdocs\u002Ffiles\u002Ffront-matter",{"path":171,"title":172,"navTitle":173,"seoTitle":8,"description":174,"type":10,"position":128,"updated":12,"release":13,"related":175,"plans":8},"\u002Fdocs\u002Ffiles\u002Ffolder-pages","Turn a folder into a page or calendar","Folder pages and calendars","Give a folder a front page with a README, or show a folder of dated notes as a calendar you can reschedule by dragging.",[169,42,176],"\u002Fdocs\u002Fplaybooks\u002Fshape-your-workspace",{"path":169,"title":178,"navTitle":179,"seoTitle":8,"description":180,"type":29,"position":181,"updated":12,"release":13,"related":182,"plans":8},"Front matter reference","Front matter","The YAML block at the top of a markdown file, and the keys Treehouse reads from it to label, title and schedule your files.",6,[171,164,110],{"path":42,"title":184,"navTitle":185,"seoTitle":8,"description":186,"type":10,"position":25,"updated":12,"release":13,"related":187,"plans":8},"Publish an HTML page","HTML pages","Show HTML files as full pages, decide when their scripts may run, and share them publicly as reports, dashboards or decks.",[32,171,188],"\u002Fdocs\u002Ffiles\u002Fview-files",{"path":190,"title":191,"navTitle":8,"seoTitle":8,"description":192,"type":24,"position":48,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Ffiles","Files and folders","Find, read, write, upload and organise the files in a workspace, and get back anything that changed.",{"path":194,"title":195,"navTitle":196,"seoTitle":8,"description":197,"type":10,"position":38,"updated":12,"release":13,"related":198,"plans":8},"\u002Fdocs\u002Ffiles\u002Forganise-files","Rename, move and organise files","Organise files","Rename, move, reorder and delete files and folders, and give them icons, from the sidebar tree.",[162,41,176],{"path":41,"title":200,"navTitle":201,"seoTitle":8,"description":202,"type":10,"position":203,"updated":12,"release":13,"related":204,"plans":8},"Keep files private","Private files","Make a file or folder visible only to you and your own agents, even in a workspace you share with others.",10,[194,32,63],{"path":206,"title":207,"navTitle":208,"seoTitle":8,"description":209,"type":10,"position":48,"updated":12,"release":13,"related":210,"plans":8},"\u002Fdocs\u002Ffiles\u002Fupload-and-download","Upload and download files","Upload and download","Add files from your computer to a workspace, decide what happens when names clash, and download a copy of any file.",[164,131,15],{"path":162,"title":212,"navTitle":213,"seoTitle":8,"description":214,"type":10,"position":215,"updated":12,"release":13,"related":216,"plans":8},"See and restore earlier versions","Version history","Look through every change to a file, see who made it, view or restore an older version, and catch up on what changed while you were away.",8,[93,109,87],{"path":188,"title":218,"navTitle":219,"seoTitle":8,"description":220,"type":10,"position":30,"updated":12,"release":13,"related":221,"plans":8},"Find and view files","Find and view","Browse the file tree, search by name, and see how Treehouse shows markdown, HTML, code, images and everything else.",[164,171,162],{"path":136,"title":223,"navTitle":8,"seoTitle":8,"description":224,"type":37,"position":48,"updated":12,"release":13,"related":225,"plans":8},"How Treehouse works","Workspaces, versions, conflicted copies and attribution - the handful of ideas the rest of Treehouse is built on.",[162,93,63,87],{"path":227,"title":228,"navTitle":8,"seoTitle":8,"description":229,"type":24,"position":11,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fget-started","Get started","What Treehouse is, how to set up your first workspace, and how it works underneath.",{"path":50,"title":231,"navTitle":8,"seoTitle":8,"description":232,"type":233,"position":11,"updated":12,"release":13,"related":234,"plans":8},"Quickstart","Create a workspace, sync it to your computer, connect an agent and let it set things up. About ten minutes.","guide",[235,57,64],"\u002Fdocs\u002Fget-started\u002Fset-up-with-an-agent",{"path":235,"title":237,"navTitle":238,"seoTitle":8,"description":239,"type":10,"position":38,"updated":12,"release":13,"related":240,"plans":8},"Set up a workspace with an agent","Set up with an agent","Hand a new, empty workspace to an agent. It interviews you, proposes a structure and builds it once you agree.",[176,64,241],"\u002Fdocs\u002Fplaybooks\u002Finbox-and-filing",{"path":243,"title":244,"navTitle":244,"seoTitle":8,"description":245,"type":37,"position":30,"updated":12,"release":13,"related":246,"plans":8},"\u002Fdocs\u002Fget-started\u002Fwhat-is-treehouse","What is Treehouse?","A shared workspace of plain files that people and agents both work in, with the sharing, history and review that plain folders lack.",[50,136,63],{"path":248,"title":249,"navTitle":250,"seoTitle":8,"description":251,"type":29,"position":11,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fhelp\u002Ffaq","Frequently asked questions","FAQ","Short answers to the questions people ask most about Treehouse, agents, sharing and data.",{"path":253,"title":254,"navTitle":8,"seoTitle":8,"description":255,"type":29,"position":48,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fhelp\u002Fglossary","Glossary","The words Treehouse uses, and what each one means in the app and in these docs.",{"path":257,"title":258,"navTitle":8,"seoTitle":8,"description":259,"type":24,"position":215,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fhelp","Help","Fixes for common problems, answers to common questions, and the words Treehouse uses.",{"path":151,"title":261,"navTitle":8,"seoTitle":262,"description":263,"type":10,"position":30,"updated":12,"release":13,"related":264,"plans":8},"Troubleshooting","Troubleshooting Treehouse sync, agents and sharing","The problems people hit most often with sync, agent connections, sharing and limits, and how to fix each one.",[146,57,93],{"path":266,"title":267,"navTitle":8,"seoTitle":268,"description":269,"type":24,"position":270,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs","Treehouse docs","Treehouse documentation","How to set up a shared workspace for your team and your agents, and how to get the most out of it once you have.",0,{"path":272,"title":273,"navTitle":274,"seoTitle":8,"description":275,"type":233,"position":215,"updated":12,"release":13,"related":276,"plans":8},"\u002Fdocs\u002Fplaybooks\u002Fclient-work","Run client work","Client work","A folder per client, agents that prepare the deliverables, and share links that give clients exactly what they should see.",[32,42,88],{"path":241,"title":278,"navTitle":279,"seoTitle":8,"description":280,"type":233,"position":48,"updated":12,"release":13,"related":281,"plans":8},"Run an inbox your agent files","Inbox and filing","Drop anything into Inbox\u002F without deciding where it goes, and have an agent file it by rules you write once.",[110,282,176],"\u002Fdocs\u002Fplaybooks\u002Fsecond-brain",{"path":284,"title":285,"navTitle":8,"seoTitle":8,"description":286,"type":24,"position":181,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fplaybooks","Playbooks","Opinionated patterns for running a workspace with your agents, from the rulebook they follow to the routines that keep it alive.",{"path":288,"title":289,"navTitle":290,"seoTitle":8,"description":291,"type":233,"position":128,"updated":12,"release":13,"related":292,"plans":8},"\u002Fdocs\u002Fplaybooks\u002Fmemory-and-decisions","Give your agents a memory","Memory and decisions","Status pages, decision records and handoff notes that let any agent pick up where the last session left off.",[64,293,171],"\u002Fdocs\u002Fplaybooks\u002Fmultiple-agents",{"path":293,"title":295,"navTitle":296,"seoTitle":8,"description":297,"type":233,"position":25,"updated":12,"release":13,"related":298,"plans":8},"Work with several agents","Several agents","Give each agent its own key and its own lane, hand work over through files, and let versioning catch the collisions.",[40,288,93],{"path":88,"title":300,"navTitle":301,"seoTitle":8,"description":302,"type":233,"position":38,"updated":12,"release":13,"related":303,"plans":8},"Review your agent's work","Review loop","Let an agent draft, review it with comments in the web app, and have the agent work through your feedback thread by thread.",[304,162,57],"\u002Fdocs\u002Fsharing\u002Fcomments",{"path":110,"title":306,"navTitle":307,"seoTitle":8,"description":308,"type":233,"position":181,"updated":12,"release":13,"related":309,"plans":8},"Set up routines","Routines","Recurring agent work, like a morning inbox run or a weekly review, and where the schedule lives when Treehouse doesn't run agents itself.",[241,130,105],{"path":282,"title":311,"navTitle":8,"seoTitle":8,"description":312,"type":233,"position":160,"updated":12,"release":13,"related":313,"plans":8},"Build a second brain","A personal workspace where you capture everything quickly and an agent keeps it filed, linked and useful.",[241,110,171],{"path":176,"title":315,"navTitle":8,"seoTitle":8,"description":316,"type":233,"position":11,"updated":12,"release":13,"related":317,"plans":8},"Shape your workspace","Folder structures that work for people and agents alike, and the handful of habits that keep a workspace easy to navigate as it grows.",[64,171,194],{"path":64,"title":319,"navTitle":8,"seoTitle":8,"description":320,"type":233,"position":30,"updated":12,"release":13,"related":321,"plans":8},"Write your AGENTS.md","The one file every agent reads first. What to put in it so any agent, in any session, works the way your team does.",[176,63,235],{"path":323,"title":324,"navTitle":325,"seoTitle":8,"description":326,"type":24,"position":160,"updated":12,"release":13,"related":327,"plans":8},"\u002Fdocs\u002Fself-hosting","Self-host Treehouse","Self-hosting","Run your own Treehouse server - the architecture, required and optional environment variables, storage and encryption, and connecting clients.",[58,81,124],{"path":109,"title":329,"navTitle":330,"seoTitle":8,"description":331,"type":10,"position":38,"updated":12,"release":13,"related":332,"plans":8},"See what changed in a workspace","Activity","The activity feed shows every change and comment in a workspace, who made it, and whether it came from a person or an agent.",[63,40,162,93],{"path":304,"title":334,"navTitle":335,"seoTitle":8,"description":336,"type":10,"position":48,"updated":12,"release":13,"related":337,"plans":8},"Comment on a document","Comments","Leave comments on passages of a markdown file, reply and resolve threads, and let agents read and act on your feedback.",[88,162,109],{"path":51,"title":339,"navTitle":340,"seoTitle":8,"description":341,"type":10,"position":128,"updated":12,"release":13,"related":342,"plans":8},"Customise your workspace","Customise a workspace","Rename a workspace, give it an icon and colour, create new workspaces, and choose a theme for everyone or just for you.",[15,32],{"path":344,"title":345,"navTitle":8,"seoTitle":8,"description":346,"type":24,"position":38,"updated":12,"release":13,"related":8,"plans":8},"\u002Fdocs\u002Fsharing","Share and collaborate","Invite people into a workspace, share files with anyone by link, comment on documents and see who changed what.",{"path":16,"title":348,"navTitle":349,"seoTitle":8,"description":350,"type":10,"position":30,"updated":12,"release":13,"related":351,"plans":352},"Invite people to a workspace","Invite people","Bring teammates into a workspace with an invite link, see who's a member, and remove people when they no longer need access.",[32,5,40],[18,19],{"path":32,"title":354,"navTitle":355,"seoTitle":8,"description":356,"type":10,"position":11,"updated":12,"release":13,"related":357,"plans":8},"Share a file or folder with a link","Share links","Send members straight to a file, or give anyone read-only access to a file or folder, with an optional password and a pinned version.",[16,42,162,15],{"id":359,"title":101,"body":360,"description":102,"extension":1298,"meta":1299,"navTitle":8,"navigation":1300,"path":58,"plans":8,"position":30,"related":1301,"release":13,"seo":1302,"seoTitle":8,"stem":1303,"type":29,"updated":12,"__hash__":1304},"docs\u002Fdocs\u002Fagents\u002Freference\u002Fauthentication.md",{"type":361,"value":362,"toc":1284},"minimark",[363,368,417,438,470,474,550,570,575,585,620,627,631,646,650,663,757,784,788,791,830,835,968,971,975,1112,1118,1122,1132,1180,1185,1200,1208,1212,1215,1235,1239,1280],[364,365,367],"h2",{"id":366},"credentials","Credentials",[369,370,371,387],"table",{},[372,373,374],"thead",{},[375,376,377,381,384],"tr",{},[378,379,380],"th",{},"Credential",[378,382,383],{},"Sent as",[378,385,386],{},"Works for",[388,389,390,406],"tbody",{},[375,391,392,396,403],{},[393,394,395],"td",{},"API key",[393,397,398,402],{},[399,400,401],"code",{},"x-api-key: \u003Ckey>"," header",[393,404,405],{},"The REST API, the MCP server and the change feed",[375,407,408,411,414],{},[393,409,410],{},"Browser session cookie",[393,412,413],{},"Cookie set by signing in",[393,415,416],{},"The REST API, including the key-management endpoints",[418,419,422],"callout",{"title":420,"type":421},"Use x-api-key, not Bearer","warning",[423,424,425,426,429,430,433,434,437],"p",{},"The server reads the key from the ",[399,427,428],{},"x-api-key"," header only. A key sent as ",[399,431,432],{},"Authorization: Bearer \u003Ckey>"," is ignored, and the request fails with ",[399,435,436],{},"401"," as if no credential was sent. This is the most common reason a new integration can't connect.",[439,440,445],"pre",{"className":441,"code":442,"language":443,"meta":444,"style":444},"language-bash shiki shiki-themes everforest-dark","curl https:\u002F\u002Fapi.trytree.house\u002Fapi\u002Fworkspace \\\n  -H \"x-api-key: th_example_key\"\n","bash","",[399,446,447,462],{"__ignoreMap":444},[448,449,451,455,459],"span",{"class":450,"line":30},"line",[448,452,454],{"class":453},"sRC7j","curl",[448,456,458],{"class":457},"sySyC"," https:\u002F\u002Fapi.trytree.house\u002Fapi\u002Fworkspace",[448,460,461],{"class":453}," \\\n",[448,463,464,467],{"class":450,"line":11},[448,465,466],{"class":457},"  -H",[448,468,469],{"class":453}," \"x-api-key: th_example_key\"\n",[364,471,473],{"id":472},"kinds-of-key","Kinds of key",[369,475,476,492],{},[372,477,478],{},[375,479,480,483,486,489],{},[378,481,482],{},"Kind",[378,484,485],{},"How it's made",[378,487,488],{},"Reaches",[378,490,491],{},"MCP tool set",[388,493,494,525],{},[375,495,496,499,509,512],{},[393,497,498],{},"Account-wide",[393,500,501,502,505,506],{},"Created in the web app, or ",[399,503,504],{},"POST \u002Fapi\u002Fkeys"," without ",[399,507,508],{},"workspaceId",[393,510,511],{},"Every workspace you're a member of, checked per request",[393,513,514,515,517,518,521,522],{},"Every tool takes ",[399,516,508],{},"; adds ",[399,519,520],{},"list_workspaces"," and ",[399,523,524],{},"create_workspace",[375,526,527,530,538,544],{},[393,528,529],{},"Workspace-scoped",[393,531,532,533,535,536],{},"The device flow (desktop app, CLI), or ",[399,534,504],{}," with ",[399,537,508],{},[393,539,540,541],{},"One workspace. Any other workspace returns ",[399,542,543],{},"403",[393,545,546,547,549],{},"No ",[399,548,508],{}," parameter",[423,551,552,553,557,558,561,562,565,566,569],{},"Every key also carries an ",[554,555,556],"strong",{},"actor type",", ",[399,559,560],{},"agent"," or ",[399,563,564],{},"human",". It is how Treehouse attributes changes: every write, move, delete and comment made with the key is recorded with that ",[399,567,568],{},"principal",", together with the key's id and name. The activity feed shows agent changes as agent changes because the key says so, not because of which endpoint was used.",[571,572,574],"h3",{"id":573},"keys-from-the-web-app","Keys from the web app",[423,576,577,578,580,581,584],{},"In the web app, open the account menu and choose ",[554,579,54],{},". ",[554,582,583],{},"Used by"," sets the actor type:",[369,586,587,596],{},[372,588,589],{},[375,590,591,593],{},[378,592,583],{},[378,594,595],{},"Actor type",[388,597,598,609],{},[375,599,600,605],{},[393,601,602],{},[554,603,604],{},"Agent (MCP)",[393,606,607],{},[399,608,560],{},[375,610,611,616],{},[393,612,613],{},[554,614,615],{},"Human (CLI)",[393,617,618],{},[399,619,564],{},[423,621,622,623,626],{},"Keys created here are account-wide. The key is shown once, when you create it. The ",[624,625,54],"a",{"href":40}," page covers the UI in detail.",[571,628,630],{"id":629},"keys-from-the-device-flow","Keys from the device flow",[423,632,633,634,637,638,642,643,645],{},"The desktop app and ",[399,635,636],{},"treehouse login"," get a workspace-scoped key through the ",[624,639,641],{"href":640},"#device-authorisation-flow","device authorisation flow"," below. These keys default to the ",[399,644,564],{}," actor type.",[364,647,649],{"id":648},"key-management-endpoints","Key management endpoints",[423,651,652,653,655,656,658,659,662],{},"These accept a browser session cookie only. A request carrying ",[399,654,428],{}," is refused with ",[399,657,543],{}," and the message ",[399,660,661],{},"Key management requires a logged-in session, not an API key",", so a leaked key can never mint or revoke other keys.",[369,664,665,678],{},[372,666,667],{},[375,668,669,672,675],{},[378,670,671],{},"Method",[378,673,674],{},"Path",[378,676,677],{},"Body \u002F result",[388,679,680,710,738],{},[375,681,682,687,692],{},[393,683,684],{},[399,685,686],{},"POST",[393,688,689],{},[399,690,691],{},"\u002Fapi\u002Fkeys",[393,693,694,695,698,699,702,703,705,706,709],{},"Body ",[399,696,697],{},"{ name?, actorType?, workspaceId? }",". Returns ",[399,700,701],{},"{ id, key, name, actorType }",", plus ",[399,704,508],{}," when scoped. The plaintext ",[399,707,708],{},"key"," is only returned here.",[375,711,712,717,721],{},[393,713,714],{},[399,715,716],{},"GET",[393,718,719],{},[399,720,691],{},[393,722,723,726,727,730,731,734,735,737],{},[399,724,725],{},"{ keys: [...] }",", each with its ",[399,728,729],{},"metadata"," (",[399,732,733],{},"actorType",", and ",[399,736,508],{}," for scoped keys). No plaintext keys.",[375,739,740,745,750],{},[393,741,742],{},[399,743,744],{},"DELETE",[393,746,747],{},[399,748,749],{},"\u002Fapi\u002Fkeys\u002F{id}",[393,751,752,753,756],{},"Revokes the key. Returns ",[399,754,755],{},"{ ok: true }",".",[423,758,759,761,762,561,764,766,767,580,769,772,773,776,777,780,781,783],{},[399,760,733],{}," is ",[399,763,560],{},[399,765,564],{},"; anything else is treated as ",[399,768,564],{},[399,770,771],{},"name"," defaults to ",[399,774,775],{},"treehouse-key"," (account-wide) or ",[399,778,779],{},"treehouse-cli"," (workspace-scoped). With ",[399,782,508],{},", you must be a member of that workspace.",[364,785,787],{"id":786},"device-authorisation-flow","Device authorisation flow",[423,789,790],{},"A client with no browser session (the CLI, the desktop app, or your own tool) can get a workspace-scoped key by asking the user to approve it in the web app. It follows the shape of OAuth device authorisation (RFC 8628).",[792,793,794,802,816,819],"ol",{},[795,796,797,798,801],"li",{},"The client calls ",[399,799,800],{},"POST \u002Fapi\u002Fdevice\u002Fcode"," with no credentials.",[795,803,804,805,808,809,812,813,756],{},"The client shows the user ",[399,806,807],{},"verification_uri_complete"," (the web app's ",[399,810,811],{},"\u002Flink"," page, with the code filled in) and ",[399,814,815],{},"user_code",[795,817,818],{},"The user signs in, picks a workspace and approves.",[795,820,821,822,825,826,829],{},"The client polls ",[399,823,824],{},"GET \u002Fapi\u002Fdevice\u002Fpoll?device_code=\u003Cdevice_code>"," every ",[399,827,828],{},"interval"," seconds until it gets the key.",[423,831,832,834],{},[399,833,800],{}," returns:",[439,836,840],{"className":837,"code":838,"language":839,"meta":444,"style":444},"language-json shiki shiki-themes everforest-dark","{\n  \"device_code\": \"…\",\n  \"user_code\": \"ABCD-EFGH\",\n  \"verification_uri\": \"https:\u002F\u002Fapp.trytree.house\u002Flink\",\n  \"verification_uri_complete\": \"https:\u002F\u002Fapp.trytree.house\u002Flink?code=ABCD-EFGH\",\n  \"expires_in\": 600,\n  \"interval\": 5\n}\n","json",[399,841,842,848,875,894,914,933,950,963],{"__ignoreMap":444},[448,843,844],{"class":450,"line":30},[448,845,847],{"class":846},"sY0Nt","{\n",[448,849,850,854,858,861,864,867,870,872],{"class":450,"line":11},[448,851,853],{"class":852},"s3WQq","  \"",[448,855,857],{"class":856},"sDOmQ","device_code",[448,859,860],{"class":852},"\"",[448,862,863],{"class":852},":",[448,865,866],{"class":852}," \"",[448,868,869],{"class":453},"…",[448,871,860],{"class":852},[448,873,874],{"class":852},",\n",[448,876,877,879,881,883,885,887,890,892],{"class":450,"line":48},[448,878,853],{"class":852},[448,880,815],{"class":856},[448,882,860],{"class":852},[448,884,863],{"class":852},[448,886,866],{"class":852},[448,888,889],{"class":453},"ABCD-EFGH",[448,891,860],{"class":852},[448,893,874],{"class":852},[448,895,896,898,901,903,905,907,910,912],{"class":450,"line":38},[448,897,853],{"class":852},[448,899,900],{"class":856},"verification_uri",[448,902,860],{"class":852},[448,904,863],{"class":852},[448,906,866],{"class":852},[448,908,909],{"class":453},"https:\u002F\u002Fapp.trytree.house\u002Flink",[448,911,860],{"class":852},[448,913,874],{"class":852},[448,915,916,918,920,922,924,926,929,931],{"class":450,"line":128},[448,917,853],{"class":852},[448,919,807],{"class":856},[448,921,860],{"class":852},[448,923,863],{"class":852},[448,925,866],{"class":852},[448,927,928],{"class":453},"https:\u002F\u002Fapp.trytree.house\u002Flink?code=ABCD-EFGH",[448,930,860],{"class":852},[448,932,874],{"class":852},[448,934,935,937,940,942,944,948],{"class":450,"line":181},[448,936,853],{"class":852},[448,938,939],{"class":856},"expires_in",[448,941,860],{"class":852},[448,943,863],{"class":852},[448,945,947],{"class":946},"s9lfW"," 600",[448,949,874],{"class":852},[448,951,952,954,956,958,960],{"class":450,"line":25},[448,953,853],{"class":852},[448,955,828],{"class":856},[448,957,860],{"class":852},[448,959,863],{"class":852},[448,961,962],{"class":946}," 5\n",[448,964,965],{"class":450,"line":215},[448,966,967],{"class":846},"}\n",[423,969,970],{},"The code expires after 10 minutes and can be used once.",[571,972,974],{"id":973},"poll-responses","Poll responses",[369,976,977,990],{},[372,978,979],{},[375,980,981,984,987],{},[378,982,983],{},"Status",[378,985,986],{},"Body",[378,988,989],{},"Meaning",[388,991,992,1007,1021,1036,1051,1066,1080,1098],{},[375,993,994,999,1004],{},[393,995,996],{},[399,997,998],{},"200",[393,1000,1001],{},[399,1002,1003],{},"{ \"status\": \"pending\" }",[393,1005,1006],{},"Not approved yet. Keep polling.",[375,1008,1009,1013,1018],{},[393,1010,1011],{},[399,1012,998],{},[393,1014,1015],{},[399,1016,1017],{},"{ \"status\": \"approved\", \"api_key\", \"api_key_id\", \"workspace_id\", \"api_base\" }",[393,1019,1020],{},"Approved. Store the key; this response is delivered once.",[375,1022,1023,1028,1033],{},[393,1024,1025],{},[399,1026,1027],{},"400",[393,1029,1030],{},[399,1031,1032],{},"device_code required",[393,1034,1035],{},"The query parameter is missing.",[375,1037,1038,1043,1048],{},[393,1039,1040],{},[399,1041,1042],{},"404",[393,1044,1045],{},[399,1046,1047],{},"invalid_grant",[393,1049,1050],{},"Unknown device code.",[375,1052,1053,1058,1063],{},[393,1054,1055],{},[399,1056,1057],{},"410",[393,1059,1060],{},[399,1061,1062],{},"expired_token",[393,1064,1065],{},"The code expired. Start again.",[375,1067,1068,1072,1077],{},[393,1069,1070],{},[399,1071,1057],{},[393,1073,1074],{},[399,1075,1076],{},"already_consumed",[393,1078,1079],{},"The key was already delivered to an earlier poll.",[375,1081,1082,1087,1092],{},[393,1083,1084],{},[399,1085,1086],{},"429",[393,1088,1089],{},[399,1090,1091],{},"slow_down",[393,1093,1094,1095,1097],{},"You polled sooner than ",[399,1096,828],{}," after the last poll. Wait longer.",[375,1099,1100,1104,1109],{},[393,1101,1102],{},[399,1103,543],{},[393,1105,1106],{},[399,1107,1108],{},"access_denied",[393,1110,1111],{},"The request was denied.",[423,1113,1114,1117],{},[399,1115,1116],{},"api_base"," is the API's own public URL, so a client that started from the app URL learns where to send requests.",[364,1119,1121],{"id":1120},"errors-and-limits","Errors and limits",[423,1123,1124,1125,1127,1128,1131],{},"A missing or invalid credential returns ",[399,1126,436],{},". When an API key is rejected, the error's ",[399,1129,1130],{},"data"," explains why:",[439,1133,1135],{"className":837,"code":1134,"language":839,"meta":444,"style":444},"{ \"error\": \"invalid_api_key\", \"reason\": \"INVALID_API_KEY\" }\n",[399,1136,1137],{"__ignoreMap":444},[448,1138,1139,1142,1144,1147,1149,1151,1153,1156,1158,1161,1163,1166,1168,1170,1172,1175,1177],{"class":450,"line":30},[448,1140,1141],{"class":846},"{ ",[448,1143,860],{"class":852},[448,1145,1146],{"class":856},"error",[448,1148,860],{"class":852},[448,1150,863],{"class":852},[448,1152,866],{"class":852},[448,1154,1155],{"class":453},"invalid_api_key",[448,1157,860],{"class":852},[448,1159,1160],{"class":852},",",[448,1162,866],{"class":852},[448,1164,1165],{"class":856},"reason",[448,1167,860],{"class":852},[448,1169,863],{"class":852},[448,1171,866],{"class":852},[448,1173,1174],{"class":453},"INVALID_API_KEY",[448,1176,860],{"class":852},[448,1178,1179],{"class":846}," }\n",[423,1181,1182,1184],{},[399,1183,1165],{}," is the auth library's code for the specific failure (for example a key that was deleted or has expired), so a client can tell a revoked key from a transient problem.",[423,1186,1187,1188,535,1190,1193,1194,1197,1198,756],{},"A valid key used on a workspace it can't reach returns ",[399,1189,543],{},[399,1191,1192],{},"Key is not scoped to this workspace"," (a workspace-scoped key) or ",[399,1195,1196],{},"Not a workspace member",". An unknown workspace returns ",[399,1199,1042],{},[423,1201,1202,1203,1205,1206,756],{},"There is no per-key rate limit: the sync CLI and agents authenticate on every request. The device endpoints are limited: ",[399,1204,800],{}," to 5 requests per 10 minutes per IP address, and approvals to 10 per 15 minutes per user. Over the limit returns ",[399,1207,1086],{},[364,1209,1211],{"id":1210},"when-someone-leaves-a-workspace","When someone leaves a workspace",[423,1213,1214],{},"When a member is removed from a workspace, or leaves it:",[1216,1217,1218,1225],"ul",{},[795,1219,1220,1221,1224],{},"Their ",[554,1222,1223],{},"workspace-scoped keys"," for that workspace are deleted. A synced folder using one stops syncing and asks them to sign in again.",[795,1226,1220,1227,1230,1231,1234],{},[554,1228,1229],{},"account-wide keys"," keep working for their other workspaces, but get ",[399,1232,1233],{},"403 Not a workspace member"," for this one.",[364,1236,1238],{"id":1237},"keeping-keys-safe","Keeping keys safe",[1216,1240,1241,1247,1259,1265],{},[795,1242,1243,1246],{},[554,1244,1245],{},"One key per agent or integration."," The key's name appears in the activity feed, so separate keys make it clear who did what, and you can revoke one without breaking the others.",[795,1248,1249,1252,1253,1255,1256,756],{},[554,1250,1251],{},"Revoke keys you no longer use",", from ",[554,1254,54],{}," in the web app or with ",[399,1257,1258],{},"DELETE \u002Fapi\u002Fkeys\u002F{id}",[795,1260,1261,1264],{},[554,1262,1263],{},"Never commit a key"," to a repository or paste it into a shared file. Treat it like a password: anyone holding it can read and write every workspace it reaches.",[795,1266,1267,1268,1271,1272,1275,1276,1279],{},"The CLI stores its key in ",[399,1269,1270],{},"\u003Cfolder>\u002F.treehouse\u002Fconfig.json"," with file mode ",[399,1273,1274],{},"0600"," (readable only by you). Keep ",[399,1277,1278],{},".treehouse\u002F"," out of version control.",[1281,1282,1283],"style",{},"html pre.shiki code .sRC7j, html code.shiki .sRC7j{--shiki-default:#A7C080}html pre.shiki code .sySyC, html code.shiki .sySyC{--shiki-default:#DBBC7F}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 pre.shiki code .sY0Nt, html code.shiki .sY0Nt{--shiki-default:#D3C6AA}html pre.shiki code .s3WQq, html code.shiki .s3WQq{--shiki-default:#859289}html pre.shiki code .sDOmQ, html code.shiki .sDOmQ{--shiki-default:#E69875}html pre.shiki code .s9lfW, html code.shiki .s9lfW{--shiki-default:#D699B6}",{"title":444,"searchDepth":11,"depth":48,"links":1285},[1286,1287,1291,1292,1295,1296,1297],{"id":366,"depth":11,"text":367},{"id":472,"depth":11,"text":473,"children":1288},[1289,1290],{"id":573,"depth":48,"text":574},{"id":629,"depth":48,"text":630},{"id":648,"depth":11,"text":649},{"id":786,"depth":11,"text":787,"children":1293},[1294],{"id":973,"depth":48,"text":974},{"id":1120,"depth":11,"text":1121},{"id":1210,"depth":11,"text":1211},{"id":1237,"depth":11,"text":1238},"md",{},true,[40,81,94],{"title":101,"description":102},"docs\u002Fagents\u002Freference\u002Fauthentication","MSnFMcmQNn6zNL44APC2mLGmtESCZ8taT5-6GQ48jAY",1790706077340]