{"openapi":"3.1.0","info":{"title":"Rush API","version":"1.0.0"},"servers":[{"url":"https://api.phoenix.so","description":"Production"},{"url":"https://api.prix.dev","description":"The same API under its earlier name, kept for existing integrations"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Sessions","description":"Start, list, read and steer sessions. A session is one agent run in its own sandbox."},{"name":"Events","description":"Follow a session live over server-sent events, or read its log."},{"name":"Messages","description":"Read a session's transcript and tool calls, and send it follow-ups."},{"name":"Results & artifacts","description":"The answer, changed files, captured transcript and files a session produced."},{"name":"Secrets","description":"Values a session uses without them appearing in a response. Every secret belongs to one Project and reaches every session in it."},{"name":"API keys","description":"API keys for server-to-server calls, and the webhook each key delivers to."},{"name":"Agents & models","description":"The harnesses, models, apps and MCP servers an org can run."},{"name":"Webhooks","description":"Requests Rush sends to your server."},{"name":"Projects","description":"Projects tie a repository to its runs and connectors."},{"name":"Billing","description":"The caller's plan, usage, spend limit and Stripe sessions."},{"name":"GitHub","description":"The GitHub App installations and repositories runs can use."},{"name":"Saved agents","description":"Reusable agent setups (harness, model, tools and connections), revisioned."},{"name":"Attachments","description":"Files uploaded to attach to a run."},{"name":"Devices","description":"Your own computers, which a run you start can use with your approval."}],"paths":{"/o/{org}/p":{"get":{"operationId":"listProjects","summary":"List the org's Projects","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"responses":{"200":{"description":"The Projects in this org the caller can see (theirs, and every one shared with the org), newest first.","content":{"application/json":{"examples":{"list":{"summary":"A Project with no repository and one with a repository","value":{"projects":[{"id":"2e6c9d31-8a4f-4b70-9d15-c3a7e0f2b864","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","user_id":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","default_harness":"claude","default_harness_version":null,"paused_at":null,"archived_at":null,"readiness":"ready","visibility":"org","people_count":0,"name":"research","installation_id":null,"repo_owner":null,"repo_name":null,"repo_id":null,"default_branch":null,"goal":"Weekly competitor and market notes.","instructions":"","last_run_at":"2026-10-05T08:00:04.000Z","sync_status":"idle","last_synced_at":null,"sync_error":null,"created_at":"2026-09-22T10:31:57.000Z","updated_at":"2026-09-22T10:31:57.000Z","is_default":false},{"id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","user_id":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","default_harness":"claude","default_harness_version":null,"paused_at":null,"archived_at":null,"readiness":"ready","visibility":"org","people_count":0,"name":"web","installation_id":58213904,"repo_owner":"acme","repo_name":"web","repo_id":702918346,"default_branch":"main","goal":"The acme.dev storefront.","instructions":"Run `pnpm test` before opening a PR.","last_run_at":"2026-10-06T15:02:11.000Z","sync_status":"synced","last_synced_at":"2026-10-06T14:58:20.000Z","sync_error":null,"created_at":"2026-09-14T16:20:05.000Z","updated_at":"2026-10-01T12:44:39.000Z","is_default":true}]}}},"schema":{"type":"object","required":["projects"],"properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createProject","summary":"Create a Project in this org, or import a template","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}}},"responses":{"201":{"description":"Project created. An import also answers `agents` (yours, each with the `listing_id` it came from) and `automations` (each switched off; a webhook trigger's secret once).","content":{"application/json":{"schema":{"type":"object","required":["project"],"properties":{"project":{"$ref":"#/components/schemas/Project"},"agents":{"type":"array","items":{"type":"object","required":["id","listing_id"],"properties":{"id":{"type":"string"},"listing_id":{"type":"string"}}}},"automations":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"A Project with this (case-insensitive) name already exists in the org.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A template that cannot be imported now: `TEMPLATE_AGENT_UNLISTED` (names `agent`), or `TEMPLATE_NEEDS_CONNECTION` (lists `needs`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}":{"get":{"operationId":"getProject","summary":"Get a Project by handle or id","description":"A private Project is its creator's alone; anyone else gets the same `404` as for a missing one.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"}],"responses":{"200":{"description":"The Project.","content":{"application/json":{"examples":{"web":{"summary":"GET /o/acme/p/web","value":{"project":{"id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","user_id":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","default_harness":"claude","default_harness_version":null,"paused_at":null,"archived_at":null,"readiness":"ready","visibility":"org","people_count":0,"name":"web","installation_id":58213904,"repo_owner":"acme","repo_name":"web","repo_id":702918346,"default_branch":"main","goal":"The acme.dev storefront.","instructions":"Run `pnpm test` before opening a PR.","last_run_at":"2026-10-06T15:02:11.000Z","sync_status":"synced","last_synced_at":"2026-10-06T14:58:20.000Z","sync_error":null,"created_at":"2026-09-14T16:20:05.000Z","updated_at":"2026-10-01T12:44:39.000Z","is_default":true}}}},"schema":{"type":"object","required":["project"],"properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/sessions":{"get":{"operationId":"listSessions","summary":"List sessions","description":"With an API key: the org's sessions the key can read, newest first, at most\n100 (`limit`, default 50), optionally only one `status`, each in the shape\n`GET /o/{org}/sessions/{session}` returns (`CloudRunSessionList`). A key\ntakes only `status` and `limit`.\n\nWith a signed-in session (the console): a search across every Project in\nthe org, filtered by the other query parameters, in the console's browsing\nshape. With `selector`, it resolves exactly one session by full id, unique\nid prefix, or title; when it matches more than one, the answer is `409`\nwith the `candidates`. These errors use `{code, message}`.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"Exact id, a unique id prefix, or a title. Switches the route into resolution mode."},"required":false,"description":"Exact id, a unique id prefix, or a title. Switches the route into resolution mode.","name":"selector","in":"query"},{"schema":{"type":"array","items":{"type":"string"},"description":"Full-text match across title, prompt and content. Repeatable. Ignored with `selector`."},"required":false,"description":"Full-text match across title, prompt and content. Repeatable. Ignored with `selector`.","name":"q","in":"query","style":"form","explode":true},{"schema":{"type":"string","description":"Only this Project (handle or id), or `_` for the sessions with no Project. A handle from another org returns no rows."},"required":false,"description":"Only this Project (handle or id), or `_` for the sessions with no Project. A handle from another org returns no rows.","name":"project","in":"query"},{"schema":{"$ref":"#/components/schemas/SessionSourceKind","description":"Only sessions started from this surface (`Session.source.kind`)."},"required":false,"description":"Only sessions started from this surface (`Session.source.kind`).","name":"source","in":"query"},{"schema":{"type":"string","description":"Only sessions this API key started (`key_…`), through the API or MCP."},"required":false,"description":"Only sessions this API key started (`key_…`), through the API or MCP.","name":"api_key","in":"query"},{"schema":{"type":"string","description":"Only sessions whose tokens acted as this connected account (its exact `account`: an email, a QuickBooks realm id, or an MCP connection's id), as `CloudRunSession.accounts` lists it."},"required":false,"description":"Only sessions whose tokens acted as this connected account (its exact `account`: an email, a QuickBooks realm id, or an MCP connection's id), as `CloudRunSession.accounts` lists it.","name":"account","in":"query"},{"schema":{"type":"string","description":"A harness as dispatched, e.g. `claude` or `codex`, or a saved agent's id or exact name for that agent's sessions only. A harness name keeps its meaning; a name two agents you can see share is `422 INVALID_BODY`."},"required":false,"description":"A harness as dispatched, e.g. `claude` or `codex`, or a saved agent's id or exact name for that agent's sessions only. A harness name keeps its meaning; a name two agents you can see share is `422 INVALID_BODY`.","name":"agent","in":"query"},{"schema":{"type":"string","enum":["cloud","local"],"description":"Every session today is `cloud`; `local` returns an empty list."},"required":false,"description":"Every session today is `cloud`; `local` returns an empty list.","name":"kind","in":"query"},{"schema":{"$ref":"#/components/schemas/Harness"},"required":false,"name":"harness","in":"query"},{"schema":{"type":"string","enum":["headless","interactive"]},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string"},"required":false,"name":"model","in":"query"},{"schema":{"type":"string","description":"`owner/name`."},"required":false,"description":"`owner/name`.","name":"repo","in":"query"},{"schema":{"type":"string","description":"One status, or several separated by commas (`failed,cancelled`). A key sends one."},"required":false,"description":"One status, or several separated by commas (`failed,cancelled`). A key sends one.","name":"status","in":"query"},{"schema":{"type":"string","description":"Lower time bound. Relative (`2h`, `7d`) or ISO 8601."},"required":false,"description":"Lower time bound. Relative (`2h`, `7d`) or ISO 8601.","name":"since","in":"query"},{"schema":{"type":"string","description":"Upper time bound. Relative (`2h`, `7d`) or ISO 8601."},"required":false,"description":"Upper time bound. Relative (`2h`, `7d`) or ISO 8601.","name":"until","in":"query"},{"schema":{"type":"string","default":"recent","enum":["recent","cost","duration"]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When `true`, return only `count` and an empty `sessions`."},"required":false,"description":"When `true`, return only `count` and an empty `sessions`.","name":"count","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":50,"description":"Max rows to return."},"required":false,"description":"Max rows to return.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response's `next_cursor`."},"required":false,"description":"Opaque pagination cursor from a previous response's `next_cursor`.","name":"cursor","in":"query"}],"responses":{"200":{"description":"The sessions; for a signed-in session, the matching sessions or the one a selector resolved to.","content":{"application/json":{"examples":{"key":{"$ref":"#/components/examples/CloudRunSessionList"},"list":{"summary":"A page of sessions","value":{"sessions":[{"id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","kind":"cloud","short_id":"3f9c2a71","title":"Fix the flaky checkout test","project":"web","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","agent":"claude","harness":"claude","harness_version_requested":null,"harness_version_resolved":"2.1.291","model":"claude-opus-5-5","mode":"headless","status":"completed","prompt":"Fix the flaky checkout test and open a PR.","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","error":null,"session_capture":"complete","message_count":24,"input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"cost_usd":1.84,"duration_ms":412000,"tool_call_count":37,"started_by":{"name":"Dana Lee","avatar_url":null},"summary":"Pinned the clock in checkout.spec.ts and opened PR","artifacts":[],"artifact_count":0,"agent_profile":null,"created_at":"2026-10-06T15:02:11.000Z","updated_at":"2026-10-06T15:09:03.000Z"}],"next_cursor":"NTA="}}},"schema":{"oneOf":[{"$ref":"#/components/schemas/CloudRunSessionList"},{"$ref":"#/components/schemas/SessionList"},{"$ref":"#/components/schemas/Session"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The selector matched more than one session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmbiguousSelector"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createSession","summary":"Start a session","description":"Starts one agent run in a fresh sandbox and returns it at once with\n`202`; follow it with `GET …/events` or the key's webhook. It runs in the\nrepository a `resources` URL names, or in none.\n\nStarted with an API key (or through the MCP server, or of an agent made from a\ntemplate), the run always uses Rush's models, billed per token to the key's\ncreator: past the account's one-time $1 free credit, paid from\nthe creator's prepaid credits, and refused at $0. It never uses a connected account of the\ncreator's, and `account_id` is refused `422 ACCOUNT_UNSUPPORTED`. A key runs at most `max_concurrent` runs\nat once (default 4), within its creator's plan limit; a run past either is answered `202` with\n`status: queued` and starts, oldest first, when a slot frees; a key at its own limit holds up\nonly its own runs, not the creator's other keys or console runs. When `agent`\nis a saved agent's id or exact name the run uses that saved agent, and gets exactly the connections it names\nplus those the run names in `connections`. A key run's repository is\nreached through its creator's GitHub App installations, and a Linear\nissue through its creator's Linear connection.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","maxLength":128,"description":"Send `request_id` in the body instead. Read the same way until it is removed; a\n`request_id` in the body wins.\n"},"required":false,"description":"Send `request_id` in the body instead. Read the same way until it is removed; a\n`request_id` in the body wins.\n","name":"idempotency-key","in":"header","deprecated":true}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"repoless":{"summary":"A run with no repository","value":{"agent":"claude","input":"Write a Python function that parses ISO 8601 durations like P1DT2H30M, with tests. Run the tests and report the result."}},"files":{"summary":"A run with an image, a PDF and an uploaded file","value":{"agent":"claude","input":[{"type":"text","text":"Compare the logo with the brand guide and the attached spreadsheet."},{"type":"image","source":{"type":"url","url":"https://example.com/logo.png"}},{"type":"document","name":"brand-guide.pdf","source":{"type":"base64","media_type":"application/pdf","data":"JVBERi0xLjcK…"}},{"type":"file","source":{"type":"file","file_id":"6f1c0d2e-8a8e-4c55-9d2b-0f6f3f0a1b2c"}}]}},"context":{"summary":"A run with a skill, two connections and a repository branch","value":{"agent":"claude","input":"Add a dark mode toggle to the settings page.","skills":["https://github.com/anthropics/skills/tree/main/skills/frontend-design"],"connections":["6f1c2a9e-3b7d-4e0a-9c55-2d8e1f4a7b30",{"url":"https://mcp.exa.ai/mcp","auth":{"mode":"bearer","token":"exa-key"}}],"resources":[{"url":"https://github.com/acme/web/tree/main"},{"url":"https://linear.app/acme/issue/ENG-42"}]}}},"schema":{"$ref":"#/components/schemas/SessionCreate"}}}},"responses":{"202":{"description":"The session as `GET` reads it, answered once it is saved, so usually `queued` (`allocating` when its start already began).","content":{"application/json":{"example":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","status":"queued","harness":"claude","created_at":"2026-10-09T00:56:44.205Z"},"schema":{"$ref":"#/components/schemas/CloudRunSession"}}}},"400":{"description":"The body is invalid: no `input` or no text block in it, a malformed\ninput block, no `agent`, an unknown `effort`, `speed` or\n`persistence`, `speed: fast` on `opencode`, a malformed `skills`, `connections` or `resources`\nentry, two repositories, or a `request_id` that is not a UUID. A\nfield this route does not take is `UNKNOWN_FIELD`. A `base64` file whose bytes\nare not its `media_type`, or an `image` block whose file is not an\nimage, is `INVALID_BODY`. A body that still sends a removed field is\n`FIELD_REMOVED`, whose message names its replacement: `prompt` and\n`attachments` became `input`; `repos`, `installation_id`, `repo_owner`,\n`repo_name`, `base_branch`, `on_pr` and `sources` became `resources`;\n`mcp_servers` became an inline `{url, name?, auth?}` entry in `connections`,\nwhose own `token` became `auth: {mode: bearer, token}`;\n`harness`, `agent_id` and `profile_id` became `agent`;\n`agents_repo` became a Project Skill or `skills`;\n`name`, `metadata` and `output_schema` are not taken.\n","content":{"application/json":{"examples":{"missing":{"value":{"error":"Missing required field: input"}},"removed":{"value":{"error":"`prompt` was removed: send the task and its files as `input` (a string, or text and file blocks).","code":"FIELD_REMOVED"}}},"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The plan does not cover this run. An API key or MCP run: `TOKEN_LIMIT_REACHED` (the account's\none-time $1 is used and it has no credits; a model call mid-run answers the same),\n`CREDITS_EXHAUSTED` (bought credits are used up) or `SPEND_CAP_REACHED`. A person's own run:\n`FREE_TRIAL_USED` (the Free plan's $1 is used and no credits were bought; past it, bought credits pay and their codes above apply), `PLAN_REQUIRED` (an automation or Slack run on Free,\nor an account with no Free plan), `MODEL_ACCOUNT_MISSING` (a paid plan's run uses the person's own\nmodel account), `COMPUTE_LIMIT_REACHED` or `WEEKLY_COMPUTE_LIMIT_REACHED`. Either: `PAYMENT_METHOD_REQUIRED`.\n","content":{"application/json":{"example":{"error":"API key and MCP runs are paid from prepaid credits. Buy credits in Billing (https://cloud.getrush.ai/console/settings?section=billing) to start one; runs stop at $0.","code":"TOKEN_LIMIT_REACHED"},"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The Project's repository is not in a GitHub App installation linked to the caller (`INSTALLATION_NOT_LINKED`, `REPO_NOT_IN_INSTALLATION`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Project, or a `file_id` in `input`, is not found (`ATTACHMENT_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The `request_id` (or the deprecated Idempotency-Key) was first sent with a different body or Project (`IDEMPOTENCY_CONFLICT`), the repository's GitHub App installation is suspended, a pull-request resource names one that is not open, a saved agent's catalog changed since it was reviewed (`CATALOG_REFRESH_REQUIRED`), a `file_id` already belongs to another run (`ATTACHMENT_IN_USE`), or a `file_id` was never `PUT` to its `upload_url` (`ATTACHMENT_NOT_UPLOADED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"A `file_id`'s stored bytes have expired (`ATTACHMENT_EXPIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is over 32 MB (`REQUEST_TOO_LARGE`). Send a large file as a `url`\nsource, or upload it with `POST /o/{org}/files` and send a `file` source.\n","content":{"application/json":{"example":{"error":"The request body is over 32 MB. Send a large file as a `url` source, or upload it with POST /o/{org}/files and send a `file` source with its id.","code":"REQUEST_TOO_LARGE"},"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field the run cannot honor: an agent outside `claude`, `codex`,\n`opencode` (`UNSUPPORTED_AGENT`); a `model` the harness does not list\nin `GET /o/{org}/agents/available`, or `speed: fast` on `claude` or `codex` for a run on Rush's models\n(an API key's, or a person's on the model trial), which run at standard speed (`code` `MODEL_UNSUPPORTED`; on a saved agent `SPEED_NOT_QUALIFIED`); a `url`\nsource that could not be fetched (`INPUT_FETCH_FAILED`: not https, a\nprivate address, more than 3 redirects, a non-2xx answer, more than 60\nseconds, or an `image` block answered with something else); a skill\nURL that cannot be fetched (`SKILL_FETCH_FAILED`) or holds no valid\n`SKILL.md` (`SKILL_INVALID`); a connection id or name that is not one of the\ncaller's connected connections, or a GitLab account (`CONNECTION_NOT_READY`); a\nname that matches two of them, or an inline server named like a named one\n(`CONNECTION_AMBIGUOUS`); an inline MCP server whose host is not public\n(`MCP_SERVER_URL_INVALID`);\na resource URL Rush cannot attach (`RESOURCE_UNSUPPORTED`); or a\nrepository no GitHub App installation of the caller covers, or a Linear\nissue with no Linear connection to read it (`RESOURCE_NOT_ACCESSIBLE`);\nor `account_id`, since a developer run always uses Rush's models\n(`ACCOUNT_UNSUPPORTED`); a saved agent whose setup the catalog no longer\nsupports (`UNSUPPORTED_PROFILE`, with `fields` naming each choice as a save\ndoes); or a saved agent that keeps its runtime current in a Project pinned\nto a partial release that does not hold the harness's `cli_version`\n(`RUNTIME_UNPINNABLE`). The run is not created.\n","content":{"application/json":{"example":{"error":"claude-opus-9 is not a model the claude harness lists.","code":"MODEL_UNSUPPORTED"},"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The account is over its 1,800-a-minute request budget (`RATE_LIMITED`).","content":{"application/json":{"example":{"error":"Rate limit api reached: 1800 requests per minute. Retry after 12 seconds.","code":"RATE_LIMITED"},"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/sessions/{session}":{"get":{"operationId":"getSession","summary":"Get one session","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"responses":{"200":{"description":"The session.","content":{"application/json":{"examples":{"completed":{"$ref":"#/components/examples/CloudRunSession"}},"schema":{"$ref":"#/components/schemas/CloudRunSession"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/sessions/{session}/cancel":{"post":{"operationId":"cancelSession","summary":"Cancel a session","description":"Ends the run and releases its sandbox. On a finished session whose sandbox is still kept (parked\nbetween turns for follow-ups, or still up), it releases the sandbox only: the session keeps its\nstatus, answer and error. Messages still waiting in line for it fail their turns with `TASK_TERMINAL`,\nand a follow-up to it is then `409 TASK_TERMINAL`. A cancel that lands while the sandbox is still being\nparked after a turn waits for that, up to 45 seconds, and answers `202` if the release is still under way. A\nfollow-up sent while the release is under way is `409 TASK_TERMINAL` too, or, behind messages already\nwaiting, is queued and fails its turn with `TASK_TERMINAL`.\nWithout this a parked sandbox is kept for 7 days after it last parked. No body is read.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"responses":{"202":{"description":"The session as `GET` reads it, `status` `cancelled`, or `cancelling` while the sandbox is still being released; it reads `cancelled` from then on. A finished session keeps its own status (`completed`, `needs_review`, `failed`).","content":{"application/json":{"example":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","status":"cancelling","harness":"claude","created_at":"2026-10-09T00:56:44.205Z"},"schema":{"$ref":"#/components/schemas/CloudRunSession"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The session already finished and its sandbox is gone (`RUN_STATE_CONFLICT`).","content":{"application/json":{"example":{"error":"Cannot cancel: already completed","code":"RUN_STATE_CONFLICT"},"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"The runtime did not confirm the cancel (`CANCELLATION_UNCONFIRMED`). Read the session, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/sessions/{session}/events":{"get":{"operationId":"streamSession","summary":"Follow a session live","description":"A server-sent event stream of the run as it happens. Before the sandbox\nstarts you get `status` events (`{status}`); then the harness's own\nevents (`message`, `tool_use`, `tool_result`, `thinking`, `result`,\n`error`), each with an `id`. A session still `queued` gets one `status` event\nand the stream closes, so reconnect until it has started. The stream ends with `done`, whose data is\n`{status, output, result}`: `result` is the `SessionAnswer`, or null when\nthe run produced none. On a session that already finished the stream\nsends only `status` and `done`, never the history: read that from\n`GET …/messages` or `GET …/trajectory`. An `error` without a `type` (`{code, message}`,\n`code` one of `NOT_FOUND` or `STREAM_ERROR`) ends it early. An API key\nreceives only these events. Reconnect with `Last-Event-ID` (or `?cursor=`)\nto resume after the last event you saw. Comment lines (`: keepalive`) keep\nidle connections open.\n","tags":["Events"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"},{"schema":{"type":"string","description":"Same as `Last-Event-ID`, for clients that cannot set headers."},"required":false,"description":"Same as `Last-Event-ID`, for clients that cannot set headers.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Resume after this event id."},"required":false,"description":"Resume after this event id.","name":"last-event-id","in":"header"}],"responses":{"200":{"description":"The event stream.","content":{"text/event-stream":{"example":"event: status\ndata: {\"status\":\"allocating\",\"id\":\"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24\"}\n\nevent: done\ndata: {\"status\":\"completed\",\"output\":\"runtime: guest harness completed\",\"result\":{\"text\":\"Pinned the clock in checkout.spec.ts.\",\"structured\":null,\"schema_valid\":null}}\n","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/sessions/{session}/messages":{"get":{"operationId":"getSessionMessages","summary":"Read a session's transcript","description":"The captured transcript as the events the live stream carries (`message`,\n`tool_use`, `tool_result`, `thinking`, `error`, `result`), filtered and sliced\non the server. A turn starts at each user message; `first`/`last` keep that\nmany turns, then `include`/`exclude` filter by role. Available once the run\nhas captured its transcript; before that the answer is `404 SESSION_NOT_CAPTURED`.\n","tags":["Messages"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"},{"schema":{"type":"string","example":"user,assistant","description":"Comma-separated roles to keep."},"required":false,"description":"Comma-separated roles to keep.","name":"include","in":"query"},{"schema":{"type":"string","example":"thinking","description":"Comma-separated roles to drop. Not with `include`."},"required":false,"description":"Comma-separated roles to drop. Not with `include`.","name":"exclude","in":"query"},{"schema":{"type":"integer","minimum":1,"description":"Keep the first N turns. Not with `last`."},"required":false,"description":"Keep the first N turns. Not with `last`.","name":"first","in":"query"},{"schema":{"type":"integer","minimum":1,"description":"Keep the last N turns. Not with `first`."},"required":false,"description":"Keep the last N turns. Not with `first`.","name":"last","in":"query"}],"responses":{"200":{"description":"The transcript slice.","content":{"application/json":{"example":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","events":[{"type":"message","role":"user","content":"Fix the flaky checkout test and open a PR."},{"type":"tool_use","tool":"Bash","call_id":"toolu_01Fj19","args":{"command":"bun test checkout"}},{"type":"tool_result","tool":"Bash","call_id":"toolu_01Fj19","success":false,"output":"1 fail"},{"type":"message","role":"assistant","content":"Pinned the clock in checkout.spec.ts and opened PR 412."}]},"schema":{"type":"object","required":["execution_id"],"additionalProperties":false,"properties":{"execution_id":{"type":"string"},"events":{"type":"array","description":"Absent when the slice holds none.","items":{"$ref":"#/components/schemas/SessionEvent"}}}}}}},"400":{"description":"A bad filter (`INVALID_FILTER`): an unknown role, `include` with `exclude`, or `first` with `last`.","content":{"application/json":{"example":{"error":"invalid role \"system\"; valid: user, assistant, thinking, tools","code":"INVALID_FILTER"},"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such session of yours (`NOT_FOUND`), or no transcript captured yet (`SESSION_NOT_CAPTURED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"postSessionMessage","summary":"Send a follow-up","description":"Delivers a message to the session's agent. A parked sandbox is woken first. While a\nturn is still running the message waits in line and runs next; the answer's `turn`\nsays which (`running` or `queued`), and its `id` is the turn to read with\nGET …/p/_/sessions/{session}/turns/{turn}. The session's own `status` stays the\nmachine's, so it can read `completed` with the previous turn's answer while a queued\nturn waits. At most 20 follow-ups wait at once; the next is `429 QUEUE_FULL`. Files land\nin the sandbox beside the session's first ones.\n","tags":["Messages"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"text":{"value":{"input":"Add support for week durations like P2W and rerun the tests."}},"file":{"value":{"input":[{"type":"text","text":"Here is the failing log."},{"type":"file","name":"ci.log","source":{"type":"base64","media_type":"text/plain","data":"RkFJTCBjaGVja291dC5zcGVjLnRz"}}]}}},"schema":{"type":"object","required":["input"],"properties":{"input":{"$ref":"#/components/schemas/RunInput"}}}}}},"responses":{"202":{"description":"Accepted; the session as `GET` reads it, and the turn the message opened.","content":{"application/json":{"examples":{"delivered":{"value":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","status":"running","harness":"claude","created_at":"2026-10-09T00:56:44.205Z","turn":{"id":"8f2c5a17-0b9e-4d63-a7f4-3e1d6b8c2a50","status":"running"}}},"queued":{"value":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","status":"running","harness":"claude","created_at":"2026-10-09T00:56:44.205Z","turn":{"id":"8f2c5a17-0b9e-4d63-a7f4-3e1d6b8c2a50","status":"queued"}}}},"schema":{"$ref":"#/components/schemas/CloudRunSession"}}}},"400":{"description":"No `input` or a malformed one (`INVALID_BODY`), its text over 256 KiB (`CONTENT_TOO_LARGE`), or the removed `content` field (`FIELD_REMOVED`, naming `input`).","content":{"application/json":{"example":{"error":"Missing required field: input","code":"INVALID_BODY"},"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The session owner's plan does not cover more usage, whoever sends the message (same codes as starting a session).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Files on a follow-up from someone other than the session's owner (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The session cannot take a message: it is closed (`TASK_TERMINAL`), not\nstarted yet, its run cannot be continued (`CONTINUATION_UNSUPPORTED`) or queue one\n(`PERSISTENCE_MODE_CONFLICT`, an ephemeral session mid-turn), or its Project is paused (`PROJECT_PAUSED`). A `file_id` another run holds is\n`ATTACHMENT_IN_USE`; one never `PUT` to its `upload_url` is `ATTACHMENT_NOT_UPLOADED`.\n","content":{"application/json":{"example":{"error":"This Task is closed and its computer is gone. Start a new Task.","code":"TASK_TERMINAL"},"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is over 32 MB (`REQUEST_TOO_LARGE`), as on session create.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A `url` source could not be fetched (`INPUT_FETCH_FAILED`), as on session create, or a\nconnection the session named was deleted, expired or revoked since\n(`CONNECTION_UNAVAILABLE`, naming its id), or an API key sent it to a person's own\nsession, which only the console continues (`ACCOUNT_UNSUPPORTED`). Nothing reached the sandbox.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"The runtime could not take the message right now; nothing was delivered. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/sessions/{session}/artifacts/{name}":{"get":{"operationId":"getSessionArtifact","summary":"Download one artifact","description":"The file's bytes, streamed, with the `Content-Type` it was saved with,\n`Content-Disposition: inline` and its filename. Send the key, or open the artifact's `url`\nfrom the session read, which carries `expires` and `signature` and needs no key until\n`url_expires_at`; `HEAD` on the link answers the headers alone. A link opens only the file\nit was issued for; a wrong, expired or altered link answers `404`, as a missing file does.\n","tags":["Results & artifacts"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"},{"schema":{"type":"string","description":"A `name` from the artifact list."},"required":true,"description":"A `name` from the artifact list.","name":"name","in":"path","example":"coverage-report.html"},{"schema":{"type":"integer","description":"Part of a file's signed `url`; send it as given, with no key."},"required":false,"description":"Part of a file's signed `url`; send it as given, with no key.","name":"expires","in":"query"},{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Part of a file's signed `url`; send it as given, with no key."},"required":false,"description":"Part of a file's signed `url`; send it as given, with no key.","name":"signature","in":"query"}],"responses":{"200":{"description":"The file.","content":{"application/octet-stream":{"examples":{"html":{"summary":"The bytes of coverage-report.html, served as text/html","value":"<!doctype html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><title>Coverage report</title></head>\n<body>…</body>\n</html>\n"}},"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/sessions/{session}/attachments/{id}":{"get":{"operationId":"getSessionAttachment","summary":"Download one file the session was given","description":"The bytes of a file the session was started or followed up with, streamed, with its type,\n`Content-Disposition: inline` and its filename. Send the key, or open the attachment's\n`url` from the session read, which needs no key until `url_expires_at`. A wrong, expired or\naltered link answers `404`, as a missing file does.\n","tags":["Attachments"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"},{"schema":{"type":"string","format":"uuid","description":"An `id` from the session's `attachments`."},"required":true,"description":"An `id` from the session's `attachments`.","name":"id","in":"path"},{"schema":{"type":"integer","description":"Part of a file's signed `url`; send it as given, with no key."},"required":false,"description":"Part of a file's signed `url`; send it as given, with no key.","name":"expires","in":"query"},{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Part of a file's signed `url`; send it as given, with no key."},"required":false,"description":"Part of a file's signed `url`; send it as given, with no key.","name":"signature","in":"query"}],"responses":{"200":{"description":"The file.","content":{"application/octet-stream":{"examples":{"pdf":{"summary":"The first bytes of spec.pdf, served as application/pdf","value":"%PDF-1.7\n%âãÏÓ\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n…"}},"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/sessions":{"post":{"operationId":"createProjectSession","summary":"Start a session (console, by Project)","description":"The console's form of `POST /o/{org}/sessions`, with the Project in the path\n(`_` for none). A signed-in caller reads the console's own session shape.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n","name":"project","in":"path"},{"schema":{"type":"string","maxLength":128,"description":"Send `request_id` in the body instead. Read the same way until it is removed; a\n`request_id` in the body wins.\n"},"required":false,"description":"Send `request_id` in the body instead. Read the same way until it is removed; a\n`request_id` in the body wins.\n","name":"idempotency-key","in":"header","deprecated":true}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"repoless":{"summary":"A run with no repository","value":{"agent":"claude","input":"Write a Python function that parses ISO 8601 durations like P1DT2H30M, with tests. Run the tests and report the result."}},"files":{"summary":"A run with an image, a PDF and an uploaded file","value":{"agent":"claude","input":[{"type":"text","text":"Compare the logo with the brand guide and the attached spreadsheet."},{"type":"image","source":{"type":"url","url":"https://example.com/logo.png"}},{"type":"document","name":"brand-guide.pdf","source":{"type":"base64","media_type":"application/pdf","data":"JVBERi0xLjcK…"}},{"type":"file","source":{"type":"file","file_id":"6f1c0d2e-8a8e-4c55-9d2b-0f6f3f0a1b2c"}}]}},"context":{"summary":"A run with a skill, two connections and a repository branch","value":{"agent":"claude","input":"Add a dark mode toggle to the settings page.","skills":["https://github.com/anthropics/skills/tree/main/skills/frontend-design"],"connections":["6f1c2a9e-3b7d-4e0a-9c55-2d8e1f4a7b30",{"url":"https://mcp.exa.ai/mcp","auth":{"mode":"bearer","token":"exa-key"}}],"resources":[{"url":"https://github.com/acme/web/tree/main"},{"url":"https://linear.app/acme/issue/ENG-42"}]}}},"schema":{"$ref":"#/components/schemas/SessionCreate"}}}},"responses":{"202":{"description":"The console's answer."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/sessions/{session}/changes":{"get":{"operationId":"getSessionChanges","summary":"List the files the session's pull request changed","description":"Read from the run's GitHub pull request, so it works after the sandbox\nis gone. A run with no pull request returns an empty list. When GitHub\ncannot be read, the answer is still `200`, with the PR link, no files,\nand `code` `CHANGES_NO_INSTALLATION` or `CHANGES_LIST_FAILED`.\n","tags":["Results & artifacts"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n","name":"project","in":"path"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"responses":{"200":{"description":"The changed files.","content":{"application/json":{"example":{"pr_url":"https://github.com/acme/web/pull/412","pr_number":412,"files":[{"filename":"tests/checkout.spec.ts","status":"modified","additions":6,"deletions":2,"changes":8}],"totals":{"files":1,"additions":6,"deletions":2,"changes":8}},"schema":{"type":"object","required":["pr_url","pr_number","files","totals"],"properties":{"pr_url":{"type":["string","null"]},"pr_number":{"type":["integer","null"]},"files":{"type":"array","items":{"type":"object","required":["filename","status","additions","deletions","changes"],"properties":{"filename":{"type":"string"},"status":{"type":"string","description":"GitHub's file status: added, modified, removed, renamed…"},"additions":{"type":"integer"},"deletions":{"type":"integer"},"changes":{"type":"integer"},"patch":{"type":"string","description":"The unified diff, when GitHub returns one."}}}},"totals":{"type":"object","required":["files","additions","deletions","changes"],"properties":{"files":{"type":"integer"},"additions":{"type":"integer"},"deletions":{"type":"integer"},"changes":{"type":"integer"}}},"error":{"type":"string","description":"Present only when the file list could not be read."},"code":{"type":"string","enum":["CHANGES_NO_INSTALLATION","CHANGES_LIST_FAILED"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/sessions/{session}/artifacts":{"get":{"operationId":"listSessionArtifacts","summary":"List the files a session produced","description":"Files the agent saved as artifacts, in upload order. Download one with `GET …/artifacts/{name}`.","tags":["Results & artifacts"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n","name":"project","in":"path"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"responses":{"200":{"description":"The artifact manifest.","content":{"application/json":{"example":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","artifacts":[{"name":"coverage-report.html","size":48213,"content_type":"text/html"}]},"schema":{"type":"object","required":["execution_id","artifacts"],"properties":{"execution_id":{"type":"string"},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactFile"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/sessions/{session}/turns":{"get":{"operationId":"listTurns","summary":"List the turns of a session","description":"Every prompt in the session in order: the one that started it, then each follow-up in the\norder they ran, then follow-ups still waiting in line (`queued`). A turn is `running` until\nthe session finishes it, then carries that status and its result. A turn that was still open\nwhen the next began ends `interrupted`; a queued one that could not be delivered ends `failed`\nwith its `error_code`, and one whose message was removed ends `cancelled`. Cost and tokens are the session's, on GET …/sessions/{session}.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n","name":"project","in":"path"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"}],"responses":{"200":{"description":"The session's turns.","content":{"application/json":{"examples":{"turns":{"summary":"A session with one follow-up","value":{"turns":[{"id":"1d4b7e92-6c3a-4f05-8a1e-b9d2c7f0e461","ordinal":1,"status":"completed","prompt":"Fix the flaky checkout test and open a PR.","result":{"text":"Pinned the clock in checkout.spec.ts and opened PR 412.","structured":null,"schema_valid":null},"started_at":"2026-10-06T15:02:11.000Z","ended_at":"2026-10-06T15:09:03.000Z"},{"id":"8f2c5a17-0b9e-4d63-a7f4-3e1d6b8c2a50","ordinal":2,"status":"running","prompt":"Also add a test for the expired-coupon path.","result":null,"started_at":"2026-10-06T15:12:40.000Z","ended_at":null}]}}},"schema":{"type":"object","required":["turns"],"properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/sessions/{session}/turns/{turn}":{"get":{"operationId":"getTurn","summary":"Get one turn","description":"One turn's status and result. A follow-up's `turn.id` names its turn from the moment it is\nsent, so a caller waits on this read rather than on the session, which reads the turn before\nit until a queued follow-up starts.\n","tags":["Sessions"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n","name":"project","in":"path"},{"schema":{"type":"string","description":"The session's full id (`execution_id`)."},"required":true,"description":"The session's full id (`execution_id`).","name":"session","in":"path","example":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24"},{"schema":{"type":"string","format":"uuid","description":"A turn id from GET …/turns, or `turn_id` from a sent follow-up."},"required":true,"description":"A turn id from GET …/turns, or `turn_id` from a sent follow-up.","name":"turn","in":"path"}],"responses":{"200":{"description":"The turn.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Turn"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/api-keys":{"get":{"x-audience":"public","tags":["API keys"],"summary":"List the org's API keys","operationId":"listApiKeys","description":"The caller's live keys in the org, without their secrets, with the runs each started in the last seven days (`stats`), and the MCP clients they connected through OAuth (`kind` `oauth`) whose refresh token has not lapsed. Any member, signed in; an API key cannot call this.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"responses":{"200":{"description":"The keys.","content":{"application/json":{"example":{"data":[{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":"https://hooks.acme.dev/rush","expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":"dana@acme.dev"},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z"}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"x-audience":"public","tags":["API keys"],"summary":"Create an API key","operationId":"createApiKey","description":"Mints a key that acts as the caller (any org member) on the session routes. The `secret` is in this response only; it is never stored or shown again. Without `expires_at` the key never expires.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"name":"ci-runner","expires_at":"2027-01-01T00:00:00Z"},"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"type":"string","enum":["runs:read","runs:write"]},"minItems":1,"description":"Defaults to both scopes."},"max_concurrent":{"type":"integer","minimum":1,"maximum":100,"default":4,"description":"Runs this key may have in progress at once."},"expires_at":{"type":["string","null"],"format":"date-time","description":"In the future and at most one year away."}},"required":["name"]}}}},"responses":{"201":{"description":"The key, with its secret.","content":{"application/json":{"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":null,"expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":"dana@acme.dev"},"last_used_at":null,"created_at":"2026-10-06T15:00:00.000Z","secret":"rk_live_Q7f2…"},"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"400":{"description":"An invalid field (`VALIDATION_ERROR`).","content":{"application/json":{"example":{"error":"expires_at must be an ISO date in the future, at most one year away","code":"VALIDATION_ERROR"},"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/api-keys/{key}":{"patch":{"x-audience":"public","tags":["API keys"],"summary":"Set, change or remove the key's webhook","operationId":"updateApiKeyWebhook","description":"Points the `runFinished` webhook of every run this key starts at a public https URL, or clears it with `null`. The signing secret (`webhook_secret`, `whsec_…`) is returned once, when the key first gets a URL and again on `rotate_secret: true`; changing the URL keeps it. Only the key's creator may call this.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","maxLength":64},"required":true,"name":"key","in":"path","description":"The key's `id` (`key_…`), not its secret.","example":"key_Zq3T9vB1mN4pX8cR2wYe"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"set":{"value":{"webhook_url":"https://hooks.acme.dev/rush"}},"rotate":{"value":{"rotate_secret":true}},"clear":{"value":{"webhook_url":null}}},"schema":{"type":"object","properties":{"webhook_url":{"type":["string","null"],"minLength":1,"maxLength":2048,"format":"uri"},"rotate_secret":{"type":"boolean","default":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"The key; `webhook_secret` only when a secret was minted.","content":{"application/json":{"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":"https://hooks.acme.dev/rush","expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":null},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z","webhook_secret":"whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"An unknown field, a URL that is not public https, or `rotate_secret` with no URL (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"x-audience":"public","tags":["API keys"],"summary":"Revoke an API key","operationId":"revokeApiKey","description":"The next request with the key is refused, and its pending webhook retries are dropped. For an OAuth grant, its access and refresh tokens both stop. Only the key's creator may revoke it; another member's key is `404`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","maxLength":64},"required":true,"name":"key","in":"path","description":"The key's `id` (`key_…`), not its secret.","example":"key_Zq3T9vB1mN4pX8cR2wYe"}],"responses":{"204":{"description":"Revoked."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/api-keys/{key}/rotate":{"post":{"x-audience":"public","tags":["API keys"],"summary":"Rotate an API key's secret","operationId":"rotateApiKey","description":"A new secret for the same key; the old one stops working at once. The expiry is kept. Only the key's creator may rotate it; an expired key is `404`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","maxLength":64},"required":true,"name":"key","in":"path","description":"The key's `id` (`key_…`), not its secret.","example":"key_Zq3T9vB1mN4pX8cR2wYe"}],"responses":{"200":{"description":"The key, with its new secret.","content":{"application/json":{"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_M3k8","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":null,"expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":null},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z","secret":"rk_live_M3k8…"},"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents/available":{"get":{"operationId":"getAgentsAvailable","summary":"List the harnesses, models and connectors the org can run","description":"One discovery read. Each harness lists the models it runs: a session's or saved agent's `model` must be a model `name` listed for its harness, with an `effort` from that model's list (no `effort` means the model takes none). A key's session runs at standard speed, and its OpenCode list holds only the models Rush's models serve. `mcp_servers` are the remote MCP servers that can be connected with `POST /me/connections`; `apps` are the built-in apps it connects as `{type: \"app\", name}`: GitLab, Linear, Slack, Buffer, QuickBooks, and each Google and Microsoft product (Gmail, Google Calendar, Google Drive, Outlook, Microsoft Calendar, OneDrive) as its own app. An app whose sign-in is not configured on this deployment is left out.","tags":["Agents & models"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","enum":["claude","codex","opencode"],"description":"Only this harness in `harnesses`."},"required":false,"description":"Only this harness in `harnesses`.","name":"harness","in":"query"}],"responses":{"200":{"description":"The catalog.","content":{"application/json":{"example":{"harnesses":[{"name":"claude","display_name":"Claude Code","models":[{"name":"claude-opus-5-5","display_name":"Opus 5.5","effort":["low","medium","high","xhigh","max"]},{"name":"claude-haiku-5-5","display_name":"Haiku 5.5"}]}],"apps":[{"name":"outlook","display_name":"Outlook","description":"Read and send mail, and read contacts","category":"Productivity"},{"name":"onedrive","display_name":"OneDrive","description":"Read and edit files","category":"Productivity"}],"mcp_servers":[{"name":"Stripe","slug":"stripe","description":"Manage payments and billing.","category":"Finance","author":"Stripe","url":"https://mcp.stripe.com/","documentation_url":"https://docs.stripe.com/mcp"}]},"schema":{"$ref":"#/components/schemas/AgentsAvailable"}}}},"400":{"description":"A `harness` that is not `claude`, `codex` or `opencode` (`VALIDATION_ERROR`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/billing":{"get":{"operationId":"getOrgBilling","summary":"Get the caller's plan usage for the current period and the plan catalog.","description":"Any org member, or an API key of the org (scope `runs:read`), which reads its creator's billing. Billing is per user, not per org: the usage is the caller's own billing account whichever org is in the path. `creditBalanceUsd` is what developer runs, and on Free a person's work past the $1, have left; it can read a little below 0 when model calls already in flight finished past $0, and that amount comes off the next purchase. Changing the plan, buying credits and setting the spend limit or auto-reload take a person in the console. This is the console's billing document, unchanged for keys: its fields are camelCase and `capUsd` and `autoReload` are `null` when not set.","tags":["Billing"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"responses":{"200":{"description":"Usage plus every plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents":{"get":{"operationId":"listSavedAgents","summary":"List saved agents you can use, newest first.","description":"Your own agents and agents shared with you in this org; 50 a page. Agents made from a template are left out unless `template` names one: then the list is that template's agents. `orphaned=true`, for an org admin, lists instead the org's agents whose creator left the org or had their account erased (never the owner's, never one made from a template), whether or not you can see them, as `OrphanedAgent`: its name, harness and how it is shared, nothing of its setup. That includes an agent that was never shared, and one whose creator's account was erased. Make one private with `PATCH {\"visibility\": \"private\"}`, or delete it with `DELETE` (`409 AGENT_IN_USE` while an automation runs it).","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","enum":["true"],"description":"`true` lists the orphaned agents. It takes only `cursor` beside it (anything else is `400 VALIDATION_ERROR`), and a caller who is not an org admin gets `403 FORBIDDEN`."},"required":false,"description":"`true` lists the orphaned agents. It takes only `cursor` beside it (anything else is `400 VALIDATION_ERROR`), and a caller who is not an org admin gets `403 FORBIDDEN`.","name":"orphaned","in":"query"},{"schema":{"type":"string","description":"A template's id or name; lists the agents made from it. An unknown one, or an agent made from a template, is `404 NOT_FOUND`; a blank one is `400 VALIDATION_ERROR`."},"required":false,"description":"A template's id or name; lists the agents made from it. An unknown one, or an agent made from a template, is `404 NOT_FOUND`; a blank one is `400 VALIDATION_ERROR`.","name":"template","in":"query"},{"schema":{"type":"string","description":"The `next_cursor` of the previous page, URL-encoded (it can hold a `+`, which a URL reads as a space); anything else is `400 VALIDATION_ERROR`."},"required":false,"description":"The `next_cursor` of the previous page, URL-encoded (it can hold a `+`, which a URL reads as a space); anything else is `400 VALIDATION_ERROR`.","name":"cursor","in":"query"}],"responses":{"200":{"description":"One page of saved agents.","content":{"application/json":{"examples":{"page":{"summary":"A template and a saved agent, the last page","value":{"agents":[{"id":"3a9d5e21-7c4b-4f18-b6a0-2e8f1d9c7b54","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Outreach","handle":"outreach-7d31b0c4","description":"Emails suppliers for each of your users.","visibility":"private","harness":"codex","revision":1,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"gpt-5.5","effort":"medium","speed":"standard","instructions":"Email suppliers.","connections":[{"id":"b2e7c4a9-5f1d-4e83-9a60-d8c3f1b7e025","kind":"oauth","name":"outlook"},{"id":"0c9f3d68-2a7e-4b51-8d4c-e6a1b9f2c370","kind":"mcp","name":"notion"}],"created_at":"2026-10-08T13:22:41.000Z","updated_at":"2026-10-08T13:22:41.000Z"},{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Plugin reviewer","handle":"plugin-reviewer-5f2a9c1e","visibility":"private","harness":"claude","revision":1,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"claude-opus-5-5","effort":"high","speed":"standard","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design","name":"frontend-design"}],"connections":[{"id":"1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96","kind":"mcp","name":"deepwiki"}],"created_at":"2026-10-07T10:48:16.000Z","updated_at":"2026-10-07T10:48:16.000Z"}]}},"orphaned":{"summary":"`?orphaned=true`: one agent shared with the org, one shared with two people","value":{"agents":[{"id":"8c1e4f72-3b9a-4d05-a6e8-1f7c2d9b0e43","name":"Release notes","harness":"claude","visibility":"org","created_at":"2026-10-21T09:14:02.000Z"},{"id":"5d7a2c91-6e4f-4b38-9c10-3a8e7f2b6d54","name":"Triage","harness":"codex","visibility":"private","people":2,"created_at":"2026-10-12T16:40:55.000Z"}]}}},"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/SavedAgent"},{"$ref":"#/components/schemas/OrphanedAgent"}]}},"next_cursor":{"type":"string","description":"Present when there is another page."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`FORBIDDEN`: `orphaned=true` from someone who is not an org admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createSavedAgent","summary":"Save an agent.","description":"A harness with its model, effort, instructions, skills, connections, runtime, tools and plugins, to start sessions from by sending its id as `agent`. Skills are fetched and pinned when the agent is saved (a GitHub source to its commit, any other to its content), and every session from the agent loads exactly that pin. `handle` and `catalog_revision` are optional: the handle defaults to one from the name and the body, the revision to the catalog's current one. From a key, a field this route does not take is `400 UNKNOWN_FIELD`, and `defaults` and `connection_refs` are `400 FIELD_REMOVED`. A person signed in to the console may send the same body, saves the same agent and reads it back in the same shape. From a session, the console editor's `defaults` and `connection_refs` are also taken in place of `model`, `effort` and `connections`, and `model`, `effort`, `connections` or `skills` beside them is `400 INVALID_BODY`. A refused body is `422` with a `code`, and per-field `fields` where the catalog does not support a choice (`UNSUPPORTED_PROFILE`, with field codes such as `UNKNOWN_MODEL` and `INVALID_EFFORT`).\n\nSend `template` instead to make an agent from a saved agent, one per user of your own app: it runs the template's current instructions, harness, model, skills and capabilities, and the accounts and MCP servers connected to it alone (`POST /o/{org}/agents/{agent}/connections`). The agent stands for your user, with no end-user field: an account connected to it belongs to that agent only, never to your own runs or another agent. Your user signs in to Rush's OAuth app, so you register none. You keep the map from your user to the agent id. It takes only `template`, `name`, `description` and `handle`; any field the template sets is `422 TEMPLATE_FIELDS`.\n\nA retry needs no key: the same body again in this org answers `200` with the agent it made, by its handle when you sent one, else by the body itself. Another body on a handle you sent is `409 HANDLE_TAKEN`. A deleted agent frees its handle, so adding the same listing after a delete makes a new agent. An `Idempotency-Key` header is ignored.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"name":"Plugin reviewer","harness":"claude","model":"claude-opus-5-5","effort":"high","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design"}],"connections":["deepwiki"]},"schema":{"oneOf":[{"$ref":"#/components/schemas/SavedAgentCreate"},{"$ref":"#/components/schemas/SavedAgentFromTemplate"}]}}}},"responses":{"200":{"description":"The same body again; the agent it made.","content":{"application/json":{"examples":{"saved":{"summary":"The agent the request example saved","value":{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Plugin reviewer","handle":"plugin-reviewer-5f2a9c1e","visibility":"private","harness":"claude","revision":1,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"claude-opus-5-5","effort":"high","speed":"standard","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design","name":"frontend-design"}],"connections":[{"id":"1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96","kind":"mcp","name":"deepwiki"}],"created_at":"2026-10-07T10:48:16.000Z","updated_at":"2026-10-07T10:48:16.000Z"}}},"schema":{"$ref":"#/components/schemas/SavedAgent"}}}},"201":{"description":"The saved agent.","content":{"application/json":{"examples":{"saved":{"summary":"The agent the request example saved","value":{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Plugin reviewer","handle":"plugin-reviewer-5f2a9c1e","visibility":"private","harness":"claude","revision":1,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"claude-opus-5-5","effort":"high","speed":"standard","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design","name":"frontend-design"}],"connections":[{"id":"1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96","kind":"mcp","name":"deepwiki"}],"created_at":"2026-10-07T10:48:16.000Z","updated_at":"2026-10-07T10:48:16.000Z"}}},"schema":{"$ref":"#/components/schemas/SavedAgent"}}}},"400":{"description":"An unknown field (`UNKNOWN_FIELD`), a removed one (`FIELD_REMOVED`), a malformed `connections` or `skills` entry, or, from a session, `model`, `effort`, `connections` or `skills` beside the console editor's config (`INVALID_BODY`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"A `template` someone else created (`FORBIDDEN`); only a template's creator makes agents from it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`HANDLE_TAKEN`: the handle you sent holds a live agent made from another body or in another org. A body with no handle is refused only if the handle it derives, and that handle with the org added, are both taken: the same body in another org saves an agent there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Body refused: `INVALID_NAME`, `INVALID_HANDLE`, `INVALID_DESCRIPTION`, `INVALID_HARNESS`, `INVALID_CATALOG`, `CATALOG_REFRESH_REQUIRED` (a stale `catalog_revision`), `INVALID_INSTRUCTIONS`, `INVALID_MODEL`, `INVALID_EFFORT`, `UNSUPPORTED_PROFILE` (a model the harness does not list, or an effort that model does not take), a connection that is not one of yours or not connected (`CONNECTION_NOT_READY`, `CONNECTION_AMBIGUOUS`), or a skill that cannot be fetched (`SKILL_FETCH_FAILED`, `SKILL_INVALID`). With `template`: a field the template sets (`TEMPLATE_FIELDS`), or a `template` that is itself made from a template or names two templates (`INVALID_BODY`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents/{agent}":{"get":{"operationId":"getSavedAgent","summary":"Get a saved agent you can use.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only."},"required":true,"description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only.","name":"agent","in":"path"},{"schema":{"type":"string","description":"An earlier revision's number, from 1; the current revision when absent."},"required":false,"description":"An earlier revision's number, from 1; the current revision when absent.","name":"revision","in":"query"}],"responses":{"200":{"description":"The agent.","content":{"application/json":{"examples":{"saved":{"summary":"A saved agent","value":{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Plugin reviewer","handle":"plugin-reviewer-5f2a9c1e","visibility":"private","harness":"claude","revision":1,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"claude-opus-5-5","effort":"high","speed":"standard","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design","name":"frontend-design"}],"connections":[{"id":"1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96","kind":"mcp","name":"deepwiki"}],"created_at":"2026-10-07T10:48:16.000Z","updated_at":"2026-10-07T10:48:16.000Z"}}},"schema":{"$ref":"#/components/schemas/SavedAgent"}}}},"400":{"description":"A `revision` that is not a positive integer (`INVALID_REVISION`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such agent visible to you (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"More than one agent you can see has that name (`INVALID_BODY`); send its id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateSavedAgent","summary":"Edit a saved agent.","description":"Send only what changes, in the body a create takes; the rest is kept, and the result is checked against today's catalog. A person's edit reads the short body as a key's does, and an unknown field is `400 UNKNOWN_FIELD` beside the short body or the console editor's config. `harness` cannot change. Only the creator can edit. Send `visibility` alone to change who can use the agent. Once the creator has left the org, an org admin may send `{\"visibility\": \"private\"}` alone, and nothing else, even for an agent they cannot see; the answer is then only `{id, visibility}` and `If-Match` is optional. Sessions already started keep what they started with. Editing a template changes the next session of every agent made from it. An agent made from a template takes `name` and `description` only, or `archive: true` alone, which removes it as `DELETE` does; a field the template owns is `422 TEMPLATE_FIELDS`, anything else `422 INVALID_BODY`.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only."},"required":true,"description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only.","name":"agent","in":"path"},{"schema":{"type":"string","description":"The `ETag` of the revision you read; another revision is `412 STALE_ETAG`. A signed-in caller must send it (`428 IF_MATCH_REQUIRED`); an API key may leave it out."},"required":false,"description":"The `ETag` of the revision you read; another revision is `412 STALE_ETAG`. A signed-in caller must send it (`428 IF_MATCH_REQUIRED`); an API key may leave it out.","name":"if-match","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedAgentUpdate"}}}},"responses":{"200":{"description":"The agent as edited; for an org admin's unshare of an orphaned agent, only its id and visibility.","content":{"application/json":{"examples":{"edited":{"summary":"After `{\"effort\": \"max\", \"description\": \"Checks plugin manifests before a release.\"}`","value":{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","user_id":"3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37","org_id":"9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95","name":"Plugin reviewer","handle":"plugin-reviewer-5f2a9c1e","visibility":"private","harness":"claude","revision":2,"catalog_revision":"a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718","runtime":{"selection":"latest_verified"},"model":"claude-opus-5-5","effort":"max","speed":"standard","instructions":"Review each plugin.json and report every problem with its file and a fix.","skills":[{"url":"https://github.com/anthropics/skills/tree/main/skills/frontend-design","name":"frontend-design"}],"connections":[{"id":"1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96","kind":"mcp","name":"deepwiki"}],"created_at":"2026-10-07T10:48:16.000Z","updated_at":"2026-10-09T08:03:27.000Z","description":"Checks plugin manifests before a release."}}},"schema":{"oneOf":[{"$ref":"#/components/schemas/SavedAgent"},{"type":"object","description":"An org admin made an orphaned agent private; nothing else of it is read.","additionalProperties":false,"required":["id","visibility"],"properties":{"id":{"type":"string","format":"uuid"},"visibility":{"type":"string","enum":["private"]}}}]}}}},"400":{"description":"An unknown or removed field, as on create.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"A visible agent belongs to another creator (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such agent visible to you (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"A concurrent edit won (`STALE_ETAG`); read the agent and send the edit again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`IMMUTABLE_FIELD` (`harness` or `handle` sent), `TEMPLATE_FIELDS` (a field an agent's template sets), or any create-time code, checked against the merged setup: `UNSUPPORTED_PROFILE` with `fields` names each choice the catalog does not support, such as `tools.ids` `SKILL_TOOL_REQUIRED` when skills (pinned or from a plugin) meet a tool selection without `Skill`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"A signed-in caller sent no `If-Match` (`IF_MATCH_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteSavedAgent","summary":"Delete a saved agent.","description":"The agent starts no new session and is no longer listed or readable. Sessions already started from it run to the end. Only the creator can delete, or an org admin once the creator has left the org (with `If-Match` optional, even for an agent the admin cannot see). `If-Match` is optional for an API key, as on an edit. Deleting an agent made from a template disconnects every account connected to it. A Google account and an MCP server with a revoke endpoint are revoked at the vendor first, unless another of your live agents or your own account holds the same Google account. A connection whose revoke did not go through stays stored, still answered `200`, until a later `DELETE` of the agent by its id (a name reaches only a live agent) or Rush's operator sweep revokes it; no run of the agent can use it meanwhile. A template that agents are still made from is `409 TEMPLATE_IN_USE`, with their count in `agents`, and an agent that automations run on is `409 AGENT_IN_USE`, with their count in `automations`.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only."},"required":true,"description":"The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only.","name":"agent","in":"path"},{"schema":{"type":"string","description":"The `ETag` of the revision you read; another revision is `412 STALE_ETAG`."},"required":false,"description":"The `ETag` of the revision you read; another revision is `412 STALE_ETAG`.","name":"if-match","in":"header"}],"responses":{"200":{"description":"The agent is deleted.","content":{"application/json":{"example":{"id":"6244972a-14cc-4592-a0e3-c7a0ab45b07b","deleted":true},"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"A visible agent belongs to another creator (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such agent visible to you, or one already deleted (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Agents are still made from this template (`TEMPLATE_IN_USE`), or automations run on this agent (`AGENT_IN_USE`); move or delete them first.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"agents":{"type":"integer","description":"How many agents are made from the template."},"automations":{"type":"integer","description":"How many automations run on the agent."}}}]}}}},"412":{"description":"A concurrent edit won (`STALE_ETAG`); read the agent and delete it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"A signed-in caller sent no `If-Match` (`IF_MATCH_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents/{agent}/connections":{"get":{"operationId":"listAgentConnections","summary":"List the accounts and MCP servers connected to one agent made from a template.","description":"The connections of one agent made from a template (`POST /o/{org}/agents {template, name}`), one per user of your own app. They belong to that agent alone: its runs use them and nothing else, and neither your own connections (`GET /me/connections`) nor another agent's appear here. Only the template's creator reads them. Each item has the shape `GET /me/connections` lists, with `agent`.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`)."},"required":true,"description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`).","name":"agent","in":"path"}],"responses":{"200":{"description":"The agent's connections.","content":{"application/json":{"examples":{"connected":{"summary":"An agent whose user connected Outlook and Notion","value":{"connections":[{"id":"c41e8a72-0d5b-4c9e-a3f6-71b2d8e45f09","type":"app","name":"outlook","agent":"9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66","auth":{"mode":"oauth"},"status":"connected"},{"id":"5a8c2e14-6b3d-4f90-9e27-d1f4a0b8c763","type":"mcp","name":"notion","agent":"9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66","url":"https://mcp.notion.com/mcp","auth":{"mode":"oauth"},"status":"connected","tools":[{"name":"notion-search","title":"Search Notion","description":"Search the workspace and connected sources.","read_only":true},{"name":"notion-create-pages","title":"Create pages","description":"Create one or more pages with properties and content.","read_only":false}]}]}}},"schema":{"type":"object","required":["connections"],"properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/AgentConnection"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such agent made from a template of yours (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The agent is a template or a plain agent, which runs on your own connections (`INVALID_BODY`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createAgentConnection","summary":"Start a sign-in that connects an account or MCP server to one agent.","description":"Starts the sign-in for one of the connections the agent's template names, for the user of your app the agent serves. That person needs no Rush account: send them to `authorize_url`, where they sign in to the app or the MCP server with Rush's OAuth client; the link works once and expires in 10 minutes. Then read the connection by its `id` until `status` is `connected`.\n\n`type` is `app` for a built-in app (`outlook`, `gmail`, …) or `mcp` for an MCP server that signs in with OAuth; `name` is the name the template's connection has (`GET /o/{org}/agents/{agent}` lists them under `connections`). An MCP server is signed in to at the same address as the template's. A Gmail or Outlook connection the template names with an `access` level asks the user for that level alone. Connecting the same name again replaces the agent's earlier connection of it.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`)."},"required":true,"description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`).","name":"agent","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"type":"mcp","name":"notion"},"schema":{"type":"object","required":["type","name"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["app","mcp"]},"name":{"type":"string","description":"One of the connections the template names, e.g. `outlook` or `notion`."}}}}}},"responses":{"202":{"description":"The sign-in, pending until the agent's user finishes it.","content":{"application/json":{"examples":{"pending":{"summary":"The sign-in for `{\"type\": \"mcp\", \"name\": \"notion\"}`","value":{"id":"e7d03b5a-9f1c-4a62-8b4e-0c6d2f9a1e37","type":"mcp","agent":"9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66","auth":{"mode":"oauth"},"status":"pending","authorize_url":"https://mcp.notion.com/authorize?response_type=code&client_id=…&code_challenge=…&code_challenge_method=S256&state=…"}}},"schema":{"$ref":"#/components/schemas/AgentConnection"}}}},"400":{"description":"The body is not `{type, name}` (`INVALID_BODY`, `UNKNOWN_FIELD`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such agent made from a template of yours (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The template does not name that connection, the MCP server takes a token rather than a sign-in, or the agent is not made from a template (`INVALID_BODY`); or the server cannot register Rush (`registration_unsupported`, `registration_failed`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents/{agent}/connections/{connection}":{"get":{"operationId":"getAgentConnection","summary":"Read one of an agent's connections, or the sign-in that makes it.","description":"The id a create returned reads as the sign-in while it is open (`pending`, or `failed` with an `error`), then as the connection it made, under that connection's own `id`.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`)."},"required":true,"description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`).","name":"agent","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The id the create returned, or a connection's own id from the list."},"required":true,"description":"The id the create returned, or a connection's own id from the list.","name":"connection","in":"path"}],"responses":{"200":{"description":"The connection or its sign-in.","content":{"application/json":{"examples":{"connected":{"summary":"The finished sign-in, read as the connection it made under its own id","value":{"id":"5a8c2e14-6b3d-4f90-9e27-d1f4a0b8c763","type":"mcp","name":"notion","agent":"9b2f6c18-4e7a-4d35-8c91-5f0a3e7d2b66","url":"https://mcp.notion.com/mcp","auth":{"mode":"oauth"},"status":"connected","tools":[{"name":"notion-search","title":"Search Notion","description":"Search the workspace and connected sources.","read_only":true},{"name":"notion-create-pages","title":"Create pages","description":"Create one or more pages with properties and content.","read_only":false}]}}},"schema":{"$ref":"#/components/schemas/AgentConnection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such agent, or no such connection of it (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteAgentConnection","summary":"Disconnect one of an agent's connections, or cancel its sign-in.","description":"The agent's next session that needs it is `422 CONNECTION_NOT_READY` until it is connected again.","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`)."},"required":true,"description":"The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`).","name":"agent","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The id the create returned, or a connection's own id from the list."},"required":true,"description":"The id the create returned, or a connection's own id from the list.","name":"connection","in":"path"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"examples":{"deleted":{"summary":"Outlook disconnected","value":{"id":"c41e8a72-0d5b-4c9e-a3f6-71b2d8e45f09","deleted":true}}},"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No such agent, or no such connection of it (`NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/secrets":{"get":{"x-audience":"public","tags":["Secrets"],"summary":"List the org's Project secrets, without values.","operationId":"listSecrets","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","format":"uuid","description":"Only this Project's secrets."},"required":false,"description":"Only this Project's secrets.","name":"project","in":"query"}],"responses":{"200":{"description":"Secrets, never a value.","content":{"application/json":{"examples":{"list":{"summary":"One Project's secrets, by name","value":{"data":[{"id":"5c1f8e27-3a9b-4d60-b2e4-7f0d6a8c1e95","name":"NPM_TOKEN","kind":"env","source":"rush","description":"","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","targets":[],"header_name":null,"header_format":null,"has_totp":false,"created_by":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","created_at":"2026-10-07T09:12:30.000Z","value_updated_at":"2026-10-07T09:12:30.000Z","last_used_at":null},{"id":"9e3a6d14-7b2c-4f81-a5d9-0c8e2f4b6a37","name":"staging-login","kind":"login","source":"rush","description":"The QA account on staging.","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","targets":["https://staging.acme.dev"],"header_name":null,"header_format":null,"has_totp":true,"created_by":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","created_at":"2026-09-30T11:05:48.000Z","value_updated_at":"2026-09-30T11:05:48.000Z","last_used_at":"2026-10-05T18:21:09.000Z"},{"id":"2b7e4c90-1d3a-4f58-8e6b-9c0a5d2f7e13","name":"stripe-api","kind":"header","source":"rush","description":"Stripe test-mode key for checkout tests.","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","targets":["api.stripe.com"],"header_name":"Authorization","header_format":"Bearer {value}","has_totp":false,"created_by":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","created_at":"2026-09-28T17:40:12.000Z","value_updated_at":"2026-09-28T17:40:12.000Z","last_used_at":"2026-10-06T15:02:14.000Z"}]}}},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Secret"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"x-audience":"public","tags":["Secrets"],"summary":"Save a secret. The value is sealed and never returned.","operationId":"createSecret","description":"`kind: env` sets the environment variable `name` on every session that uses it; `name` follows environment-variable rules and may not be one Rush sets itself. `kind: header` never reaches the session's environment: E2B's egress proxy adds `header_name: header_format(value)` to the session's HTTPS requests to each host in `targets`, outside the sandbox. `Basic {value}` takes `username:password` and encodes it. A header secret's `name` is a label (letters, digits, `.`, `-`, `_`). Rush's own API hosts (`api.phoenix.so`, `api.prix.dev`) are never a target: the session signs in to Rush there, so such a secret is refused with `SECRET_TARGET_INVALID`; give the agent a Rush API key as a `kind: env` secret instead. `kind: login` takes one https origin in `targets` plus `username`, `password` and an optional base32 `totp_secret`. Its value is never in the session's environment or conversation: the agent runs `rush-sign-in <name>` and Rush types it into the session's browser on that origin only. The agent shares that browser, so this keeps the value out of the transcript, not out of the sandbox. `source: onepassword` (`header` and `login` only; an environment variable is readable by the agent, so it stays in Rush) stores no value: `value` is an `op://` reference, read with the creator's connected 1Password service account when a session starts or signs in. A header takes one field (`op://Vault/Item/field`), a login takes the item (`op://Vault/Item`, read as its `username`, `password` and, with `totp: true`, its one-time code). The reference must be readable when it is saved, or the request is refused with a `SECRET_ONEPASSWORD_*` code. `project_id` is required: the secret reaches every session in that Project. `copy_of` copies a secret of this org into `project_id` instead: send only `project_id`, `copy_of` and an optional new `name`; everything else, the value included, comes from the source, which keeps working. Only the person who added the source, signed in as themselves, may copy it (`FORBIDDEN` otherwise, an API key included), because the copy puts its value in front of another Project's sessions. A body that is not a JSON object is `400 INVALID_BODY`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","format":"uuid","description":"A Project of this org; every session in it gets the secret."},"copy_of":{"type":"string","format":"uuid","description":"Copy this secret into `project_id`. Without it, `name` and the value are required."},"name":{"type":"string","maxLength":128},"kind":{"type":"string","enum":["env","header","login"],"default":"env"},"value":{"type":"string","maxLength":32768,"description":"The value; with `source: onepassword`, its `op://` reference."},"source":{"type":"string","enum":["rush","onepassword"],"default":"rush","description":"Where the value lives. `onepassword` is for `header` and `login`."},"totp":{"type":"boolean","description":"`login` with `source: onepassword` only: also read the item's one-time password."},"description":{"type":"string","maxLength":500},"targets":{"type":"array","minItems":1,"maxItems":16,"items":{"type":"string"},"description":"`header` only: bare lowercase hostnames, such as `api.stripe.com` (no scheme, port, path, wildcard or IP)."},"header_name":{"type":"string","description":"`header` only: the header to set; `Host`, `Content-Length` and hop-by-hop headers are refused."},"header_format":{"type":"string","enum":["{value}","Bearer {value}","Basic {value}"],"description":"`header` only."},"username":{"type":"string","maxLength":1024,"description":"`login` only."},"password":{"type":"string","maxLength":1024,"description":"`login` only."},"totp_secret":{"type":"string","description":"`login` only: the base32 two-factor setup key."}},"required":["project_id"],"additionalProperties":{}}}}},"responses":{"201":{"description":"Saved.","content":{"application/json":{"examples":{"env":{"summary":"An environment variable, saved","value":{"data":{"id":"5c1f8e27-3a9b-4d60-b2e4-7f0d6a8c1e95","name":"NPM_TOKEN","kind":"env","source":"rush","description":"","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","targets":[],"header_name":null,"header_format":null,"has_totp":false,"created_by":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","created_at":"2026-10-07T09:12:30.000Z","value_updated_at":"2026-10-07T09:12:30.000Z","last_used_at":null}}}},"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Secret"}},"required":["data"]}}}},"400":{"description":"A body that is not a JSON object (`INVALID_BODY`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`FORBIDDEN`: `copy_of` names a secret the caller did not add, or the caller is an API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`SECRET_NOT_FOUND`: `copy_of` names no secret the caller can see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`SECRET_NAME_TAKEN`: a secret with this name already exists in the same scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SECRET_FIELD_IMMUTABLE` (a field beside `copy_of` other than `project_id` and `name`), `SECRET_PROJECT_REQUIRED`, `SECRET_PROJECT_NOT_IN_ORG`, `SECRET_NAME_INVALID`, `SECRET_VALUE_INVALID`, `SECRET_KIND_INVALID`, `SECRET_SOURCE_INVALID`, `SECRET_TARGET_INVALID`, `SECRET_DESCRIPTION_INVALID`, or for a 1Password reference `SECRET_ONEPASSWORD_NOT_CONNECTED`, `SECRET_ONEPASSWORD_TOKEN_REJECTED` or `SECRET_ONEPASSWORD_NOT_FOUND` (`SECRET_ONEPASSWORD_RATE_LIMITED` is 429 and `SECRET_ONEPASSWORD_UNAVAILABLE` 502).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/secrets/{secret}":{"patch":{"x-audience":"public","tags":["Secrets"],"summary":"Replace a secret's value or note, or a sign-in's site.","operationId":"updateSecret","description":"Only its creator or an org admin. A sign-in's value is `username`, `password` and an optional `totp_secret`, replaced together; any other secret's is `value`. A sign-in's `targets` (its one https site) can change on its own, keeping the stored username and password, but only by the person who added it, signed in as themselves. Any other field but `description` is refused with `SECRET_FIELD_IMMUTABLE`. A body that is not a JSON object is `400 INVALID_BODY`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"secret","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","maxLength":32768},"username":{"type":"string","maxLength":1024},"password":{"type":"string","maxLength":1024},"totp_secret":{"type":"string"},"targets":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":1,"description":"A sign-in's new site, such as https://login.example.com."},"description":{"type":"string","maxLength":500}},"additionalProperties":{}}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"examples":{"value":{"summary":"A header secret with its value replaced","value":{"data":{"id":"2b7e4c90-1d3a-4f58-8e6b-9c0a5d2f7e13","name":"stripe-api","kind":"header","source":"rush","description":"Stripe test-mode key for checkout tests.","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","targets":["api.stripe.com"],"header_name":"Authorization","header_format":"Bearer {value}","has_totp":false,"created_by":"4e8a1f3c-6b2d-4c97-a05e-8d3f2b1c9a76","created_at":"2026-09-28T17:40:12.000Z","value_updated_at":"2026-10-07T09:14:55.000Z","last_used_at":"2026-10-06T15:02:14.000Z"}}}},"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Secret"}},"required":["data"]}}}},"400":{"description":"A body that is not a JSON object (`INVALID_BODY`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Not its creator or an org admin, or a new site from anyone but the person who added the sign-in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`SECRET_NOT_FOUND`: no such secret the caller can see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`SECRET_CHANGED`: a site-only move found the value replaced since it was read; read it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SECRET_FIELD_IMMUTABLE`, `SECRET_VALUE_INVALID` or `SECRET_DESCRIPTION_INVALID`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"x-audience":"public","tags":["Secrets"],"summary":"Delete a secret. A session that names it afterwards fails instead of starting without it.","operationId":"deleteSecret","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"secret","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Not its creator or an org admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`SECRET_NOT_FOUND`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/files":{"post":{"operationId":"createFiles","summary":"Get an upload URL for each file of a session's input.","description":"Name each file and its type, then `PUT` its bytes to the `upload_url` that comes back,\nstraight to storage and in parallel if you like, with the same `Content-Type` as its\n`mime_type`. There is no size field and no size limit here: one `PUT` takes a file up to\n5 GB. An `upload_url` is good for an hour. Pass each id as a\n`{\"type\": \"file\", \"source\": {\"type\": \"file\", \"file_id\": id}}` block in a session's or a\nfollow-up's `input`. When the session starts, each file's bytes are checked against its\ntype and its size is read from storage; a file never uploaded is refused there with\n`409 ATTACHMENT_NOT_UPLOADED`. At most 50 files per call. Rate-limited to 30 calls a minute\nper caller.\n","tags":["Attachments"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"files":[{"name":"demo.mp4","mime_type":"video/mp4"},{"name":"spec.pdf","mime_type":"application/pdf"}]},"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","required":["name","mime_type"],"properties":{"name":{"type":"string","maxLength":255,"description":"The file name in the sandbox. No `/`, `\\`, `..`, leading `.`, or control characters."},"mime_type":{"type":"string","description":"The file's media type. Send it as the `Content-Type` of the `PUT`."}}}}}}}}},"responses":{"201":{"description":"An upload URL per file, in the order asked for.","content":{"application/json":{"examples":{"files":{"summary":"Two upload URLs, in the order asked for","value":{"files":[{"id":"3f0c8b2e-5d14-4a7f-9b63-1e2d7c9a0f48","name":"demo.mp4","mime_type":"video/mp4","upload_url":"https://uploads.example.com/attachments/3f0c8b2e…?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=5e0a…","upload_expires_at":"2026-10-06T16:01:47.312Z"},{"id":"7a91d4c6-0e2b-4f85-a3d7-6b1c9e5f2a03","name":"spec.pdf","mime_type":"application/pdf","upload_url":"https://uploads.example.com/attachments/7a91d4c6…?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=c38d…","upload_expires_at":"2026-10-06T16:01:47.312Z"}]}}},"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","items":{"type":"object","required":["id","name","mime_type","upload_url","upload_expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mime_type":{"type":"string"},"upload_url":{"type":"string","format":"uri","description":"A signed URL to `PUT` the file to, with `Content-Type: <mime_type>`."},"upload_expires_at":{"type":"string","format":"date-time"}}}}}}}}},"400":{"description":"Not the JSON shape above, a `multipart/form-data` body or a `size` field (`INVALID_BODY`, naming the shape), an invalid name or type, or more than 50 files (`TOO_MANY_FILES`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Upload rate limit exceeded, or the account is over its 1,800-a-minute request budget. `Retry-After` is set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/github":{"get":{"operationId":"getGithubConnection","summary":"List the GitHub App installations the caller can use and their repositories.","description":"Without `state`: the installations the caller owns plus those GitHub grants them, each\nwith the repositories a `resources` URL can name (`GithubInstallationsForKey` for an API\nkey, `GithubInstallations` for the console). With `state`: the status of the caller's own\npending connect (`GithubConnectStatus`).\n","tags":["GitHub"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"A `state` minted by `POST /o/{org}/github` (43 base64url characters). Switches the response to the connect status."},"required":false,"description":"A `state` minted by `POST /o/{org}/github` (43 base64url characters). Switches the response to the connect status.","name":"state","in":"query"}],"responses":{"200":{"description":"Installations (no `state`) or connect status (with `state`).","content":{"application/json":{"example":{"installations":[{"id":163786121,"account":"bisma-nawazz","account_type":"User","repositories":[{"full_name":"bisma-nawazz/code-forge","private":true},{"full_name":"bisma-nawazz/.agents","private":false}]}]},"schema":{"oneOf":[{"$ref":"#/components/schemas/GithubInstallationsForKey"},{"$ref":"#/components/schemas/GithubInstallations"},{"$ref":"#/components/schemas/GithubConnectStatus"}]}}}},"400":{"description":"`state` is not 43 base64url characters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Org not found, or `state` is not one of the caller's pending connects.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/automations":{"get":{"operationId":"listOrgAutomations","summary":"List automations across the org's Projects.","description":"Every automation in the Projects the caller can see, newest first, at most 200. With `agent`, only\nthose that run it: a saved agent by its id, or a default harness by name. A wake runs its\nsession's agent and names none, so `agent` never matches one.\n","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A saved agent's id, or `claude`, `codex` or `opencode`."},"required":false,"description":"A saved agent's id, or `claude`, `codex` or `opencode`.","name":"agent","in":"query"}],"responses":{"200":{"description":"The automations, each with its triggers and its five latest runs.","content":{"application/json":{"schema":{"type":"object","required":["automations"],"properties":{"automations":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/automations":{"get":{"operationId":"listAutomations","summary":"List the Project's automations.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"}],"responses":{"200":{"description":"Every automation in the Project, oldest first, each with its triggers and its five latest runs.","content":{"application/json":{"schema":{"type":"object","required":["automations"],"properties":{"automations":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createAutomation","summary":"Create an automation.","description":"An automation is a saved prompt in this Project, with one of its runner's saved agents\n(`profile_id`) or the Project's default harness. Its triggers run it as `created_by`, the\nmember who last changed what it does; Run now runs it as whoever presses it. `triggers` is\nrequired, with at least one: an automation runs on its own, and Run now is for trying it.\nEvery one is validated before anything is written. A `webhook` trigger's secret is returned\nonce, on that trigger in this response.\n","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AutomationInput"},{"type":"object","required":["name","prompt","triggers"],"properties":{"triggers":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"#/components/schemas/AutomationTriggerInput"}}}}]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["automation"],"properties":{"automation":{"$ref":"#/components/schemas/Automation"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"A wake's session is one the caller may read but not send follow-ups to; or, with an API key, a `linear` or `email` trigger, or a wake of a session no key started (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A wake's session is not resumable (`PERSISTENCE_MODE_CONFLICT`) or is closed (`TASK_TERMINAL`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A schedule does not parse, names an unknown timezone, or fires more than once an hour, or every 10 minutes for a wake (`INVALID_SCHEDULE`); a `linear` trigger's runner has no Linear connection (`LINEAR_NOT_CONNECTED`), or an `email` trigger's no Gmail connection (`GMAIL_NOT_CONNECTED`); `model` is not one `harness` lists, or takes no such `effort` (`MODEL_UNSUPPORTED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/automations/{automation}":{"get":{"operationId":"getAutomation","summary":"Get one automation.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"}],"responses":{"200":{"description":"The automation.","content":{"application/json":{"schema":{"type":"object","required":["automation"],"properties":{"automation":{"$ref":"#/components/schemas/Automation"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateAutomation","summary":"Edit an automation.","description":"An automation runs as whoever last changed what it does, so when an org admin who is not `created_by` changes `prompt`, `profile_id`, `session_id` or `read_only`, or switches a wake back on, `created_by` becomes that caller and `profile_id` must be one of theirs. `name`, `enabled`, `max_runs_per_hour` and `notify_each_run` alone leave it unchanged. Switching it back on moves each schedule to its next slot. `project` moves it to another Project of the org (a name or id), which counts as changing what it does. It keeps its id, triggers and webhook URLs, and its next run gets that Project's secrets, files and connections. Its secrets stay where they are; copy one with `copy_of` on `POST /o/{org}/secrets`. A wake cannot move (`VALIDATION_ERROR`, field `project`), nor can an automation with a GitHub trigger go to a Project with no repository (`PROJECT_HAS_NO_REPOSITORY`); in one with a repository, its GitHub trigger listens to that repository from then on. `recent_runs` lists only runs in its current Project; earlier ones stay with the Project they ran in.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AutomationInput"},{"type":"object","properties":{"project":{"type":"string","description":"Move it to this Project of the org: its name or id."}}}]}}}},"responses":{"200":{"description":"The updated automation.","content":{"application/json":{"schema":{"type":"object","required":["automation"],"properties":{"automation":{"$ref":"#/components/schemas/Automation"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin, sends `notify_each_run` without being `created_by`, or may not send follow-ups to a wake's session (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A wake's session is not resumable (`PERSISTENCE_MODE_CONFLICT`) or is closed (`TASK_TERMINAL`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Moving one with a GitHub trigger to a Project with no repository (`PROJECT_HAS_NO_REPOSITORY`), removing `session_id` while a schedule fires more than once an hour (`INVALID_SCHEDULE`), or a takeover by a caller with no Linear connection (`LINEAR_NOT_CONNECTED`) or, for an automation with an email trigger, no Gmail connection (`GMAIL_NOT_CONNECTED`); `model` is not one `harness` lists, or takes no such `effort` (`MODEL_UNSUPPORTED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteAutomation","summary":"Delete an automation and its triggers.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/automations/{automation}/triggers":{"post":{"operationId":"createAutomationTrigger","summary":"Add a trigger to an automation.","description":"A `webhook` trigger's secret is returned once, in this response. A change by someone other than `created_by` makes them its runner, as an edit does.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTriggerInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["trigger"],"properties":{"trigger":{"$ref":"#/components/schemas/AutomationTrigger"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid schedule (`INVALID_SCHEDULE`), or a `linear` trigger whose runner has no Linear connection (`LINEAR_NOT_CONNECTED`), or an `email` trigger whose runner has no Gmail connection (`GMAIL_NOT_CONNECTED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/automations/{automation}/triggers/{trigger}":{"patch":{"operationId":"updateAutomationTrigger","summary":"Edit a trigger.","description":"The kind cannot change. `config` is replaced whole; changing a schedule moves `next_fire_at`.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The trigger's id."},"required":true,"description":"The trigger's id.","name":"trigger","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/TriggerEvent"}},"branch_patterns":{"type":"array","items":{"type":"string"}},"config":{"$ref":"#/components/schemas/TriggerConfig"}}}}}},"responses":{"200":{"description":"The updated trigger.","content":{"application/json":{"schema":{"type":"object","required":["trigger"],"properties":{"trigger":{"$ref":"#/components/schemas/AutomationTrigger"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Invalid schedule (`INVALID_SCHEDULE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteAutomationTrigger","summary":"Remove a trigger.","description":"An automation keeps at least one trigger, so removing its last one is refused; switch it off (`enabled`) to pause it.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The trigger's id."},"required":true,"description":"The trigger's id.","name":"trigger","in":"path"}],"responses":{"204":{"description":"Removed."},"400":{"description":"It is the automation's last trigger (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/p/{project}/automations/{automation}/triggers/{trigger}/secret":{"post":{"operationId":"rotateAutomationTriggerSecret","summary":"Rotate a webhook trigger's secret.","description":"A webhook's new secret is returned once. The old one stops working at once.","tags":["Projects"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`."},"required":true,"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less dispatch on `POST`; \"no Project constraint, resolve by session id alone\" everywhere else). A real handle that doesn't match the session's actual Project is `404`.","name":"project","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The automation's id."},"required":true,"description":"The automation's id.","name":"automation","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The trigger's id."},"required":true,"description":"The trigger's id.","name":"trigger","in":"path"}],"responses":{"200":{"description":"The trigger with its new `webhook_secret`.","content":{"application/json":{"schema":{"type":"object","required":["trigger"],"properties":{"trigger":{"$ref":"#/components/schemas/AutomationTrigger"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The caller is neither the automation's creator nor an org admin (`FORBIDDEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/o/{org}/agents/community/{agent}":{"get":{"operationId":"getCommunityAgent","summary":"Read one agent listed in Community","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"agent","in":"path"}],"responses":{"200":{"description":"The listing: its text, maker and integrations, never its setup","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"logo_url":{"type":["string","null"]}},"required":["name","slug"]},"integrations":{"type":"array","items":{"type":"string"},"description":"The apps it works with, by name."},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"How it starts, by kind: `request` is a run you start; the rest are automation triggers. Absent on a listing approved before makers declared it."},"logo_url":{"type":"string","description":"The listing's square logo, a public image URL that never changes."},"cover_url":{"type":"string","description":"The listing's wide cover image, a public image URL that never changes."},"listed_at":{"type":"string"},"harness":{"type":"string"},"model":{"type":"string"},"added":{"type":"boolean"}},"required":["id","name","subtitle","description","category","maker","listed_at","harness","model","added"]}}}},"400":{"description":"The agent is not a listing id (a UUID)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not listed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/agents/community":{"get":{"operationId":"listCommunityAgents","summary":"List the agents companies listed in Community","tags":["Saved agents"],"x-audience":"public","parameters":[{"schema":{"type":"string"},"required":true,"name":"org","in":"path","description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Listed agents, newest listing first, 24 a page","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"logo_url":{"type":["string","null"]}},"required":["name","slug"]},"integrations":{"type":"array","items":{"type":"string"},"description":"The apps it works with, by name."},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"How it starts, by kind: `request` is a run you start; the rest are automation triggers. Absent on a listing approved before makers declared it."},"logo_url":{"type":"string","description":"The listing's square logo, a public image URL that never changes."},"cover_url":{"type":"string","description":"The listing's wide cover image, a public image URL that never changes."},"listed_at":{"type":"string"},"harness":{"type":"string"},"model":{"type":"string"},"added":{"type":"boolean"}},"required":["id","name","subtitle","description","category","maker","listed_at","harness","model","added"]}},"next_cursor":{"type":"string"}},"required":["agents"]}}}},"400":{"description":"Unknown category, or a cursor that is not an earlier next_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/devices/{name}":{"delete":{"operationId":"removeDevice","summary":"Remove one of your computers and disconnect it.","tags":["Devices"],"x-audience":"public","parameters":[{"schema":{"type":"string","description":"The device's `name` from `GET /me/devices`."},"required":true,"description":"The device's `name` from `GET /me/devices`.","name":"name","in":"path"}],"responses":{"204":{"description":"Removed."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"You have no device with that name; `code` is `NOT_FOUND`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/me/devices":{"get":{"operationId":"listDevices","summary":"List your linked computers.","description":"The computers you registered, which a run you start may name in `devices`, and your Phoenix session link when there is one. An API key reads its creator's.","tags":["Devices"],"x-audience":"public","responses":{"200":{"description":"Your devices.","content":{"application/json":{"schema":{"type":"object","properties":{"devices":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The name you start a run with (`devices` on `POST /o/{org}/sessions`)."},"kind":{"type":"string","enum":["computer"]},"os":{"type":"string","enum":["macos"]},"arch":{"type":"string","enum":["arm64","x86_64"]},"online":{"type":"boolean","description":"Whether the Rush app on it is connected now."},"last_seen_at":{"type":"string","format":"date-time","description":"When it last connected. Absent until it has."},"created_at":{"type":"string","format":"date-time"}},"required":["name","kind","os","arch","online","created_at"]},{"type":"object","properties":{"device":{"type":"string","enum":["phoenix-link"]},"kind":{"type":"string","enum":["phoenix_link"]},"phoenix_user_id":{"type":"string"}},"required":["device","kind","phoenix_user_id"]}]}}},"required":["devices"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/community/agents/{agent}":{"get":{"operationId":"getPublicCommunityAgent","summary":"Read one Community agent, with no credential","tags":["Saved agents"],"x-audience":"public","security":[],"parameters":[{"schema":{"type":"string","description":"The listing's id."},"required":true,"description":"The listing's id.","name":"agent","in":"path"}],"responses":{"200":{"description":"The listing: its text, maker, apps and triggers, never its setup","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"description":"The company that listed it, by the name Phoenix approved."},"integrations":{"type":"array","items":{"type":"string"},"description":"The apps it works with, by name."},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"How it starts, by kind: `request` is a run you start; the rest are automation triggers. Absent on a listing approved before makers declared it."},"logo_url":{"type":"string","description":"The listing's square logo, a public image URL that never changes."},"cover_url":{"type":"string","description":"The listing's wide cover image, a public image URL that never changes."},"listed_at":{"type":"string"}},"required":["id","name","subtitle","description","category","maker","listed_at"]}}}},"404":{"description":"Not a listed agent: never listed, withdrawn, removed, or not an id (`NOT_FOUND`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/community/agents":{"get":{"operationId":"listPublicCommunityAgents","summary":"List Community agents, with no credential","description":"Every agent a company listed and Phoenix approved, newest listing first, 24 a page. Needs no API key; the answer is the same for every caller.","tags":["Saved agents"],"x-audience":"public","security":[],"parameters":[{"schema":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Listed agents, newest listing first, 24 a page","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"description":"The company that listed it, by the name Phoenix approved."},"integrations":{"type":"array","items":{"type":"string"},"description":"The apps it works with, by name."},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"How it starts, by kind: `request` is a run you start; the rest are automation triggers. Absent on a listing approved before makers declared it."},"logo_url":{"type":"string","description":"The listing's square logo, a public image URL that never changes."},"cover_url":{"type":"string","description":"The listing's wide cover image, a public image URL that never changes."},"listed_at":{"type":"string"}},"required":["id","name","subtitle","description","category","maker","listed_at"]}},"next_cursor":{"type":"string"}},"required":["agents"]}}}},"400":{"description":"An unknown category or query parameter, or a cursor that is not an earlier next_cursor (`VALIDATION_ERROR`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/community/projects/{project}":{"get":{"operationId":"getPublicCommunityProject","summary":"Read one Community Project, with no credential","tags":["Projects"],"x-audience":"public","security":[],"parameters":[{"schema":{"type":"string","description":"The listing's id."},"required":true,"description":"The listing's id.","name":"project","in":"path"}],"responses":{"200":{"description":"The listed snapshot: its text, agents, automations and what it needs","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string","description":"The Project's goal."},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"listed_at":{"type":"string"},"instructions":{"type":"string","description":"The instructions every run in an imported Project gets."},"default_harness":{"type":"string"},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"description":"The Community agents its automations run, by listing id."},"automations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"prompt":{"type":"string"},"agent":{"type":"string","description":"A listing id from `agents`, or a default harness's name."},"model":{"type":"string"},"effort":{"type":"string"},"read_only":{"type":"boolean","enum":[true]},"max_runs_per_hour":{"type":"integer"},"triggers":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"branch_patterns":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{}}},"required":["kind"]}}},"required":["name","prompt","agent","max_runs_per_hour","triggers"]}},"needs":{"type":"array","items":{"type":"string","enum":["github","linear","gmail"]},"description":"What an importer connects before its automations can fire."}},"required":["id","name","subtitle","description","category","maker","listed_at","instructions","default_harness","agents","automations"]}}}},"404":{"description":"Not a listed Project: never listed, withdrawn, removed, or not an id (`NOT_FOUND`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/community/projects":{"get":{"operationId":"listPublicCommunityProjects","summary":"List Community Projects, with no credential","description":"Every Project a company listed as a template and Phoenix approved, newest listing first, 24 a page. Needs no API key.","tags":["Projects"],"x-audience":"public","security":[],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Listed Projects, newest listing first, 24 a page","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string","description":"The Project's goal."},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"maker":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"listed_at":{"type":"string"},"instructions":{"type":"string","description":"The instructions every run in an imported Project gets."},"default_harness":{"type":"string"},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"description":"The Community agents its automations run, by listing id."},"automations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"prompt":{"type":"string"},"agent":{"type":"string","description":"A listing id from `agents`, or a default harness's name."},"model":{"type":"string"},"effort":{"type":"string"},"read_only":{"type":"boolean","enum":[true]},"max_runs_per_hour":{"type":"integer"},"triggers":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"branch_patterns":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{}}},"required":["kind"]}}},"required":["name","prompt","agent","max_runs_per_hour","triggers"]}},"needs":{"type":"array","items":{"type":"string","enum":["github","linear","gmail"]},"description":"What an importer connects before its automations can fire."}},"required":["id","name","subtitle","description","category","maker","listed_at","instructions","default_harness","agents","automations"]}},"next_cursor":{"type":"string"}},"required":["projects"]}}}},"400":{"description":"An unknown query parameter, or a cursor that is not an earlier next_cursor (`VALIDATION_ERROR`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"runFinished":{"post":{"tags":["Webhooks"],"x-audience":"public","operationId":"runFinished","summary":"A run started with an API key finished a turn","description":"Sent to the `webhook_url` set on the API key that started the run (PATCH /o/{org}/api-keys/{key}), within about 30 seconds of a turn finishing: one per turn of a resumable run. Signed per Standard Webhooks with the key's `whsec_` secret. Any 2xx within 5 seconds acknowledges it; anything else is retried 2, 4 and 6 minutes after the first attempt with the same `webhook-id`, then dropped. Revoking the key or clearing its webhook drops pending retries.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Stable across retries: webhook:{execution_id}:{ms the turn finished}."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds of this attempt."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"v1,<base64 HMAC-SHA256 of \"{webhook-id}.{webhook-timestamp}.{body}\", keyed by the base64 bytes after whsec_>."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"type":"string","enum":["run.completed","run.failed","run.cancelled"]},"timestamp":{"type":"string","format":"date-time","description":"When the turn finished."},"data":{"type":"object","required":["execution_id","org_id","status","session_url","events_url"],"properties":{"execution_id":{"type":"string"},"turn_id":{"type":"string","format":"uuid","description":"The turn this answers: the `turn.id` a follow-up returned, or the run's first turn. Absent when no turn ended with this finish; then read GET …/turns."},"org_id":{"type":"string"},"project_id":{"type":"string","format":"uuid","description":"The Project the console ran the session in; absent for none."},"status":{"type":"string","description":"completed, needs_review, failed or cancelled."},"result":{"type":"string","description":"The turn's final answer; absent when there is none or it is over 16 KiB (GET session_url)."},"total_cost_usd":{"type":"number"},"session_url":{"type":"string","format":"uri","description":"The session, with its full answer and artifacts."},"events_url":{"type":"string","format":"uri"}}}}},"example":{"type":"run.completed","timestamp":"2026-10-06T15:09:03.000Z","data":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","turn_id":"3d8a2f61-94c7-4b0e-8e15-6a7c2d9b4f03","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","status":"completed","result":"Pinned the clock in checkout.spec.ts and opened PR 412.","total_cost_usd":1.84,"session_url":"https://api.phoenix.so/o/0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90/sessions/7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","events_url":"https://api.phoenix.so/o/0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90/sessions/7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24/events"}}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key (`rk_live_…`, from POST /o/{org}/api-keys), which acts as the member who created it, in its own org, on the routes marked `x-audience: public`; or a signed-in Phoenix ID session, as the console and the `rush` CLI send."}},"responses":{"Unauthorized":{"description":"No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invalid or expired token","code":"AUTH_FAILED","requestId":"req_8f3a2c"}}}},"NotFound":{"description":"No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Execution not found"}}}},"BadRequest":{"description":"Malformed request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.","headers":{"Retry-After":{"description":"Seconds until the budget resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed a minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in this minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the budget resets, in milliseconds since the epoch.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Rate limit api reached: 1800 requests per minute. Retry after 12 seconds.","code":"RATE_LIMITED","requestId":"req_8f3a2c"}}}}},"examples":{"CloudRunSession":{"summary":"A finished session","value":{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","status":"completed","harness":"claude","model":"claude-opus-5-5","effort":"high","result":"Pinned the clock in checkout.spec.ts and opened PR 412.","repo_owner":"acme","repo_name":"web","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"total_tokens":231670,"total_cost_usd":1.84,"tool_calls_count":37,"turns_count":1,"artifacts":[{"name":"coverage-report.html","mime_type":"text/html","url":"https://api.phoenix.so/o/acme/sessions/7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24/artifacts/coverage-report.html?expires=1791306543&signature=9b1f…","url_expires_at":"2026-10-06T16:09:03.000Z"}],"created_at":"2026-10-06T15:02:11.000Z","completed_at":"2026-10-06T15:09:03.000Z"}},"CloudRunSessionList":{"summary":"One page","value":{"sessions":[{"execution_id":"7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24","org_id":"acme","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","status":"completed","harness":"claude","model":"claude-opus-5-5","effort":"high","result":"Pinned the clock in checkout.spec.ts and opened PR 412.","repo_owner":"acme","repo_name":"web","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"total_tokens":231670,"total_cost_usd":1.84,"tool_calls_count":37,"turns_count":1,"artifacts":[{"name":"coverage-report.html","mime_type":"text/html","url":"https://api.phoenix.so/o/acme/sessions/7c1e9a4f-2b6d-4f83-a5c0-9e3d1b8f6a24/artifacts/coverage-report.html?expires=1791306543&signature=9b1f…","url_expires_at":"2026-10-06T16:09:03.000Z"}],"created_at":"2026-10-06T15:02:11.000Z","completed_at":"2026-10-06T15:09:03.000Z"}]}}},"schemas":{"Turn":{"type":"object","required":["id","ordinal","status","prompt","result","started_at","ended_at"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":["integer","null"],"minimum":1,"description":"1 for the prompt that started the session, then one per follow-up in the order they ran. Null for a follow-up waiting in line (`queued`) or one that failed there: it takes its place when it starts."},"status":{"type":"string","enum":["queued","running","completed","needs_review","failed","cancelled","expired","interrupted"],"description":"`queued` is a follow-up sent while a turn was running, waiting for its turn."},"prompt":{"type":["string","null"]},"result":{"description":"The turn's answer, as GET …/sessions/{session}/result returned it when the turn ended."},"error_code":{"type":"string","description":"Why the turn failed: the run's failure code (`RUN_FAILED`, `HARNESS_EXITED`, `TOKEN_LIMIT_REACHED`, …), or for a queued follow-up that never ran, why (`ATTACHMENT_EXPIRED`, `TASK_TERMINAL`, `DELIVERY_RETRIES_EXHAUSTED` or the delivery refusal). A turn that ran and failed spent its run time, so resend only one that never ran. Absent when the turn did not fail, and on turns that ran and ended before migration 408."},"started_at":{"type":"string","format":"date-time","description":"When the turn started, or for a queued one when it was sent."},"ended_at":{"type":["string","null"],"format":"date-time"},"input_tokens":{"type":"integer","minimum":0,"description":"The turn's own tokens, as its harness reported them when it ended. Absent until then, and on a turn that reported none."},"output_tokens":{"type":"integer","minimum":0},"cache_read_tokens":{"type":"integer","minimum":0},"reasoning_tokens":{"type":"integer","minimum":0},"total_cost_usd":{"type":"number","minimum":0,"description":"What the provider billed for this turn's model calls so far, from the ledger the session's `total_cost_usd`\nis settled from: each call counts toward the turn that had started last when the call was logged,\nso once the session has finished its turns add up to its `total_cost_usd`. `0` for a run on a person's\nown model account, which they pay the provider for. Absent on a turn that never started (`queued`,\nor failed or cancelled in the queue).\n"}}},"Secret":{"type":"object","description":"A secret without its value.","required":["id","name","kind","source","description","project_id","targets","has_totp","created_by","created_at","value_updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["env","header","login"]},"source":{"type":"string","enum":["rush","onepassword"],"description":"Where the value lives; a 1Password secret holds only its reference."},"description":{"type":"string"},"project_id":{"type":"string","format":"uuid"},"targets":{"type":"array","items":{"type":"string"},"description":"Hosts (header) or one origin (login); empty for env."},"header_name":{"type":["string","null"]},"header_format":{"type":["string","null"]},"has_totp":{"type":"boolean"},"created_by":{"type":["string","null"],"format":"uuid","description":"Null once the member who added it has deleted their account; the secret stays with the Project."},"created_at":{"type":"string","format":"date-time"},"value_updated_at":{"type":"string","format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"}}},"AgentConnection":{"type":"object","description":"One connection of an agent made from a template, or the sign-in that makes it. Absent fields are\nomitted: `authorize_url` only on the create, `error` only on a failed sign-in, `url` and `tools`\nonly on a connected MCP server.\n","required":["id","type","agent","status"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["app","mcp"]},"name":{"type":"string","description":"The name a session's `connections` and the template use."},"agent":{"type":"string","format":"uuid","description":"The agent the connection belongs to."},"url":{"type":"string","format":"uri","description":"The MCP server's address."},"auth":{"type":"object","properties":{"mode":{"type":"string","enum":["oauth","bearer","none"]}}},"status":{"type":"string","enum":["pending","connected","failed"]},"authorize_url":{"type":"string","format":"uri","description":"Where the agent's user signs in. Single use; expires in 10 minutes."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["connection_expired","cancelled_by_caller","connection_failed"]},"message":{"type":"string"}}},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"read_only":{"type":"boolean"}}}}}},"Error":{"type":"object","description":"Every non-2xx body. Two envelopes are live: most routes send `error`\n(a sentence) with an optional `code` or `error_code`; the org-wide\nsession search sends `code` and `message`. Some refusals add fields\n(`candidates`, `fields`, plan usage). Branch on `code` / `error_code`.\n","anyOf":[{"required":["error"]},{"required":["code","message"]}],"properties":{"error":{"type":"string","description":"A sentence for a person."},"code":{"type":"string","description":"Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED."},"error_code":{"type":"string","description":"The machine code on routes that name it this way."},"message":{"type":"string"},"requestId":{"type":"string"}},"additionalProperties":true},"Harness":{"type":"string","enum":["claude","codex","opencode"],"description":"Launch-boundary managed harnesses."},"SessionStatus":{"type":"string","enum":["queued","allocating","running","paused","input_required","needs_review","completed","failed","cancelling","cancelled","expired"],"description":"`paused` is a resumable session parked between turns; `needs_review` finished without the proof it was asked for; `cancelling` appears only in the `202` answer to a cancel whose sandbox is still being released; `GET` reads `cancelled` once it is."},"Project":{"type":"object","required":["id","name","installation_id","repo_owner","repo_name","default_harness","readiness"],"description":"The repository is optional Context. A GitHub one has installation_id, repo_owner and repo_name all set; a gitlab.com one has `repo_host: gitlab`, repo_owner (its group path) and repo_name, with installation_id and repo_id null; with none, all are null.","properties":{"id":{"type":"string","format":"uuid"},"org_id":{"type":"string","format":"uuid","description":"The org the Project belongs to."},"user_id":{"type":"string","format":"uuid","description":"The Project's creator: the one person who sees it while it is private, and the only one who changes its visibility."},"visibility":{"$ref":"#/components/schemas/ProjectVisibility"},"name":{"type":"string"},"repo_host":{"type":"string","enum":["gitlab"],"description":"Present when the repository is on gitlab.com; absent for a GitHub repository or none."},"installation_id":{"type":["integer","null"],"format":"int64"},"repo_owner":{"type":["string","null"]},"repo_name":{"type":["string","null"]},"repo_id":{"type":["integer","null"],"format":"int64"},"default_branch":{"type":["string","null"]},"default_harness":{"$ref":"#/components/schemas/Harness"},"default_harness_version":{"type":["string","null"]},"readiness":{"type":"string","enum":["pending","ready","error"]},"sync_status":{"type":"string","enum":["idle","syncing","synced","error"]},"sync_error":{"type":["string","null"]},"last_synced_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"is_default":{"type":"boolean","description":"The project a prompt-only surface (Slack) resolves to. Per user, not per org."},"people_count":{"type":"integer","description":"How many people it is shared with by name (GET …/people lists them)."},"goal":{"type":"string","description":"What the Project is for; empty when unset."},"instructions":{"type":"string","description":"Standing instructions every run in the Project receives ahead of its prompt; empty when unset."},"paused_at":{"type":["string","null"],"format":"date-time","description":"When it was paused: no run or follow-up starts (`409 PROJECT_PAUSED`) and no automation fires. Null when running."},"archived_at":{"type":["string","null"],"format":"date-time","description":"When it was archived. A client leaves it out of its lists; nothing else changes, its runs and automations carry on. Null when not archived."},"last_run_at":{"type":["string","null"],"format":"date-time","description":"When a run last started in the Project. Null before its first run."}}},"ProjectVisibility":{"type":"string","enum":["private","org"],"description":"Who sees the Project, its runs, automations, secrets and files: `private` is its creator alone, `org` is every member of its org. A run is always readable by whoever started it; a run with no Project is readable by them alone."},"ProjectCreate":{"type":"object","required":["name"],"description":"A name alone makes a Project with no repository. A repository is installation_id, repo_owner and repo_name together (`400 VALIDATION_ERROR` for some but not all); default_branch and repo_id need one. The caller's GitHub installation must see the repository (`403 INSTALLATION_NOT_LINKED` or `REPO_NOT_IN_INSTALLATION`). A gitlab.com repository is `repo_host: gitlab` with repo_owner (the group path, `group/subgroup` when nested) and repo_name, and no installation_id or repo_id. The caller's own GitLab sign-in must be able to push to it, asked of GitLab now: no sign-in or one that needs reconnecting is `422 CONNECTION_NOT_READY`, two with no `connection` naming one `422 CONNECTION_AMBIGUOUS`, a project it cannot see or push to `404`/`403 RESOURCE_NOT_ACCESSIBLE`, a default_branch that does not exist `404 NOT_FOUND`, and GitLab unreachable `502 PROVIDER_ERROR`. Each member's run in the Project clones it with that member's own GitLab sign-in, checked again at every start; no member's account is lent to another.","properties":{"template":{"type":"string","format":"uuid","description":"A Project template's id (`GET /community/projects`). The new Project takes the template's goal, instructions and default agent, adds each Community agent it runs (as `POST /o/{org}/agents {template}` does) and creates its automations switched off; send only `name`, `visibility` and a repository with it. `404 NOT_FOUND` for no listed template; `422 TEMPLATE_AGENT_UNLISTED` when one of its agents is no longer listed; `422 TEMPLATE_NEEDS_CONNECTION` with `needs` (`github`: send a repository, `linear`, `gmail`: connect it; an API key takes neither). Answers 201 `{project, agents: [{id, listing_id}], automations}` with each webhook trigger's secret once; anything refused after the Project exists deletes it and its automations (the agents it added stay, and a retry reuses them)."},"name":{"type":"string"},"goal":{"type":"string","maxLength":280},"instructions":{"type":"string","maxLength":20000,"description":"Standing instructions every run in the Project reads first."},"file_ids":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid"},"description":"Finished uploads of the caller's (`POST /o/{org}/files`) that become the Project's files, copied into every run started in it. Refused before the Project is made, with the code a run would get (`404 ATTACHMENT_NOT_FOUND`, `409 ATTACHMENT_IN_USE`, `410 ATTACHMENT_EXPIRED`, `400 INVALID_BODY`)."},"visibility":{"$ref":"#/components/schemas/ProjectVisibility","description":"Defaults to private."},"repo_host":{"type":"string","enum":["gitlab"],"description":"gitlab.com; absent for GitHub."},"connection":{"type":"string","description":"With `repo_host: gitlab`: which of your GitLab sign-ins (`GET /me/connections`) checks the repository. Not stored."},"installation_id":{"type":"integer","format":"int64"},"repo_owner":{"type":"string"},"repo_name":{"type":"string"},"repo_id":{"type":"integer","format":"int64"},"default_branch":{"type":"string"},"default_harness":{"$ref":"#/components/schemas/Harness","description":"Defaults to claude."},"default_harness_version":{"type":"string"}}},"SessionCreate":{"type":"object","required":["input"],"description":"`agent` is required, and the repository, if any, is a `resources` URL. Any\nother field is `400 UNKNOWN_FIELD`; `name`, `metadata`, `output_schema`,\n`harness`, `agent_id` and `profile_id` are `400 FIELD_REMOVED`.\n","properties":{"agent":{"type":"string","description":"What runs: a harness (`claude`, `codex` or `opencode`), or a saved agent's id or exact name (`GET /o/{org}/agents`; a harness name keeps its meaning, and a name two agents share is `422 INVALID_BODY`), which brings its harness, model, effort, instructions, skills and connections; one whose saved setup the catalog no longer supports (such as skills with a tool selection that leaves out `Skill`) is `422 UNSUPPORTED_PROFILE`, with `fields` naming the choice, until it is edited (one added from Community, until its maker lists a new revision). Required on `POST /o/{org}/sessions`; on a Project's route the Project's default harness runs when it is left out.","example":"claude"},"input":{"$ref":"#/components/schemas/RunInput"},"model":{"type":"string","description":"A model `id` that GET /o/{org}/agents/available lists for this harness. Omitted: the harness default."},"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max","auto"],"description":"Reasoning effort; must be one the model's row lists."},"speed":{"type":"string","enum":["standard","fast"],"description":"How fast the model runs. A run on Rush's models (every API key's, and a person's on the model trial) runs at `standard` only; `fast` is `422 MODEL_UNSUPPORTED` (`400 VALIDATION_ERROR` on `opencode`, `422 SPEED_NOT_QUALIFIED` on a saved agent). Omitted: standard."},"account_id":{"type":"string","description":"Refused `422 ACCOUNT_UNSUPPORTED` with an API key: a developer run always uses Rush's models. Only a person's own run, started in the console, may name one of their connected accounts."},"strategy":{"type":"string","enum":["platform"],"description":"Rush's models, covered by the account's one-time $1 and then paid from the caller's prepaid credits. Every run started with an API key or an MCP client already uses them, so this changes nothing there; a person's own run that sends it is refused `422 ACCOUNT_UNSUPPORTED`, except on the Free plan past the $1 with credits bought, where their run moves onto credits with or without it."},"request_id":{"type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","example":"3f2a1c4e-8b7d-4e6f-9a1b-2c3d4e5f6a7b","description":"A UUID you make once for each run you mean to start. A retry with the same `request_id` and\nbody returns the run it first started, until that run fails or is cancelled; the same\n`request_id` with another body or Project is `409 IDEMPOTENCY_CONFLICT`. Not a UUID is\n`400 VALIDATION_ERROR`. Optional: without one, every request starts a run.\n"},"skills":{"type":"array","maxItems":10,"description":"Skills the agent loads for this run, each by public URL, as a string or `{url}`: a GitHub `tree` URL to a\ndirectory holding `SKILL.md`, a URL to a `SKILL.md` file (`github.com/…/blob/…`,\n`raw.githubusercontent.com/…` or any https host), or a `.zip` URL. Fetched when the run\nis created; a GitHub source is pinned to the commit its branch or tag points at, and the\npin is kept with the run. All of a run's skills pack to at most\n32 MB unpacked, one file at most 10 MB. An unreachable URL is `422 SKILL_FETCH_FAILED`; no `SKILL.md`, a bad\nname or too large is `422 SKILL_INVALID`.\n","items":{"$ref":"#/components/schemas/SkillUrl"}},"connections":{"type":"array","maxItems":20,"description":"What this run connects to, each entry in one of three forms:\n\n- **An id** of one of the caller's own connections (`GET /me/connections`): an MCP\n  server (connected with a token, by OAuth, or with no auth), a Google or Microsoft\n  product (Gmail, Outlook, OneDrive, ...) of one account, or a GitLab account. Secrets are never named: a session gets every secret of its Project\n  (`/o/{org}/secrets`).\n- **A name** of one of them, the `name` `GET /me/connections` lists: the name the\n  caller gave an MCP server (`\"deepwiki\"`, `\"EXA_API_KEY\"`), or the provider of\n  an account or a built-in connector, which `GET /me/connections` lists as `{type: \"app\",\n  name: \"linear\"}` (`\"linear\"`, `\"gmail\"`). Only the caller's own rows match, and only\n  user-level ones or ones in this run's Project. A name that matches two of them is\n  `422 CONNECTION_AMBIGUOUS`, whose message lists their ids; send one id instead.\n- **An inline MCP server** `{url, name?, auth?}`, used by this run and its follow-ups\n  only and never added to `/me/connections`. `url` is a streamable HTTP endpoint on\n  https whose host resolves to public addresses only (else `422 MCP_SERVER_URL_INVALID`).\n  `auth` is the shape `POST /me/connections` takes: `{mode: \"bearer\", token}` sends the\n  token as `Authorization: Bearer`; `{mode: \"none\"}` or no `auth` sends none. A `token`\n  beside `url` is `400 FIELD_REMOVED`. The token is stored encrypted on the run and never returned. `name` defaults to a slug of the host\n  (`mcp-deepwiki-com`), and may not be a built-in connection's or share a name with\n  another entry (`422 CONNECTION_AMBIGUOUS` when it matches a named server).\n\nIds and names fit Anthropic's stored-credential model (a vault id per run); the inline\nform fits OpenAI's inline `authorization` and Cursor's `mcpServers` headers. An id or\nname that is unknown, still connecting, or waiting on a reconnect is\n`422 CONNECTION_NOT_READY`. Follow-ups keep all three.\n","items":{"oneOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"A connection id or name."},{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"name":{"type":"string"},"auth":{"oneOf":[{"type":"object","required":["mode"],"additionalProperties":false,"properties":{"mode":{"type":"string","const":"none"}}},{"type":"object","required":["mode","token"],"additionalProperties":false,"properties":{"mode":{"type":"string","const":"bearer"},"token":{"type":"string","minLength":1,"maxLength":8192,"writeOnly":true}}}]}}}]}},"devices":{"type":"array","minItems":1,"maxItems":3,"description":"Your own linked computers this run may drive, by `name` from `GET /me/devices`. The agent\nreaches each one's signed-in browser with `browser start --device NAME`; every step runs on\nthat computer only after you approve the run there, in the Rush menu-bar app. A device\nthat is not yours is `404 NOT_FOUND`; one whose app is not connected is `409 DEVICE_OFFLINE`.\nFollow-ups keep them. An API key names its creator's devices.\n","items":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$"}},"resources":{"type":"array","maxItems":10,"description":"What Rush puts in front of the agent before it starts, each by URL, with `connection`\nnaming the account that reaches it when more than one could:\n`https://github.com/<owner>/<repo>` clones the repository at its default branch, `…/tree/<branch>`\nat that branch, and `…/pull/<n>` on that open pull request's branch; at most one\nrepository per run, reached through a GitHub App installation of the caller\n(`connection` is an installation id from `GET /o/{org}/github`).\n`https://gitlab.com/<group>/<project>` (`…/-/tree/<branch>` at a branch) clones a gitlab.com\nproject with the caller's own GitLab sign-in (`connection` is its id). On a Project run it may\nonly name the Project's repository; a Project whose repository is on gitlab.com clones it on\nevery run with the starter's own GitLab sign-in, refused like a gitlab.com resource when they\nhave none (`422 CONNECTION_NOT_READY`). `https://linear.app/<workspace>/issue/<ID>` puts the\nissue in the prompt, read through the caller's Linear connection. Any other URL is\n`422 RESOURCE_UNSUPPORTED`; a repository no installation covers, or an issue with no\nLinear connection, is `422 RESOURCE_NOT_ACCESSIBLE`.\n","items":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"connection":{"type":"string","maxLength":64}}}}},"additionalProperties":false},"RunInput":{"description":"The task, as a string or as content blocks. Text blocks are joined, with a blank line\nbetween them, into the prompt (at most 256 KiB, at least one text block). Every file\nblock is stored before the run starts and downloaded into the sandbox at\n`/workspace/.rush/attachments/`, where the prompt names it.\n","oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/InputBlock"}}]},"InputBlock":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1}}},{"type":"object","required":["type","source"],"properties":{"type":{"type":"string","enum":["image","document","file"],"description":"What the file is. `image` must be an `image/*` type; `document` and `file` take any type."},"name":{"type":"string","maxLength":255,"description":"The file name in the sandbox. No `/`, `\\`, `..`, leading `.`, or control characters. Default: the URL's last segment, else `input-<n>`, given the extension its `Content-Type` reads as when it has none."},"source":{"$ref":"#/components/schemas/InputSource"}}}]},"InputSource":{"description":"Where the bytes come from. `url`: a public https file Rush fetches (public addresses only,\nat most 3 redirects, 60 seconds, no size limit). `base64`: the bytes in the request,\nwhich is limited to 32 MB in all. `file`: an id from `POST /o/{org}/files`, for a large\nprivate file; each id rides on one run.\n","oneOf":[{"type":"object","required":["type","url"],"properties":{"type":{"type":"string","const":"url"},"url":{"type":"string","format":"uri"}}},{"type":"object","required":["type","media_type","data"],"properties":{"type":{"type":"string","const":"base64"},"media_type":{"type":"string","description":"The bytes' media type; checked against them for common types."},"data":{"type":"string","contentEncoding":"base64"}}},{"type":"object","required":["type","file_id"],"properties":{"type":{"type":"string","const":"file"},"file_id":{"type":"string","format":"uuid"}}}]},"Session":{"type":"object","description":"A session as the org-wide search (`GET /o/{org}/sessions`) returns it:\nbuilt for browsing, with a short id, a title and usage totals. Once you\nhave an id, `GET …/sessions/{session}` returns the fuller\n`CloudRunSession`. `kind` is always `cloud` today.\n","required":["id","short_id","status","created_at"],"properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["cloud","local"],"default":"cloud"},"short_id":{"type":"string","description":"Indexed short handle for prefix resolution."},"title":{"type":["string","null"]},"project":{"type":["string","null"]},"org_id":{"type":["string","null"],"format":"uuid","description":"Owning org; null for older sessions started outside an org."},"project_id":{"type":["string","null"],"format":"uuid","description":"The Project the session ran in; null for a run without one."},"agent":{"type":["string","null"]},"harness":{"$ref":"#/components/schemas/Harness"},"harness_version_requested":{"type":["string","null"]},"harness_version_resolved":{"type":["string","null"]},"model":{"type":["string","null"]},"mode":{"type":["string","null"],"enum":["headless","interactive",null]},"status":{"$ref":"#/components/schemas/SessionStatus"},"prompt":{"type":["string","null"]},"branch":{"type":["string","null"]},"pr_url":{"type":["string","null"]},"error":{"type":["string","null"]},"error_code":{"type":["string","null"],"description":"Why the run failed, as a code (`HARNESS_EXITED`, `TOKEN_LIMIT_REACHED`, `MACHINE_LOST`, …: `RUN_FAILURES` in `rush/shared/runs/failures.ts`); null when it did not fail or failed before codes were recorded."},"session_capture":{"type":["string","null"],"enum":["complete","partial","failed",null]},"message_count":{"type":"integer","default":0},"input_tokens":{"type":"integer","default":0},"output_tokens":{"type":"integer","default":0},"cache_read_tokens":{"type":"integer","default":0},"cache_write_tokens":{"type":"integer","default":0},"cost_usd":{"type":"number","default":0},"duration_ms":{"type":["integer","null"]},"tool_call_count":{"type":"integer","default":0},"started_by":{"type":["object","null"],"description":"The person who started the run; null for older sessions with no recorded starter.","properties":{"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}}},"summary":{"type":["string","null"],"description":"Stored summary or last assistant text line (max 200 chars); null when there is no capture."},"recap":{"type":["object","null"],"description":"What the last finished turn did, written from its final message; null when it left none.","properties":{"headline":{"type":"string","maxLength":80},"points":{"type":"array","maxItems":3,"items":{"type":"string","maxLength":140}}}},"artifacts":{"type":"array","description":"First 6 artifact previews from the stored manifest, in upload order (no timestamps, so no recency implied).","items":{"type":"object","required":["name","size","content_type"],"properties":{"name":{"type":"string"},"size":{"type":"integer"},"content_type":{"type":"string"}}}},"artifact_count":{"type":"integer","default":0},"agent_profile":{"type":["object","null"],"description":"The saved agent profile this run was dispatched from, named only to a caller who can see that agent; null otherwise.","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"automation":{"type":["object","null"],"description":"The automation that started this run; null for a run someone started.","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"source":{"type":"object","description":"Where the run came from, derived from what the run records: an automation, an org API\nkey through MCP or over HTTP (with the key), Slack, a GitHub review, the retired Linear\ndispatch, or else a person in the console or the `rush` CLI (`console`).\n","required":["kind"],"properties":{"kind":{"$ref":"#/components/schemas/SessionSourceKind"},"key":{"type":"object","description":"The API key that started an `api` or `mcp` run.","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"persistence_mode":{"type":["string","null"],"enum":["ephemeral","resumable",null],"description":"Whether the session keeps its computer between turns; only a resumable one can be woken by an automation. Null for older rows."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"SessionSourceKind":{"type":"string","enum":["console","api","mcp","automation","slack","github","linear"]},"SessionList":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"count":{"type":["integer","null"],"description":"Present (and rows omitted) when the request set `count=true`."},"next_cursor":{"type":["string","null"]}}},"CloudRunSession":{"type":"object","description":"A session as `GET …/sessions/{session}` and the session list return it. It starts with\nwhere the session lives, so its path is `/o/{org_id}/sessions/{execution_id}`;\n`project_id` appears only for a session the console ran in a Project. A field appears only when it has a value,\nand every time is RFC 3339 UTC with milliseconds. A create, a cancel and a follow-up answer\nit too. It has no `prompt`: the caller has its input, and `/messages` has every turn.\n","required":["execution_id","org_id","status"],"additionalProperties":false,"properties":{"execution_id":{"type":"string","description":"The session id."},"org_id":{"type":"string","description":"The org as the request's path named it."},"project_id":{"type":"string","format":"uuid","description":"The Project the console ran the session in."},"status":{"$ref":"#/components/schemas/SessionStatus"},"harness":{"type":"string","description":"`claude`, `codex` or `opencode`."},"agent_id":{"type":"string","format":"uuid","description":"The saved agent the session was started from, if any."},"model":{"type":"string"},"effort":{"type":"string"},"result":{"type":"string","description":"The agent's final answer for the last finished turn, in full."},"turn":{"type":"object","description":"Only on a follow-up's answer: the turn the message opened, `running` or waiting in line (`queued`).","required":["id","status"],"additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","queued"]}}},"recap":{"type":"object","description":"What the last finished turn did, written from `result` when it finished: the line Rush's notifications lead with. Absent when the turn left no answer.","required":["headline"],"properties":{"headline":{"type":"string","maxLength":80},"points":{"type":"array","maxItems":3,"items":{"type":"string","maxLength":140}}}},"error":{"type":"object","required":["code","message"],"description":"Why a `failed` or `expired` run ended. `message` is a sentence a person can act on.","properties":{"code":{"type":"string","description":"A plan or account limit the run hit (`FREE_TRIAL_USED`, `PLAN_REQUIRED`, `TOKEN_LIMIT_REACHED`, `CREDITS_EXHAUSTED`, `SPEND_CAP_REACHED`, `COMPUTE_LIMIT_REACHED`, `WEEKLY_COMPUTE_LIMIT_REACHED`, `PAYMENT_METHOD_REQUIRED`), the model account it used (`PROVIDER_AUTH_FAILED`, `PROVIDER_RATE_LIMITED`, `MODEL_ACCOUNT_MISSING`), Rush's own model provider refusing its calls (`RUSH_MODELS_UNAVAILABLE`), how it ended (`HARNESS_EXITED`, `RUN_STALLED`, `RUN_TIMED_OUT`, `RUN_START_FAILED`, `MACHINE_UNAVAILABLE`, `MACHINE_REFUSED`, `MACHINE_LOST`, `LEASE_EXPIRED`, `SAVED_STATE_EXPIRED`, `BRANCH_NOT_FOUND`, `AGENT_UNAVAILABLE`, `CONNECTION_UNAVAILABLE`, `AUTH_FAILED`), or `RUN_FAILED`. Runs that failed before codes were recorded read `RUN_FAILED`."},"message":{"type":"string"}}},"repo_owner":{"type":"string"},"repo_name":{"type":"string"},"branch":{"type":"string"},"pr_url":{"type":"string"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"cache_read_tokens":{"type":"integer"},"cache_write_tokens":{"type":"integer"},"total_tokens":{"type":"integer","description":"Uncached input plus cache writes plus output."},"reasoning_tokens":{"type":"integer"},"total_cost_usd":{"type":"number"},"tool_calls_count":{"type":"integer"},"turns_count":{"type":"integer"},"artifacts":{"type":"array","description":"Every file the agent saved to `/workspace/.rush/artifacts/`. `url` downloads it from this\nAPI with no credential until `url_expires_at`, an hour after the read; read the session\nagain for a fresh link. `GET …/artifacts/{name}` with the key also downloads it.\n","items":{"type":"object","required":["name","mime_type","url","url_expires_at"],"properties":{"name":{"type":"string"},"mime_type":{"type":"string"},"url":{"type":"string","format":"uri","description":"A signed https link to the file on this API."},"url_expires_at":{"type":"string","format":"date-time"}}}},"attachments":{"type":"array","description":"The files the session was started or followed up with. `url` downloads one with no\ncredential until `url_expires_at`, as for artifacts; `GET …/attachments/{id}` with the\nkey also downloads it.\n","items":{"type":"object","required":["id","name","mime_type","url","url_expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mime_type":{"type":"string"},"url":{"type":"string","format":"uri","description":"A signed https link to the file on this API."},"url_expires_at":{"type":"string","format":"date-time"}}}},"accounts":{"type":"array","description":"The connections the session's tokens acted as, one entry per account however often it\nwas used, with when it was first used: a signed-in app account (`oauth`) or an MCP server\nsigned as one person (`mcp`); a connection added to the Project for its members is not\nlisted, so its sessions stay readable by the team. The session's `agent_id`\nsays whose agent it was. Absent when the session used none, and for sessions started\nbefore accounts were recorded. Never a token.\n","items":{"type":"object","required":["kind","vendor","account","first_used_at"],"properties":{"kind":{"type":"string","enum":["oauth","mcp"]},"vendor":{"type":"string","description":"For `oauth` the app vendor (`google`, `microsoft`, `buffer`, `quickbooks`); for `mcp` the server's name."},"account":{"type":"string","description":"For `oauth` the account's email (for QuickBooks, the company's realm id); for `mcp` the connection's id, or the server's host when the session supplied its own token."},"products":{"type":"array","items":{"type":"string"},"description":"The account's products the session reached, such as `gmail` or `outlook`. Absent for `mcp`."},"first_used_at":{"type":"string","format":"date-time"}}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"}}},"SkillUrl":{"description":"A skill by public URL, as a string or `{url}`; or, on a run only, `{file_id}`: a `.zip` or `.tar.gz`\nof the skill's folder that you uploaded with `POST /o/{org}/files`, for a skill no public URL serves.\nAn archive holds one skill, its shallowest `SKILL.md`; two side by side are `422 SKILL_INVALID`.\nA saved agent refuses `{file_id}` (`422 SKILL_INVALID`).\n","oneOf":[{"type":"string","format":"uri","maxLength":2048},{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048}}},{"type":"object","required":["file_id"],"additionalProperties":false,"properties":{"file_id":{"type":"string","format":"uuid"}}}]},"CloudRunSessionList":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/CloudRunSession"}}}},"AmbiguousSelector":{"type":"object","required":["code","message","candidates"],"description":"Returned as the 409 body when a selector matched more than one session.","properties":{"code":{"type":"string","enum":["AMBIGUOUS_SELECTOR"]},"message":{"type":"string"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}},"SessionEvent":{"type":"object","description":"One transcript event, the same on the live stream and from `/messages`. Which optional\nfields appear depends on `type`; a field with no value is left out.\n","required":["type"],"properties":{"type":{"type":"string","enum":["message","tool_use","tool_result","thinking","error","result"]},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"tool":{"type":"string"},"call_id":{"type":"string","description":"Links a tool_use to its tool_result."},"args":{"type":"object","description":"A tool_use's input as the agent wrote it, e.g. `command` or `file_path`."},"success":{"type":"boolean"},"output":{"type":"string"}}},"ArtifactFile":{"type":"object","description":"One file a session saved as an artifact.","required":["name","size","content_type"],"properties":{"name":{"type":"string"},"size":{"type":"integer","description":"Bytes."},"content_type":{"type":"string"}}},"ApiKeyScope":{"type":"string","enum":["runs:read","runs:write"],"description":"`runs:read` reads sessions; `runs:write` starts, steers and messages them."},"ApiKey":{"type":"object","required":["id","name","prefix","scopes","max_concurrent","webhook_url","expires_at","created_by","last_used_at","created_at"],"properties":{"id":{"type":"string","description":"`key_…`; use it in the key routes."},"kind":{"type":"string","enum":["key","oauth"],"description":"`key` is minted here; `oauth` is an MCP client a person connected by signing in. An `oauth` grant reaches only the MCP server, cannot be rotated and has no webhook; its `expires_at` is when it ends unless the client refreshes it."},"name":{"type":"string"},"prefix":{"type":"string","description":"The secret's first characters, to tell keys apart."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScope"}},"max_concurrent":{"type":"integer"},"webhook_url":{"type":["string","null"]},"expires_at":{"type":["string","null"],"format":"date-time"},"created_by":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":["string","null"]}}},"last_used_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"stats":{"type":"object","description":"The runs the key started in the last seven days. Only in the list. `finished` counts runs\nthat ended `completed` or `needs_review`, out of `ended`. `webhook_deliveries` is the\nstate of each run's latest completion webhook: delivered, still being retried, or dropped\nafter the last try.\n","required":["since","runs","finished","ended","spend_usd","mcp_runs","webhook_deliveries"],"properties":{"since":{"type":"string","format":"date-time"},"runs":{"type":"integer"},"finished":{"type":"integer"},"ended":{"type":"integer"},"spend_usd":{"type":"number"},"mcp_runs":{"type":"integer","description":"Of `runs`, those started through MCP."},"webhook_deliveries":{"type":"object","required":["delivered","retrying","failed"],"properties":{"delivered":{"type":"integer"},"retrying":{"type":"integer"},"failed":{"type":"integer"}}}}},"secret":{"type":"string","pattern":"^rk_live_","description":"The key's secret. Only in the create and rotate responses; never shown again."},"webhook_secret":{"type":"string","pattern":"^whsec_","description":"The webhook signing secret. Only in the update response that minted it."}}},"ApiKeyWithSecret":{"description":"An `ApiKey` with its `secret`, as create and rotate return it. The secret is never shown again.","allOf":[{"$ref":"#/components/schemas/ApiKey"},{"required":["secret"]}]},"AgentsAvailable":{"type":"object","required":["harnesses"],"additionalProperties":false,"properties":{"harnesses":{"type":"array","items":{"type":"object","required":["name","display_name","models"],"properties":{"name":{"$ref":"#/components/schemas/Harness"},"display_name":{"type":"string"},"models":{"type":"array","items":{"type":"object","required":["name","display_name"],"properties":{"name":{"type":"string","description":"The value a session's or saved agent's `model` takes."},"display_name":{"type":"string"},"effort":{"type":"array","items":{"type":"string"},"description":"The effort levels the model takes; absent when it takes none."}}}},"cli_version":{"type":"string","description":"The harness CLI release a saved agent's `runtime` `{selection: \"latest_verified\"}` runs today, and one `{selection: \"pinned\", id}` can hold."},"tools":{"type":"array","items":{"type":"string"},"description":"The native tool ids a saved agent's `tools` `{mode: \"selected\", ids}` may name. Absent when the harness runs every tool only."},"plugins":{"type":"array","description":"The catalog plugins a saved agent's `plugins` may install, by `catalog_id`. Absent when the harness has none.","items":{"type":"object","required":["catalog_id","name","description"],"properties":{"catalog_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"requires_browser":{"type":"boolean","enum":[true],"description":"Present when the plugin needs `capabilities.browser`."},"apps":{"type":"array","items":{"type":"string"},"description":"The apps its MCP servers connect to; absent when it needs none."}}}}}}},"apps":{"type":"array","description":"The built-in apps `POST /me/connections` connects as `{type: \"app\", name}`. Connecting a Google or Microsoft product asks for its permissions only; a session that names it gets a token for only the products it names.","items":{"type":"object","required":["name","display_name","description","category"],"properties":{"name":{"type":"string","description":"What `POST /me/connections` and a session's `connections` take."},"display_name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"}}}},"mcp_servers":{"type":"array","items":{"type":"object","required":["name","slug","description","category","author"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"author":{"type":"string"},"url":{"type":"string","format":"uri","description":"The `url` to send to `POST /me/connections`. Absent for a server each customer runs at their own address."},"url_template":{"type":"string","description":"For a server each customer runs (n8n), its URL with a `{name}` per entry in `url_variables`, for example `https://{host}/mcp-server/http`. Fill each in and send the result as `url`."},"url_variables":{"type":"array","items":{"type":"object","required":["name","description"],"properties":{"name":{"type":"string"},"description":{"type":"string"}}}},"auth":{"type":"object","description":"For a server with no sign-in (LumisReach), the API key it takes: send `{type: \"mcp\", url, name, auth: {mode: \"bearer\", token: \"<key>\"}}` to `POST /me/connections`. Absent for a server you sign in to.","required":["mode","description"],"properties":{"mode":{"type":"string","enum":["bearer"]},"description":{"type":"string","description":"What the key is and where to create it."}}},"documentation_url":{"type":"string","format":"uri"}}}}}},"BillingUsage":{"type":"object","description":"The caller's plan usage for the current billing period and week, every plan. Every billing route answers it.","required":["plans","plan","hasPaymentMethod","periodStart","periodEnd","periodUsedUsd","capUsd","computeMinutesUsed","computeMinutesIncluded","weekStart","weekEnd","weeklyComputeMinutesUsed","weeklyComputeMinutesIncluded","maxConcurrentRuns","tokenSpendUsd","tokenSpendIncluded","creditsGrantedUsd","creditBalanceUsd","autoReload","seats","members","managesBilling"],"properties":{"plans":{"type":"array","description":"Every plan, so a client that keeps a write's answer still has the catalog.","items":{"$ref":"#/components/schemas/BillingPlan"}},"plan":{"type":"string","enum":["free","pro","max"],"description":"The org's plan: its owner's, which every member's runs share."},"seats":{"type":"integer","minimum":1,"description":"Seats the plan pays for; each adds the plan's hours to the pool. Free, and a subscription on a flat price, count one."},"members":{"type":"integer","minimum":1,"description":"The org's members, its owner included. A per-member plan's seats follow it within minutes."},"managesBilling":{"type":"boolean","description":"Whether the caller is the org's owner, the one person who may change the plan."},"planEndsAt":{"type":"string","format":"date-time","description":"When the plan ends and the account moves to Free (a move to Free, or a cancel in the billing portal). Absent while the plan renews."},"hasPaymentMethod":{"type":"boolean"},"periodStart":{"type":"string","format":"date-time","description":"The org's billing cycle, which the pool of hours resets on."},"periodEnd":{"type":"string","format":"date-time"},"periodUsedUsd":{"type":"number","description":"Billed USD this period, including in-flight compute."},"capUsd":{"type":["number","null"],"description":"The spend cap; null when none is set."},"computeMinutesUsed":{"type":"number","description":"Minutes of the org's pool used this period by its members' own runs: a run started with an API key never uses them."},"computeMinutesIncluded":{"type":"number","description":"The pool: the plan's minutes times its seats; -1 means no ceiling (an admin account)."},"weekStart":{"type":"string","format":"date-time"},"weekEnd":{"type":"string","format":"date-time"},"weeklyComputeMinutesUsed":{"type":"number"},"weeklyComputeMinutesIncluded":{"type":"number","description":"The week's included minutes; -1 means no weekly ceiling (an admin account, or a plan whose week is not below its month, such as Free)."},"maxConcurrentRuns":{"type":"integer","description":"Runs at once; 9007199254740991 (Number.MAX_SAFE_INTEGER) on an admin account."},"tokenSpendUsd":{"type":"number","description":"What the Free plan's $1 has paid, raw vendor cost: the person's own runs' Rush-paid model calls and, on Free, their compute. API key and MCP runs never count. It never resets."},"tokenSpendIncluded":{"type":"number","description":"The one-time free credit for a Free person's own runs, AI model and compute: $1 on Free; 0 on a paid plan, whose runs use the person's own Claude or ChatGPT subscription or API key, and on the no-Free-plan side of the billing-free-plan test; -1 on an admin account."},"freePlanTest":{"type":"string","enum":["control","no-free-plan"],"description":"The account's side of the billing-free-plan test: on `no-free-plan` there is no Free plan and runs need Pro or Max. Absent for an account from before the test."},"creditsGrantedUsd":{"type":"number","description":"Every credit the caller has bought. 0 for an account that never bought any."},"creditBalanceUsd":{"type":"number","description":"Credits left: bought, less what usage has cost, debited or not yet. At or below 0 an account that bought credits gets `402 CREDITS_EXHAUSTED`; it can read a little below 0 when calls in flight finished past it."},"autoReload":{"type":["object","null"],"description":"Under `belowUsd`, charge the saved card `addUsd` of credits; null when off. Auto-reload adds at most $500 in any rolling 30 days; past that it charges nothing until older reloads age out.","required":["belowUsd","addUsd"],"properties":{"belowUsd":{"type":"integer","minimum":1},"addUsd":{"type":"integer","minimum":10},"paused":{"type":"boolean","enum":[true],"description":"Present when the next reload would pass the $500 in 30 days ceiling, so none is charged. Credits bought by hand are not limited."},"pausedUntil":{"type":"string","format":"date-time","description":"When a reload of `addUsd` fits under the ceiling again. Absent when `addUsd` alone is above it."}}}}},"BillingPlan":{"type":"object","required":["slug","name","monthlyPriceUsd","includedComputeMinutes","includedComputeMinutesPerWeek","maxConcurrentRuns","requiresPaymentMethod"],"properties":{"slug":{"type":"string","enum":["free","pro","max"]},"name":{"type":"string"},"monthlyPriceUsd":{"type":"number","description":"Per member a month."},"includedComputeMinutes":{"type":"integer","description":"Minutes each seat adds to the pool a month (Free: the whole org)."},"includedComputeMinutesPerWeek":{"type":"integer","description":"Minutes each seat adds to the week's window."},"maxConcurrentRuns":{"type":"integer","description":"Runs at once per member."},"requiresPaymentMethod":{"type":"boolean"}}},"OrphanedAgent":{"type":"object","description":"A saved agent whose creator left the org, as an org admin lists it (`GET /o/{org}/agents?orphaned=true`). Nothing of its setup is read.","required":["id","name","harness","visibility","created_at"],"additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"harness":{"type":"string","description":"The harness it runs on."},"visibility":{"type":"string","enum":["private","org","public"],"description":"`org`: every member may use it."},"people":{"type":"integer","minimum":1,"description":"How many people it is shared with by name; absent when none."},"listed":{"type":"boolean","enum":[true],"description":"Present when it is listed in Community; making it private takes it off."},"created_at":{"type":"string","format":"date-time"}}},"SavedAgent":{"type":"object","description":"A saved agent, as an API key and a person signed in to the console both read it. A field appears only\nwhen it has a value.\n","required":["id","user_id","org_id","name","handle","visibility","harness","revision","catalog_revision","runtime","model","speed","created_at","updated_at"],"additionalProperties":false,"properties":{"visibility":{"type":"string","enum":["private","org","public"],"description":"Private by default; org makes the agent usable by current org members; public lists it in Community once Phoenix approves it."},"listing":{"type":"object","description":"What Community serves of the agent, present once Phoenix has approved a revision; your own org reads it.","required":["state","category","subtitle","listed_revision"],"additionalProperties":false,"properties":{"state":{"type":"string","enum":["listed","withdrawn","removed"]},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"subtitle":{"type":"string","maxLength":30},"listed_revision":{"type":"integer","description":"The revision Community lists and its adders run."},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"How the listed agent starts, by kind."},"note":{"type":"string","description":"Phoenix's note on a removal."},"logo_url":{"type":"string","description":"The listed square logo: a public image URL that never changes."},"cover_url":{"type":"string","description":"The listed wide cover image: a public image URL that never changes."}}},"review":{"type":"object","description":"A revision submitted to Community that Phoenix has not decided, or turned down.","required":["revision","category","subtitle","state"],"additionalProperties":false,"properties":{"revision":{"type":"integer"},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"]},"subtitle":{"type":"string","maxLength":30},"triggers":{"type":"array","items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]}},"state":{"type":"string","enum":["in_review","rejected"]},"note":{"type":"string","description":"Why Phoenix turned it down."},"logo_url":{"type":"string","description":"The logo submitted with this revision."},"cover_url":{"type":"string","description":"The cover submitted with this revision."}}},"id":{"type":"string","format":"uuid"},"template":{"type":"string","format":"uuid","description":"Present on an agent made from a template; everything but its name and description is the template's."},"added":{"type":"boolean","enum":[true],"description":"Present on an agent added from a Community listing; it runs the listed revision and never shows the maker's setup."},"user_id":{"type":"string","format":"uuid","description":"Its creator."},"org_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"handle":{"type":"string"},"description":{"type":"string"},"harness":{"$ref":"#/components/schemas/Harness"},"revision":{"type":"integer","description":"The revision read, the number its `ETag` carries and an edit's `If-Match` names."},"archived":{"type":"boolean","enum":[true],"description":"Present on a deleted agent, which starts no run."},"source":{"type":"object","description":"What the agent was made from, when it was made from another agent or a catalog harness. Only its creator reads it."},"catalog_revision":{"type":"string","description":"The catalog revision the agent was last saved against."},"runtime":{"type":"object","description":"`{selection: \"latest_verified\"}` keeps the harness CLI current; `{selection: \"pinned\", id}` holds one release.","required":["selection"],"properties":{"selection":{"type":"string","enum":["latest_verified","pinned"]},"id":{"type":"string"}}},"model":{"type":"string"},"effort":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"instructions":{"type":"string"},"skills":{"type":"array","items":{"type":"object","required":["url","name"],"properties":{"url":{"type":"string","format":"uri"},"name":{"type":"string"}}}},"connections":{"type":"array","description":"The agent's connections from `GET /me/connections`, each with the name a run's `connections`\ntakes. A deleted connection has no `name`. On an agent made from a template, one entry per\nconnection the template names: `id` is the agent's own account of that app, absent until connected.\nAnyone but the agent's creator reads each by its app's `name` (and an MCP server's own `display_name`),\nnever the creator's `id`.\n","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"type":"string","description":"The kind of connection, as `GET /me/connections` names it."},"name":{"type":"string"},"display_name":{"type":"string"},"access":{"$ref":"#/components/schemas/MailAccess"}}}},"missing_connections":{"type":"array","items":{"type":"object","required":["whose"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The connection's name; absent when the template owner's connection was deleted."},"whose":{"type":"string","enum":["agent","template"],"description":"Who connects it: `agent`, this agent's user, at `/o/{org}/agents/{agent}/connections` (an agent added\nfrom a Community listing, its person at `/me/connections`); `template`, the template's owner, whose\nown connection has lapsed or was deleted. A lapsed one clears when the owner signs in to the same\naccount again at `/me/connections`; for a deleted one or another account, the owner connects it and\nthen `PATCH`es the template's `connections` (keeping the `access` of any that has one), since the\ntemplate names a connection by its id.\n"}}},"description":"On an agent made from a template, each connection its template names that a run of it lacks; absent\nonce there are none. Every run of this agent is `422 CONNECTION_NOT_READY` until each is connected.\nA read of an older revision (`?revision=`) reports what that revision's connections lack. It checks that\nan account exists, not its `access` level: an account connected below what the template now names (a\nraised level, or a dropped one, which asks for all of the app) is not listed. Until it is connected\nagain, a run is accepted and then ends `failed` with `CONNECTION_UNAVAILABLE`, not the `422` above.\n"},"connections_added":{"type":"array","items":{"type":"string"},"description":"In a `PATCH` answer for a template that agents are made from, the connection names the edit added (a\nconnection that replaces a deleted one counts as added). An agent made from it that has no account of one\nneeds its user to connect it; `GET /o/{org}/agents?template=<id>` names each agent's\n`missing_connections`. Absent when the edit added none.\n"},"capabilities":{"type":"object","description":"Present when browser or computer use is on.","properties":{"browser":{"type":"boolean"},"computer":{"type":"boolean"}}},"tools":{"type":"object","description":"Present when the agent allows only some tools: `{mode: \"selected\", ids}`, with `ids` left out when it allows none."},"network":{"type":"object","description":"Present when the agent reaches only some domains: `{mode: \"allowlist\", domains}`, with `domains` left out when it reaches none."},"plugins":{"type":"array","description":"The catalog plugins the agent installs, by `catalog_id`.","items":{"type":"object","required":["catalog_id"],"properties":{"catalog_id":{"type":"string"}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"SavedAgentFromTemplate":{"type":"object","required":["template"],"additionalProperties":false,"properties":{"template":{"type":"string","description":"The id or name of a saved agent you created that is not itself made from a template, or the id of a Community agent (`GET /o/{org}/agents/community`)."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"Yours to choose, such as your own user id. Required for your own template; a Community agent's name when omitted."},"description":{"type":"string","maxLength":500},"handle":{"type":"string","description":"A lowercase slug; made from `name` when omitted."}}},"SavedAgentCreate":{"type":"object","required":["name","harness"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"harness":{"$ref":"#/components/schemas/Harness"},"handle":{"type":"string","description":"A lowercase slug. Omitted: made from `name` and the body, with the org added when that is taken, and a repeat in this org is answered by the body."},"catalog_revision":{"type":"string","description":"The current one when omitted, which is what a key does: only a console session reads it, from `GET /o/{org}/agents/available`. A stale one is `422 CATALOG_REFRESH_REQUIRED`."},"model":{"type":"string","description":"A model `id` `GET /o/{org}/agents/available` lists for the harness. Omitted: the harness's first model."},"effort":{"type":"string","description":"One of the model's effort levels."},"instructions":{"type":"string","description":"At most 16 KiB."},"skills":{"type":"array","maxItems":10,"description":"Skills by URL, as on session create; fetched and pinned when saved.","items":{"$ref":"#/components/schemas/SkillUrl"}},"connections":{"type":"array","description":"Ids or names of your own connections (`GET /me/connections`), as on session create.","items":{"$ref":"#/components/schemas/SavedAgentConnection"}},"capabilities":{"type":"object","properties":{"browser":{"type":"boolean"},"computer":{"type":"boolean"}}},"runtime":{"$ref":"#/components/schemas/SavedAgentRuntime"},"tools":{"$ref":"#/components/schemas/SavedAgentTools"},"network":{"$ref":"#/components/schemas/SavedAgentNetwork"},"plugins":{"$ref":"#/components/schemas/SavedAgentPlugins"},"source":{"type":"object","description":"What the agent is made from: `{profile_id, revision}`, an agent this org shows you (else `404 SOURCE_NOT_FOUND`), or `{catalog_id: \"harness/<harness>\", revision}`. Set once; an edit that names it is `422 IMMUTABLE_FIELD`."}}},"SavedAgentUpdate":{"type":"object","description":"Any field of `SavedAgentCreate` but `harness`, `handle` and `source`, or a separate visibility change. A stale `catalog_revision` is `422 CATALOG_REFRESH_REQUIRED`. Only the creator can edit; a visible non-creator receives 403 FORBIDDEN, except that an org admin may send `{\"visibility\": \"private\"}` alone for an agent whose creator left the org.","additionalProperties":false,"properties":{"visibility":{"type":"string","enum":["private","org","public"],"description":"Creator only (or `private` from an org admin, for an agent whose creator left the org); send alone as a separate sharing change. public submits the agent to Community for review: an org admin, with `category`, `subtitle` and `triggers`. Once Phoenix approves it, the listing is public: anyone reads it at `GET /community/agents` and on getrush.ai/templates/. private or org withdraws a listing."},"category":{"type":"string","enum":["Engineering","Business","Marketing","General"],"description":"With visibility public."},"subtitle":{"type":"string","maxLength":30,"description":"With visibility public; one line."},"triggers":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["request","schedule","github","linear","email","webhook"]},"description":"With visibility public: how the agent starts, by kind. `request` is a run someone starts with the API, an MCP client or the console; the rest are automation trigger kinds. Phoenix reviews them with the revision, and the listing shows them on getrush.ai. Leave it out to keep the last submission's, else the listed ones."},"logo":{"type":["string","null"],"description":"With visibility public: the listing's square logo as a base64 `data:` URI of a PNG, JPEG or WebP image, at most 2 MiB. Leave it out to keep the last submission's, else the listed one; `null` lists none."},"cover":{"type":["string","null"],"description":"With visibility public: the listing's wide cover image (shown about 4:1), in the same form as `logo`."},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"model":{"type":"string"},"effort":{"type":"string"},"instructions":{"type":"string"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillUrl"}},"connections":{"type":"array","items":{"$ref":"#/components/schemas/SavedAgentConnection"}},"capabilities":{"type":"object","properties":{"browser":{"type":"boolean"},"computer":{"type":"boolean"}}},"runtime":{"$ref":"#/components/schemas/SavedAgentRuntime"},"tools":{"$ref":"#/components/schemas/SavedAgentTools"},"network":{"$ref":"#/components/schemas/SavedAgentNetwork"},"plugins":{"$ref":"#/components/schemas/SavedAgentPlugins"}}},"SavedAgentRuntime":{"type":"object","description":"`{selection: \"latest_verified\"}` (the default) keeps the harness CLI current; `{selection: \"pinned\", id}` holds one release. A pin set on a create or an edit must be the harness's `cli_version` in `GET /o/{org}/agents/available`, the release its models are checked on; any other is `422 UNSUPPORTED_PROFILE` with field code `RUNTIME_NOT_VERIFIED`. A pin already saved stays through later edits, and an agent customized from another keeps that agent's pin.","required":["selection"],"additionalProperties":false,"properties":{"selection":{"type":"string","enum":["latest_verified","pinned"]},"id":{"type":"string"}}},"SavedAgentTools":{"type":"object","description":"`{mode: \"default\"}` (the default) runs every native tool; `{mode: \"selected\", ids}` only the ids named, from the harness's `tools` in `GET /o/{org}/agents/available` (Claude Code only). With skills or a plugin that has skills, `ids` must include `Skill`.","required":["mode"],"additionalProperties":false,"properties":{"mode":{"type":"string","enum":["default","selected"]},"ids":{"type":"array","items":{"type":"string"}}}},"SavedAgentNetwork":{"type":"object","description":"`{mode: \"public\"}` (the default). `{mode: \"allowlist\", domains}` is `422 UNSUPPORTED_PROFILE` (`NETWORK_ENFORCEMENT_NOT_QUALIFIED`) until a runtime enforces it.","required":["mode"],"additionalProperties":false,"properties":{"mode":{"type":"string","enum":["public","allowlist"]},"domains":{"type":"array","items":{"type":"string"}}}},"SavedAgentPlugins":{"type":"array","description":"Catalog plugins installed into every run of the agent, by the harness's `plugins` in `GET /o/{org}/agents/available`; each is pinned by its digest when saved. One the harness does not list is `422 UNSUPPORTED_PROFILE`.","items":{"type":"object","required":["catalog_id"],"additionalProperties":false,"properties":{"catalog_id":{"type":"string"}}}},"SavedAgentConnection":{"description":"A connection by its id or name, or a Gmail or Outlook account with the access level the agent may\nuse: `{name, access}`. The level is what each agent made from it asks its user for at sign-in and\nall its runs' tokens carry, the agent's own runs included. Any other app with a level is\n`422 INVALID_CONNECTION_REFS`.\n","oneOf":[{"type":"string"},{"type":"object","required":["name","access"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The connection's id or name."},"access":{"$ref":"#/components/schemas/MailAccess"}}}]},"MailAccess":{"type":"string","enum":["read","send"],"description":"`read`: read mail (and Outlook contacts). `send`: read and send. Absent: all of the app's access,\nwhich for Gmail also changes labels and for Outlook is the same as `send`.\n"},"GithubRepository":{"type":"object","required":["id","name","full_name","private"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"full_name":{"type":"string"},"private":{"type":"boolean"}}},"GithubInstallation":{"type":"object","required":["id","account_login","account_type","repositories","suspended","created_at","settings_url","owned","manageable"],"properties":{"id":{"type":"integer","description":"GitHub installation id."},"account_login":{"type":"string"},"account_type":{"type":"string","description":"GitHub account type, e.g. `User` or `Organization`."},"repositories":{"type":"array","description":"Owned installations list every mirrored repository; granted ones only those the caller can push to.","items":{"$ref":"#/components/schemas/GithubRepository"}},"suspended":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"settings_url":{"type":"string","format":"uri","description":"The installation's settings page on github.com."},"owned":{"type":"boolean","description":"The caller installed it. False means reachable through their GitHub access; only the installer can disconnect it for everyone."},"manageable":{"type":"boolean","description":"The caller can choose this installation's repositories at `settings_url`: they installed it, it is on their own GitHub login, or GitHub says they are an active admin of its organization."}}},"GithubInstallations":{"type":"object","required":["installations","github_authorization","github_logins","pending_requests"],"properties":{"installations":{"type":"array","items":{"$ref":"#/components/schemas/GithubInstallation"}},"github_authorization":{"type":"string","enum":["authorized","required","unavailable"],"description":"`required`: the caller has no usable GitHub authorization. `unavailable`: GitHub was not reached, so only owned installations are listed."},"github_logins":{"type":"array","description":"The caller's own connected GitHub logins.","items":{"type":"string"}},"pending_requests":{"type":"array","description":"The caller's outstanding requests to install the App on accounts not yet installed. Empty when GitHub does not answer.","items":{"type":"object","required":["account_login","account_type","requested_by","requested_at"],"properties":{"account_login":{"type":"string"},"account_type":{"type":"string"},"requested_by":{"type":"string"},"requested_at":{"type":"string","format":"date-time"}}}},"installable_orgs":{"type":"array","description":"The caller's GitHub organizations with no installation or pending request. Absent (not empty) when GitHub did not answer.","items":{"type":"object","required":["login","install_url"],"properties":{"login":{"type":"string"},"install_url":{"type":"string","format":"uri"}}}},"refresh":{"type":"object","description":"Present only on `POST /o/{org}/github/sync`.","required":["complete"],"properties":{"complete":{"type":"boolean","description":"Every owned installation re-read and GitHub reachable."}}}}},"GithubInstallationsForKey":{"type":"object","description":"The installations an API key's creator can use, and the repositories each covers.","required":["installations"],"additionalProperties":false,"properties":{"installations":{"type":"array","items":{"type":"object","required":["id","account","account_type"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"account":{"type":"string","description":"The GitHub user or organization the App is installed on."},"account_type":{"type":"string","enum":["User","Organization"]},"suspended":{"type":"boolean","const":true,"description":"Present only when the installation is suspended; a suspended installation runs nothing."},"repositories":{"type":"array","description":"Absent when the installation covers none.","items":{"type":"object","required":["full_name","private"],"additionalProperties":false,"properties":{"full_name":{"type":"string","description":"`owner/name`; `https://github.com/{full_name}` is its `resources` URL."},"private":{"type":"boolean"}}}}}}}}},"GithubConnectStatus":{"oneOf":[{"type":"object","required":["pending"],"properties":{"pending":{"type":"boolean","const":true}}},{"type":"object","required":["pending","installation_id","setup_action"],"properties":{"pending":{"type":"boolean","const":false},"installation_id":{"type":["integer","null"]},"setup_action":{"type":"string","description":"Defaults to `install`."}}}]},"Automation":{"type":"object","required":["id","project_id","name","prompt","read_only","enabled","max_runs_per_hour","notify_each_run","created_by","created_at","updated_at","triggers"],"description":"An API key reads it with every null and empty field left out: `profile_id`, `profile`, `session_id`, `api_key_id` and an empty `recent_runs` are absent then.","properties":{"id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid","description":"The Project it runs in."},"name":{"type":"string"},"prompt":{"type":"string","description":"The instructions each run receives; a trigger's event follows as untrusted data."},"profile_id":{"type":["string","null"],"format":"uuid","description":"The saved agent it runs with; null when it runs a default harness or is a wake."},"harness":{"$ref":"#/components/schemas/Harness","description":"The default harness it runs; absent with a saved agent or a wake."},"model":{"type":"string","description":"The model it runs `harness` with; absent for the harness default."},"effort":{"type":"string","description":"The effort it runs `model` at; absent for the model default."},"profile":{"type":["object","null"],"description":"The saved agent it runs with; null when none, or when the caller cannot see that agent (`profile_id` still names it).","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"harness":{"$ref":"#/components/schemas/Harness"}}},"session_id":{"type":["string","null"],"description":"Makes it a wake: each fire sends the prompt to this session as a follow-up instead of starting a run. The session must be in this Project, changeable by `created_by`, resumable and open. A fire that lands mid-turn is skipped; a session that has closed turns the automation off and notifies its runner."},"read_only":{"type":"boolean","description":"Its runs can read the repository and comment, but not push."},"enabled":{"type":"boolean"},"max_runs_per_hour":{"type":"integer","minimum":1,"maximum":30,"description":"Runs and wake turns all its triggers together may start per hour. A trigger's run past it is created queued and starts when the hour has room, up to one more hour's worth waiting; an event past that is refused, and so are Run now and a wake at the cap."},"notify_each_run":{"type":"boolean","description":"How its finished runs reach `created_by`: each on its own (true), or as one Slack message a day that each run updates (false, the default). Failures always come on their own. Only `created_by` may change it (`403 FORBIDDEN` for anyone else, an org admin included)."},"created_by":{"type":"string","description":"The member its runs start as: the last one to change what it does."},"api_key_id":{"type":["string","null"],"description":"The API key it was set up or last changed with. Its fires are then that key's runs: prepaid credits, the key's connection rules and `max_concurrent`; once the key is revoked or expires they start nothing (`skipped`, `api_key_revoked`). A key changes only automations set up with a key (`403 FORBIDDEN` otherwise). Null: set up in the console, it runs as `created_by`."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/AutomationTrigger"}},"recent_runs":{"type":"array","description":"Its five latest runs, newest first.","items":{"type":"object","required":["id","status","trigger_id","title","summary","created_at"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"trigger_id":{"type":["string","null"],"description":"The trigger that started it; null for Run now."},"title":{"type":["string","null"],"description":"The run's title: the first line of its prompt unless someone named it."},"summary":{"type":["string","null"],"description":"What the agent said when the run finished; null until then."},"created_at":{"type":"string","format":"date-time"}}}}}},"AutomationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"prompt":{"type":"string","minLength":1,"maxLength":20000},"profile_id":{"type":["string","null"],"format":"uuid","description":"A saved agent the caller can use. Send it or `harness`, not both."},"harness":{"$ref":"#/components/schemas/Harness","description":"A default harness to run. An automation that starts runs and names neither keeps its Project's default harness."},"model":{"type":["string","null"],"description":"A model id `harness` lists (`GET /o/{org}/agents/available`); null or absent is the harness default."},"effort":{"type":["string","null"],"enum":["none","minimal","low","medium","high","xhigh","max","auto",null],"description":"An effort `model` takes; needs `model`."},"session_id":{"type":["string","null"]},"read_only":{"type":"boolean"},"enabled":{"type":"boolean"},"max_runs_per_hour":{"type":"integer","minimum":1,"maximum":30},"notify_each_run":{"type":"boolean"}}},"AutomationTrigger":{"type":"object","required":["id","kind","created_at"],"description":"An API key reads it with every null and empty field left out (`events`, `branch_patterns`, an empty `config`, an unset `next_fire_at`, `last_fired_at`, `last_error_code` or `last_failed_at`).","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["github","schedule","webhook","linear","email","session"]},"events":{"type":"array","description":"GitHub event keys (kind `github`) or Linear event keys (kind `linear`).","items":{"$ref":"#/components/schemas/TriggerEvent"}},"branch_patterns":{"type":"array","items":{"type":"string"},"description":"Globs on a pull request's base branch (kind `github` only)."},"config":{"$ref":"#/components/schemas/TriggerConfig"},"next_fire_at":{"type":["string","null"],"format":"date-time","description":"The next schedule slot, or when an email trigger next reads Gmail; null for other kinds."},"last_fired_at":{"type":["string","null"],"format":"date-time"},"last_error_code":{"type":["string","null"],"description":"The error code of this trigger's last fire that started nothing (a refused run such as `MODEL_UNSUPPORTED`, `RATE_LIMITED` past the hourly cap, `INTERNAL_ERROR`, or `API_KEY_REVOKED` when the key it was set up with is revoked or expired, which also turns the automation off). Cleared by the next fire that starts work, and `API_KEY_REVOKED` also by switching the automation back on, which rebinds it. The automation's creator is also notified: once a day per code, or once for `API_KEY_REVOKED`."},"last_failed_at":{"type":["string","null"],"format":"date-time","description":"When that fire started nothing; set and cleared with `last_error_code`."},"created_at":{"type":"string","format":"date-time"},"webhook_url":{"type":"string","format":"uri","description":"Kind `webhook` only: POST here with `Authorization: Bearer <secret>`; the body (at most 64 KB) becomes the event text and an `Idempotency-Key` header dedups retries. Answers 202 with a TriggerFireOutcome, and 401 for an unknown trigger or a wrong secret alike."},"webhook_secret":{"type":"string","description":"Kind `webhook`, only in the response that created or rotated it."}}},"AutomationTriggerInput":{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["github","schedule","webhook","linear","email","session"]},"events":{"type":"array","description":"Required and non-empty for kinds `github` and `linear`; empty or absent otherwise.","items":{"$ref":"#/components/schemas/TriggerEvent"}},"branch_patterns":{"type":"array","items":{"type":"string"}},"config":{"$ref":"#/components/schemas/TriggerConfig"}}},"TriggerEvent":{"oneOf":[{"$ref":"#/components/schemas/TriggerGithubEvent"},{"$ref":"#/components/schemas/TriggerLinearEvent"}]},"TriggerLinearEvent":{"type":"string","description":"A Linear issue event: it moved into one of `config.states`, or gained one of `config.labels`. Changes made by an app integration never fire.","enum":["linear.issue.state_changed","linear.issue.labeled"]},"TriggerGithubEvent":{"type":"string","description":"A GitHub event a trigger can listen to. A person-caused event fires one only when its sender can write to the repository, and its comment, issue or pull request is by an OWNER, MEMBER or COLLABORATOR (`author_association`) or is the sender's own pull request; pull requests from forks and CI runs from forks never fire.","enum":["issue_comment.mention","pull_request_review_comment.mention","pull_request.opened","pull_request.synchronize","pull_request.closed.merged","pull_request.labeled","issues.opened","issues.labeled","check_suite.failure","workflow_run.failure"]},"TriggerConfig":{"type":"object","additionalProperties":false,"properties":{"labels":{"type":"array","items":{"type":"string"},"description":"Kind `github`: any-of label filter. Kind `linear`: the labels whose addition fires `linear.issue.labeled` (required with it)."},"teams":{"type":"array","items":{"type":"string"},"description":"Kind `linear`: Linear team keys; empty means every public team."},"states":{"type":"object","additionalProperties":{"type":"string","enum":["plan","exec"]},"description":"Kind `linear`: Linear state name -> mode (required with `linear.issue.state_changed`). `plan` starts a read-only run that posts its plan as a comment on the issue through the runner's Linear connection; `exec` starts an ordinary run."},"authors":{"type":"array","items":{"type":"string"},"description":"Kind `github`: GitHub logins."},"cron":{"type":"string","description":"Kind `schedule`: a 5-field cron expression, at most hourly (every 10 minutes for a wake). Exactly one of `cron` and `every` is sent; `every` is stored as its cron."},"every":{"type":"string","enum":["10m","30m","1h","1d"],"writeOnly":true,"description":"Kind `schedule`: the plain-language schedule, read in `timezone` (`1d` is midnight); stored and returned as `cron`. `10m` and `30m` need a wake (the automation's `session_id`)."},"timezone":{"type":"string","description":"Kind `schedule`: an IANA timezone; UTC when omitted."},"from":{"type":"array","items":{"type":"string"},"description":"Kind `email`: senders that may start a run, each an address (`dana@acme.com`) or a domain (`acme.com`, `@acme.com`); empty means anyone. Mail from anyone else, or whose domain did not pass DMARC at Gmail, is skipped."},"label":{"type":"string","description":"Kind `email`: a Gmail label name; only new mail carrying it fires (a Gmail filter that adds the label picks the mail). Without it, any new inbox message fires."},"history_id":{"type":"string","readOnly":true,"description":"Kind `email`: the Gmail history the trigger has read up to. An email trigger reads its runner's connected Gmail (primary account) about once a minute; each new message (sender, subject, date, the plain-text body up to 64 KB, at most 20 attachments as the run's files) starts one run, deduped on its Gmail id. Mail sent by the runner never fires. Adding one needs a Gmail connection (422 `GMAIL_NOT_CONNECTED`) and makes the caller its runner."},"history_account":{"type":"string","readOnly":true,"description":"Kind `email`: the Gmail account `history_id` belongs to. When the runner's account changes, the trigger reads from now."},"agents":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Kind `session` (required): the runs it follows, by saved agent id, or a harness name for runs with no saved agent. When such a run in the Project ends, the automation starts with the ended run's status, outcome, pull request, structured result and final message as its event. Its runner must be able to read that run."},"ended":{"type":"array","items":{"type":"string","enum":["completed","needs_review","failed"]},"description":"Kind `session`: the ways the run ended that fire it; `[completed]` when omitted."},"outcome":{"type":"array","items":{"type":"string"},"description":"Kind `session`: fire only when the run's structured result (its `output_schema` answer, when valid) has one of these as `outcome`, such as `approved` or `changes_requested`. Absent means any."},"max_depth":{"type":"integer","minimum":1,"maximum":10,"description":"Kind `session`: how many session triggers in a row may follow one run something else started; 3 when omitted. Runs on one pull request count together, so a review and fix loop through GitHub events ends too."}}}}}}