{"openapi":"3.1.0","info":{"title":"treg","version":"0.0.1"},"paths":{"/meta":{"get":{"summary":"Meta","description":"Open: what the dashboard needs to render correct, shareable snippets — the public proxy URL\n(so copy/paste snippets use the real domain, not whatever origin the browser happens to be on)\n— plus the bundle version, so an open tab can detect a new deploy and offer a refresh.\n\n`treg_version` and `app_version` answer DIFFERENT questions and both are worth having.\n`app_version` is a hash of index.html: it changes whenever the dashboard bundle does, which is\nwhat an open tab compares to offer a refresh. `treg_version` is the released package version,\nwhich is what a release check needs — after publishing 0.9.0 there was no way to confirm from the\nlive path which version was actually serving, only the commit id.","operationId":"meta_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Meta Meta Get"}}}}}}},"/catalog/platforms":{"get":{"summary":"Catalog Platforms","description":"Open: the platform shelves of the endpoint catalog, busiest first.","operationId":"catalog_platforms_catalog_platforms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Catalog Platforms Catalog Platforms Get"}}}}}}},"/catalog/platforms/{slug}":{"get":{"summary":"Catalog Platform","description":"Open: one platform's operations, grouped by capability so the same job across providers sits\non one row — that grouping is what makes comparison (and a future failover router) possible.\n\nBy default the account/utility (\"management\") endpoints are dropped from every shape below — the\nbrowse view is data + action. `?include_hidden=1` returns the whole surface (each endpoint still\ncarries `kind`, so a client can file the plumbing behind an expander); `hidden_count` always\nreports how many were set aside so a caller can label that expander without a second request.","operationId":"catalog_platform_catalog_platforms__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"include_hidden","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Include Hidden"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Catalog Platform Catalog Platforms  Slug  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/catalog/search":{"get":{"summary":"Catalog Search","description":"Open: free-text search across the whole catalog — the DISCOVER half of the loop.\n\nAn agent that knows what it wants (\"tiktok comments\") shouldn't have to guess which platform\nshelf hides it. Ranking is plain token matching (see `catalog_store.search`) so results are\nreproducible and explainable; equal scores — the common case, not the edge — then break on what\ntreg has MEASURED and on price, so the cut stops being file order. `hints` carries the next\ncommand, since finding the endpoint is never the goal — inspecting or calling it is.","operationId":"catalog_search_catalog_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Catalog Search Catalog Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/catalog/endpoints/{endpoint_id}":{"get":{"summary":"Catalog Endpoint","description":"Open: everything about ONE endpoint — the INSPECT half of the loop.\n\nDeliberately one round-trip: params, cost, the sibling providers offering the same capability\n(so a price/verification comparison needs no second call), a paste-ready `call_template`, and the\ncaptured example response inline — an agent shouldn't have to fetch /catalog/examples to learn\nthe response shape it is about to parse.","operationId":"catalog_endpoint_catalog_endpoints__endpoint_id__get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Catalog Endpoint Catalog Endpoints  Endpoint Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/github":{"get":{"summary":"Auth Github","operationId":"auth_github_auth_github_get","parameters":[{"name":"cli","in":"query","required":false,"schema":{"type":"string","default":"","title":"Cli"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/github/callback":{"get":{"summary":"Auth Github Callback","operationId":"auth_github_callback_auth_github_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"treg_oauth_state","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Oauth State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/google":{"get":{"summary":"Auth Google","description":"Human login via Google OAuth — a parallel door to GitHub, same session/CLI-handshake plumbing.","operationId":"auth_google_auth_google_get","parameters":[{"name":"cli","in":"query","required":false,"schema":{"type":"string","default":"","title":"Cli"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/google/callback":{"get":{"summary":"Auth Google Callback","operationId":"auth_google_callback_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"treg_oauth_state","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Oauth State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/cli/start":{"post":{"summary":"Auth Cli Start","description":"`treg login` calls this FIRST. The SERVER mints both the login_id and a short pairing code and\nremembers them (pending approval). The code is shown only in that terminal; the browser must echo it\nback at approve time, where it's validated server-side, before any token is issued. So a login the\nuser didn't start (a phished /login?cli=<id> link) can't be completed, and the poll endpoint carries\nno code to brute-force. Unauthenticated — on its own it grants nothing.","operationId":"auth_cli_start_auth_cli_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Auth Cli Start Auth Cli Start Post"}}}}}}},"/auth/cli/poll":{"get":{"summary":"Auth Cli Poll","description":"The CLI polls this after opening the browser; returns the identity token once, then forgets it.\nA token only lands here after auth_cli_approve validated the terminal pairing code, so a login the\nuser didn't approve never yields one — there is nothing here to brute-force (no code parameter).","operationId":"auth_cli_poll_auth_cli_poll_get","parameters":[{"name":"login_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Cli Poll Auth Cli Poll Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/cli/orgs":{"get":{"summary":"Auth Cli Orgs","description":"The /login page fetches this (session-cookie authed) to render the team picker before completing\na `treg login` handshake. Returns the signed-in user's teams; empty list if no session.","operationId":"auth_cli_orgs_auth_cli_orgs_get","parameters":[{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Cli Orgs Auth Cli Orgs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/cli/approve":{"post":{"summary":"Auth Cli Approve","description":"Complete a `treg login` handshake from an EXISTING browser session (the \"Continue as\" button\non /login, and the email door after /auth/email/verify sets the cookie). Deliberately a POST with\na same-origin check — auto-completing on a GET would let a phisher mail out /login?cli=<their-id>\nand poll the victim's identity token straight out of /auth/cli/poll.\n\n`org` (optional) is the team slug the user picked in the /login org picker; it's validated to be\none of the user's memberships and passed back to the CLI so it lands on the RIGHT team instead of\nguessing (`_pick_active_org`).","operationId":"auth_cli_approve_auth_cli_approve_post","parameters":[{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliApproveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Cli Approve Auth Cli Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"summary":"Auth Me","description":"Who is the caller? Drives the dashboard's identity display in BOTH session mode (cookie) and\ntoken mode (X-Treg-Token) — the token door otherwise had no way to learn its own email, which\nbroke `isPersonal` and join-by-code.","operationId":"auth_me_auth_me_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Me Auth Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"summary":"Auth Logout","operationId":"auth_logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/email/start":{"post":{"summary":"Auth Email Start","description":"Prove ownership of an email: mint a 6-digit code. With no mail sender yet, dev mode returns\n+ logs it (so dummy emails are testable); prod will email it instead. Throttled per-email AND per-IP\n(sliding window) so this open endpoint can't be used to email-bomb an inbox or reset the OTP\nbrute-force counter at will. All this state is in the DB (survives restart, correct multi-instance).","operationId":"auth_email_start_auth_email_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStartIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Auth Email Start Auth Email Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/verify":{"post":{"summary":"Auth Email Verify","description":"Check the code → find-or-create the user → mint an identity token AND set a browser session\ncookie. The CLI reads the token from the body; the dashboard just reloads into session mode\n(same path as GitHub login) — one endpoint serves both clients.","operationId":"auth_email_verify_auth_email_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailVerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/invite-signin":{"get":{"summary":"Auth Invite Signin","description":"Landing for an invite email link. Two secrets, two very different trust levels:\n\n`t` (email_token) exists ONLY in the emailed link — possession proves inbox access, the same bar\nas the emailed OTP — so it may sign the invitee in. But not on this GET: corporate mail scanners\n(Outlook SafeLinks etc.) prefetch GET links and would consume a one-time credential before the\nhuman ever clicks. So the GET only renders a confirm page whose button POSTs the token back;\nthe POST below mints the session.\n\n`code` (legacy + out-of-band) is also returned to the admin who created the invite, so it can\nNEVER be an authentication factor — holding it lets you JOIN (POST /invites/accept), not log in.\nLinks carrying ?code= (emails sent before the split, or relayed by an admin) keep their old\nbehavior: validate and bounce to the SPA login with the email prefilled; the invitee proves the\nemail through a real door (OTP / GitHub / Google) and the invite auto-appears via /invites/mine.\nAn invalid/expired secret of either kind just lands on the site.","operationId":"auth_invite_signin_auth_invite_signin_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"t","in":"query","required":false,"schema":{"type":"string","default":"","title":"T"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Auth Invite Signin Confirm","description":"The confirm page's POST: the emailed one-time token signs the invitee in. Mirrors the OTP\ndoor (auth_email_verify) — find-or-create the user, refuse the suspended, set the session\ncookie — because the trust source is identical: only the inbox saw this secret. The token is\nconsumed here (one-time) so a link floating in a forwarded thread can't be replayed; the invite\nitself stays PENDING — acceptance happens in the dashboard, where a multi-team invitee can\naccept several at once. Body is parsed by hand (urlencoded form) to avoid the python-multipart\ndependency FastAPI's Form() would pull in.","operationId":"auth_invite_signin_confirm_auth_invite_signin_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/cli-token":{"get":{"summary":"Auth Cli Token","description":"Mint a fresh CLI/bearer token for the authenticated caller (session cookie OR token). Identity\ntokens are stateless (`sess.make`), so handing one out rotates/invalidates nothing — it just lets\nthe dashboard embed a working token in copy-paste snippets + a 'copy token' button, so a human\ndoesn't have to hunt for it in `~/.treg/config.json`.\n\nWhen the caller names a team (the dashboard sends `X-Treg-Org` for the active org, and only after\nconfirming membership), the org slug is BAKED into the token. That is what makes the dashboard's\n\"your API key\" work as a bare bearer where no `X-Treg-Org` header can travel — pasted into an MCP\nserver's Authorization it resolves to that team, no header, no per-org agent token to manage. A\ncaller in one team who sends no header still gets a plain token (MCP auto-selects the sole team).","operationId":"auth_cli_token_auth_cli_token_get","parameters":[{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Cli Token Auth Cli Token Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/revoke-tokens":{"post":{"summary":"Auth Revoke Tokens","description":"Kill switch for a leaked token: invalidate every signed identity token (from `treg login`) AND\nevery browser session this user holds, in one step. Bumping user.token_version makes all previously\nminted tokens (which carry the old tv) mismatch and be rejected. Unlike suspending the account this\nkeeps the user active; unlike rotating TREG_SESSION_SECRET it affects ONLY this user. We then re-issue\na fresh session cookie + token for the caller, so the device that pressed the button stays signed in\nwhile every other device is signed out. (Org membership tokens from accept-invite are a separate token\ntype and are unaffected — those are revoked by removing the membership.)","operationId":"auth_revoke_tokens_auth_revoke_tokens_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"post":{"summary":"Register User","operationId":"register_user_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Register User Users Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs":{"post":{"summary":"Create Org","operationId":"create_org_orgs_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Org Orgs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Orgs","operationId":"list_orgs_orgs_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Orgs Orgs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/invites":{"post":{"summary":"Create Invite","operationId":"create_invite_orgs__org_id__invites_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Invite Orgs  Org Id  Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Invites","operationId":"list_invites_orgs__org_id__invites_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Invites Orgs  Org Id  Invites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invites/accept":{"post":{"summary":"Accept Invite","operationId":"accept_invite_invites_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Accept Invite Invites Accept Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invites/mine":{"get":{"summary":"My Invites","description":"Every pending invite addressed to MY email — the code-free door. Proving my email (via any\nlogin method) is enough to see these; the invite code becomes a shortcut, not a requirement.","operationId":"my_invites_invites_mine_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response My Invites Invites Mine Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboard/demo":{"post":{"summary":"Onboard Demo","description":"Seed a sandbox team owned by the caller — fake teammates (one per role) + a working `echo`\ntool + sample activity — so a brand-new user can feel the product immediately. Idempotent\n(reuses an existing demo team); marks the caller onboarded. Same seed for dashboard + CLI.","operationId":"onboard_demo_onboard_demo_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/OnboardIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Onboard Demo Onboard Demo Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboard/skip":{"post":{"summary":"Onboard Skip","description":"Dismiss onboarding without seeding — so it's never auto-offered again.","operationId":"onboard_skip_onboard_skip_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Onboard Skip Onboard Skip Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboard/reset":{"post":{"summary":"Onboard Reset","description":"Remove the caller's demo team(s) + demo teammates from their real teams — a clean exit.","operationId":"onboard_reset_onboard_reset_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Onboard Reset Onboard Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/sandbox":{"post":{"summary":"Demo Sandbox Mint","description":"Mint a login-free, short-lived sandbox TEAM for the landing-page studio: a throwaway org + a\nstarter secret + a starter endpoint + a member token, returned so the browser (and the visitor's\nterminal) can register more, call them, and export a skill — all with no account. Sandbox calls\nnever touch the network (see call_tool → sandbox.synthesize); rate-limited per IP; GC'd after the\nTTL. No auth — this is the anonymous front door.","operationId":"demo_sandbox_mint_demo_sandbox_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Demo Sandbox Mint Demo Sandbox Post"}}}}}}},"/demo/sandbox/live":{"get":{"summary":"Demo Sandbox Live","description":"Live-wire facts for an EXISTING sandbox (the browser reuses one via localStorage, so it may\npredate the mint response carrying them): is the wire on, and who am I in the feed.","operationId":"demo_sandbox_live_demo_sandbox_live_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demo Sandbox Live Demo Sandbox Live Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/sandbox/skill":{"get":{"summary":"Demo Sandbox Skill","description":"Export whatever the visitor built in their sandbox as a shareable **skill** (treg.json manifest\n+ SKILL.md + install commands). Sandbox-only — the payoff that shows what skills are.","operationId":"demo_sandbox_skill_demo_sandbox_skill_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demo Sandbox Skill Demo Sandbox Skill Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills/samples":{"get":{"summary":"Skill Samples","description":"The hosted sample skills the landing offers — each with its files (SKILL.md/treg.json/.secret)\nand the prompt to try. Public: the landing renders these as file packages.","operationId":"skill_samples_skills_samples_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Skill Samples Skills Samples Get"}}}}}}},"/onboard/seed-tool":{"post":{"summary":"Onboard Seed Tool","description":"Pre-seed the working `echo` tool into the caller's active team so the no-key call in the\ndashboard onboarding just works (the user builds the team + invites by hand; the tool is on us).","operationId":"onboard_seed_tool_onboard_seed_tool_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Onboard Seed Tool Onboard Seed Tool Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboard/accept-teammate":{"post":{"summary":"Onboard Accept Teammate","description":"Auto-accept the fake teammate the user just invited during onboarding, so it lands in the\nroster instantly (they feel the invite, then see the loop close). Admin+ only, demo email only.","operationId":"onboard_accept_teammate_onboard_accept_teammate_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeammateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Onboard Accept Teammate Onboard Accept Teammate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invites/{invite_id}/accept":{"post":{"summary":"Accept My Invite","description":"Accept an invite addressed to my already-proven email — no code needed (the identity token\nproves the email). The code path (`POST /invites/accept`) stays for out-of-band joins.","operationId":"accept_my_invite_invites__invite_id__accept_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Accept My Invite Invites  Invite Id  Accept Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/invites/{invite_id}":{"delete":{"summary":"Revoke Invite","operationId":"revoke_invite_orgs__org_id__invites__invite_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Invite Orgs  Org Id  Invites  Invite Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members":{"get":{"summary":"List Members","operationId":"list_members_orgs__org_id__members_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Members Orgs  Org Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/usage":{"get":{"summary":"Org Usage","description":"Usage rollups for an org over the last `days` (admin/owner): by user (with a call/local/server\nsplit), by tool, by day, and totals — counts only, no request/response bodies. Powers the dashboard\nUsage view.","operationId":"org_usage_orgs__org_id__usage_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Org Usage Orgs  Org Id  Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/balance":{"get":{"summary":"Org Balance","description":"The org's prepaid balance. Amounts are integer micro-USD (`*_micro`) with a display-only USD\ntwin — never compute against the USD field (see ledger.py on why money is integers here).\n\n**Two audiences, one route.** Any MEMBER sees the figure and the in-flight holds: they are the\nones spending it, every agent is told to run `treg balance` after a call, and a 402 already hands\nthem `balance_micro` anyway — refusing the same number here while shipping it in an error was\nincoherent. The FUNDING DETAIL is admin+: the credit blocks (what was bought, when, what is left\nof each) and the ledger, which together are the org's purchase history, not its wallet.","operationId":"org_balance_orgs__org_id__balance_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Org Balance Orgs  Org Id  Balance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/tag-keys":{"get":{"summary":"List Tag Keys","description":"Every tag key this team has actually SENT, plus the ones it may budget on.\n\nTwo different questions that had been given one answer. Reporting works on ANY key — the money\nfor an undeclared one is folded in Python — while ENFORCEMENT only works on a declared key,\nbecause it needs an index. Feeding a reporting picker the declared list hid `feature=` and\nfriends from the dashboard even though the API served them fine.","operationId":"list_tag_keys_orgs__org_id__tag_keys_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tag Keys Orgs  Org Id  Tag Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/usage/by-tag":{"get":{"summary":"Usage By Tag","description":"What each value of one tag consumed — the numbers a reselling builder invoices from.\n\nMONEY COMES FROM THE LEDGER, never from `CallRecord`. Audit rows are fire-and-forget and the queue\nsheds them under load, which is precisely the traffic a successful builder generates; an invoice\nbuilt on them would under-bill silently and unrecoverably. Call COUNTS come from the audit table,\nwhere losing a row costs a slightly low count and nothing else.\n\n`unattributed` is reported explicitly rather than dropped. A builder reconciling this against their\nown ledger has to see the spend they cannot attribute to anyone — silently omitting it is how the\ntwo sets of books stop agreeing without anybody noticing.","operationId":"usage_by_tag_orgs__org_id__usage_by_tag_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage By Tag Orgs  Org Id  Usage By Tag Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/settings":{"get":{"summary":"Get Org Settings","description":"The team's spend ceiling and tag configuration. Readable by any member — a limit nobody can see\nis a limit that turns into a support ticket the first time an agent trips it.","operationId":"get_org_settings_orgs__org_id__settings_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Org Settings Orgs  Org Id  Settings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Set Org Settings","description":"Set the team's own spend ceiling and which tag keys carry budgets. Admin+.\n\nA team may LOWER its ceiling freely; raising it past the platform ceiling is refused rather than\nsilently clamped, because a builder who thinks they set $500/day and actually got $5 discovers it\nas an outage in the middle of their launch.","operationId":"set_org_settings_orgs__org_id__settings_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Org Settings Orgs  Org Id  Settings Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/budgets":{"get":{"summary":"List Tag Budgets","description":"Every per-tag limit this team has SET — the per-dimension defaults plus the overrides.\n\nRegistry rows are excluded. One is created per distinct value so the cardinality check stays a\ncheap lookup, and listing them made a table of eight rows in which six limited nothing: the\nbookkeeping was being presented as if it were policy.\n\nAdmin+, because a budget names the team's customers.","operationId":"list_tag_budgets_orgs__org_id__budgets_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"dim","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dim"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tag Budgets Orgs  Org Id  Budgets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/budgets/{dim}":{"put":{"summary":"Set Tag Default","description":"Set the DEFAULT limit for a whole dimension — what every value inherits without an override.\n\nUnlimited until this is set: a team that never calls it behaves exactly as before. Changing it\ntakes effect on the next call for everyone without an override, since resolution happens per\ncall — so lowering a default is a live change across the whole customer base.","operationId":"set_tag_default_orgs__org_id__budgets__dim__put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string","title":"Dim"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagBudgetIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Tag Default Orgs  Org Id  Budgets  Dim  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/budgets/{dim}/{val}":{"put":{"summary":"Set Tag Budget","description":"Set (or update) one limit — `PUT /orgs/1/budgets/customer/cust_8123 {\"daily_cap_micro\": 5000000}`.\n\nAn UPSERT that leaves unsent fields alone, the same `model_fields_set` shape `create_agent` uses:\na PUT that only flips `status` must not silently wipe the caps someone set last week.","operationId":"set_tag_budget_orgs__org_id__budgets__dim___val__put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string","title":"Dim"}},{"name":"val","in":"path","required":true,"schema":{"type":"string","title":"Val"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagBudgetIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Tag Budget Orgs  Org Id  Budgets  Dim   Val  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Tag Budget","description":"Drop a limit. The tag keeps being recorded and invoiced — only the ceiling goes away.","operationId":"delete_tag_budget_orgs__org_id__budgets__dim___val__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"dim","in":"path","required":true,"schema":{"type":"string","title":"Dim"}},{"name":"val","in":"path","required":true,"schema":{"type":"string","title":"Val"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tag Budget Orgs  Org Id  Budgets  Dim   Val  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing":{"get":{"summary":"Billing Get","description":"The org's billing state: whether top-ups are available at all on this deployment, whether\nthere's a Stripe customer and a saved card, the auto-top-up policy + why it's off if it is, and how\nmuch of this month's automatic cap has been used.","operationId":"billing_get_billing_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Get Billing Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/topup":{"post":{"summary":"Billing Topup","description":"Start a hosted Stripe Checkout for a one-off top-up and return its URL.\n\nReturns a URL, not a credit: the balance moves when Stripe's webhook says the payment succeeded\n(see billing.py). Nothing about this response — including a payer who \"completes\" the success\nredirect by hand — can create balance.","operationId":"billing_topup_billing_topup_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Topup Billing Topup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/autotopup":{"post":{"summary":"Billing Autotopup","description":"Set the org's auto-top-up policy (and record consent when enabling).\n\nEnabling without a card on file is not an error — the preferences and the consent are stored and a\nStripe-hosted card-capture URL comes back in `setup_url`. Finishing that page fires\n`setup_intent.succeeded`, which saves the payment method and arms the policy. That ordering is\ndeliberate: consent is recorded against the numbers the human saw, before any card exists.","operationId":"billing_autotopup_billing_autotopup_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Autotopup Billing Autotopup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/history":{"get":{"summary":"Billing History","description":"This team's completed top-ups, newest first, each with its invoice PDF or card receipt.\n\nRead-only in both directions: it moves no money, and the amounts come from our own credit blocks\nrather than from Stripe, so the history can never contradict the balance. Stripe is asked only for\nthe document links, and `stripe_ok: false` says they were unavailable — the payments listed are\nstill correct.","operationId":"billing_history_billing_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":24,"title":"Limit"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing History Billing History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/portal":{"post":{"summary":"Billing Portal","description":"A one-time link into Stripe's hosted billing portal — card, billing address, tax ID, and the\nfull invoice archive. 422 until the team has a Stripe customer, which it gets on its first\npayment; `billing_state`'s `portal` flag is what the UI hides the button on.","operationId":"billing_portal_billing_portal_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Portal Billing Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/referrals":{"get":{"summary":"My Referrals","description":"This person's referral link and everyone who has used it.\n\nAlso runs the payout sweep, scoped to this user. There is no scheduler in treg, so the two\ntrigger points are any top-up (`billing._credit`) and this page — which means someone checking\nwhether their reward has landed is the one who makes it land. That is the same lazy,\ncaller-pays-for-their-own-cleanup bargain as `ledger.reap_stale_holds`.","operationId":"my_referrals_referrals_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response My Referrals Referrals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/referrals/code":{"post":{"summary":"Mint Referral Code","description":"Mint this person's referral code, or return the one they already have.\n\nIdempotent, so the dashboard can call it every time the page opens without checking first. Codes\nare minted here rather than at signup because most people never open this page, and a code\nnobody has seen is a unique index entry earning nothing.","operationId":"mint_referral_code_referrals_code_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mint Referral Code Referrals Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{user_id}/cap":{"patch":{"summary":"Set Member Cap","description":"Set a member's per-user daily usage cap (admin/owner). `-1` = unlimited; any other negative is\nrejected. Separate from role (owner-only) — capping is a management action, not a privilege change.","operationId":"set_member_cap_orgs__org_id__members__user_id__cap_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Member Cap Orgs  Org Id  Members  User Id  Cap Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{user_id}/access":{"patch":{"summary":"Set Member Access","description":"Set which tools a member may call/run (`tool_access`: None = all, else the allowed names) and\nwhether they may run locally (`local_run_enabled`). Admin/owner only; an owner can't be restricted.","operationId":"set_member_access_orgs__org_id__members__user_id__access_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Member Access Orgs  Org Id  Members  User Id  Access Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/me":{"get":{"summary":"My Usage","description":"The caller's own usage today + cap for the active org — so a member sees 'used / cap' without\nadmin access. `cap` is -1 when unlimited.","operationId":"my_usage_usage_me_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response My Usage Usage Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{user_id}":{"delete":{"summary":"Remove Member","operationId":"remove_member_orgs__org_id__members__user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Member Orgs  Org Id  Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Set Member Role","operationId":"set_member_role_orgs__org_id__members__user_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Member Role Orgs  Org Id  Members  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/leave":{"post":{"summary":"Leave Org","operationId":"leave_org_orgs__org_id__leave_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Leave Org Orgs  Org Id  Leave Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}":{"delete":{"summary":"Delete Org","description":"Delete a team and everything in it (owner only). `?confirm=<slug>` must match.\n\nThe confirmation is REQUIRED by the API, not just collected by the clients that already ask for\nit. This route is irreversible and sits one path segment above every other org route, so any\nclient that normalizes `..` turns `DELETE /orgs/{id}/<anything>/..` into this call — that is how\n`treg org unpin ..` deleted a team during testing. A request arriving without the slug it is\nabout to destroy is not a request anyone meant to send.","operationId":"delete_org_orgs__org_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"confirm","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Confirm"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Org Orgs  Org Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/public-token":{"post":{"summary":"Create Public Token","description":"Mint (or ROTATE) the org's publishable token: flips the org to `public_demo` and returns a\nviewer-role token bound to a dedicated can't-log-in identity. Safe to print on a web page:\nthe lockdown in require_member/require_identity limits it to /call + reads, /call is per-IP\nrate-limited, and calling this endpoint again replaces the token (instant revocation of the\nold one). Owner-only — publishing a credential is an org-level decision.","operationId":"create_public_token_orgs__org_id__public_token_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Public Token Orgs  Org Id  Public Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Public Token","description":"Revoke the publishable token and lift the org's public_demo lockdown.","operationId":"delete_public_token_orgs__org_id__public_token_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Public Token Orgs  Org Id  Public Token Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/agents":{"post":{"summary":"Create Agent","description":"Mint (or ROTATE) an agent token: a member identity for a machine caller, with its own cap, tool\nACL and audit trail. Re-POSTing the same name rotates the token — the previous one dies here, the\nsame instant-revocation idiom as the public token. Admin+; only an owner may mint an admin agent.\n\nOn a ROTATE, a field the caller did not send is LEFT AS IT IS — a rotate replaces the token, never\nthe agent's limits. Reading an absent field as its default would silently widen a scoped agent to\nevery tool (`tool_access=None`), to unlimited calls (`daily_call_cap=-1`) and back to local runs\n(`local_run_enabled=True`) — the dashboard's Rotate button sends only {name, role, cap}, so this\nwould fire on the ordinary path. Same shape `set_member_access` already uses for `project_access`.","operationId":"create_agent_orgs__org_id__agents_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Agent Orgs  Org Id  Agents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Agents","description":"Every agent identity in the org, with its limits and today's usage. Never the token.","operationId":"list_agents_orgs__org_id__agents_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Agents Orgs  Org Id  Agents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/checkin":{"post":{"summary":"Agent Checkin","description":"The handshake at the end of the setup instruction: the agent calls in AS ITSELF, proving the\ntoken landed in the right environment. Audited synchronously (not fire-and-forget) so the\ndashboard's poll sees `connected` flip the moment this returns. Works for any member token —\nfor a human it is just a no-op ping.","operationId":"agent_checkin_agents_checkin_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Agent Checkin Agents Checkin Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/agents/observed":{"get":{"summary":"List Observed Agents","description":"The agents ALREADY running under members' own tokens, discovered from traffic: one row per\n(member, runtime) seen in the last 30 days, e.g. \"sam@… / claude-code\". The zero-setup half\nof the agents story — nobody mints anything, the roster fills itself from `CallRecord.client`\n(and RunRecord). Self-reported attribution, not authentication, which is why this view only\ninforms; scoping one for real = mint it a token (\"Scope this agent\" in the dashboard).\n\nMachine identities are excluded — their calls are already attributed to themselves. So is a\nplain terminal (`client` in ('', 'cli')): a roster that lists every human twice teaches nothing.","operationId":"list_observed_agents_orgs__org_id__agents_observed_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Observed Agents Orgs  Org Id  Agents Observed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/agents/{user_id}":{"delete":{"summary":"Revoke Agent","description":"Revoke an agent: delete its membership, which kills its token immediately.","operationId":"revoke_agent_orgs__org_id__agents__user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Agent Orgs  Org Id  Agents  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/projects":{"post":{"summary":"Create Project","description":"Create a project — a sub-scope inside the team (admin+). Tools can then be filed under it and\nmembers scoped to it. Creating one changes nothing on its own: existing tools stay org-wide.","operationId":"create_project_orgs__org_id__projects_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Orgs  Org Id  Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Projects","description":"The team's projects. A member scoped to some of them sees only those (the ACL hides what it\ngates, matching how `list_tools` behaves).","operationId":"list_projects_orgs__org_id__projects_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Projects Orgs  Org Id  Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/projects/{project_id}":{"delete":{"summary":"Delete Project","description":"Delete a project. Its tools are NOT deleted — they fall back to org-wide, which is the safe\ndirection (a tool that quietly vanished from every listing would be far worse than one that\nbriefly becomes visible to the whole team). Members scoped to it lose that entry.\n\nThe freed tools are what keeps a scoped member from being locked out: they were the member's only\ntools and they are now org-wide, so the member keeps exactly what they had. The scope list itself\nmust NOT be widened to do that (see below).","operationId":"delete_project_orgs__org_id__projects__project_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project Orgs  Org Id  Projects  Project Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/pins":{"get":{"summary":"List Capability Pins","description":"The team's provider choices, per capability. Readable by any member — an agent has to know\nwhat it is allowed to call, and finding out by being refused is a wasted round-trip.","operationId":"list_capability_pins_orgs__org_id__pins_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Capability Pins Orgs  Org Id  Pins Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Capability Pin","description":"Pin a capability to one provider for the whole team (admin+). Re-pinning replaces.\n\nBoth halves are validated against the catalog: an unknown capability, or a provider that does\nnot actually serve it, would be a rule that silently blocks every call to a job the team\ngenuinely uses — a typo must fail here, loudly, not at 3am in an agent's log.","operationId":"set_capability_pin_orgs__org_id__pins_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityPinIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Capability Pin Orgs  Org Id  Pins Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Clear Capability Pin","description":"Remove a pin (admin+) — the capability goes back to the caller's choice.\n\nThe capability is a QUERY parameter, not a path segment, and that is a safety decision rather\nthan a style one. As `/orgs/{id}/pins/{capability}` it was one keystroke from a catastrophe:\nevery normalizing HTTP client (httpx included) rewrites `/orgs/1/pins/..` to `/orgs/1` BEFORE\nsending it — which is DELETE /orgs/{id}, the delete-the-team route. `treg org unpin ..` really\ndid destroy an org in testing. Server-side validation cannot defend against it, because the\nrewrite happens in the client; taking the value out of the path removes the class entirely.","operationId":"clear_capability_pin_orgs__org_id__pins_delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"capability","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Capability"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Capability Pin Orgs  Org Id  Pins Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/deny":{"post":{"summary":"Create Deny Rule","description":"Block calls to a host / path / method for the whole team, or for one member or agent (admin+).\n\nEnforced on the proxy AND both run tiers, and it applies to every role including owner — a deny\nrule is a guardrail, not a permission tier.","operationId":"create_deny_rule_orgs__org_id__deny_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyRuleIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Deny Rule Orgs  Org Id  Deny Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Deny Rules","operationId":"list_deny_rules_orgs__org_id__deny_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Deny Rules Orgs  Org Id  Deny Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/policy/cli-deny":{"get":{"summary":"List Cli Deny","description":"READ-ONLY: every CLI tool's effective argv deny patterns, so the Policy screen can show the\nwhole \"what is blocked\" picture in one place. These live on the TOOL (treg.json `cli.deny` +\ncatalog defaults, see `localrun.effective_profile`), not in the DenyRule table — editing them\nmeans editing the skill or the catalog, which is why this endpoint only reports (admin+).","operationId":"list_cli_deny_orgs__org_id__policy_cli_deny_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Cli Deny Orgs  Org Id  Policy Cli Deny Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/deny/{rule_id}":{"delete":{"summary":"Delete Deny Rule","operationId":"delete_deny_rule_orgs__org_id__deny__rule_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Deny Rule Orgs  Org Id  Deny  Rule Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/secrets":{"post":{"summary":"Create Secret","operationId":"create_secret_secrets_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Secret Secrets Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Secrets","operationId":"list_secrets_secrets_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Secrets Secrets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/secrets/{secret_id}":{"patch":{"summary":"Update Secret","operationId":"update_secret_secrets__secret_id__patch","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Secret Secrets  Secret Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Secret","operationId":"delete_secret_secrets__secret_id__delete","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Secret Secrets  Secret Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools":{"post":{"summary":"Create Tool","operationId":"create_tool_tools_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tool Tools Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tools","operationId":"list_tools_tools_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tools Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/by-name/{name}":{"get":{"summary":"Get Tool By Name","description":"Name-keyed lookup so shareable detail URLs (/app/tools/<name>) resolve without an id.","operationId":"get_tool_by_name_tools_by_name__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tool By Name Tools By Name  Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{tool_id}":{"patch":{"summary":"Update Tool","operationId":"update_tool_tools__tool_id__patch","parameters":[{"name":"tool_id","in":"path","required":true,"schema":{"type":"integer","title":"Tool Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tool Tools  Tool Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Tool","operationId":"delete_tool_tools__tool_id__delete","parameters":[{"name":"tool_id","in":"path","required":true,"schema":{"type":"integer","title":"Tool Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tool Tools  Tool Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{name}/grant":{"post":{"summary":"Grant Local Run","description":"Mint the process material for ONE local run of this tool's CLI: the audited, owner-opt-in\nexception to \"values are never returned\". OAuth secrets release only the expiring leaf; the\ndeny check happens here, where the secret lives. Unlike /call (which injects server-side and\nleaks nothing), a grant HANDS the credential value to the caller's machine — so it needs member+\n(a viewer may call but not extract). Loosening this to a per-tool run ACL is a future policy knob.","operationId":"grant_local_run_tools__name__grant_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Grant Local Run Tools  Name  Grant Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{name}/run-report":{"post":{"summary":"Report Local Run","description":"The client's post-run verdict (it matches stderr against the grant's error patterns LOCALLY\nand sends only this enum — raw output never leaves the machine). credential_invalid flips the\ngranted secrets to invalid via the same health fields the runner uses.","operationId":"report_local_run_tools__name__run_report_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunReportIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Report Local Run Tools  Name  Run Report Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills":{"post":{"summary":"Register Skill","description":"Register a skill from a raw payload (recipe + secrets + tools). The dashboard's folder importer\nand the CLI build this same payload; the shared core is `_register_skill_bundle`.","operationId":"register_skill_skills_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Register Skill Skills Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills/analyze":{"post":{"summary":"Analyze Skill Folder","description":"Classify an uploaded skill folder WITHOUT registering — the dashboard's verify step. Same\nclassifier as `treg upload skills`: recipe-only vs contract vs generated, plus readiness gaps.","operationId":"analyze_skill_folder_skills_analyze_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillAnalyzeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Analyze Skill Folder Skills Analyze Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills/import":{"post":{"summary":"Import Skill Folder","description":"Register selected skills from an uploaded folder: scan → build the payload (secret VALUES from\nthe uploaded files / provided env values) → register each as a bundle. Mirrors `treg upload skills`.","operationId":"import_skill_folder_skills_import_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillImportIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Import Skill Folder Skills Import Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bundles":{"get":{"summary":"List Bundles","operationId":"list_bundles_bundles_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Bundles Bundles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bundles/by-name/{name}":{"get":{"summary":"Get Bundle By Name","description":"Name-keyed lookup so shareable detail URLs (/app/skills/<name>) resolve without an id.","operationId":"get_bundle_by_name_bundles_by_name__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Bundle By Name Bundles By Name  Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bundles/{bundle_id}":{"get":{"summary":"Get Bundle","operationId":"get_bundle_bundles__bundle_id__get","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"integer","title":"Bundle Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Bundle Bundles  Bundle Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Bundle","description":"Edit a bundle's SKILL.md text. Only its creator or an admin may. (Execution config lives on\nthe tool's cli profile, not here.)","operationId":"update_bundle_bundles__bundle_id__patch","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"integer","title":"Bundle Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Bundle Bundles  Bundle Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Bundle","operationId":"delete_bundle_bundles__bundle_id__delete","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"integer","title":"Bundle Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Bundle Bundles  Bundle Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls":{"get":{"summary":"List Calls","description":"This team's recent calls. `days` windows it and `before_id` pages backwards — a builder\nreconciling a month cannot do it through a newest-first limit alone.\n\nAnalytics, NOT an invoice: these rows are written fire-and-forget and the queue sheds them under\nload. Money comes from `/orgs/{id}/usage/by-tag`, which reads the ledger.","operationId":"list_calls_calls_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Calls Calls Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_ref}":{"get":{"summary":"Get Call","description":"One call by the `X-Treg-Call-Id` it returned — the join key for a builder's own records.\n\nAlso reports the LEDGER's view of the same reference, because that is the durable one: the audit\nrow is fire-and-forget and may have been shed, while the money entries were written synchronously.\nA 404 here therefore means \"no audit row\", not \"this call never happened\" — check `ledger` in the\nbody before concluding anything about money.","operationId":"get_call_calls__call_ref__get","parameters":[{"name":"call_ref","in":"path","required":true,"schema":{"type":"string","title":"Call Ref"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Call Calls  Call Ref  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs":{"get":{"summary":"List Runs","description":"Audit log for CLI executions (`treg run`, both tiers), scoped to the caller's org — each row\ntagged `where`: \"server\" (RunRecord) or \"local\" (a `local_run` GRANT on the member's machine).\nLocal successes carry no exit code (only failures report back), so `exit_code` is null for them.\nIds are prefixed (s/l) so the two sources never collide as list keys.","operationId":"list_runs_runs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Runs Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/providers":{"get":{"summary":"Oauth Providers List","description":"Providers treg holds its own approved app for. `configured` is false when this deployment\nhasn't set that provider's client credentials — listed, but its flow can't run here.","operationId":"oauth_providers_list_oauth_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Oauth Providers List Oauth Providers Get"}}}}}}},"/oauth/start":{"post":{"summary":"Oauth Start","operationId":"oauth_start_oauth_start_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthStartIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth Start Oauth Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/callback":{"get":{"summary":"Oauth Callback","operationId":"oauth_callback_oauth_callback_get","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections":{"get":{"summary":"List Connections","description":"Every OAuth credential in the org, with health AND expiry. Metadata only — no token material.","operationId":"list_connections_connections_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Connections Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections/{secret_id}/resources":{"get":{"summary":"Connection Resources","description":"What this connection can act on — GSC sites, and later GA properties / Ads accounts.\n\nLive-fetched rather than stored: the answer changes when the user gains or loses access\nupstream, and a stale picker is worse than no picker.","operationId":"connection_resources_connections__secret_id__resources_get","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Connection Resources Connections  Secret Id  Resources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections/{secret_id}/resource":{"post":{"summary":"Set Connection Resource","operationId":"set_connection_resource_connections__secret_id__resource_post","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRefIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Connection Resource Connections  Secret Id  Resource Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections/token":{"post":{"summary":"Connect With Token","description":"Connect a provider the user brings a pasted credential for — a bot token (Slack) or an API\nkey (Apollo, TikHub, Semrush, …).\n\nThe credential is VERIFIED against the provider's probe before anything is stored. Saving an\nunverified credential just moves the failure to the first real call, by which point the user\nhas left the setup screen and has no idea which of the steps they got wrong.","operationId":"connect_with_token_connections_token_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenConnectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Connect With Token Connections Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections/{secret_id}/extra-credential":{"post":{"summary":"Set Extra Credential","description":"Supply the second credential a provider needs, and finish building its tool.\n\nGoogle Ads takes the user's OAuth bearer AND a developer-token header from an approved manager\naccount. treg can't invent the latter, so the connect deliberately stops short of a tool. This\nis the other half: store the extra credential and provision the tool with BOTH bindings, so the\nconnection goes from \"connected but uncallable\" to actually usable.","operationId":"set_extra_credential_connections__secret_id__extra_credential_post","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraCredentialIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Extra Credential Connections  Secret Id  Extra Credential Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connections/{secret_id}":{"delete":{"summary":"Revoke Connection","description":"Disconnect, and take the provider's own tool with it.\n\nA tool left bound to a deleted credential isn't \"still configured\" — it's broken, and it says so\nonly at call time with \"a bound secret is missing\". We remove the tool treg auto-provisioned for\nthis provider (that's treg's creation, not the user's) and drop the dead binding from any tool\nthe user built themselves, leaving their other bindings intact.","operationId":"revoke_connection_connections__secret_id__delete","parameters":[{"name":"secret_id","in":"path","required":true,"schema":{"type":"integer","title":"Secret Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Connection Connections  Secret Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/status/{state}":{"get":{"summary":"Oauth Status","operationId":"oauth_status_oauth_status__state__get","parameters":[{"name":"state","in":"path","required":true,"schema":{"type":"string","title":"State"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth Status Oauth Status  State  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health/run":{"post":{"summary":"Run Health","operationId":"run_health_health_run_post","parameters":[{"name":"all_orgs","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All Orgs"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Health Health Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Get Health","operationId":"get_health_health_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Health Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/stats":{"get":{"summary":"Admin Stats","operationId":"admin_stats_admin_stats_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Stats Admin Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs":{"get":{"summary":"Admin Orgs","operationId":"admin_orgs_admin_orgs_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Admin Orgs Admin Orgs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}":{"get":{"summary":"Admin Org Detail","operationId":"admin_org_detail_admin_orgs__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Org Detail Admin Orgs  Org Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Admin Delete Org","operationId":"admin_delete_org_admin_orgs__org_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete Org Admin Orgs  Org Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"summary":"Admin Users","operationId":"admin_users_admin_users_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Admin Users Admin Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tools":{"get":{"summary":"Admin Tools","operationId":"admin_tools_admin_tools_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Admin Tools Admin Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/calls":{"get":{"summary":"Admin Calls","operationId":"admin_calls_admin_calls_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Admin Calls Admin Calls Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/errors":{"get":{"summary":"Admin Errors","description":"Failed PLATFORM calls with the evidence to explain them — the caller's request and the\nprovider's own answer (see models.CallRecord.error_request).\n\nSuperadmin-only and deliberately not mirrored on `/calls`: the rows hold customers' request\ncontent, so v1 keeps them behind the same door as every other cross-tenant view.\n\nAgeing happens HERE rather than on the request path. There is no scheduler in this app by design\n(see the comment above `_claim_idempotent`), and the obvious lazy hook — a marker written on the\nrequest session — cannot work: `get_session` never commits, so the marker would roll back and the\npurge would then run on every single failed call. Doing it on this route costs one UPDATE to the\nperson who came to read errors, which is exactly who wants the stale ones gone.","operationId":"admin_errors_admin_errors_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Errors Admin Errors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/health":{"get":{"summary":"Admin Health","operationId":"admin_health_admin_health_get","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Admin Health Admin Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/superadmin":{"post":{"summary":"Admin Set Superadmin","operationId":"admin_set_superadmin_admin_users__user_id__superadmin_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoolIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Set Superadmin Admin Users  User Id  Superadmin Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/suspend":{"post":{"summary":"Admin Suspend User","operationId":"admin_suspend_user_admin_users__user_id__suspend_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoolIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Suspend User Admin Users  User Id  Suspend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"delete":{"summary":"Admin Delete User","operationId":"admin_delete_user_admin_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete User Admin Users  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/suspend":{"post":{"summary":"Admin Suspend Org","operationId":"admin_suspend_org_admin_orgs__org_id__suspend_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"integer","title":"Org Id"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoolIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Suspend Org Admin Orgs  Org Id  Suspend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/reconcile/drift":{"get":{"summary":"Admin Reconcile Drift","description":"Endpoints whose observed cost has wandered from the catalog's estimate. Only the providers that\nreport their own charge in-band appear (see `reconcile.price_drift`).","operationId":"admin_reconcile_drift_admin_reconcile_drift_get","parameters":[{"name":"since_days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Since Days"}},{"name":"min_calls","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Min Calls"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Reconcile Drift Admin Reconcile Drift Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/reconcile/spend":{"get":{"summary":"Admin Reconcile Spend","description":"Settled platform spend per provider — the number to hold next to the provider's own invoice.","operationId":"admin_reconcile_spend_admin_reconcile_spend_get","parameters":[{"name":"since_days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Since Days"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Reconcile Spend Admin Reconcile Spend Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/reconcile/repeats":{"get":{"summary":"Admin Reconcile Repeats","description":"How much of the bill was the same query twice — the cache-worthiness measurement.","operationId":"admin_reconcile_repeats_admin_reconcile_repeats_get","parameters":[{"name":"since_days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Since Days"}},{"name":"top","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Top"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Reconcile Repeats Admin Reconcile Repeats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/referrals":{"get":{"summary":"Admin Referrals","description":"Every referral, across every team — who invited whom, what it cost, and what is still owed.\n\nCross-org, so `require_superadmin` and nothing weaker, exactly like the reconcile trio above.\nRead-only: it pays nothing and refuses nothing. `pending_payout_micro` is what the sweep will\ngrant once holds elapse, and it is the number that says whether this program is affordable\nbefore the money leaves — the same job `provider_spend` does for provider bills.\n\nThis is also the report the influencer tier will read when it lands: a cash payout run is this\nlist, filtered to partners on a contract, exported.","operationId":"admin_referrals_admin_referrals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Referrals Admin Referrals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/call/{rest}":{"head":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Call Tool","operationId":"call_tool_call__rest__head","parameters":[{"name":"rest","in":"path","required":true,"schema":{"type":"string","title":"Rest"}},{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/run":{"post":{"summary":"Run Tool Server","description":"Run a tool's CLI **on the treg server**, with its `cli.inject` secrets injected into the\nchild process — the caller never holds the key. Both run tiers read the same `Tool.cli`\nprofile; any tool WITH a profile is server-runnable (no per-tool opt-in — unlike the local\ntier, the key never reaches the member, and the bin allow-list still gates what executes).\nSee docs/CLI-RUN-PLAN.md.\n\nmember+ (executing argv server-side is a register-tier capability, not a read); the sandbox is\nexcluded (it never touches the real world). A non-zero CLI exit is a normal 200 result with\n`exit_code` set; only a failure to *start* (not enabled / CLI absent) is a 4xx.","operationId":"run_tool_server_run_post","parameters":[{"name":"x-treg-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Token"}},{"name":"x-treg-org","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Treg-Org"}},{"name":"treg_session","in":"cookie","required":false,"schema":{"type":"string","default":"","title":"Treg Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Tool Server Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AcceptIn":{"properties":{"code":{"type":"string","title":"Code"},"email":{"type":"string","title":"Email"}},"type":"object","required":["code","email"],"title":"AcceptIn"},"AccessIn":{"properties":{"tool_access":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tool Access"},"project_access":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},{"type":"null"}],"title":"Project Access"},"local_run_enabled":{"type":"boolean","title":"Local Run Enabled","default":true}},"type":"object","title":"AccessIn"},"AgentIn":{"properties":{"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role","default":"member"},"daily_call_cap":{"type":"integer","title":"Daily Call Cap","default":-1},"tool_access":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tool Access"},"project_access":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Project Access"},"local_run_enabled":{"type":"boolean","title":"Local Run Enabled","default":true},"promoted_member":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promoted Member"},"promoted_client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promoted Client"},"pinned_tags":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Pinned Tags"}},"type":"object","required":["name"],"title":"AgentIn"},"AutoTopupIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"threshold_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Usd"},"amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usd"},"monthly_cap_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Cap Usd"},"consent":{"type":"boolean","title":"Consent","default":false}},"type":"object","required":["enabled"],"title":"AutoTopupIn"},"BoolIn":{"properties":{"value":{"type":"boolean","title":"Value","default":true}},"type":"object","title":"BoolIn"},"BundleUpdate":{"properties":{"recipe":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipe"}},"type":"object","title":"BundleUpdate"},"CapIn":{"properties":{"daily_call_cap":{"type":"integer","title":"Daily Call Cap"}},"type":"object","required":["daily_call_cap"],"title":"CapIn"},"CapabilityPinIn":{"properties":{"capability":{"type":"string","title":"Capability"},"provider":{"type":"string","title":"Provider"}},"type":"object","required":["capability","provider"],"title":"CapabilityPinIn"},"CliApproveIn":{"properties":{"login_id":{"type":"string","title":"Login Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"org":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org"}},"type":"object","required":["login_id"],"title":"CliApproveIn"},"DenyRuleIn":{"properties":{"host":{"type":"string","title":"Host","default":""},"path_prefix":{"type":"string","title":"Path Prefix","default":""},"method":{"type":"string","title":"Method","default":""},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"note":{"type":"string","title":"Note","default":""}},"type":"object","title":"DenyRuleIn"},"EmailStartIn":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"EmailStartIn"},"EmailVerifyIn":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"}},"type":"object","required":["email","code"],"title":"EmailVerifyIn"},"ExtraCredentialIn":{"properties":{"value":{"type":"string","title":"Value"}},"type":"object","required":["value"],"title":"ExtraCredentialIn"},"GrantIn":{"properties":{"argv":{"items":{"type":"string"},"type":"array","title":"Argv","default":[]}},"type":"object","title":"GrantIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteIn":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"},"expires_days":{"type":"integer","title":"Expires Days","default":7},"tool_access":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tool Access"},"project_access":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},{"type":"null"}],"title":"Project Access"},"local_run_enabled":{"type":"boolean","title":"Local Run Enabled","default":true},"landing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landing"}},"type":"object","required":["email"],"title":"InviteIn"},"OAuthStartIn":{"properties":{"name":{"type":"string","title":"Name","default":""},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capability"},"connection_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Connection Id"},"client_id":{"type":"string","title":"Client Id","default":""},"client_secret":{"type":"string","title":"Client Secret","default":""},"auth_uri":{"type":"string","title":"Auth Uri","default":"https://accounts.google.com/o/oauth2/auth"},"token_uri":{"type":"string","title":"Token Uri","default":"https://oauth2.googleapis.com/token"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},"type":"object","title":"OAuthStartIn","description":"Two modes. BYO: supply client_id/client_secret/auth_uri/token_uri/scopes yourself.\nREGISTRY: supply `provider` (+ optional `capability`) and treg fills all of it from its own\napproved app — see oauth_providers.py."},"OnboardIn":{"properties":{"team_name":{"type":"string","title":"Team Name","default":"Acme Design"}},"type":"object","title":"OnboardIn"},"OrgIn":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"OrgIn"},"OrgSettingsIn":{"properties":{"daily_cap_micro":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Cap Micro"},"budget_dims":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Budget Dims"},"primary_dim":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Dim"}},"type":"object","title":"OrgSettingsIn"},"ProjectIn":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ProjectIn"},"ResourceRefIn":{"properties":{"resource_ref":{"type":"string","title":"Resource Ref"},"resource_name":{"type":"string","title":"Resource Name","default":""}},"type":"object","required":["resource_ref"],"title":"ResourceRefIn"},"RoleIn":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleIn"},"RunIn":{"properties":{"tool":{"type":"string","title":"Tool"},"args":{"items":{"type":"string"},"type":"array","title":"Args","default":[]},"timeout_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout S"}},"type":"object","required":["tool"],"title":"RunIn"},"RunReportIn":{"properties":{"audit_id":{"type":"integer","title":"Audit Id"},"exit_code":{"type":"integer","title":"Exit Code"},"verdict":{"type":"string","title":"Verdict"}},"type":"object","required":["audit_id","exit_code","verdict"],"title":"RunReportIn"},"SecretIn":{"properties":{"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"},"kind":{"type":"string","title":"Kind","default":"env"},"bundle_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bundle Id"}},"type":"object","required":["name","value"],"title":"SecretIn"},"SecretUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},"type":"object","title":"SecretUpdate"},"SkillAnalyzeIn":{"properties":{"files":{"items":{"$ref":"#/components/schemas/SkillFileIn"},"type":"array","title":"Files","default":[]}},"type":"object","title":"SkillAnalyzeIn"},"SkillFileIn":{"properties":{"path":{"type":"string","title":"Path"},"content":{"type":"string","title":"Content"}},"type":"object","required":["path","content"],"title":"SkillFileIn"},"SkillImportIn":{"properties":{"files":{"items":{"$ref":"#/components/schemas/SkillFileIn"},"type":"array","title":"Files","default":[]},"select":{"items":{"type":"string"},"type":"array","title":"Select","default":[]},"env_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Env Values","default":{}}},"type":"object","title":"SkillImportIn"},"SkillIn":{"properties":{"name":{"type":"string","title":"Name"},"recipe":{"type":"string","title":"Recipe","default":""},"files":{"additionalProperties":{"type":"string"},"type":"object","title":"Files","default":{}},"secrets":{"items":{"$ref":"#/components/schemas/SkillSecretIn"},"type":"array","title":"Secrets","default":[]},"tools":{"items":{"$ref":"#/components/schemas/SkillToolIn"},"type":"array","title":"Tools","default":[]}},"type":"object","required":["name"],"title":"SkillIn"},"SkillSecretIn":{"properties":{"local_name":{"type":"string","title":"Local Name"},"value":{"type":"string","title":"Value"},"kind":{"type":"string","title":"Kind","default":"env"}},"type":"object","required":["local_name","value"],"title":"SkillSecretIn"},"SkillToolIn":{"properties":{"name":{"type":"string","title":"Name"},"base_url":{"type":"string","title":"Base Url"},"bindings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Bindings","default":[]},"health_check":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Health Check"},"examples":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Examples","default":[]},"cli":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cli"}},"type":"object","required":["name","base_url"],"title":"SkillToolIn"},"TagBudgetIn":{"properties":{"daily_cap_micro":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Cap Micro"},"monthly_cap_micro":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Cap Micro"},"calls_per_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Per Day"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"TagBudgetIn"},"TeammateIn":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"TeammateIn"},"TokenConnectIn":{"properties":{"provider":{"type":"string","title":"Provider"},"token":{"type":"string","title":"Token"}},"type":"object","required":["provider","token"],"title":"TokenConnectIn"},"ToolIn":{"properties":{"name":{"type":"string","title":"Name"},"base_url":{"type":"string","title":"Base Url"},"bundle_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bundle Id"},"bindings":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Bindings"},"secret_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Secret Id"},"injector":{"type":"string","title":"Injector","default":"env"},"auth_in":{"type":"string","title":"Auth In","default":"header"},"auth_name":{"type":"string","title":"Auth Name","default":"Authorization"},"auth_format":{"type":"string","title":"Auth Format","default":"Bearer {secret}"},"secret_field":{"type":"string","title":"Secret Field","default":"access_token"},"health_check":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Health Check"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples"},"cli":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cli"},"project":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Project"}},"type":"object","required":["name","base_url"],"title":"ToolIn"},"ToolUpdate":{"properties":{"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"},"bindings":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Bindings"},"health_check":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Health Check"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples"},"cli":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cli"},"project":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Project"}},"type":"object","title":"ToolUpdate"},"TopupIn":{"properties":{"amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usd"}},"type":"object","title":"TopupIn"},"UserIn":{"properties":{"email":{"type":"string","title":"Email"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["email"],"title":"UserIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}