{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0","description":"# StackAI API developer guide\n\nBuild applications that run StackAI workflows, search knowledge, invoke connected tools, and measure quality. Start with a working request, then use the reference for exact parameters, request bodies, response schemas, and errors.\n\nUse the public REST reference for workflow execution, knowledge bases, integration actions, evaluations, skills, and webhook subscriptions. Each operation states its route version and request contract. SCIM uses separate provisioning credentials and protocol responses.\n\n### Choose your starting point\n\n| Your goal | Start here | What you need |\n|---|---|---|\n| Run a workflow from your backend | Quickstart, then Runs v2 | Published project, personal API key, input keys |\n| Stream a response to an application | Legacy inference and streaming | Published flow, API key, SSE-capable client |\n| Upload documents and retrieve passages | Knowledge ingestion and search | Knowledge base access and indexing/query permissions |\n| Call an integration action | Providers and connections | Existing connection, action schema, use permission |\n| Regression-test a workflow | Evaluations and monitors | Project contract, dataset, evaluator, experiment |\n| Publish reusable instructions | Skills and versions | Skill authoring permissions, bundle or form fields |\n| Receive signed notifications | Webhooks | Authorized administrator, HTTPS receiver |\n| Provision users and groups | SCIM provisioning | SCIM token and identity-provider configuration |\n\nThe API version is part of each route. Do not prepend `/v2` to a legacy route. The specification's `info.version` is the document/service version, not a promise that every path has that version. A project version is a third, separate concept: it selects a saved workflow snapshot.\n\n## Quickstart\n\nRun a saved workflow from your backend and read its result. This walkthrough uses the same saved project version for the input schema and execution, so a newer unpublished edit cannot change the input contract halfway through.\n\n### 1. Prepare a key and a saved project version\n\nCreate a personal API key in **StackAI → Settings → API Keys**, in the organization containing your project. Give it `projects.read`, `projects.run`, and `analytics.read`. The key owner must also have access to the project. Store the key in your backend's secret manager.\n\nPublish the project and enable run logging. Copy the project ID from its URL. In the project's version history, select the saved version you intend to run and note its version number. Use that number throughout this walkthrough. Saved versions and API versions are separate: `/v2` selects the API contract; `PROJECT_VERSION` selects workflow content.\n\n```bash\nexport STACKAI_BASE_URL='https://api.stack-ai.com'\nexport PROJECT_ID='YOUR_PROJECT_ID'\nexport PROJECT_VERSION='1' # Replace with your selected saved version number.\n# Set STACKAI_API_KEY through your secret manager or secure local environment.\n```\n\nFor a private installation, replace the base URL with its configured API origin.\n\n### 2. Read that version's inputs\n\n```bash\ncurl --fail-with-body -sS --get \\\n  \"$STACKAI_BASE_URL/v2/projects/$PROJECT_ID/io-schema\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode \"version=$PROJECT_VERSION\"\n```\n\nFor a workflow with one text input and one output, a response can look like this:\n\n```json\n{\"data\":{\"input_kind\":\"legacy_input_nodes\",\"inputs\":[{\"id\":\"in-0\",\"name\":\"Question\"}],\"outputs\":[{\"id\":\"out-0\",\"name\":\"Answer\"}]}}\n```\n\nUse the returned `id` values as object keys, not the display names. Replace `in-0` and `out-0` below if your project returns different identifiers. `latest` is useful for discovery, but it can select a different saved version from the published version; this walkthrough pins a number instead.\n\n### 3. Start one run\n\nCreate `run.json`. Replace the project ID and version with the values you selected above:\n\n```json\n{\"project_id\":\"YOUR_PROJECT_ID\",\"project_version\":1,\"input\":{\"in-0\":\"Summarize our refund policy\"}}\n```\n\n```bash\ncurl --fail-with-body -sS -D run-headers.txt \\\n  \"$STACKAI_BASE_URL/v2/runs\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @run.json\n```\n\nA **201 Created** response includes a `Location` header and a run object. Save `data.run_id` before you do anything else. The status might already have advanced by the time you receive the response. This excerpt shows a run still waiting to execute:\n\n```json\n{\"data\":{\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"project_version\":1,\"status\":\"queued\",\"output\":null,\"error\":null}}\n```\n\nThe excerpt omits timestamps, usage, and other run fields. The endpoint reference contains complete response examples. A 201 confirms creation, not successful execution. If the POST times out, do not automatically repeat it: the first run may already exist.\n\n### 4. Read the result\n\n```bash\nexport RUN_ID='5f4c3b2a-1111-4111-8111-123456789abc' # Use your returned ID.\ncurl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/runs/$RUN_ID\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\"\n```\n\nPoll with a bounded delay. `queued` and `running` mean work is in progress. `succeeded`, `failed`, and `cancelled` are terminal. A `paused` run needs a human response; waiting alone cannot resume it.\n\nA successful response excerpt:\n\n```json\n{\"data\":{\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"project_version\":1,\"status\":\"succeeded\",\"output\":{\"out-0\":\"Eligible purchases can be returned within 30 days.\"},\"error\":null}}\n```\n\nThis text illustrates the response shape; your workflow supplies its own answer. Display the value under the output ID returned in step 2. A failed run can still return HTTP 200 from the status endpoint:\n\n```json\n{\"data\":{\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"status\":\"failed\",\"output\":null,\"error\":\"The connected service could not complete the request.\"}}\n```\n\nCheck the run's status before displaying its output. Keep its ID so you can inspect the same execution after a process restart. See **Run workflows end to end** for a bounded polling client and human-input handling.\n\n## Authentication and authorization\n\n### Bearer is the header scheme, not the credential type\n\nFor the documented REST operations, the portable default is:\n\n```http\nAuthorization: Bearer YOUR_CREDENTIAL\n```\n\nA personal API key and a user access token are different credentials even when both use this header. Personal keys begin with `sk_`. They are tied to an owner and organization, can expire or be revoked, and remain bounded by the owner's live permissions. A JWT is a user session access token governed by the organization's sign-in and MFA rules. Do not use an ID token or refresh token in place of an access token.\n\n| Surface | Credential to use | Important distinction |\n|---|---|---|\n| v1 knowledge bases and v2 REST | Personal API key in Bearer; authenticated user JWT where supported | Resource access and permission checks still apply |\n| `/inference/v0/...` | Personal API key in Bearer; legacy organization public key where still enabled | These are API-key routes; do not assume a user JWT works |\n| Legacy `/analytics/org/...` | Personal API key in Bearer; legacy organization **private** key where still enabled | The legacy public key is not the analytics credential |\n| SCIM Users and Groups | Dedicated SCIM token in Bearer | Not a normal personal API key or user session token |\n| Webhook deliveries to your server | Verify webhook signature headers | The signing secret is not a StackAI REST API key |\n\n### What about X-API-Key?\n\nSome endpoints accept the raw personal key as `X-API-Key: sk_...`. Other public routes explicitly read the Bearer authorization header. **X-API-Key is not a universal substitute across these APIs.** All examples in this documentation use Bearer. Do not send both headers: mixed JWT/key credentials or different keys can be rejected as ambiguous or conflicting. Use the exact `Bearer ` spelling in examples.\n\n\n\n| Endpoint family | Personal-key header |\n|---|---|\n| `/v2/runs` and its run detail, resume, and cancel operations | `Authorization: Bearer sk_...` or `X-API-Key: sk_...` |\n| `/inference/v0/...` and legacy `/analytics/org/...` | Use `Authorization: Bearer sk_...`; do not substitute `X-API-Key` |\n| Other REST examples in this guide | Use the documented `Authorization: Bearer sk_...` form |\n| `/scim/v2/...` | Use the dedicated SCIM token in `Authorization: Bearer`; a personal key is not interchangeable |\n\nFor example, read a run with the alternative personal-key header:\n\n```bash\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/runs/$RUN_ID\" \\\n  -H \"X-API-Key: $STACKAI_API_KEY\"\n```\n\nObtain personal API keys in StackAI settings. Obtain user access tokens through your organization’s supported sign-in flow. These API routes do not provide a public password-grant login endpoint.\n\n### Scope and resource access both matter\n\nA scope grants no extra access beyond the key owner's current permissions. A key can carry `kbs.read` and still fail to read a knowledge base the owner cannot access. A project can be in the same organization yet unavailable because of folder permissions. Review the permission note on each endpoint.\n\nTypical minimum sets:\n\n| Task | Permissions/scopes |\n|---|---|\n| Inspect a project's IO | `projects.read` |\n| Start/resume/cancel v2 runs | `projects.run` |\n| Poll/list v2 runs | `analytics.read` |\n| Read a v2 pause token | Both `analytics.read` and `projects.run` |\n| Create, upload, poll, search a KB | `kbs.create`, `kbs.index`, `kbs.read`, `kbs.query` |\n| Sync a KB | `kbs.sync` |\n| Browse providers/connections; run action | `connections.read`; `connections.use` |\n| Manage evals | Relevant `evals.read/create/update/delete/run`; trace-backed operations also require `analytics.read` |\n| Manage skills | Relevant `skills.read/create/update/delete` |\n| Manage outbound webhook subscriptions | `org.webhooks.manage` |\n\nWebhook management is not an assignable scope in the current personal-key scope picker. Use an authorized user session for this administrative workflow; an existing unscoped key remains subject to its owner's live permissions. Do not widen a production integration's credential just to avoid a scope error.\n\nStore keys in a server-side secret manager. Do not embed them in browser JavaScript, mobile binaries, URLs, screenshots, or logs. Put your own authenticated backend between an end-user interface and these APIs. Rotate compromised credentials and update dependent services. An embed-session credential has a restricted surface and is not a general-purpose REST key.\n\n## Requests, responses, pagination, and retries\n\n### JSON and multipart\n\nUse `Content-Type: application/json` for JSON bodies. For uploads, use multipart and let the HTTP client generate the boundary. With curl, `-F 'file=@document.pdf'` is appropriate; do not combine it with a manually set JSON content type. Skill bundles use **files** (plural), while KB uploads use **file** (singular).\n\nEncode path segments and query values; never concatenate raw user input into a URL. Repeated array query parameters are sent as repeated keys where the endpoint says so. UUID fields must contain actual UUIDs; a project ID or provider slug is not interchangeable with a run, resource, or connection ID.\n\n### Read the envelope for the endpoint you called\n\nMost v2 single-resource responses put the object in `data`. Cursor responses put items in `data` with `next_cursor` and potentially other cursor fields. Offset responses include their own pagination metadata. Empty success metadata can be omitted. A **204** has no response body: do not call `.json()` on it.\n\nLegacy inference, v1 knowledge bases, and legacy analytics do not all share the v2 envelope. Do not add a universal `response.data` accessor to a client covering every version. Use the exact response schema under each endpoint. v1 KB listing returns an array; v2 KB listing returns an envelope.\n\n### Pagination is not one global convention\n\n| Family | Pagination | Typical default/maximum |\n|---|---|---|\n| v2 runs | `cursor`, `page_size` | 50 / 1000 |\n| KB collections | `cursor`, `page_size`, `direction` | 50 / 1000 |\n| KB resources | `cursor`, `page_size`, `direction` | 50 / 100 |\n| Providers, connections, skills, most eval lists, subscriptions | `offset`, `limit` | 0 and 50 / 100 |\n| Eval run scores and sampled runs | Cursor pagination | Read the endpoint's limits |\n| Legacy analytics | Zero-based `page`, `page_size` | 0 and 25 |\n| SCIM | One-based `startIndex`, `count` | Protocol-specific |\n\nTreat cursors as opaque. Keep filters fixed during traversal, URL-encode the cursor, and stop when no next cursor is returned. For offset lists, advance by the items returned and use response totals/has-more information where available. Concurrent changes can affect offset traversals; deduplicate by stable ID if you need a complete export. v1 KB list accepts pagination parameters but returns a bare list without a next-cursor envelope; prefer v2 for new paginated clients rather than inventing a cursor.\n\n### Retry reads; reconcile writes\n\nUse connection/read timeouts, a total deadline, exponential backoff with jitter, and bounded attempts. Retry transient read failures and 429/503 responses when appropriate, honoring `Retry-After` when present. Stop and fix credentials or permissions for 401/403; fix payloads for 400/422.\n\nDo not automatically retry a run start, action invocation, upload, score creation, or other write after an ambiguous timeout or 500. The operation may already have taken effect, incurred usage, or changed an external system. No general idempotency-key contract is defined here. Persist returned resource IDs, inspect status, and reconcile before deciding to send another write.\n\nFor asynchronous operations, preserve `Location` and any `status_url`. Resolve relative URLs against the API origin. Only attach credentials to your trusted API origin; a signed file-download URL is a different request and does not need your StackAI authorization header.\n\n## Run workflows end to end\n\n### Pick the execution interface\n\nUse `/v2/runs` for persisted asynchronous run creation, list/detail reads, cancellation, and ask-human resume. Use `/inference/v0/run/{org_id}/{flow_id}` when your integration needs the legacy inline JSON or SSE response contract. These interfaces have different bodies, states, and version selectors.\n\n| Selection | v2 run body `project_version` | IO schema query `version` | Eval experiment `project_version_id` |\n|---|---|---|---|\n| Current published | Omit or null | Inspect the known published version number | Use the selected saved number |\n| Draft | `-1` | `draft` | `draft` |\n| Saved snapshot | Nonnegative integer | Nonnegative integer | Nonnegative integer |\n| Newest saved | No `latest` literal | `latest` (default) | No `latest` literal |\n\nDo not confuse newest saved with published. Draft access is permission-dependent and unsuitable for a reproducible production integration. The legacy inference query uses an integer `version`: omission or `-1` selects the latest published version. In v2, `-1` selects the draft instead. Do not copy that value between the two interfaces.\n\n### A bounded polling client\n\nThis Python example assumes `httpx` is installed. It starts exactly one run and never retries the POST automatically. Replace the example input key with the discovered contract.\n\n```python\nimport os\nimport time\nimport httpx\n\nbase = os.environ.get(\"STACKAI_BASE_URL\", \"https://api.stack-ai.com\").rstrip(\"/\")\nheaders = {\"Authorization\": f\"Bearer {os.environ['STACKAI_API_KEY']}\"}\nwith httpx.Client(base_url=base, headers=headers, timeout=30) as client:\n    response = client.post(\"/v2/runs\", json={\n        \"project_id\": os.environ[\"PROJECT_ID\"],\n        \"input\": {\"in-0\": \"Summarize our refund policy\"},\n        \"project_version\": int(os.environ[\"PROJECT_VERSION\"]),\n    })\n    response.raise_for_status()\n    run_id = response.json()[\"data\"][\"run_id\"]\n    print(\"Save this run ID:\", run_id)\n    deadline = time.monotonic() + 300\n    while time.monotonic() < deadline:\n        response = client.get(f\"/v2/runs/{run_id}\")\n        response.raise_for_status()\n        run = response.json()[\"data\"]\n        if run[\"status\"] == \"succeeded\":\n            print(run[\"output\"])\n            break\n        if run[\"status\"] in {\"failed\", \"cancelled\"}:\n            raise RuntimeError(f\"Run {run_id}: {run['status']}; {run.get('error')}\")\n        if run[\"status\"] == \"paused\":\n            print(\"Human input required; retain the run ID and render the prompt securely.\")\n            break\n        time.sleep(2)\n    else:\n        raise TimeoutError(f\"Polling deadline reached; inspect existing run {run_id}\")\n```\n\nA client timeout does not cancel the run. Add bounded retry logic for safe GETs in production. Store the run ID before polling so a process restart can resume observing the same execution.\n\n### Human-in-the-loop\n\nGET the run. When paused, `data.pending_input` contains the question, expected response type, optional choices, resume token, and token expiry if the caller can both read and resume. A null `pending_input` does not prove the run has no pause; the caller may lack `projects.run`.\n\nSubmit the actual human answer:\n\n```json\n{\n  \"resume_token\": \"TOKEN_FROM_PENDING_INPUT\",\n  \"response\": \"THE_HUMAN_ANSWER\",\n  \"response_type\": \"text\"\n}\n```\n\nPOST this body to `/v2/runs/{run_id}/resume`, then poll the Location URL. The 202 acknowledges resume acceptance. Match `response_type` to the prompt (`text`, `approval`, or `choice`); do not invent choices. Keep the token secret, do not log it, and do not reuse it for a later pause. Token expiry is distinct from the pause timeout. Only supported ask-human pauses/backends can be resumed here; 409 means the current state is incompatible.\n\n### Cancellation\n\nPOST `/v2/runs/{run_id}/cancel` using the actor type and identity that started the run. Being an administrator or using a session for the same person is not automatically equivalent to the originating personal-key actor. A 404 can conceal inaccessible or non-owned runs. A 202 acknowledges the request; poll until terminal. Cancellation cannot undo side effects already performed by tools.\n\n## Legacy inference, streaming, and analytics\n\n### Inline JSON\n\nThe legacy inference body is the input map itself, not the v2 `{project_id, input}` wrapper.\n\n```bash\ncurl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"in-0\":\"Summarize our refund policy\"}'\n```\n\n`ORG_ID` must identify the key's organization. The project must be published for this public inference route. Inputs and outputs depend on the deployed flow; use its exported API example or IO contract. Inspect the result state instead of treating every HTTP 200 as completion.\n\n### Server-sent events\n\n```bash\ncurl --fail-with-body -N -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID?delta=false&prefix=true&verbose=true\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Accept: text/event-stream' \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"in-0\":\"Summarize our refund policy\"}'\n```\n\nParse SSE frames across arbitrary network chunks; a network read is not necessarily an entire JSON event. Inspect the response Content-Type before parsing, because errors may be JSON. Preserve the run identifier when available and handle terminal and paused states. A dropped stream does not prove the run failed. Avoid starting another execution just to reconnect. Disable buffering in your own reverse proxy as needed.\n\nFor background legacy execution, pass `execution_mode=remote` and omit the SSE Accept header. The 202 response supplies a run ID and WebSocket handle; use the returned handle, not a guessed URL. Poll `/inference/v0/runs/{org_id}/{run_id}` when streaming is unavailable.\n\n### Consume a stream in your application\n\nFor a standard SSE parser, request `prefix=true`. Request `verbose=true` to receive the run ID, state, and pause information. With `delta=false`, each output frame contains the latest complete output values: replace the displayed value rather than appending it. For example:\n\n```bash\ncurl --fail-with-body -N -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID?prefix=true&verbose=true&delta=false\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Accept: text/event-stream' \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"in-0\":\"Summarize our refund policy\"}'\n```\n\nThese illustrative frames show a growing answer followed by the completion marker. Optional progress and citation fields are omitted here:\n\n```text\ndata: {\"outputs\":{\"out-0\":\"Eligible purchases\"},\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"metadata\":{},\"state\":null}\n\ndata: {\"outputs\":{\"out-0\":\"Eligible purchases can be returned within 30 days.\"},\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"metadata\":{},\"state\":\"COMPLETED\",\"error\":null}\n\ndata: {\"outputs\":{\"type\":\"stream_complete\",\"message\":\"Stream completed successfully\"},\"run_id\":\"5f4c3b2a-1111-4111-8111-123456789abc\",\"metadata\":{\"done\":true},\"state\":\"COMPLETED\",\"error\":null}\n\n```\n\nRead `state` and `error`, not the marker's message, to decide whether execution succeeded. A completion marker means that the stream ended; its state can also be `FAILED`, `CANCELLED`, or `PAUSED`. Do not display `outputs.type` or the marker's message as an answer. Save the last answer frame separately. For a pause, preserve `pause` securely on your backend and obtain the person's response before using the resume endpoint.\n\nThe following server-side generator parses frames across arbitrary network chunks. Call it from your application's authenticated backend route. Verify that the signed-in user may run the configured project before calling it; keep the API key and any resume token on the backend.\n\n```python\nimport json\nimport os\nimport httpx\n\nasync def stream_answer(question, save_run, save_pause):\n    base = os.environ[\"STACKAI_BASE_URL\"].rstrip(\"/\")\n    path = f\"/inference/v0/run/{os.environ['ORG_ID']}/{os.environ['PROJECT_ID']}\"\n    headers = {\"Authorization\": f\"Bearer {os.environ['STACKAI_API_KEY']}\",\n               \"Accept\": \"text/event-stream\"}\n    async with httpx.AsyncClient(base_url=base, timeout=60) as client:\n        async with client.stream(\"POST\", path, headers=headers,\n                params={\"prefix\": \"true\", \"verbose\": \"true\", \"delta\": \"false\"},\n                json={\"in-0\": question}) as response:\n            response.raise_for_status()\n            if \"text/event-stream\" not in response.headers.get(\"content-type\", \"\"):\n                raise RuntimeError(\"Expected a streaming response\")\n            data_lines = []\n            completed = False\n            async for line in response.aiter_lines():\n                if line.startswith(\"data:\"):\n                    data_lines.append(line[5:].lstrip(\" \"))\n                elif line == \"\" and data_lines:\n                    event = json.loads(\"\\n\".join(data_lines))\n                    data_lines = []\n                    if event.get(\"run_id\"):\n                        await save_run(event[\"run_id\"])\n                    if (event.get(\"metadata\") or {}).get(\"done\"):\n                        completed = True\n                        yield {\"type\": \"finished\", \"run_id\": event.get(\"run_id\"),\n                               \"state\": event.get(\"state\")}\n                        break\n                    if event.get(\"pause\"):\n                        await save_pause(event[\"run_id\"], event[\"pause\"])\n                        # Keep its resume token out of browser events and logs.\n                        yield {\"type\": \"needs_input\", \"run_id\": event.get(\"run_id\")}\n                    elif event.get(\"state\") in {\"FAILED\", \"CANCELLED\"}:\n                        yield {\"type\": \"failed\", \"run_id\": event.get(\"run_id\")}\n                    elif \"out-0\" in event.get(\"outputs\", {}):\n                        yield {\"type\": \"answer\", \"text\": event[\"outputs\"][\"out-0\"],\n                               \"run_id\": event.get(\"run_id\")}\n            if not completed:\n                raise RuntimeError(\"Stream disconnected; inspect the saved run ID\")\n```\n\nImplement `save_run` and `save_pause` using your application’s durable, access-controlled storage. The output ID and input key above must match your project. Send these normalized events to the browser through your application's own stream. The browser only needs to replace answer text for `answer`, show a waiting state for `needs_input`, and check the final state for `finished`. Render answer text as text, or sanitize any supported rich content; do not inject arbitrary HTML.\n\nIf your authenticated backend exposes these normalized events as newline-delimited JSON at `/api/answer`, a browser client can consume them as follows. The route must authenticate the user, authorize the configured project, call `stream_answer`, and send one JSON object followed by a newline for each yielded event. Do not pass arbitrary project IDs or API keys through from the browser.\n\n```javascript\nasync function showAnswer(question, answerElement, statusElement) {\n  const response = await fetch(\"/api/answer\", {\n    method: \"POST\",\n    headers: {\"Content-Type\": \"application/json\"},\n    body: JSON.stringify({question}),\n    credentials: \"same-origin\",\n  });\n  if (!response.ok || !response.body) throw new Error(\"Could not start the answer\");\n  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();\n  let pending = \"\";\n  let finished = false;\n  while (true) {\n    const {value, done} = await reader.read();\n    if (done) break;\n    pending += value;\n    let boundary;\n    while ((boundary = pending.indexOf(\"\\n\")) !== -1) {\n      const line = pending.slice(0, boundary);\n      pending = pending.slice(boundary + 1);\n      if (!line.trim()) continue;\n      const event = JSON.parse(line);\n      if (event.type === \"answer\") answerElement.textContent = event.text;\n      if (event.type === \"needs_input\") statusElement.textContent = \"Your response is needed\";\n      if (event.type === \"failed\") statusElement.textContent = \"The request could not finish\";\n      if (event.type === \"finished\") {\n        finished = true;\n        statusElement.textContent = event.state === \"COMPLETED\" ? \"Complete\"\n          : event.state === \"PAUSED\" ? \"Your response is needed\" : \"The request did not complete\";\n      }\n    }\n  }\n  if (!finished) statusElement.textContent = \"Connection lost; check this request's saved status\";\n}\n```\n\nA disconnect is not a request to execute again. Retain the run ID and query `/inference/v0/runs/{org_id}/{run_id}` for its state. This API does not document replay from an SSE `Last-Event-ID`; do not rely on automatic browser reconnection to resume at the last token.\n\n\n### Legacy resume\n\nPOST the resume token and human response to `/inference/v0/runs/{org_id}/{run_id}/resume`. Inline JSON, SSE, and remote resume have different backend support. Trigger-backed runs reject SSE with 406; retry the resume interface without SSE only after checking the response/state, then poll. In-process runs reject `execution_mode=remote` with 409. An out-of-band response can say `RESUMED` with no outputs while execution continues. The legacy state vocabulary includes `COMPLETED`; v2 exposes `succeeded`.\n\n### Analytics exports\n\nGET `/analytics/org/{org_id}/flows/{flow_id}` with a personal key or supported legacy private organization key. It returns a list, using zero-based `page` and optional `page_size`, `start_date`, `end_date`, `user_id`, and comma-separated `state`. Use timezone-qualified timestamps and ensure start is not after end. State values are `PENDING`, `RUNNING`, `PAUSED`, `RESUMED`, `COMPLETED`, `FAILED`, and `CANCELLED`.\n\nFor new run-history integrations, `/v2/runs` provides cursor pagination and lowercase statuses. A workflow result and a run-history record serve different purposes; logging controls can make run history unavailable.\n\n## Knowledge ingestion and search\n\n### Create, upload, wait, query\n\n1. POST `/v2/knowledge-bases` with a name and optional source/indexing configuration. Retain `data.knowledge_base_id` from the response.\n2. POST a file to `/v2/knowledge-bases/{knowledge_base_id}/resources` as multipart. Retain `data.resource_id`.\n3. GET that resource until `data.status` is `indexed`. Treat `error` as a failure requiring investigation. `resource`, `parsed`, and `pending` are not proof of search readiness; `pending_delete` and `deleted` are deletion states.\n4. POST `/v2/knowledge-bases/{knowledge_base_id}/query` and use returned passages and source metadata in your application.\n\n```bash\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/knowledge-bases\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"name\":\"Support handbook\",\"description\":\"Approved support policies\"}'\n\n# Set KB_ID to the returned knowledge_base_id.\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/resources\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -F 'file=@handbook.pdf'\n\n# Set RESOURCE_ID to the returned resource_id and poll this URL.\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/resources/$RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\"\n\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/query\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"query\":\"What is the refund window?\",\"top_k\":5,\"strategy\":\"hybrid\",\"retrieval_type\":\"chunks\"}'\n```\n\nUpload automatically starts indexing; a 202 is acceptance, not completion. Bound polling and record the resource ID for recovery. Do not repeatedly upload the same document while waiting. The query endpoint retrieves content; it is not itself a chat/completion endpoint. Empty retrieval is a valid application condition: tell the user there is insufficient evidence rather than fabricate a sourced answer.\n\n### Choose a retrieval strategy\n\n`semantic` searches by meaning, `keyword` targets lexical matches, and `hybrid` combines them. `top_k` is 1–20, default 10. Choose a smaller result set for focused questions; increase only when your downstream context budget supports it. Preserve source attribution. Retrieved text can contain instructions from untrusted documents; treat it as evidence, not system instructions.\n\n### Connected sources and maintenance\n\nCreate or update the KB with a valid existing `connection_id` and source IDs, or supported website sources. Connection/source availability, catalog policy, embedding model access, and KB permissions can all affect admission. Source IDs are provider-specific; do not substitute a display name or an arbitrary URL.\n\nPOST `/sync` for one synchronization and inspect resources afterward. A successful sync request does not mean every resource has been indexed. GET `/metadata-schemas` to inspect user and dataloader metadata shapes. GET a resource's `/download` to obtain a signed URL for the original file, and fetch that URL separately without forwarding your API key. Treat signed URLs as temporary secrets.\n\nPATCH updates selected fields; use the schema's nullability rules rather than assuming null means delete. DELETE a resource removes that resource; DELETE the KB removes the KB. Confirm IDs in your own application before destructive actions and check downstream workflows that depend on the content.\n\n### v1 compatibility\n\nThe v1 lifecycle, resource, and sync operations remain covered in the reference. Keep their original paths and response models when maintaining existing clients. New v2 clients must account for the `data` envelope, cursor fields, and additional query/download/metadata capabilities. Changing `/v1` to `/v2` without updating parsing is not a migration plan.\n\n## Providers, connections, and actions\n\nA **provider** describes an integration, an **action** describes an operation it can perform, and a **connection** is an authorized instance of that integration in your organization. A trigger descriptor explains an event source; reading it does not activate a trigger.\n\n### Discover before invoking\n\n1. GET `/v2/providers` and choose a returned provider ID.\n2. GET `/v2/providers/{provider_id}` for its details.\n3. GET `/v2/providers/{provider_id}/actions`, then GET the chosen `/{action_id}` for the actual input/output schema.\n4. GET `/v2/connections?provider_id=...` and choose an accessible compatible connection. A `needs_reconnection` status requires repair in StackAI.\n5. POST `/v2/providers/{provider_id}/actions/{action_id}/run` with `connection_id` when required and the action-specific `inputs`.\n\n```json\n{\n  \"connection_id\": \"00000000-0000-4000-8000-000000000001\",\n  \"inputs\": {\"ACTION_SPECIFIC_FIELD\": \"VALUE_FROM_YOUR_APPLICATION\"}\n}\n```\n\nThe UUID and field above are placeholders, not a universally valid action request. Do not infer an action's inputs from its name. Omit `connection_id` only for actions whose contract supports that. The call is synchronous; inspect returned outputs and errors.\n\nThe public API lists existing connections; it does not define a connection-create operation in this contract. Establish or reconnect credentials through StackAI's supported connection flow. Users see only connections available through their roles/sharing; an empty list need not mean the organization has none.\n\nUse the trigger list/detail routes to discover configuration requirements. There is no trigger-enable operation in this public catalog. Actions can send messages, update records, or otherwise change third-party systems, so use a test connection first and reconcile ambiguous failures before retrying.\n\n### Example: read a Linear issue before routing a request\n\nUse a connected Linear account to retrieve an issue's title and status. This is a read operation; it does not create or change an issue. First establish a Linear connection in StackAI and confirm your key has `connections.read` and `connections.use`.\n\nDiscover the action's current contract and the connections available to you:\n\n```bash\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\"\ncurl --fail-with-body -sS --get \"$STACKAI_BASE_URL/v2/connections\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode 'provider_id=linear'\n```\n\nChoose a healthy Linear connection from the returned list. Save its ID as `CONNECTION_ID`, and choose an issue that account can read. The action requires `issue_id`, which can be an issue identifier such as `ENG-123`.\n\nCreate `linear-issue.json` with your actual connection and issue:\n\n```json\n{\"connection_id\":\"00000000-0000-4000-8000-000000000001\",\"inputs\":{\"issue_id\":\"ENG-123\"}}\n```\n\n```bash\ncurl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue/run\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @linear-issue.json\n```\n\nThe result is inside `data.outputs`. For example, an excerpt can contain:\n\n```json\n{\"data\":{\"outputs\":{\"identifier\":\"ENG-123\",\"title\":\"Restore customer access\",\"status\":\"In Progress\"}}}\n```\n\nUse `identifier`, `title`, and `status` from the response to enrich your application's routing decision. The action returns additional issue fields; consult its discovered output schema. If the connection is missing, check sharing and organization access. If it needs reconnection, repair it in StackAI. If the issue is inaccessible, use an issue the connected Linear account can read.\n\n\n## Evaluations and monitors\n\n### Example: verify a request classifier before release\n\nSuppose a workflow routes requests by returning a category such as `billing`. Check that a saved version still classifies a known billing request correctly. An exact-match evaluator is appropriate because the result is a category, not free-form prose.\n\nUse a project with one selected input and one selected output. Set `PROJECT_ID`, `PROJECT_VERSION`, and `STACKAI_API_KEY` as in the quickstart. Read `/v2/projects/{project_id}/io-schema?version={saved-version}` first. Replace `in-0`, `out-0`, and `legacy_input_nodes` in every body below with the returned contract. Use a key with the required `projects.read`, `evals.read`, `evals.create`, `evals.update`, and `evals.run` permissions, plus access to the project.\n\nThis Python example uses `httpx`. It creates one dataset, one rule evaluator, and one experiment, then runs and reads them. It does not automatically retry writes.\n\n```python\nimport os\nimport time\nimport httpx\n\nproject_id = os.environ[\"PROJECT_ID\"]\nversion = int(os.environ[\"PROJECT_VERSION\"])\ncontract = {\"input_kind\": \"legacy_input_nodes\",\n            \"input_keys\": [\"in-0\"], \"output_node_ids\": [\"out-0\"]}\nheaders = {\"Authorization\": f\"Bearer {os.environ['STACKAI_API_KEY']}\"}\nwith httpx.Client(base_url=os.environ[\"STACKAI_BASE_URL\"].rstrip(\"/\"),\n                  headers=headers, timeout=30) as client:\n    def post(path, body):\n        response = client.post(path, json=body)\n        response.raise_for_status()\n        return response.json()[\"data\"]\n\n    dataset = post(\"/v2/evals/datasets\", {\n        \"project_id\": project_id, \"name\": \"Request classification\",\n        \"node_contract\": contract,\n    })\n    dataset_id = dataset[\"dataset_id\"]\n    print(\"Save dataset:\", dataset_id)\n    post(f\"/v2/evals/datasets/{dataset_id}/rows\", {\"rows\": [{\n        \"inputs\": {\"in-0\": \"I was charged twice for my subscription.\"},\n        \"expected_output\": {\"out-0\": \"billing\"},\n    }]})\n    evaluator = post(\"/v2/evals/evaluators\", {\n        \"project_id\": project_id, \"name\": \"Correct request category\",\n        \"evaluator_type\": \"builtin_rule\", \"node_contract\": contract,\n        \"config\": {\"rule\": \"exact_match\", \"target_output_node_id\": \"out-0\"},\n    })\n    evaluator_id = evaluator[\"evaluator_id\"]\n    print(\"Save evaluator:\", evaluator_id)\n    experiment = post(\"/v2/evals/experiments\", {\n        \"dataset_id\": dataset_id, \"project_version_id\": version,\n        \"evaluator_ids\": [evaluator_id], \"name\": \"Saved-version category check\",\n    })\n    experiment_id = experiment[\"experiment_id\"]\n    print(\"Save experiment:\", experiment_id)\n    job = post(f\"/v2/evals/experiments/{experiment_id}/jobs\", {\n        \"mode\": \"generate\", \"evaluator_ids\": [evaluator_id],\n    })\n    job_id = job[\"job_id\"]\n    print(\"Save job:\", job_id)\n    deadline = time.monotonic() + 300\n    while job[\"status\"] in {\"queued\", \"running\"}:\n        if time.monotonic() >= deadline:\n            raise TimeoutError(f\"Inspect existing job {job_id}; do not start another\")\n        time.sleep(2)\n        response = client.get(\n            f\"/v2/evals/experiments/{experiment_id}/jobs/{job_id}\")\n        response.raise_for_status()\n        job = response.json()[\"data\"]\n    print(\"Job status:\", job[\"status\"])\n    response = client.get(f\"/v2/evals/experiments/{experiment_id}/rows\")\n    response.raise_for_status()\n    print(response.json())\n```\n\nRead each row's `generated_output`, `status`, `error`, and `scores`. A matching output `{\"out-0\":\"billing\"}` receives an exact-match score of `1`; a different category receives `0`. A score of `0` is a completed comparison, not an execution error. A failed scoring status means the comparison could not complete—for example, because an expected value was missing. Inspect job and row errors before judging quality.\n\nOne case checks only one behavior. Add representative inputs and known correct categories to the dataset, then create another experiment for the version you want to compare. Experiments snapshot the dataset: editing it later does not change an existing experiment. Use a semantic or judge-based evaluator when more than one wording can be correct.\n\n\n### Job lifecycle and conflicts\n\n202 means the job was queued. Terminal statuses are `completed`, `completed_with_failures`, `failed`, and `cancelled`. Inspect row-level failures even if some outputs succeeded. Only one job may be active per experiment: a 409 can include the active job's Location/status URL and IDs in metadata. Follow that job instead of repeatedly creating jobs. A 503 on a job read means live state is temporarily unavailable; retry that GET.\n\nDataset detail reads expose contract-drift warnings. Dataset PATCH can re-key rows against a replacement contract; inspect the update body before using it as a simple rename. Evaluator config changes create immutable versions when material. Explicit null clears a row's expected output and clears experiment notes where documented; omitted fields remain unchanged.\n\nDeleting a dataset also removes its rows and experiments. Deleting an experiment removes its snapshot rows and scores. Evaluator deletion is soft and preserves historical scores. These operations have different retention semantics.\n\n### Monitor production quality\n\nGET `/v2/evals/monitor-limits` first. Choose a reference-free evaluator and POST a monitor with the project, evaluator, sampling rate, and daily cap. Current schema bounds sampling to greater than zero and at most 0.3 and the daily cap to 1–1000; use the limits endpoint rather than hard-coding policy forever.\n\nRead/update the monitor, inspect `/v2/evals/monitors/{monitor_id}/score-stats`, tune `/v2/evals/monitors/{monitor_id}/alert`, and traverse `/v2/evals/monitors/{monitor_id}/sampled-runs`. Windows are `24h`, `7d`, `30d`, or `all`. Explicit null on an alert knob resets it to the server default; omit it to keep the stored setting. Sampled-run traversal preserves an insertion cutoff. Deleting the monitor retains scores already present in run history.\n\n### Score individual runs\n\nPOST `/v2/evals/runs/{run_id}/scores` using a reference-free evaluator. This appends a score; it does not overwrite history, so retries can create additional scores. List the run's scores (oldest first) or GET a specific `/v2/evals/scores/{score_id}`. Trace-backed scoring and score reads require analytics access in addition to their evaluation permissions.\n\n## Skills and versioned bundles\n\nSkills package reusable instructions and supporting files. GET `/v2/skills` to discover visible built-in and organization skills. GET a skill for its current published instructions/manifest; GET `/versions` and a numbered version for reproducible integrations.\n\n### Publish a first version\n\nUse multipart form fields for a simple skill:\n\n```bash\ncurl --fail-with-body -sS \"$STACKAI_BASE_URL/v2/skills\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --form-string 'name=policy-summary' \\\n  --form-string 'description=Summarize approved policy text with citations' \\\n  --form-string 'instructions=Summarize only the provided policy. Cite the source and state when evidence is missing.'\n```\n\nFor a bundle, send repeated `files` parts whose filenames preserve relative POSIX paths, or a single zip. Include the bundle's `SKILL.md` and valid supporting files. Do not use absolute paths or traversal paths in the bundle. Use the endpoint's validation errors to fix invalid or oversized bundles; no universal upload-size allowance is promised here.\n\n### Publish and pin revisions\n\nPOST `/v2/skills/{skill_id}/versions` to publish another version. Repeat `carry_paths` to retain selected files, and set `base_version` to the version to copy from when needed; otherwise it uses the current version. Unmentioned files are not a substitute for explicitly carried files. Supplying a changed name can rename the skill when publishing.\n\nSave the skill ID and returned version number. Fetch that exact version when reproducibility matters instead of always using latest. Version numbers are 1-based. Conflicting names or versions can produce 409. DELETE removes an owned skill and all its versions; organization administrators may delete other organization skills. Do not treat deletion as an unpublish operation for just one version.\n\n## Webhooks and signed event delivery\n\n### Register and store the secret\n\nPOST `/v2/webhooks/subscriptions` with your HTTPS URL and desired event types:\n\n```json\n{\n  \"url\":\"https://your-service.example.com/webhooks/stackai\",\n  \"event_types\":[\"run.succeeded\",\"run.failed\"]\n}\n```\n\nUse an authorized credential with `org.webhooks.manage`. Store the signing secret returned at creation immediately; list responses cannot recover it. To replace a lost secret, create a replacement subscription and retire the old one carefully. There is no PATCH subscription operation in this contract.\n\n### Completion notifications and availability\n\nUse `GET /v2/runs/{run_id}` as the supported way to observe a workflow's completion. Creating a webhook subscription stores its URL and selected event names; it does not enable run-event delivery. Do not replace polling with a subscription when building a run-status integration.\n\n| Capability | What you can rely on |\n|---|---|\n| Create, list, and delete subscriptions | Manage the URL and accepted event types through the subscription endpoints |\n| Observe completion of a run | Poll the run until it reaches a terminal status |\n| Receive a run lifecycle notification | Subscription creation alone does not establish this capability; it is not a replacement for run polling |\n| Replay a delivery or inspect delivery history | No public replay or delivery-history endpoint is provided |\n\nAccepted subscription event names are `run.started`, `run.step.succeeded`, `run.step.failed`, `run.succeeded`, `run.failed`, and `run.cancelled`. These names describe subscription filters, not a guarantee that an event will be produced for every run. The receiver guidance below applies when webhook deliveries are enabled for your deployment.\n\n### Authenticate deliveries, then deduplicate\n\nDeliveries use the Standard Webhooks headers `webhook-id`, `webhook-timestamp`, and `webhook-signature`. Verify against the exact raw request body and the subscription's `whsec_...` secret before parsing or processing. Use a Standard Webhooks verifier with timestamp validation; JSON reserialization changes the bytes and can break verification.\n\nConceptual Python handler logic with the `standardwebhooks` package:\n\n```python\nfrom standardwebhooks.webhooks import Webhook\n\n# raw_body and headers come from your HTTP framework.\n# secret comes from your secret manager, never from the incoming request.\nverified_event = Webhook(secret).verify(raw_body, headers)\nevent_id = headers[\"webhook-id\"]\n# Atomically persist event_id and enqueue work only if it is new.\n# Return 2xx after durable acceptance; process the work asynchronously.\n```\n\nCatch verification errors and reject invalid requests. Use durable, atomic deduplication; an in-memory set is insufficient across workers or restarts. Preserve the verified event's ID with your processing record. Retries reuse the same event ID and body. Do not assume event order or exactly-once delivery.\n\nSuccessful 2xx responses acknowledge delivery. Redirects are not followed. Retryable client/server failures and transport failures can be retried; the current implementation has a bounded ladder of up to ten attempts with jitter. Return a suitable transient failure when you cannot durably accept work, rather than 200 and silently losing it. A 503 with numeric Retry-After can influence retry timing within server limits.\n\nGET subscriptions to inventory active endpoints; DELETE a subscription to stop deliveries and remove it from that list. There is no public delivery-history or replay endpoint in this contract.\n\n## SCIM 2.0 provisioning\n\nSCIM is a separate externally facing identity-management surface under `/scim/v2`. Configure it through your identity provider and StackAI's SCIM settings. Use the dedicated SCIM bearer token and `application/scim+json` payloads for provisioning; normal workflow API keys are not interchangeable. See the existing [StackAI SCIM setup guide](https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-in-stackai/system-for-cross-domain-identity-management-scim).\n\nUse the discovery endpoints below to read the SCIM capabilities and schemas available in your deployment. SCIM responses follow their own protocol rather than the REST v2 envelope.\n\n| Method | Path | Usage |\n|---|---|---|\n| GET | `/scim/v2/ServiceProviderConfig` | Discover supported provisioning capabilities before configuring the IdP |\n| GET | `/scim/v2/ResourceTypes` | Discover Users and Groups resource types |\n| GET | `/scim/v2/ResourceTypes/{resource_type_id}` | Read one resource-type descriptor |\n| GET | `/scim/v2/Schemas` | Discover schema attributes and extensions |\n| GET | `/scim/v2/Schemas/{schema_id}` | Read a specific schema URI |\n| GET | `/scim/v2/Users` | List/filter users with `startIndex` and `count` |\n| POST | `/scim/v2/Users` | Provision a user from a SCIM user body; retain returned ID |\n| GET | `/scim/v2/Users/{user_id}` | Read the provisioned user by SCIM ID |\n| PUT | `/scim/v2/Users/{user_id}` | Replace the user's supported attributes using a complete desired representation |\n| PATCH | `/scim/v2/Users/{user_id}` | Apply SCIM PatchOp operations, such as updating active state |\n| DELETE | `/scim/v2/Users/{user_id}` | Deprovision the user; treat this as an access-changing action |\n| GET | `/scim/v2/Groups` | List/filter groups; use the returned SCIM IDs |\n| POST | `/scim/v2/Groups` | Create a group and supported membership representation |\n| GET | `/scim/v2/Groups/{group_id}` | Read a group and its members |\n| PUT | `/scim/v2/Groups/{group_id}` | Replace the supported group representation |\n| PATCH | `/scim/v2/Groups/{group_id}` | Add/remove members with SCIM PatchOp semantics |\n| DELETE | `/scim/v2/Groups/{group_id}` | Delete the group; review membership/access effects first |\n\nRead discovery → match existing users by a supported filter → create or update → reconcile group membership → verify by GET → deprovision when the IdP revokes access. User filters include `userName eq \"person@example.com\"`, `externalId eq \"idp-id\"`, and supported email filters. URL-encode the filter. Pagination is 1-based; `count=0` requests totals without Resources. A SCIM ID, an external IdP ID, and a StackAI project/user identifier should not be guessed interchangeable.\n\n```bash\ncurl --fail-with-body -sS --get \"$STACKAI_BASE_URL/scim/v2/Users\" \\\n  -H \"Authorization: Bearer $STACKAI_SCIM_TOKEN\" \\\n  -H 'Accept: application/scim+json' \\\n  --data-urlencode 'filter=userName eq \"person@example.com\"' \\\n  --data-urlencode 'startIndex=1' --data-urlencode 'count=100'\n```\n\nSCIM error responses and `Resources`/`totalResults` pagination follow the provisioning protocol, not the v2 REST `data` envelope. Do not use the generic REST client's parsing rules without a SCIM adapter.\n\n## Troubleshooting and production checklist\n\n| Symptom | Check first | Next action |\n|---|---|---|\n| 401 | Correct Bearer syntax, credential type, expiry/revocation, organization | Replace/refresh through the supported credential flow; do not retry unchanged credentials |\n| 403 | Key scopes, owner's permissions, resource/folder access, publication or logging rules | Inspect the endpoint and error metadata; request only the missing permission |\n| 404 | Correct deployment, resource ID, organization, saved version, resource access | Verify the ID with an authorized read; absence may intentionally conceal access |\n| 400/422 | JSON shape, extra fields, required keys, enum values, UUIDs, multipart names | Compare with the exact endpoint schema; preserve safe field-level errors |\n| 402 on run start/resume | Organization usage allowance | Resolve the usage limit before trying again |\n| 409 | Active job, already-resumed run, cancellation state, name/version collision | Read current state; do not blindly repeat the write |\n| 406 on legacy resume | SSE requested for a trigger-backed continuation | Use the supported non-SSE/polling path |\n| 429 | Deployment throttling | Back off, honor Retry-After when available, lower concurrency |\n| 500 after a write | Side effect may already have occurred | Reconcile existing runs/resources before retrying |\n| 503 on run reservation | Dispatch did not occur according to this route's contract | Retry within a bounded policy |\n| 503 on eval job GET | Live job state temporarily unavailable | Retry the same status URL, not job creation |\n| Empty KB search | Indexing status, source access, query strategy, actual content | Wait for indexed resources and test with a known document phrase |\n| Empty connection list | Provider filter and connection sharing | Check access in StackAI and reconnect degraded entries |\n| Missing pause payload | Read and run permissions both present | Use a credential permitted to resume; keep the token out of logs |\n\nLog method, route template, status, safe error code, latency, and returned resource IDs. Redact authorization, resume tokens, webhook secrets, signed URLs, and sensitive input/output. The public error envelope can contain `errors`, `detail`, `response_code`, and `meta`; legacy responses can differ. Do not assume every exception conforms to one JSON shape.\n\nBefore shipping: test against a nonproduction project; pin the intended saved workflow version; validate the input contract; configure timeouts and safe retry limits; persist asynchronous IDs; verify all terminal states and pauses; exercise pagination beyond one page; check key revocation; and test your webhook signature/deduplication path if used.\n\nNo universal numeric request-rate, execution-time, or file-size limit is asserted by this documentation. Use schema-enforced bounds, deployment policy, and observed response headers. Do not infer an SLA or supported SDK from illustrative HTTP examples.\n\n## Versioning, coverage, and OpenAPI\n\nThe API version is part of the route. Keep an existing v1 client on v1 parsing until you intentionally migrate it. Use v2 for the capabilities it supports; use the inference interface when you need its inline response or streaming contract. Calling an interface legacy does not by itself announce a retirement date.\n\nBefore changing versions, compare the authentication method, input body, response envelope, pagination, status values, and project-version selector. For example, v2 run creation accepts `{project_id, project_version, input}`, while inference accepts the input map itself. A v2 `project_version` of `-1` selects a draft; an inference `version` of `-1` selects published content.\n\nDownload the OpenAPI specification to generate a client or validate request and response shapes. Its document version is separate from both route versions and saved project versions. Examples show the documented shapes; replace project IDs, connection IDs, and input keys with your own values. The reference covers the public operations listed in its navigation. Undocumented browser routes and provider authorization callbacks are not public integration endpoints.\n","x-gitbook-description-html":"<h1>StackAI API developer guide</h1>\n<p>Build applications that run StackAI workflows, search knowledge, invoke connected tools, and measure quality. Start with a working request, then use the reference for exact parameters, request bodies, response schemas, and errors.</p>\n<p>Use the public REST reference for workflow execution, knowledge bases, integration actions, evaluations, skills, and webhook subscriptions. Each operation states its route version and request contract. SCIM uses separate provisioning credentials and protocol responses.</p>\n<h3>Choose your starting point</h3>\n<table>\n<thead>\n<tr>\n<th>Your goal</th>\n<th>Start here</th>\n<th>What you need</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Run a workflow from your backend</td>\n<td>Quickstart, then Runs v2</td>\n<td>Published project, personal API key, input keys</td>\n</tr>\n<tr>\n<td>Stream a response to an application</td>\n<td>Legacy inference and streaming</td>\n<td>Published flow, API key, SSE-capable client</td>\n</tr>\n<tr>\n<td>Upload documents and retrieve passages</td>\n<td>Knowledge ingestion and search</td>\n<td>Knowledge base access and indexing/query permissions</td>\n</tr>\n<tr>\n<td>Call an integration action</td>\n<td>Providers and connections</td>\n<td>Existing connection, action schema, use permission</td>\n</tr>\n<tr>\n<td>Regression-test a workflow</td>\n<td>Evaluations and monitors</td>\n<td>Project contract, dataset, evaluator, experiment</td>\n</tr>\n<tr>\n<td>Publish reusable instructions</td>\n<td>Skills and versions</td>\n<td>Skill authoring permissions, bundle or form fields</td>\n</tr>\n<tr>\n<td>Receive signed notifications</td>\n<td>Webhooks</td>\n<td>Authorized administrator, HTTPS receiver</td>\n</tr>\n<tr>\n<td>Provision users and groups</td>\n<td>SCIM provisioning</td>\n<td>SCIM token and identity-provider configuration</td>\n</tr>\n</tbody></table>\n<p>The API version is part of each route. Do not prepend <code>/v2</code> to a legacy route. The specification&#39;s <code>info.version</code> is the document/service version, not a promise that every path has that version. A project version is a third, separate concept: it selects a saved workflow snapshot.</p>\n<h2>Quickstart</h2>\n<p>Run a saved workflow from your backend and read its result. This walkthrough uses the same saved project version for the input schema and execution, so a newer unpublished edit cannot change the input contract halfway through.</p>\n<h3>1. Prepare a key and a saved project version</h3>\n<p>Create a personal API key in <strong>StackAI → Settings → API Keys</strong>, in the organization containing your project. Give it <code>projects.read</code>, <code>projects.run</code>, and <code>analytics.read</code>. The key owner must also have access to the project. Store the key in your backend&#39;s secret manager.</p>\n<p>Publish the project and enable run logging. Copy the project ID from its URL. In the project&#39;s version history, select the saved version you intend to run and note its version number. Use that number throughout this walkthrough. Saved versions and API versions are separate: <code>/v2</code> selects the API contract; <code>PROJECT_VERSION</code> selects workflow content.</p>\n<pre><code class=\"language-bash\">export STACKAI_BASE_URL=&#39;https://api.stack-ai.com&#39;\nexport PROJECT_ID=&#39;YOUR_PROJECT_ID&#39;\nexport PROJECT_VERSION=&#39;1&#39; # Replace with your selected saved version number.\n# Set STACKAI_API_KEY through your secret manager or secure local environment.\n</code></pre>\n<p>For a private installation, replace the base URL with its configured API origin.</p>\n<h3>2. Read that version&#39;s inputs</h3>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS --get \\\n  &quot;$STACKAI_BASE_URL/v2/projects/$PROJECT_ID/io-schema&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  --data-urlencode &quot;version=$PROJECT_VERSION&quot;\n</code></pre>\n<p>For a workflow with one text input and one output, a response can look like this:</p>\n<pre><code class=\"language-json\">{&quot;data&quot;:{&quot;input_kind&quot;:&quot;legacy_input_nodes&quot;,&quot;inputs&quot;:[{&quot;id&quot;:&quot;in-0&quot;,&quot;name&quot;:&quot;Question&quot;}],&quot;outputs&quot;:[{&quot;id&quot;:&quot;out-0&quot;,&quot;name&quot;:&quot;Answer&quot;}]}}\n</code></pre>\n<p>Use the returned <code>id</code> values as object keys, not the display names. Replace <code>in-0</code> and <code>out-0</code> below if your project returns different identifiers. <code>latest</code> is useful for discovery, but it can select a different saved version from the published version; this walkthrough pins a number instead.</p>\n<h3>3. Start one run</h3>\n<p>Create <code>run.json</code>. Replace the project ID and version with the values you selected above:</p>\n<pre><code class=\"language-json\">{&quot;project_id&quot;:&quot;YOUR_PROJECT_ID&quot;,&quot;project_version&quot;:1,&quot;input&quot;:{&quot;in-0&quot;:&quot;Summarize our refund policy&quot;}}\n</code></pre>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS -D run-headers.txt \\\n  &quot;$STACKAI_BASE_URL/v2/runs&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data-binary @run.json\n</code></pre>\n<p>A <strong>201 Created</strong> response includes a <code>Location</code> header and a run object. Save <code>data.run_id</code> before you do anything else. The status might already have advanced by the time you receive the response. This excerpt shows a run still waiting to execute:</p>\n<pre><code class=\"language-json\">{&quot;data&quot;:{&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;project_version&quot;:1,&quot;status&quot;:&quot;queued&quot;,&quot;output&quot;:null,&quot;error&quot;:null}}\n</code></pre>\n<p>The excerpt omits timestamps, usage, and other run fields. The endpoint reference contains complete response examples. A 201 confirms creation, not successful execution. If the POST times out, do not automatically repeat it: the first run may already exist.</p>\n<h3>4. Read the result</h3>\n<pre><code class=\"language-bash\">export RUN_ID=&#39;5f4c3b2a-1111-4111-8111-123456789abc&#39; # Use your returned ID.\ncurl --fail-with-body -sS \\\n  &quot;$STACKAI_BASE_URL/v2/runs/$RUN_ID&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot;\n</code></pre>\n<p>Poll with a bounded delay. <code>queued</code> and <code>running</code> mean work is in progress. <code>succeeded</code>, <code>failed</code>, and <code>cancelled</code> are terminal. A <code>paused</code> run needs a human response; waiting alone cannot resume it.</p>\n<p>A successful response excerpt:</p>\n<pre><code class=\"language-json\">{&quot;data&quot;:{&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;project_version&quot;:1,&quot;status&quot;:&quot;succeeded&quot;,&quot;output&quot;:{&quot;out-0&quot;:&quot;Eligible purchases can be returned within 30 days.&quot;},&quot;error&quot;:null}}\n</code></pre>\n<p>This text illustrates the response shape; your workflow supplies its own answer. Display the value under the output ID returned in step 2. A failed run can still return HTTP 200 from the status endpoint:</p>\n<pre><code class=\"language-json\">{&quot;data&quot;:{&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;status&quot;:&quot;failed&quot;,&quot;output&quot;:null,&quot;error&quot;:&quot;The connected service could not complete the request.&quot;}}\n</code></pre>\n<p>Check the run&#39;s status before displaying its output. Keep its ID so you can inspect the same execution after a process restart. See <strong>Run workflows end to end</strong> for a bounded polling client and human-input handling.</p>\n<h2>Authentication and authorization</h2>\n<h3>Bearer is the header scheme, not the credential type</h3>\n<p>For the documented REST operations, the portable default is:</p>\n<pre><code class=\"language-http\">Authorization: Bearer YOUR_CREDENTIAL\n</code></pre>\n<p>A personal API key and a user access token are different credentials even when both use this header. Personal keys begin with <code>sk_</code>. They are tied to an owner and organization, can expire or be revoked, and remain bounded by the owner&#39;s live permissions. A JWT is a user session access token governed by the organization&#39;s sign-in and MFA rules. Do not use an ID token or refresh token in place of an access token.</p>\n<table>\n<thead>\n<tr>\n<th>Surface</th>\n<th>Credential to use</th>\n<th>Important distinction</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>v1 knowledge bases and v2 REST</td>\n<td>Personal API key in Bearer; authenticated user JWT where supported</td>\n<td>Resource access and permission checks still apply</td>\n</tr>\n<tr>\n<td><code>/inference/v0/...</code></td>\n<td>Personal API key in Bearer; legacy organization public key where still enabled</td>\n<td>These are API-key routes; do not assume a user JWT works</td>\n</tr>\n<tr>\n<td>Legacy <code>/analytics/org/...</code></td>\n<td>Personal API key in Bearer; legacy organization <strong>private</strong> key where still enabled</td>\n<td>The legacy public key is not the analytics credential</td>\n</tr>\n<tr>\n<td>SCIM Users and Groups</td>\n<td>Dedicated SCIM token in Bearer</td>\n<td>Not a normal personal API key or user session token</td>\n</tr>\n<tr>\n<td>Webhook deliveries to your server</td>\n<td>Verify webhook signature headers</td>\n<td>The signing secret is not a StackAI REST API key</td>\n</tr>\n</tbody></table>\n<h3>What about X-API-Key?</h3>\n<p>Some endpoints accept the raw personal key as <code>X-API-Key: sk_...</code>. Other public routes explicitly read the Bearer authorization header. <strong>X-API-Key is not a universal substitute across these APIs.</strong> All examples in this documentation use Bearer. Do not send both headers: mixed JWT/key credentials or different keys can be rejected as ambiguous or conflicting. Use the exact <code>Bearer </code> spelling in examples.</p>\n<table>\n<thead>\n<tr>\n<th>Endpoint family</th>\n<th>Personal-key header</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>/v2/runs</code> and its run detail, resume, and cancel operations</td>\n<td><code>Authorization: Bearer sk_...</code> or <code>X-API-Key: sk_...</code></td>\n</tr>\n<tr>\n<td><code>/inference/v0/...</code> and legacy <code>/analytics/org/...</code></td>\n<td>Use <code>Authorization: Bearer sk_...</code>; do not substitute <code>X-API-Key</code></td>\n</tr>\n<tr>\n<td>Other REST examples in this guide</td>\n<td>Use the documented <code>Authorization: Bearer sk_...</code> form</td>\n</tr>\n<tr>\n<td><code>/scim/v2/...</code></td>\n<td>Use the dedicated SCIM token in <code>Authorization: Bearer</code>; a personal key is not interchangeable</td>\n</tr>\n</tbody></table>\n<p>For example, read a run with the alternative personal-key header:</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/runs/$RUN_ID&quot; \\\n  -H &quot;X-API-Key: $STACKAI_API_KEY&quot;\n</code></pre>\n<p>Obtain personal API keys in StackAI settings. Obtain user access tokens through your organization’s supported sign-in flow. These API routes do not provide a public password-grant login endpoint.</p>\n<h3>Scope and resource access both matter</h3>\n<p>A scope grants no extra access beyond the key owner&#39;s current permissions. A key can carry <code>kbs.read</code> and still fail to read a knowledge base the owner cannot access. A project can be in the same organization yet unavailable because of folder permissions. Review the permission note on each endpoint.</p>\n<p>Typical minimum sets:</p>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>Permissions/scopes</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Inspect a project&#39;s IO</td>\n<td><code>projects.read</code></td>\n</tr>\n<tr>\n<td>Start/resume/cancel v2 runs</td>\n<td><code>projects.run</code></td>\n</tr>\n<tr>\n<td>Poll/list v2 runs</td>\n<td><code>analytics.read</code></td>\n</tr>\n<tr>\n<td>Read a v2 pause token</td>\n<td>Both <code>analytics.read</code> and <code>projects.run</code></td>\n</tr>\n<tr>\n<td>Create, upload, poll, search a KB</td>\n<td><code>kbs.create</code>, <code>kbs.index</code>, <code>kbs.read</code>, <code>kbs.query</code></td>\n</tr>\n<tr>\n<td>Sync a KB</td>\n<td><code>kbs.sync</code></td>\n</tr>\n<tr>\n<td>Browse providers/connections; run action</td>\n<td><code>connections.read</code>; <code>connections.use</code></td>\n</tr>\n<tr>\n<td>Manage evals</td>\n<td>Relevant <code>evals.read/create/update/delete/run</code>; trace-backed operations also require <code>analytics.read</code></td>\n</tr>\n<tr>\n<td>Manage skills</td>\n<td>Relevant <code>skills.read/create/update/delete</code></td>\n</tr>\n<tr>\n<td>Manage outbound webhook subscriptions</td>\n<td><code>org.webhooks.manage</code></td>\n</tr>\n</tbody></table>\n<p>Webhook management is not an assignable scope in the current personal-key scope picker. Use an authorized user session for this administrative workflow; an existing unscoped key remains subject to its owner&#39;s live permissions. Do not widen a production integration&#39;s credential just to avoid a scope error.</p>\n<p>Store keys in a server-side secret manager. Do not embed them in browser JavaScript, mobile binaries, URLs, screenshots, or logs. Put your own authenticated backend between an end-user interface and these APIs. Rotate compromised credentials and update dependent services. An embed-session credential has a restricted surface and is not a general-purpose REST key.</p>\n<h2>Requests, responses, pagination, and retries</h2>\n<h3>JSON and multipart</h3>\n<p>Use <code>Content-Type: application/json</code> for JSON bodies. For uploads, use multipart and let the HTTP client generate the boundary. With curl, <code>-F &#39;file=@document.pdf&#39;</code> is appropriate; do not combine it with a manually set JSON content type. Skill bundles use <strong>files</strong> (plural), while KB uploads use <strong>file</strong> (singular).</p>\n<p>Encode path segments and query values; never concatenate raw user input into a URL. Repeated array query parameters are sent as repeated keys where the endpoint says so. UUID fields must contain actual UUIDs; a project ID or provider slug is not interchangeable with a run, resource, or connection ID.</p>\n<h3>Read the envelope for the endpoint you called</h3>\n<p>Most v2 single-resource responses put the object in <code>data</code>. Cursor responses put items in <code>data</code> with <code>next_cursor</code> and potentially other cursor fields. Offset responses include their own pagination metadata. Empty success metadata can be omitted. A <strong>204</strong> has no response body: do not call <code>.json()</code> on it.</p>\n<p>Legacy inference, v1 knowledge bases, and legacy analytics do not all share the v2 envelope. Do not add a universal <code>response.data</code> accessor to a client covering every version. Use the exact response schema under each endpoint. v1 KB listing returns an array; v2 KB listing returns an envelope.</p>\n<h3>Pagination is not one global convention</h3>\n<table>\n<thead>\n<tr>\n<th>Family</th>\n<th>Pagination</th>\n<th>Typical default/maximum</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>v2 runs</td>\n<td><code>cursor</code>, <code>page_size</code></td>\n<td>50 / 1000</td>\n</tr>\n<tr>\n<td>KB collections</td>\n<td><code>cursor</code>, <code>page_size</code>, <code>direction</code></td>\n<td>50 / 1000</td>\n</tr>\n<tr>\n<td>KB resources</td>\n<td><code>cursor</code>, <code>page_size</code>, <code>direction</code></td>\n<td>50 / 100</td>\n</tr>\n<tr>\n<td>Providers, connections, skills, most eval lists, subscriptions</td>\n<td><code>offset</code>, <code>limit</code></td>\n<td>0 and 50 / 100</td>\n</tr>\n<tr>\n<td>Eval run scores and sampled runs</td>\n<td>Cursor pagination</td>\n<td>Read the endpoint&#39;s limits</td>\n</tr>\n<tr>\n<td>Legacy analytics</td>\n<td>Zero-based <code>page</code>, <code>page_size</code></td>\n<td>0 and 25</td>\n</tr>\n<tr>\n<td>SCIM</td>\n<td>One-based <code>startIndex</code>, <code>count</code></td>\n<td>Protocol-specific</td>\n</tr>\n</tbody></table>\n<p>Treat cursors as opaque. Keep filters fixed during traversal, URL-encode the cursor, and stop when no next cursor is returned. For offset lists, advance by the items returned and use response totals/has-more information where available. Concurrent changes can affect offset traversals; deduplicate by stable ID if you need a complete export. v1 KB list accepts pagination parameters but returns a bare list without a next-cursor envelope; prefer v2 for new paginated clients rather than inventing a cursor.</p>\n<h3>Retry reads; reconcile writes</h3>\n<p>Use connection/read timeouts, a total deadline, exponential backoff with jitter, and bounded attempts. Retry transient read failures and 429/503 responses when appropriate, honoring <code>Retry-After</code> when present. Stop and fix credentials or permissions for 401/403; fix payloads for 400/422.</p>\n<p>Do not automatically retry a run start, action invocation, upload, score creation, or other write after an ambiguous timeout or 500. The operation may already have taken effect, incurred usage, or changed an external system. No general idempotency-key contract is defined here. Persist returned resource IDs, inspect status, and reconcile before deciding to send another write.</p>\n<p>For asynchronous operations, preserve <code>Location</code> and any <code>status_url</code>. Resolve relative URLs against the API origin. Only attach credentials to your trusted API origin; a signed file-download URL is a different request and does not need your StackAI authorization header.</p>\n<h2>Run workflows end to end</h2>\n<h3>Pick the execution interface</h3>\n<p>Use <code>/v2/runs</code> for persisted asynchronous run creation, list/detail reads, cancellation, and ask-human resume. Use <code>/inference/v0/run/{org_id}/{flow_id}</code> when your integration needs the legacy inline JSON or SSE response contract. These interfaces have different bodies, states, and version selectors.</p>\n<table>\n<thead>\n<tr>\n<th>Selection</th>\n<th>v2 run body <code>project_version</code></th>\n<th>IO schema query <code>version</code></th>\n<th>Eval experiment <code>project_version_id</code></th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Current published</td>\n<td>Omit or null</td>\n<td>Inspect the known published version number</td>\n<td>Use the selected saved number</td>\n</tr>\n<tr>\n<td>Draft</td>\n<td><code>-1</code></td>\n<td><code>draft</code></td>\n<td><code>draft</code></td>\n</tr>\n<tr>\n<td>Saved snapshot</td>\n<td>Nonnegative integer</td>\n<td>Nonnegative integer</td>\n<td>Nonnegative integer</td>\n</tr>\n<tr>\n<td>Newest saved</td>\n<td>No <code>latest</code> literal</td>\n<td><code>latest</code> (default)</td>\n<td>No <code>latest</code> literal</td>\n</tr>\n</tbody></table>\n<p>Do not confuse newest saved with published. Draft access is permission-dependent and unsuitable for a reproducible production integration. The legacy inference query uses an integer <code>version</code>: omission or <code>-1</code> selects the latest published version. In v2, <code>-1</code> selects the draft instead. Do not copy that value between the two interfaces.</p>\n<h3>A bounded polling client</h3>\n<p>This Python example assumes <code>httpx</code> is installed. It starts exactly one run and never retries the POST automatically. Replace the example input key with the discovered contract.</p>\n<pre><code class=\"language-python\">import os\nimport time\nimport httpx\n\nbase = os.environ.get(&quot;STACKAI_BASE_URL&quot;, &quot;https://api.stack-ai.com&quot;).rstrip(&quot;/&quot;)\nheaders = {&quot;Authorization&quot;: f&quot;Bearer {os.environ[&#39;STACKAI_API_KEY&#39;]}&quot;}\nwith httpx.Client(base_url=base, headers=headers, timeout=30) as client:\n    response = client.post(&quot;/v2/runs&quot;, json={\n        &quot;project_id&quot;: os.environ[&quot;PROJECT_ID&quot;],\n        &quot;input&quot;: {&quot;in-0&quot;: &quot;Summarize our refund policy&quot;},\n        &quot;project_version&quot;: int(os.environ[&quot;PROJECT_VERSION&quot;]),\n    })\n    response.raise_for_status()\n    run_id = response.json()[&quot;data&quot;][&quot;run_id&quot;]\n    print(&quot;Save this run ID:&quot;, run_id)\n    deadline = time.monotonic() + 300\n    while time.monotonic() &lt; deadline:\n        response = client.get(f&quot;/v2/runs/{run_id}&quot;)\n        response.raise_for_status()\n        run = response.json()[&quot;data&quot;]\n        if run[&quot;status&quot;] == &quot;succeeded&quot;:\n            print(run[&quot;output&quot;])\n            break\n        if run[&quot;status&quot;] in {&quot;failed&quot;, &quot;cancelled&quot;}:\n            raise RuntimeError(f&quot;Run {run_id}: {run[&#39;status&#39;]}; {run.get(&#39;error&#39;)}&quot;)\n        if run[&quot;status&quot;] == &quot;paused&quot;:\n            print(&quot;Human input required; retain the run ID and render the prompt securely.&quot;)\n            break\n        time.sleep(2)\n    else:\n        raise TimeoutError(f&quot;Polling deadline reached; inspect existing run {run_id}&quot;)\n</code></pre>\n<p>A client timeout does not cancel the run. Add bounded retry logic for safe GETs in production. Store the run ID before polling so a process restart can resume observing the same execution.</p>\n<h3>Human-in-the-loop</h3>\n<p>GET the run. When paused, <code>data.pending_input</code> contains the question, expected response type, optional choices, resume token, and token expiry if the caller can both read and resume. A null <code>pending_input</code> does not prove the run has no pause; the caller may lack <code>projects.run</code>.</p>\n<p>Submit the actual human answer:</p>\n<pre><code class=\"language-json\">{\n  &quot;resume_token&quot;: &quot;TOKEN_FROM_PENDING_INPUT&quot;,\n  &quot;response&quot;: &quot;THE_HUMAN_ANSWER&quot;,\n  &quot;response_type&quot;: &quot;text&quot;\n}\n</code></pre>\n<p>POST this body to <code>/v2/runs/{run_id}/resume</code>, then poll the Location URL. The 202 acknowledges resume acceptance. Match <code>response_type</code> to the prompt (<code>text</code>, <code>approval</code>, or <code>choice</code>); do not invent choices. Keep the token secret, do not log it, and do not reuse it for a later pause. Token expiry is distinct from the pause timeout. Only supported ask-human pauses/backends can be resumed here; 409 means the current state is incompatible.</p>\n<h3>Cancellation</h3>\n<p>POST <code>/v2/runs/{run_id}/cancel</code> using the actor type and identity that started the run. Being an administrator or using a session for the same person is not automatically equivalent to the originating personal-key actor. A 404 can conceal inaccessible or non-owned runs. A 202 acknowledges the request; poll until terminal. Cancellation cannot undo side effects already performed by tools.</p>\n<h2>Legacy inference, streaming, and analytics</h2>\n<h3>Inline JSON</h3>\n<p>The legacy inference body is the input map itself, not the v2 <code>{project_id, input}</code> wrapper.</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS \\\n  &quot;$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data &#39;{&quot;in-0&quot;:&quot;Summarize our refund policy&quot;}&#39;\n</code></pre>\n<p><code>ORG_ID</code> must identify the key&#39;s organization. The project must be published for this public inference route. Inputs and outputs depend on the deployed flow; use its exported API example or IO contract. Inspect the result state instead of treating every HTTP 200 as completion.</p>\n<h3>Server-sent events</h3>\n<pre><code class=\"language-bash\">curl --fail-with-body -N -sS \\\n  &quot;$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID?delta=false&amp;prefix=true&amp;verbose=true&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Accept: text/event-stream&#39; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data &#39;{&quot;in-0&quot;:&quot;Summarize our refund policy&quot;}&#39;\n</code></pre>\n<p>Parse SSE frames across arbitrary network chunks; a network read is not necessarily an entire JSON event. Inspect the response Content-Type before parsing, because errors may be JSON. Preserve the run identifier when available and handle terminal and paused states. A dropped stream does not prove the run failed. Avoid starting another execution just to reconnect. Disable buffering in your own reverse proxy as needed.</p>\n<p>For background legacy execution, pass <code>execution_mode=remote</code> and omit the SSE Accept header. The 202 response supplies a run ID and WebSocket handle; use the returned handle, not a guessed URL. Poll <code>/inference/v0/runs/{org_id}/{run_id}</code> when streaming is unavailable.</p>\n<h3>Consume a stream in your application</h3>\n<p>For a standard SSE parser, request <code>prefix=true</code>. Request <code>verbose=true</code> to receive the run ID, state, and pause information. With <code>delta=false</code>, each output frame contains the latest complete output values: replace the displayed value rather than appending it. For example:</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -N -sS \\\n  &quot;$STACKAI_BASE_URL/inference/v0/run/$ORG_ID/$PROJECT_ID?prefix=true&amp;verbose=true&amp;delta=false&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Accept: text/event-stream&#39; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data &#39;{&quot;in-0&quot;:&quot;Summarize our refund policy&quot;}&#39;\n</code></pre>\n<p>These illustrative frames show a growing answer followed by the completion marker. Optional progress and citation fields are omitted here:</p>\n<pre><code class=\"language-text\">data: {&quot;outputs&quot;:{&quot;out-0&quot;:&quot;Eligible purchases&quot;},&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;metadata&quot;:{},&quot;state&quot;:null}\n\ndata: {&quot;outputs&quot;:{&quot;out-0&quot;:&quot;Eligible purchases can be returned within 30 days.&quot;},&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;metadata&quot;:{},&quot;state&quot;:&quot;COMPLETED&quot;,&quot;error&quot;:null}\n\ndata: {&quot;outputs&quot;:{&quot;type&quot;:&quot;stream_complete&quot;,&quot;message&quot;:&quot;Stream completed successfully&quot;},&quot;run_id&quot;:&quot;5f4c3b2a-1111-4111-8111-123456789abc&quot;,&quot;metadata&quot;:{&quot;done&quot;:true},&quot;state&quot;:&quot;COMPLETED&quot;,&quot;error&quot;:null}\n</code></pre>\n<p>Read <code>state</code> and <code>error</code>, not the marker&#39;s message, to decide whether execution succeeded. A completion marker means that the stream ended; its state can also be <code>FAILED</code>, <code>CANCELLED</code>, or <code>PAUSED</code>. Do not display <code>outputs.type</code> or the marker&#39;s message as an answer. Save the last answer frame separately. For a pause, preserve <code>pause</code> securely on your backend and obtain the person&#39;s response before using the resume endpoint.</p>\n<p>The following server-side generator parses frames across arbitrary network chunks. Call it from your application&#39;s authenticated backend route. Verify that the signed-in user may run the configured project before calling it; keep the API key and any resume token on the backend.</p>\n<pre><code class=\"language-python\">import json\nimport os\nimport httpx\n\nasync def stream_answer(question, save_run, save_pause):\n    base = os.environ[&quot;STACKAI_BASE_URL&quot;].rstrip(&quot;/&quot;)\n    path = f&quot;/inference/v0/run/{os.environ[&#39;ORG_ID&#39;]}/{os.environ[&#39;PROJECT_ID&#39;]}&quot;\n    headers = {&quot;Authorization&quot;: f&quot;Bearer {os.environ[&#39;STACKAI_API_KEY&#39;]}&quot;,\n               &quot;Accept&quot;: &quot;text/event-stream&quot;}\n    async with httpx.AsyncClient(base_url=base, timeout=60) as client:\n        async with client.stream(&quot;POST&quot;, path, headers=headers,\n                params={&quot;prefix&quot;: &quot;true&quot;, &quot;verbose&quot;: &quot;true&quot;, &quot;delta&quot;: &quot;false&quot;},\n                json={&quot;in-0&quot;: question}) as response:\n            response.raise_for_status()\n            if &quot;text/event-stream&quot; not in response.headers.get(&quot;content-type&quot;, &quot;&quot;):\n                raise RuntimeError(&quot;Expected a streaming response&quot;)\n            data_lines = []\n            completed = False\n            async for line in response.aiter_lines():\n                if line.startswith(&quot;data:&quot;):\n                    data_lines.append(line[5:].lstrip(&quot; &quot;))\n                elif line == &quot;&quot; and data_lines:\n                    event = json.loads(&quot;\\n&quot;.join(data_lines))\n                    data_lines = []\n                    if event.get(&quot;run_id&quot;):\n                        await save_run(event[&quot;run_id&quot;])\n                    if (event.get(&quot;metadata&quot;) or {}).get(&quot;done&quot;):\n                        completed = True\n                        yield {&quot;type&quot;: &quot;finished&quot;, &quot;run_id&quot;: event.get(&quot;run_id&quot;),\n                               &quot;state&quot;: event.get(&quot;state&quot;)}\n                        break\n                    if event.get(&quot;pause&quot;):\n                        await save_pause(event[&quot;run_id&quot;], event[&quot;pause&quot;])\n                        # Keep its resume token out of browser events and logs.\n                        yield {&quot;type&quot;: &quot;needs_input&quot;, &quot;run_id&quot;: event.get(&quot;run_id&quot;)}\n                    elif event.get(&quot;state&quot;) in {&quot;FAILED&quot;, &quot;CANCELLED&quot;}:\n                        yield {&quot;type&quot;: &quot;failed&quot;, &quot;run_id&quot;: event.get(&quot;run_id&quot;)}\n                    elif &quot;out-0&quot; in event.get(&quot;outputs&quot;, {}):\n                        yield {&quot;type&quot;: &quot;answer&quot;, &quot;text&quot;: event[&quot;outputs&quot;][&quot;out-0&quot;],\n                               &quot;run_id&quot;: event.get(&quot;run_id&quot;)}\n            if not completed:\n                raise RuntimeError(&quot;Stream disconnected; inspect the saved run ID&quot;)\n</code></pre>\n<p>Implement <code>save_run</code> and <code>save_pause</code> using your application’s durable, access-controlled storage. The output ID and input key above must match your project. Send these normalized events to the browser through your application&#39;s own stream. The browser only needs to replace answer text for <code>answer</code>, show a waiting state for <code>needs_input</code>, and check the final state for <code>finished</code>. Render answer text as text, or sanitize any supported rich content; do not inject arbitrary HTML.</p>\n<p>If your authenticated backend exposes these normalized events as newline-delimited JSON at <code>/api/answer</code>, a browser client can consume them as follows. The route must authenticate the user, authorize the configured project, call <code>stream_answer</code>, and send one JSON object followed by a newline for each yielded event. Do not pass arbitrary project IDs or API keys through from the browser.</p>\n<pre><code class=\"language-javascript\">async function showAnswer(question, answerElement, statusElement) {\n  const response = await fetch(&quot;/api/answer&quot;, {\n    method: &quot;POST&quot;,\n    headers: {&quot;Content-Type&quot;: &quot;application/json&quot;},\n    body: JSON.stringify({question}),\n    credentials: &quot;same-origin&quot;,\n  });\n  if (!response.ok || !response.body) throw new Error(&quot;Could not start the answer&quot;);\n  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();\n  let pending = &quot;&quot;;\n  let finished = false;\n  while (true) {\n    const {value, done} = await reader.read();\n    if (done) break;\n    pending += value;\n    let boundary;\n    while ((boundary = pending.indexOf(&quot;\\n&quot;)) !== -1) {\n      const line = pending.slice(0, boundary);\n      pending = pending.slice(boundary + 1);\n      if (!line.trim()) continue;\n      const event = JSON.parse(line);\n      if (event.type === &quot;answer&quot;) answerElement.textContent = event.text;\n      if (event.type === &quot;needs_input&quot;) statusElement.textContent = &quot;Your response is needed&quot;;\n      if (event.type === &quot;failed&quot;) statusElement.textContent = &quot;The request could not finish&quot;;\n      if (event.type === &quot;finished&quot;) {\n        finished = true;\n        statusElement.textContent = event.state === &quot;COMPLETED&quot; ? &quot;Complete&quot;\n          : event.state === &quot;PAUSED&quot; ? &quot;Your response is needed&quot; : &quot;The request did not complete&quot;;\n      }\n    }\n  }\n  if (!finished) statusElement.textContent = &quot;Connection lost; check this request&#39;s saved status&quot;;\n}\n</code></pre>\n<p>A disconnect is not a request to execute again. Retain the run ID and query <code>/inference/v0/runs/{org_id}/{run_id}</code> for its state. This API does not document replay from an SSE <code>Last-Event-ID</code>; do not rely on automatic browser reconnection to resume at the last token.</p>\n<h3>Legacy resume</h3>\n<p>POST the resume token and human response to <code>/inference/v0/runs/{org_id}/{run_id}/resume</code>. Inline JSON, SSE, and remote resume have different backend support. Trigger-backed runs reject SSE with 406; retry the resume interface without SSE only after checking the response/state, then poll. In-process runs reject <code>execution_mode=remote</code> with 409. An out-of-band response can say <code>RESUMED</code> with no outputs while execution continues. The legacy state vocabulary includes <code>COMPLETED</code>; v2 exposes <code>succeeded</code>.</p>\n<h3>Analytics exports</h3>\n<p>GET <code>/analytics/org/{org_id}/flows/{flow_id}</code> with a personal key or supported legacy private organization key. It returns a list, using zero-based <code>page</code> and optional <code>page_size</code>, <code>start_date</code>, <code>end_date</code>, <code>user_id</code>, and comma-separated <code>state</code>. Use timezone-qualified timestamps and ensure start is not after end. State values are <code>PENDING</code>, <code>RUNNING</code>, <code>PAUSED</code>, <code>RESUMED</code>, <code>COMPLETED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>\n<p>For new run-history integrations, <code>/v2/runs</code> provides cursor pagination and lowercase statuses. A workflow result and a run-history record serve different purposes; logging controls can make run history unavailable.</p>\n<h2>Knowledge ingestion and search</h2>\n<h3>Create, upload, wait, query</h3>\n<ol>\n<li>POST <code>/v2/knowledge-bases</code> with a name and optional source/indexing configuration. Retain <code>data.knowledge_base_id</code> from the response.</li>\n<li>POST a file to <code>/v2/knowledge-bases/{knowledge_base_id}/resources</code> as multipart. Retain <code>data.resource_id</code>.</li>\n<li>GET that resource until <code>data.status</code> is <code>indexed</code>. Treat <code>error</code> as a failure requiring investigation. <code>resource</code>, <code>parsed</code>, and <code>pending</code> are not proof of search readiness; <code>pending_delete</code> and <code>deleted</code> are deletion states.</li>\n<li>POST <code>/v2/knowledge-bases/{knowledge_base_id}/query</code> and use returned passages and source metadata in your application.</li>\n</ol>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/knowledge-bases&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data &#39;{&quot;name&quot;:&quot;Support handbook&quot;,&quot;description&quot;:&quot;Approved support policies&quot;}&#39;\n\n# Set KB_ID to the returned knowledge_base_id.\ncurl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/resources&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -F &#39;file=@handbook.pdf&#39;\n\n# Set RESOURCE_ID to the returned resource_id and poll this URL.\ncurl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/resources/$RESOURCE_ID&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot;\n\ncurl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/knowledge-bases/$KB_ID/query&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data &#39;{&quot;query&quot;:&quot;What is the refund window?&quot;,&quot;top_k&quot;:5,&quot;strategy&quot;:&quot;hybrid&quot;,&quot;retrieval_type&quot;:&quot;chunks&quot;}&#39;\n</code></pre>\n<p>Upload automatically starts indexing; a 202 is acceptance, not completion. Bound polling and record the resource ID for recovery. Do not repeatedly upload the same document while waiting. The query endpoint retrieves content; it is not itself a chat/completion endpoint. Empty retrieval is a valid application condition: tell the user there is insufficient evidence rather than fabricate a sourced answer.</p>\n<h3>Choose a retrieval strategy</h3>\n<p><code>semantic</code> searches by meaning, <code>keyword</code> targets lexical matches, and <code>hybrid</code> combines them. <code>top_k</code> is 1–20, default 10. Choose a smaller result set for focused questions; increase only when your downstream context budget supports it. Preserve source attribution. Retrieved text can contain instructions from untrusted documents; treat it as evidence, not system instructions.</p>\n<h3>Connected sources and maintenance</h3>\n<p>Create or update the KB with a valid existing <code>connection_id</code> and source IDs, or supported website sources. Connection/source availability, catalog policy, embedding model access, and KB permissions can all affect admission. Source IDs are provider-specific; do not substitute a display name or an arbitrary URL.</p>\n<p>POST <code>/sync</code> for one synchronization and inspect resources afterward. A successful sync request does not mean every resource has been indexed. GET <code>/metadata-schemas</code> to inspect user and dataloader metadata shapes. GET a resource&#39;s <code>/download</code> to obtain a signed URL for the original file, and fetch that URL separately without forwarding your API key. Treat signed URLs as temporary secrets.</p>\n<p>PATCH updates selected fields; use the schema&#39;s nullability rules rather than assuming null means delete. DELETE a resource removes that resource; DELETE the KB removes the KB. Confirm IDs in your own application before destructive actions and check downstream workflows that depend on the content.</p>\n<h3>v1 compatibility</h3>\n<p>The v1 lifecycle, resource, and sync operations remain covered in the reference. Keep their original paths and response models when maintaining existing clients. New v2 clients must account for the <code>data</code> envelope, cursor fields, and additional query/download/metadata capabilities. Changing <code>/v1</code> to <code>/v2</code> without updating parsing is not a migration plan.</p>\n<h2>Providers, connections, and actions</h2>\n<p>A <strong>provider</strong> describes an integration, an <strong>action</strong> describes an operation it can perform, and a <strong>connection</strong> is an authorized instance of that integration in your organization. A trigger descriptor explains an event source; reading it does not activate a trigger.</p>\n<h3>Discover before invoking</h3>\n<ol>\n<li>GET <code>/v2/providers</code> and choose a returned provider ID.</li>\n<li>GET <code>/v2/providers/{provider_id}</code> for its details.</li>\n<li>GET <code>/v2/providers/{provider_id}/actions</code>, then GET the chosen <code>/{action_id}</code> for the actual input/output schema.</li>\n<li>GET <code>/v2/connections?provider_id=...</code> and choose an accessible compatible connection. A <code>needs_reconnection</code> status requires repair in StackAI.</li>\n<li>POST <code>/v2/providers/{provider_id}/actions/{action_id}/run</code> with <code>connection_id</code> when required and the action-specific <code>inputs</code>.</li>\n</ol>\n<pre><code class=\"language-json\">{\n  &quot;connection_id&quot;: &quot;00000000-0000-4000-8000-000000000001&quot;,\n  &quot;inputs&quot;: {&quot;ACTION_SPECIFIC_FIELD&quot;: &quot;VALUE_FROM_YOUR_APPLICATION&quot;}\n}\n</code></pre>\n<p>The UUID and field above are placeholders, not a universally valid action request. Do not infer an action&#39;s inputs from its name. Omit <code>connection_id</code> only for actions whose contract supports that. The call is synchronous; inspect returned outputs and errors.</p>\n<p>The public API lists existing connections; it does not define a connection-create operation in this contract. Establish or reconnect credentials through StackAI&#39;s supported connection flow. Users see only connections available through their roles/sharing; an empty list need not mean the organization has none.</p>\n<p>Use the trigger list/detail routes to discover configuration requirements. There is no trigger-enable operation in this public catalog. Actions can send messages, update records, or otherwise change third-party systems, so use a test connection first and reconcile ambiguous failures before retrying.</p>\n<h3>Example: read a Linear issue before routing a request</h3>\n<p>Use a connected Linear account to retrieve an issue&#39;s title and status. This is a read operation; it does not create or change an issue. First establish a Linear connection in StackAI and confirm your key has <code>connections.read</code> and <code>connections.use</code>.</p>\n<p>Discover the action&#39;s current contract and the connections available to you:</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot;\ncurl --fail-with-body -sS --get &quot;$STACKAI_BASE_URL/v2/connections&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  --data-urlencode &#39;provider_id=linear&#39;\n</code></pre>\n<p>Choose a healthy Linear connection from the returned list. Save its ID as <code>CONNECTION_ID</code>, and choose an issue that account can read. The action requires <code>issue_id</code>, which can be an issue identifier such as <code>ENG-123</code>.</p>\n<p>Create <code>linear-issue.json</code> with your actual connection and issue:</p>\n<pre><code class=\"language-json\">{&quot;connection_id&quot;:&quot;00000000-0000-4000-8000-000000000001&quot;,&quot;inputs&quot;:{&quot;issue_id&quot;:&quot;ENG-123&quot;}}\n</code></pre>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS \\\n  &quot;$STACKAI_BASE_URL/v2/providers/linear/actions/get_issue/run&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  -H &#39;Content-Type: application/json&#39; \\\n  --data-binary @linear-issue.json\n</code></pre>\n<p>The result is inside <code>data.outputs</code>. For example, an excerpt can contain:</p>\n<pre><code class=\"language-json\">{&quot;data&quot;:{&quot;outputs&quot;:{&quot;identifier&quot;:&quot;ENG-123&quot;,&quot;title&quot;:&quot;Restore customer access&quot;,&quot;status&quot;:&quot;In Progress&quot;}}}\n</code></pre>\n<p>Use <code>identifier</code>, <code>title</code>, and <code>status</code> from the response to enrich your application&#39;s routing decision. The action returns additional issue fields; consult its discovered output schema. If the connection is missing, check sharing and organization access. If it needs reconnection, repair it in StackAI. If the issue is inaccessible, use an issue the connected Linear account can read.</p>\n<h2>Evaluations and monitors</h2>\n<h3>Example: verify a request classifier before release</h3>\n<p>Suppose a workflow routes requests by returning a category such as <code>billing</code>. Check that a saved version still classifies a known billing request correctly. An exact-match evaluator is appropriate because the result is a category, not free-form prose.</p>\n<p>Use a project with one selected input and one selected output. Set <code>PROJECT_ID</code>, <code>PROJECT_VERSION</code>, and <code>STACKAI_API_KEY</code> as in the quickstart. Read <code>/v2/projects/{project_id}/io-schema?version={saved-version}</code> first. Replace <code>in-0</code>, <code>out-0</code>, and <code>legacy_input_nodes</code> in every body below with the returned contract. Use a key with the required <code>projects.read</code>, <code>evals.read</code>, <code>evals.create</code>, <code>evals.update</code>, and <code>evals.run</code> permissions, plus access to the project.</p>\n<p>This Python example uses <code>httpx</code>. It creates one dataset, one rule evaluator, and one experiment, then runs and reads them. It does not automatically retry writes.</p>\n<pre><code class=\"language-python\">import os\nimport time\nimport httpx\n\nproject_id = os.environ[&quot;PROJECT_ID&quot;]\nversion = int(os.environ[&quot;PROJECT_VERSION&quot;])\ncontract = {&quot;input_kind&quot;: &quot;legacy_input_nodes&quot;,\n            &quot;input_keys&quot;: [&quot;in-0&quot;], &quot;output_node_ids&quot;: [&quot;out-0&quot;]}\nheaders = {&quot;Authorization&quot;: f&quot;Bearer {os.environ[&#39;STACKAI_API_KEY&#39;]}&quot;}\nwith httpx.Client(base_url=os.environ[&quot;STACKAI_BASE_URL&quot;].rstrip(&quot;/&quot;),\n                  headers=headers, timeout=30) as client:\n    def post(path, body):\n        response = client.post(path, json=body)\n        response.raise_for_status()\n        return response.json()[&quot;data&quot;]\n\n    dataset = post(&quot;/v2/evals/datasets&quot;, {\n        &quot;project_id&quot;: project_id, &quot;name&quot;: &quot;Request classification&quot;,\n        &quot;node_contract&quot;: contract,\n    })\n    dataset_id = dataset[&quot;dataset_id&quot;]\n    print(&quot;Save dataset:&quot;, dataset_id)\n    post(f&quot;/v2/evals/datasets/{dataset_id}/rows&quot;, {&quot;rows&quot;: [{\n        &quot;inputs&quot;: {&quot;in-0&quot;: &quot;I was charged twice for my subscription.&quot;},\n        &quot;expected_output&quot;: {&quot;out-0&quot;: &quot;billing&quot;},\n    }]})\n    evaluator = post(&quot;/v2/evals/evaluators&quot;, {\n        &quot;project_id&quot;: project_id, &quot;name&quot;: &quot;Correct request category&quot;,\n        &quot;evaluator_type&quot;: &quot;builtin_rule&quot;, &quot;node_contract&quot;: contract,\n        &quot;config&quot;: {&quot;rule&quot;: &quot;exact_match&quot;, &quot;target_output_node_id&quot;: &quot;out-0&quot;},\n    })\n    evaluator_id = evaluator[&quot;evaluator_id&quot;]\n    print(&quot;Save evaluator:&quot;, evaluator_id)\n    experiment = post(&quot;/v2/evals/experiments&quot;, {\n        &quot;dataset_id&quot;: dataset_id, &quot;project_version_id&quot;: version,\n        &quot;evaluator_ids&quot;: [evaluator_id], &quot;name&quot;: &quot;Saved-version category check&quot;,\n    })\n    experiment_id = experiment[&quot;experiment_id&quot;]\n    print(&quot;Save experiment:&quot;, experiment_id)\n    job = post(f&quot;/v2/evals/experiments/{experiment_id}/jobs&quot;, {\n        &quot;mode&quot;: &quot;generate&quot;, &quot;evaluator_ids&quot;: [evaluator_id],\n    })\n    job_id = job[&quot;job_id&quot;]\n    print(&quot;Save job:&quot;, job_id)\n    deadline = time.monotonic() + 300\n    while job[&quot;status&quot;] in {&quot;queued&quot;, &quot;running&quot;}:\n        if time.monotonic() &gt;= deadline:\n            raise TimeoutError(f&quot;Inspect existing job {job_id}; do not start another&quot;)\n        time.sleep(2)\n        response = client.get(\n            f&quot;/v2/evals/experiments/{experiment_id}/jobs/{job_id}&quot;)\n        response.raise_for_status()\n        job = response.json()[&quot;data&quot;]\n    print(&quot;Job status:&quot;, job[&quot;status&quot;])\n    response = client.get(f&quot;/v2/evals/experiments/{experiment_id}/rows&quot;)\n    response.raise_for_status()\n    print(response.json())\n</code></pre>\n<p>Read each row&#39;s <code>generated_output</code>, <code>status</code>, <code>error</code>, and <code>scores</code>. A matching output <code>{&quot;out-0&quot;:&quot;billing&quot;}</code> receives an exact-match score of <code>1</code>; a different category receives <code>0</code>. A score of <code>0</code> is a completed comparison, not an execution error. A failed scoring status means the comparison could not complete—for example, because an expected value was missing. Inspect job and row errors before judging quality.</p>\n<p>One case checks only one behavior. Add representative inputs and known correct categories to the dataset, then create another experiment for the version you want to compare. Experiments snapshot the dataset: editing it later does not change an existing experiment. Use a semantic or judge-based evaluator when more than one wording can be correct.</p>\n<h3>Job lifecycle and conflicts</h3>\n<p>202 means the job was queued. Terminal statuses are <code>completed</code>, <code>completed_with_failures</code>, <code>failed</code>, and <code>cancelled</code>. Inspect row-level failures even if some outputs succeeded. Only one job may be active per experiment: a 409 can include the active job&#39;s Location/status URL and IDs in metadata. Follow that job instead of repeatedly creating jobs. A 503 on a job read means live state is temporarily unavailable; retry that GET.</p>\n<p>Dataset detail reads expose contract-drift warnings. Dataset PATCH can re-key rows against a replacement contract; inspect the update body before using it as a simple rename. Evaluator config changes create immutable versions when material. Explicit null clears a row&#39;s expected output and clears experiment notes where documented; omitted fields remain unchanged.</p>\n<p>Deleting a dataset also removes its rows and experiments. Deleting an experiment removes its snapshot rows and scores. Evaluator deletion is soft and preserves historical scores. These operations have different retention semantics.</p>\n<h3>Monitor production quality</h3>\n<p>GET <code>/v2/evals/monitor-limits</code> first. Choose a reference-free evaluator and POST a monitor with the project, evaluator, sampling rate, and daily cap. Current schema bounds sampling to greater than zero and at most 0.3 and the daily cap to 1–1000; use the limits endpoint rather than hard-coding policy forever.</p>\n<p>Read/update the monitor, inspect <code>/v2/evals/monitors/{monitor_id}/score-stats</code>, tune <code>/v2/evals/monitors/{monitor_id}/alert</code>, and traverse <code>/v2/evals/monitors/{monitor_id}/sampled-runs</code>. Windows are <code>24h</code>, <code>7d</code>, <code>30d</code>, or <code>all</code>. Explicit null on an alert knob resets it to the server default; omit it to keep the stored setting. Sampled-run traversal preserves an insertion cutoff. Deleting the monitor retains scores already present in run history.</p>\n<h3>Score individual runs</h3>\n<p>POST <code>/v2/evals/runs/{run_id}/scores</code> using a reference-free evaluator. This appends a score; it does not overwrite history, so retries can create additional scores. List the run&#39;s scores (oldest first) or GET a specific <code>/v2/evals/scores/{score_id}</code>. Trace-backed scoring and score reads require analytics access in addition to their evaluation permissions.</p>\n<h2>Skills and versioned bundles</h2>\n<p>Skills package reusable instructions and supporting files. GET <code>/v2/skills</code> to discover visible built-in and organization skills. GET a skill for its current published instructions/manifest; GET <code>/versions</code> and a numbered version for reproducible integrations.</p>\n<h3>Publish a first version</h3>\n<p>Use multipart form fields for a simple skill:</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS &quot;$STACKAI_BASE_URL/v2/skills&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_API_KEY&quot; \\\n  --form-string &#39;name=policy-summary&#39; \\\n  --form-string &#39;description=Summarize approved policy text with citations&#39; \\\n  --form-string &#39;instructions=Summarize only the provided policy. Cite the source and state when evidence is missing.&#39;\n</code></pre>\n<p>For a bundle, send repeated <code>files</code> parts whose filenames preserve relative POSIX paths, or a single zip. Include the bundle&#39;s <code>SKILL.md</code> and valid supporting files. Do not use absolute paths or traversal paths in the bundle. Use the endpoint&#39;s validation errors to fix invalid or oversized bundles; no universal upload-size allowance is promised here.</p>\n<h3>Publish and pin revisions</h3>\n<p>POST <code>/v2/skills/{skill_id}/versions</code> to publish another version. Repeat <code>carry_paths</code> to retain selected files, and set <code>base_version</code> to the version to copy from when needed; otherwise it uses the current version. Unmentioned files are not a substitute for explicitly carried files. Supplying a changed name can rename the skill when publishing.</p>\n<p>Save the skill ID and returned version number. Fetch that exact version when reproducibility matters instead of always using latest. Version numbers are 1-based. Conflicting names or versions can produce 409. DELETE removes an owned skill and all its versions; organization administrators may delete other organization skills. Do not treat deletion as an unpublish operation for just one version.</p>\n<h2>Webhooks and signed event delivery</h2>\n<h3>Register and store the secret</h3>\n<p>POST <code>/v2/webhooks/subscriptions</code> with your HTTPS URL and desired event types:</p>\n<pre><code class=\"language-json\">{\n  &quot;url&quot;:&quot;https://your-service.example.com/webhooks/stackai&quot;,\n  &quot;event_types&quot;:[&quot;run.succeeded&quot;,&quot;run.failed&quot;]\n}\n</code></pre>\n<p>Use an authorized credential with <code>org.webhooks.manage</code>. Store the signing secret returned at creation immediately; list responses cannot recover it. To replace a lost secret, create a replacement subscription and retire the old one carefully. There is no PATCH subscription operation in this contract.</p>\n<h3>Completion notifications and availability</h3>\n<p>Use <code>GET /v2/runs/{run_id}</code> as the supported way to observe a workflow&#39;s completion. Creating a webhook subscription stores its URL and selected event names; it does not enable run-event delivery. Do not replace polling with a subscription when building a run-status integration.</p>\n<table>\n<thead>\n<tr>\n<th>Capability</th>\n<th>What you can rely on</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Create, list, and delete subscriptions</td>\n<td>Manage the URL and accepted event types through the subscription endpoints</td>\n</tr>\n<tr>\n<td>Observe completion of a run</td>\n<td>Poll the run until it reaches a terminal status</td>\n</tr>\n<tr>\n<td>Receive a run lifecycle notification</td>\n<td>Subscription creation alone does not establish this capability; it is not a replacement for run polling</td>\n</tr>\n<tr>\n<td>Replay a delivery or inspect delivery history</td>\n<td>No public replay or delivery-history endpoint is provided</td>\n</tr>\n</tbody></table>\n<p>Accepted subscription event names are <code>run.started</code>, <code>run.step.succeeded</code>, <code>run.step.failed</code>, <code>run.succeeded</code>, <code>run.failed</code>, and <code>run.cancelled</code>. These names describe subscription filters, not a guarantee that an event will be produced for every run. The receiver guidance below applies when webhook deliveries are enabled for your deployment.</p>\n<h3>Authenticate deliveries, then deduplicate</h3>\n<p>Deliveries use the Standard Webhooks headers <code>webhook-id</code>, <code>webhook-timestamp</code>, and <code>webhook-signature</code>. Verify against the exact raw request body and the subscription&#39;s <code>whsec_...</code> secret before parsing or processing. Use a Standard Webhooks verifier with timestamp validation; JSON reserialization changes the bytes and can break verification.</p>\n<p>Conceptual Python handler logic with the <code>standardwebhooks</code> package:</p>\n<pre><code class=\"language-python\">from standardwebhooks.webhooks import Webhook\n\n# raw_body and headers come from your HTTP framework.\n# secret comes from your secret manager, never from the incoming request.\nverified_event = Webhook(secret).verify(raw_body, headers)\nevent_id = headers[&quot;webhook-id&quot;]\n# Atomically persist event_id and enqueue work only if it is new.\n# Return 2xx after durable acceptance; process the work asynchronously.\n</code></pre>\n<p>Catch verification errors and reject invalid requests. Use durable, atomic deduplication; an in-memory set is insufficient across workers or restarts. Preserve the verified event&#39;s ID with your processing record. Retries reuse the same event ID and body. Do not assume event order or exactly-once delivery.</p>\n<p>Successful 2xx responses acknowledge delivery. Redirects are not followed. Retryable client/server failures and transport failures can be retried; the current implementation has a bounded ladder of up to ten attempts with jitter. Return a suitable transient failure when you cannot durably accept work, rather than 200 and silently losing it. A 503 with numeric Retry-After can influence retry timing within server limits.</p>\n<p>GET subscriptions to inventory active endpoints; DELETE a subscription to stop deliveries and remove it from that list. There is no public delivery-history or replay endpoint in this contract.</p>\n<h2>SCIM 2.0 provisioning</h2>\n<p>SCIM is a separate externally facing identity-management surface under <code>/scim/v2</code>. Configure it through your identity provider and StackAI&#39;s SCIM settings. Use the dedicated SCIM bearer token and <code>application/scim+json</code> payloads for provisioning; normal workflow API keys are not interchangeable. See the existing <a href=\"https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-in-stackai/system-for-cross-domain-identity-management-scim\">StackAI SCIM setup guide</a>.</p>\n<p>Use the discovery endpoints below to read the SCIM capabilities and schemas available in your deployment. SCIM responses follow their own protocol rather than the REST v2 envelope.</p>\n<table>\n<thead>\n<tr>\n<th>Method</th>\n<th>Path</th>\n<th>Usage</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>GET</td>\n<td><code>/scim/v2/ServiceProviderConfig</code></td>\n<td>Discover supported provisioning capabilities before configuring the IdP</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/ResourceTypes</code></td>\n<td>Discover Users and Groups resource types</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/ResourceTypes/{resource_type_id}</code></td>\n<td>Read one resource-type descriptor</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Schemas</code></td>\n<td>Discover schema attributes and extensions</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Schemas/{schema_id}</code></td>\n<td>Read a specific schema URI</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Users</code></td>\n<td>List/filter users with <code>startIndex</code> and <code>count</code></td>\n</tr>\n<tr>\n<td>POST</td>\n<td><code>/scim/v2/Users</code></td>\n<td>Provision a user from a SCIM user body; retain returned ID</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Users/{user_id}</code></td>\n<td>Read the provisioned user by SCIM ID</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td><code>/scim/v2/Users/{user_id}</code></td>\n<td>Replace the user&#39;s supported attributes using a complete desired representation</td>\n</tr>\n<tr>\n<td>PATCH</td>\n<td><code>/scim/v2/Users/{user_id}</code></td>\n<td>Apply SCIM PatchOp operations, such as updating active state</td>\n</tr>\n<tr>\n<td>DELETE</td>\n<td><code>/scim/v2/Users/{user_id}</code></td>\n<td>Deprovision the user; treat this as an access-changing action</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Groups</code></td>\n<td>List/filter groups; use the returned SCIM IDs</td>\n</tr>\n<tr>\n<td>POST</td>\n<td><code>/scim/v2/Groups</code></td>\n<td>Create a group and supported membership representation</td>\n</tr>\n<tr>\n<td>GET</td>\n<td><code>/scim/v2/Groups/{group_id}</code></td>\n<td>Read a group and its members</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td><code>/scim/v2/Groups/{group_id}</code></td>\n<td>Replace the supported group representation</td>\n</tr>\n<tr>\n<td>PATCH</td>\n<td><code>/scim/v2/Groups/{group_id}</code></td>\n<td>Add/remove members with SCIM PatchOp semantics</td>\n</tr>\n<tr>\n<td>DELETE</td>\n<td><code>/scim/v2/Groups/{group_id}</code></td>\n<td>Delete the group; review membership/access effects first</td>\n</tr>\n</tbody></table>\n<p>Read discovery → match existing users by a supported filter → create or update → reconcile group membership → verify by GET → deprovision when the IdP revokes access. User filters include <code>userName eq &quot;person@example.com&quot;</code>, <code>externalId eq &quot;idp-id&quot;</code>, and supported email filters. URL-encode the filter. Pagination is 1-based; <code>count=0</code> requests totals without Resources. A SCIM ID, an external IdP ID, and a StackAI project/user identifier should not be guessed interchangeable.</p>\n<pre><code class=\"language-bash\">curl --fail-with-body -sS --get &quot;$STACKAI_BASE_URL/scim/v2/Users&quot; \\\n  -H &quot;Authorization: Bearer $STACKAI_SCIM_TOKEN&quot; \\\n  -H &#39;Accept: application/scim+json&#39; \\\n  --data-urlencode &#39;filter=userName eq &quot;person@example.com&quot;&#39; \\\n  --data-urlencode &#39;startIndex=1&#39; --data-urlencode &#39;count=100&#39;\n</code></pre>\n<p>SCIM error responses and <code>Resources</code>/<code>totalResults</code> pagination follow the provisioning protocol, not the v2 REST <code>data</code> envelope. Do not use the generic REST client&#39;s parsing rules without a SCIM adapter.</p>\n<h2>Troubleshooting and production checklist</h2>\n<table>\n<thead>\n<tr>\n<th>Symptom</th>\n<th>Check first</th>\n<th>Next action</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>401</td>\n<td>Correct Bearer syntax, credential type, expiry/revocation, organization</td>\n<td>Replace/refresh through the supported credential flow; do not retry unchanged credentials</td>\n</tr>\n<tr>\n<td>403</td>\n<td>Key scopes, owner&#39;s permissions, resource/folder access, publication or logging rules</td>\n<td>Inspect the endpoint and error metadata; request only the missing permission</td>\n</tr>\n<tr>\n<td>404</td>\n<td>Correct deployment, resource ID, organization, saved version, resource access</td>\n<td>Verify the ID with an authorized read; absence may intentionally conceal access</td>\n</tr>\n<tr>\n<td>400/422</td>\n<td>JSON shape, extra fields, required keys, enum values, UUIDs, multipart names</td>\n<td>Compare with the exact endpoint schema; preserve safe field-level errors</td>\n</tr>\n<tr>\n<td>402 on run start/resume</td>\n<td>Organization usage allowance</td>\n<td>Resolve the usage limit before trying again</td>\n</tr>\n<tr>\n<td>409</td>\n<td>Active job, already-resumed run, cancellation state, name/version collision</td>\n<td>Read current state; do not blindly repeat the write</td>\n</tr>\n<tr>\n<td>406 on legacy resume</td>\n<td>SSE requested for a trigger-backed continuation</td>\n<td>Use the supported non-SSE/polling path</td>\n</tr>\n<tr>\n<td>429</td>\n<td>Deployment throttling</td>\n<td>Back off, honor Retry-After when available, lower concurrency</td>\n</tr>\n<tr>\n<td>500 after a write</td>\n<td>Side effect may already have occurred</td>\n<td>Reconcile existing runs/resources before retrying</td>\n</tr>\n<tr>\n<td>503 on run reservation</td>\n<td>Dispatch did not occur according to this route&#39;s contract</td>\n<td>Retry within a bounded policy</td>\n</tr>\n<tr>\n<td>503 on eval job GET</td>\n<td>Live job state temporarily unavailable</td>\n<td>Retry the same status URL, not job creation</td>\n</tr>\n<tr>\n<td>Empty KB search</td>\n<td>Indexing status, source access, query strategy, actual content</td>\n<td>Wait for indexed resources and test with a known document phrase</td>\n</tr>\n<tr>\n<td>Empty connection list</td>\n<td>Provider filter and connection sharing</td>\n<td>Check access in StackAI and reconnect degraded entries</td>\n</tr>\n<tr>\n<td>Missing pause payload</td>\n<td>Read and run permissions both present</td>\n<td>Use a credential permitted to resume; keep the token out of logs</td>\n</tr>\n</tbody></table>\n<p>Log method, route template, status, safe error code, latency, and returned resource IDs. Redact authorization, resume tokens, webhook secrets, signed URLs, and sensitive input/output. The public error envelope can contain <code>errors</code>, <code>detail</code>, <code>response_code</code>, and <code>meta</code>; legacy responses can differ. Do not assume every exception conforms to one JSON shape.</p>\n<p>Before shipping: test against a nonproduction project; pin the intended saved workflow version; validate the input contract; configure timeouts and safe retry limits; persist asynchronous IDs; verify all terminal states and pauses; exercise pagination beyond one page; check key revocation; and test your webhook signature/deduplication path if used.</p>\n<p>No universal numeric request-rate, execution-time, or file-size limit is asserted by this documentation. Use schema-enforced bounds, deployment policy, and observed response headers. Do not infer an SLA or supported SDK from illustrative HTTP examples.</p>\n<h2>Versioning, coverage, and OpenAPI</h2>\n<p>The API version is part of the route. Keep an existing v1 client on v1 parsing until you intentionally migrate it. Use v2 for the capabilities it supports; use the inference interface when you need its inline response or streaming contract. Calling an interface legacy does not by itself announce a retirement date.</p>\n<p>Before changing versions, compare the authentication method, input body, response envelope, pagination, status values, and project-version selector. For example, v2 run creation accepts <code>{project_id, project_version, input}</code>, while inference accepts the input map itself. A v2 <code>project_version</code> of <code>-1</code> selects a draft; an inference <code>version</code> of <code>-1</code> selects published content.</p>\n<p>Download the OpenAPI specification to generate a client or validate request and response shapes. Its document version is separate from both route versions and saved project versions. Examples show the documented shapes; replace project IDs, connection IDs, and input keys with your own values. The reference covers the public operations listed in its navigation. Undocumented browser routes and provider authorization callbacks are not public integration endpoints.</p>\n"},"paths":{"/inference/v0/runs/{org_id}/{run_id}":{"get":{"tags":["endpoint-getRun"],"summary":"Get Run","description":"Get the status of a run, including the human-in-the-loop pause when waiting.\n\n**How to use**\n\nUse this to observe a legacy run or retrieve its pause context. Read `state` and `pause` from this response, not the v2 `data.status`/`pending_input` fields. Terminal legacy success is `COMPLETED`.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.read`. Resource and owner access checks also apply.","operationId":"getRun","security":[{"LegacyAPIKeyBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run ID to fetch the status for.","title":"Run Id","x-gitbook-description-html":"<p>The run ID to fetch the status for.</p>\n"},"description":"The run ID to fetch the status for.","x-gitbook-description-html":"<p>The run ID to fetch the status for.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatusResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"404":{"description":"Run not found or does not belong to this organization","x-gitbook-description-html":"<p>Run not found or does not belong to this organization</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scope":"projects.read","x-required-scopes":["projects.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/runs/${ORG_ID}/${RUN_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get the status of a run, including the human-in-the-loop pause when waiting.</p>\n<p><strong>How to use</strong></p>\n<p>Use this to observe a legacy run or retrieve its pause context. Read <code>state</code> and <code>pause</code> from this response, not the v2 <code>data.status</code>/<code>pending_input</code> fields. Terminal legacy success is <code>COMPLETED</code>.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.read</code>. Resource and owner access checks also apply.</p>\n"}},"/inference/v0/runs/{org_id}/{run_id}/resume":{"post":{"tags":["endpoint-resumeRun"],"summary":"Resume Run","description":"Resume a paused run that is waiting on a human-in-the-loop response.\n\n**How to use**\n\nRead the current pause first and submit its token with the actual human answer. A `RESUMED` response can be nonterminal. Remote resume is only supported for out-of-band execution; SSE is not supported for trigger-backed runs. Inspect 406/409 responses before choosing a supported continuation mode.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"resume_token\": \"TOKEN_FROM_PAUSE\",\n  \"response\": \"THE_HUMAN_ANSWER\"\n}\n```","operationId":"resumeRun","security":[{"LegacyAPIKeyBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The paused run ID to resume.","title":"Run Id","x-gitbook-description-html":"<p>The paused run ID to resume.</p>\n"},"description":"The paused run ID to resume.","x-gitbook-description-html":"<p>The paused run ID to resume.</p>\n"},{"name":"verbose","in":"query","required":false,"schema":{"type":"boolean","description":"Return the full model when streaming an in-process resume over SSE.","default":true,"title":"Verbose","x-gitbook-description-html":"<p>Return the full model when streaming an in-process resume over SSE.</p>\n"},"description":"Return the full model when streaming an in-process resume over SSE.","x-gitbook-description-html":"<p>Return the full model when streaming an in-process resume over SSE.</p>\n"},{"name":"execution_mode","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ExecutionMode"},{"type":"null"}],"description":"Set to 'remote' to watch the continuation over a WebSocket (202 + handle) instead of blocking on this request; only valid for runs that resume out of band (Temporal/trigger) — sending it for an in-process run returns 409. Omit to resume inline (JSON, or SSE when the request sends Accept: text/event-stream).","title":"Execution Mode","x-gitbook-description-html":"<p>Set to &#39;remote&#39; to watch the continuation over a WebSocket (202 + handle) instead of blocking on this request; only valid for runs that resume out of band (Temporal/trigger) — sending it for an in-process run returns 409. Omit to resume inline (JSON, or SSE when the request sends Accept: text/event-stream).</p>\n"},"description":"Set to 'remote' to watch the continuation over a WebSocket (202 + handle) instead of blocking on this request; only valid for runs that resume out of band (Temporal/trigger) — sending it for an in-process run returns 409. Omit to resume inline (JSON, or SSE when the request sends Accept: text/event-stream).","x-gitbook-description-html":"<p>Set to &#39;remote&#39; to watch the continuation over a WebSocket (202 + handle) instead of blocking on this request; only valid for runs that resume out of band (Temporal/trigger) — sending it for an in-process run returns 409. Omit to resume inline (JSON, or SSE when the request sends Accept: text/event-stream).</p>\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeRunRequest","description":"Resume token plus the human response to inject into the paused run.","x-gitbook-description-html":"<p>Resume token plus the human response to inject into the paused run.</p>\n"},"example":{"resume_token":"TOKEN_FROM_PAUSE","response":"THE_HUMAN_ANSWER"}}}},"responses":{"200":{"description":"Returns the run-result envelope (same shape as a normal run): in-memory runs resume synchronously with a terminal state + outputs; out-of-band (Temporal/trigger) runs return state=RESUMED with empty outputs, and the client polls GET /runs/{org_id}/{run_id} for completion. With Accept: text/event-stream the continuation streams back as SSE for in-process and live Temporal runs (trigger-backed runs return 406).","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}},"x-gitbook-description-html":"<p>Returns the run-result envelope (same shape as a normal run): in-memory runs resume synchronously with a terminal state + outputs; out-of-band (Temporal/trigger) runs return state=RESUMED with empty outputs, and the client polls GET /runs/{org_id}/{run_id} for completion. With Accept: text/event-stream the continuation streams back as SSE for in-process and live Temporal runs (trigger-backed runs return 406).</p>\n"},"202":{"description":"Returned with execution_mode=remote and no Accept: text/event-stream on a durable run: the continuation runs in the background; the body carries the run_id and a WebSocket handle. Watch the room or poll GET /runs/{org_id}/{run_id} for completion.","x-gitbook-description-html":"<p>Returned with execution_mode=remote and no Accept: text/event-stream on a durable run: the continuation runs in the background; the body carries the run_id and a WebSocket handle. Watch the room or poll GET /runs/{org_id}/{run_id} for completion.</p>\n"},"401":{"description":"Invalid or expired resume token","x-gitbook-description-html":"<p>Invalid or expired resume token</p>\n"},"403":{"description":"Run is paused on a step not resumable via the public API (only ask-human pauses are supported).","x-gitbook-description-html":"<p>Run is paused on a step not resumable via the public API (only ask-human pauses are supported).</p>\n"},"404":{"description":"Run not found or does not belong to this organization","x-gitbook-description-html":"<p>Run not found or does not belong to this organization</p>\n"},"406":{"description":"Accept: text/event-stream was sent for a trigger-backed run, which has no event stream to relay. Retry without the Accept header and poll GET /runs/{org_id}/{run_id}, or pass execution_mode=remote for a 202 + WebSocket handle.","x-gitbook-description-html":"<p>Accept: text/event-stream was sent for a trigger-backed run, which has no event stream to relay. Retry without the Accept header and poll GET /runs/{org_id}/{run_id}, or pass execution_mode=remote for a 202 + WebSocket handle.</p>\n"},"409":{"description":"Run is not paused/resumable, or execution_mode=remote was sent for an in-process run that can only resume inline.","x-gitbook-description-html":"<p>Run is not paused/resumable, or execution_mode=remote was sent for an in-process run that can only resume inline.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scope":"projects.run","x-required-scopes":["projects.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/runs/${ORG_ID}/${RUN_ID}/resume\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Resume a paused run that is waiting on a human-in-the-loop response.</p>\n<p><strong>How to use</strong></p>\n<p>Read the current pause first and submit its token with the actual human answer. A <code>RESUMED</code> response can be nonterminal. Remote resume is only supported for out-of-band execution; SSE is not supported for trigger-backed runs. Inspect 406/409 responses before choosing a supported continuation mode.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;resume_token&quot;: &quot;TOKEN_FROM_PAUSE&quot;,\n  &quot;response&quot;: &quot;THE_HUMAN_ANSWER&quot;\n}\n</code></pre>\n"}},"/inference/v0/run/{org_id}/{flow_id}":{"post":{"tags":["endpoint-runDeployedFlow"],"summary":"Run Deployed Flow","description":"Run a flow and get the result.\n\n**How to use**\n\nSend the workflow input map as the entire JSON body. The flow must be published. Omit `execution_mode` for inline JSON or SSE; request `remote` without SSE for a 202 background handle. Do not resend after a timeout without checking whether execution started.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"in-0\": \"Summarize our refund policy\"\n}\n```","operationId":"runDeployedFlow","security":[{"LegacyAPIKeyBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","title":"Flow Id","x-gitbook-description-html":"<p>The flow ID. <a href=\"/docs/api-reference/how-to-get-flow-id\">Learn how to get it</a>.</p>\n"},"description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","x-gitbook-description-html":"<p>The flow ID. <a href=\"/docs/api-reference/how-to-get-flow-id\">Learn how to get it</a>.</p>\n"},{"name":"version","in":"query","required":false,"schema":{"type":"integer","description":"Version of the flow","default":-1,"title":"Version","x-gitbook-description-html":"<p>Version of the flow</p>\n"},"description":"Version of the flow","x-gitbook-description-html":"<p>Version of the flow</p>\n"},{"name":"verbose","in":"query","required":false,"schema":{"type":"boolean","description":"Return the full model","default":true,"title":"Verbose","x-gitbook-description-html":"<p>Return the full model</p>\n"},"description":"Return the full model","x-gitbook-description-html":"<p>Return the full model</p>\n"},{"name":"delta","in":"query","required":false,"schema":{"type":"boolean","description":"Stream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).","default":true,"title":"Delta","x-gitbook-description-html":"<p>Stream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).</p>\n"},"description":"Stream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).","x-gitbook-description-html":"<p>Stream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).</p>\n"},{"name":"prefix","in":"query","required":false,"schema":{"type":"boolean","description":"Add a prefix to the output. Only applies when streaming (Accept: text/event-stream).","default":false,"title":"Prefix","x-gitbook-description-html":"<p>Add a prefix to the output. Only applies when streaming (Accept: text/event-stream).</p>\n"},"description":"Add a prefix to the output. Only applies when streaming (Accept: text/event-stream).","x-gitbook-description-html":"<p>Add a prefix to the output. Only applies when streaming (Accept: text/event-stream).</p>\n"},{"name":"execution_mode","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ExecutionMode"},{"type":"null"}],"description":"Set to 'remote' to run durably in the background and receive a 202 with a WebSocket handle. Omit for inline execution (JSON, or SSE when the request sends Accept: text/event-stream).","title":"Execution Mode","x-gitbook-description-html":"<p>Set to &#39;remote&#39; to run durably in the background and receive a 202 with a WebSocket handle. Omit for inline execution (JSON, or SSE when the request sends Accept: text/event-stream).</p>\n"},"description":"Set to 'remote' to run durably in the background and receive a 202 with a WebSocket handle. Omit for inline execution (JSON, or SSE when the request sends Accept: text/event-stream).","x-gitbook-description-html":"<p>Set to &#39;remote&#39; to run durably in the background and receive a 202 with a WebSocket handle. Omit for inline execution (JSON, or SSE when the request sends Accept: text/event-stream).</p>\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Input parameters for the flow","title":"Inputs","x-gitbook-description-html":"<p>Input parameters for the flow</p>\n"},"example":{"in-0":"Summarize our refund policy"}}}},"responses":{"200":{"description":"The run-result envelope (same InferenceResponse shape as resume): a terminal state + outputs, or state=PAUSED with the pause payload when the run pauses on a human-in-the-loop step. With Accept: text/event-stream the run streams back as SSE InferenceResponse frames instead.","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}},"x-gitbook-description-html":"<p>The run-result envelope (same InferenceResponse shape as resume): a terminal state + outputs, or state=PAUSED with the pause payload when the run pauses on a human-in-the-loop step. With Accept: text/event-stream the run streams back as SSE InferenceResponse frames instead.</p>\n"},"202":{"description":"Returned with execution_mode=remote and no Accept: text/event-stream: the run executes durably in the background; the body carries the run_id and a WebSocket handle to stream updates. Poll GET /runs/{org_id}/{run_id} for the terminal state.","x-gitbook-description-html":"<p>Returned with execution_mode=remote and no Accept: text/event-stream: the run executes durably in the background; the body carries the run_id and a WebSocket handle to stream updates. Poll GET /runs/{org_id}/{run_id} for the terminal state.</p>\n"},"403":{"description":"Project is not published","x-gitbook-description-html":"<p>Project is not published</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scope":"projects.run","x-required-scopes":["projects.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/inference/v0/run/${ORG_ID}/${FLOW_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Run a flow and get the result.</p>\n<p><strong>How to use</strong></p>\n<p>Send the workflow input map as the entire JSON body. The flow must be published. Omit <code>execution_mode</code> for inline JSON or SSE; request <code>remote</code> without SSE for a 202 background handle. Do not resend after a timeout without checking whether execution started.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;in-0&quot;: &quot;Summarize our refund policy&quot;\n}\n</code></pre>\n"}},"/v1/knowledge-bases/{knowledge_base_id}/resources":{"get":{"tags":["endpoint-listKnowledgeBaseResources"],"summary":"List Resources","description":"List files in the knowledge base with optional cursor pagination.\n\n**How to use**\n\nList resources and inspect processing status. Use cursor pagination and retain resource_id for detail reads. Do not treat a listed pending/parsed resource as indexed.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"listKnowledgeBaseResources","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["NTUwZTg0MDAtZTI5Yi00MWQ0LWE3MTYtNDQ2NjU1NDQwMDAw"],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResourcesResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List files in the knowledge base with optional cursor pagination.</p>\n<p><strong>How to use</strong></p>\n<p>List resources and inspect processing status. Use cursor pagination and retain resource_id for detail reads. Do not treat a listed pending/parsed resource as indexed.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-uploadKnowledgeBaseResource"],"summary":"Create Resource","description":"Upload a file directly to a knowledge base and start indexing.\n\nThis endpoint allows API users to upload files directly without needing to use\npresigned URLs. The file is uploaded to storage and indexing is started automatically.\nReturns the resource ID so callers can poll for indexing status.\n\n**How to use**\n\nUpload multipart field file (singular). Indexing starts automatically. Save the resource_id from the 202 response and poll resource GET until indexed or error. Do not set the multipart boundary yourself or re-upload while waiting.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.index`. Resource and owner access checks also apply.","operationId":"uploadKnowledgeBaseResource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_uploadKnowledgeBaseResource"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceUploadResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.index"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -F 'file=@document.pdf'"}],"x-gitbook-description-html":"<p>Upload a file directly to a knowledge base and start indexing.</p>\n<p>This endpoint allows API users to upload files directly without needing to use\npresigned URLs. The file is uploaded to storage and indexing is started automatically.\nReturns the resource ID so callers can poll for indexing status.</p>\n<p><strong>How to use</strong></p>\n<p>Upload multipart field file (singular). Indexing starts automatically. Save the resource_id from the 202 response and poll resource GET until indexed or error. Do not set the multipart boundary yourself or re-upload while waiting.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.index</code>. Resource and owner access checks also apply.</p>\n"}},"/v1/knowledge-bases/{knowledge_base_id}/resources/{resource_id}":{"get":{"tags":["endpoint-getKnowledgeBaseResource"],"summary":"Get Resource By Id","description":"Get one file resource by ID from the knowledge base.\n\n**How to use**\n\nPoll this after upload/sync. indexed indicates readiness; error needs investigation. pending_delete/deleted should not be treated as available search content.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBaseResource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFileResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get one file resource by ID from the knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Poll this after upload/sync. indexed indicates readiness; error needs investigation. pending_delete/deleted should not be treated as available search content.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"delete":{"tags":["endpoint-deleteKnowledgeBaseResource"],"summary":"Delete Resource By Id","description":"Delete a file resource by ID.\n\n**How to use**\n\nDelete the specified resource from its KB. Verify both IDs before removing content used by downstream retrieval. A 204 has no body.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.delete`. Resource and owner access checks also apply.","operationId":"deleteKnowledgeBaseResource","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Resource Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a file resource by ID.</p>\n<p><strong>How to use</strong></p>\n<p>Delete the specified resource from its KB. Verify both IDs before removing content used by downstream retrieval. A 204 has no body.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v1/knowledge-bases/{knowledge_base_id}/sync":{"post":{"tags":["endpoint-syncKnowledgeBase"],"summary":"Synchronize Knowledge Base","description":"Synchronize the knowledge base.\n\n**How to use**\n\nRequests a one-shot synchronization. A 202 means accepted, not that every resource is indexed. Inspect KB/resource status before querying updated source content.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.sync`. Resource and owner access checks also apply.","operationId":"syncKnowledgeBase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseSyncResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.sync"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X POST \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}/sync\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Synchronize the knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Requests a one-shot synchronization. A 202 means accepted, not that every resource is indexed. Inspect KB/resource status before querying updated source content.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.sync</code>. Resource and owner access checks also apply.</p>\n"}},"/v1/knowledge-bases":{"get":{"tags":["endpoint-listKnowledgeBases"],"summary":"Get Knowledge Bases","description":"List all available knowledge bases for the specified flow.\n\n**How to use**\n\nDiscover KBs available to the authenticated caller; select the returned knowledge_base_id. The v1 response is a bare array, so do not expect v2 cursor/envelope fields.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"listKnowledgeBases","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["ZXhhbXBsZV9jdXJzb3I="],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseResponse"},"title":"Response Listknowledgebases"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List all available knowledge bases for the specified flow.</p>\n<p><strong>How to use</strong></p>\n<p>Discover KBs available to the authenticated caller; select the returned knowledge_base_id. The v1 response is a bare array, so do not expect v2 cursor/envelope fields.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createKnowledgeBase"],"summary":"Create Knowledge Base","description":"Create a new knowledge base.\n\n**How to use**\n\nCreate a named content store, optionally selecting existing connection or website sources. Save knowledge_base_id, then upload or synchronize content. Catalog, source, embedding-model, and sharing policies can affect admission.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Support handbook\",\n  \"description\": \"Approved support policies\"\n}\n```","operationId":"createKnowledgeBase","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseRequest"},"example":{"name":"Support handbook","description":"Approved support policies"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Create a new knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Create a named content store, optionally selecting existing connection or website sources. Save knowledge_base_id, then upload or synchronize content. Catalog, source, embedding-model, and sharing policies can affect admission.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Support handbook&quot;,\n  &quot;description&quot;: &quot;Approved support policies&quot;\n}\n</code></pre>\n"}},"/v1/knowledge-bases/{knowledge_base_id}":{"get":{"tags":["endpoint-getKnowledgeBase"],"summary":"Get Knowledge Base By Id","description":"Get a knowledge base by its ID in the current organization.\n\n**How to use**\n\nRead configuration and indexing totals before querying, changing, or deleting a KB. Existence does not mean all resources are indexed.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a knowledge base by its ID in the current organization.</p>\n<p><strong>How to use</strong></p>\n<p>Read configuration and indexing totals before querying, changing, or deleting a KB. Existence does not mean all resources are indexed.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateKnowledgeBase"],"summary":"Update Knowledge Base","description":"Update a knowledge base.\n\n**How to use**\n\nSend only fields to change and follow their nullability rules. Source and indexing configuration changes may need synchronization/reindexing; review resource readiness afterward.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Updated support handbook\"\n}\n```","operationId":"updateKnowledgeBase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeBaseRequest"},"example":{"name":"Updated support handbook"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update a knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Send only fields to change and follow their nullability rules. Source and indexing configuration changes may need synchronization/reindexing; review resource readiness afterward.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Updated support handbook&quot;\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteKnowledgeBase"],"summary":"Delete Knowledge Base","description":"Delete a knowledge base by its ID.\n\n**How to use**\n\nRemoves the knowledge base. Check dependent workflows and retain necessary source material before deletion. A 204 response has no JSON body.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.delete`. Resource and owner access checks also apply.","operationId":"deleteKnowledgeBase","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v1/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a knowledge base by its ID.</p>\n<p><strong>How to use</strong></p>\n<p>Removes the knowledge base. Check dependent workflows and retain necessary source material before deletion. A 204 response has no JSON body.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases":{"get":{"tags":["endpoint-listKnowledgeBasesV2"],"summary":"List Knowledge Bases","description":"List knowledge bases available to the caller, newest first.\n\n**How to use**\n\nDiscover KBs available to the authenticated caller; select the returned knowledge_base_id. Read items under data and follow next_cursor. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"listKnowledgeBasesV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["ZXhhbXBsZV9jdXJzb3I="],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_KnowledgeBaseResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List knowledge bases available to the caller, newest first.</p>\n<p><strong>How to use</strong></p>\n<p>Discover KBs available to the authenticated caller; select the returned knowledge_base_id. Read items under data and follow next_cursor. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createKnowledgeBaseV2"],"summary":"Create Knowledge Base","description":"Create a new knowledge base.\n\n**How to use**\n\nCreate a named content store, optionally selecting existing connection or website sources. Save knowledge_base_id, then upload or synchronize content. Catalog, source, embedding-model, and sharing policies can affect admission. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Support handbook\",\n  \"description\": \"Approved support policies\"\n}\n```","operationId":"createKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseRequestV2"},"example":{"name":"Support handbook","description":"Approved support policies"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Create a new knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Create a named content store, optionally selecting existing connection or website sources. Save knowledge_base_id, then upload or synchronize content. Catalog, source, embedding-model, and sharing policies can affect admission. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Support handbook&quot;,\n  &quot;description&quot;: &quot;Approved support policies&quot;\n}\n</code></pre>\n"}},"/v2/knowledge-bases/{knowledge_base_id}":{"get":{"tags":["endpoint-getKnowledgeBaseV2"],"summary":"Get Knowledge Base","description":"Get a knowledge base by its ID.\n\n**How to use**\n\nRead configuration and indexing totals before querying, changing, or deleting a KB. Existence does not mean all resources are indexed. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a knowledge base by its ID.</p>\n<p><strong>How to use</strong></p>\n<p>Read configuration and indexing totals before querying, changing, or deleting a KB. Existence does not mean all resources are indexed. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateKnowledgeBaseV2"],"summary":"Update Knowledge Base","description":"Update a knowledge base.\n\n**How to use**\n\nSend only fields to change and follow their nullability rules. Source and indexing configuration changes may need synchronization/reindexing; review resource readiness afterward. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Updated support handbook\"\n}\n```","operationId":"updateKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeBaseRequestV2"},"example":{"name":"Updated support handbook"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update a knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Send only fields to change and follow their nullability rules. Source and indexing configuration changes may need synchronization/reindexing; review resource readiness afterward. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Updated support handbook&quot;\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteKnowledgeBaseV2"],"summary":"Delete Knowledge Base","description":"Delete a knowledge base by its ID.\n\n**How to use**\n\nRemoves the knowledge base. Check dependent workflows and retain necessary source material before deletion. A 204 response has no JSON body. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.delete`. Resource and owner access checks also apply.","operationId":"deleteKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a knowledge base by its ID.</p>\n<p><strong>How to use</strong></p>\n<p>Removes the knowledge base. Check dependent workflows and retain necessary source material before deletion. A 204 response has no JSON body. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/metadata-schemas":{"get":{"tags":["endpoint-getKnowledgeBaseMetadataSchemasV2"],"summary":"Get Knowledge Base Metadata Schemas","description":"Get the user and dataloader metadata schemas for a knowledge base.\n\n**How to use**\n\nInspect the user and dataloader metadata schema before interpreting file metadata. These metadata descriptions are not the content-search endpoint.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBaseMetadataSchemasV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseMetadataSchemasResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/metadata-schemas\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get the user and dataloader metadata schemas for a knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Inspect the user and dataloader metadata schema before interpreting file metadata. These metadata descriptions are not the content-search endpoint.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/resources":{"get":{"tags":["endpoint-listKnowledgeBaseResourcesV2"],"summary":"List Resources","description":"List all files in the knowledge base (flat).\n\n**How to use**\n\nList resources and inspect processing status. Use cursor pagination and retain resource_id for detail reads. Do not treat a listed pending/parsed resource as indexed. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"listKnowledgeBaseResourcesV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["NTUwZTg0MDAtZTI5Yi00MWQ0LWE3MTYtNDQ2NjU1NDQwMDAw"],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_KnowledgeBaseFileResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List all files in the knowledge base (flat).</p>\n<p><strong>How to use</strong></p>\n<p>List resources and inspect processing status. Use cursor pagination and retain resource_id for detail reads. Do not treat a listed pending/parsed resource as indexed. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-uploadKnowledgeBaseResourceV2"],"summary":"Upload Resource","description":"Upload a file directly and start indexing; poll the resource GET for status.\n\n**How to use**\n\nUpload multipart field file (singular). Indexing starts automatically. Save the resource_id from the 202 response and poll resource GET until indexed or error. Do not set the multipart boundary yourself or re-upload while waiting. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.index`. Resource and owner access checks also apply.","operationId":"uploadKnowledgeBaseResourceV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_uploadKnowledgeBaseResourceV2"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ResourceUploadResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.index"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -F 'file=@document.pdf'"}],"x-gitbook-description-html":"<p>Upload a file directly and start indexing; poll the resource GET for status.</p>\n<p><strong>How to use</strong></p>\n<p>Upload multipart field file (singular). Indexing starts automatically. Save the resource_id from the 202 response and poll resource GET until indexed or error. Do not set the multipart boundary yourself or re-upload while waiting. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.index</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/resources/{resource_id}":{"get":{"tags":["endpoint-getKnowledgeBaseResourceV2"],"summary":"Get Resource By Id","description":"Get one file resource by ID.\n\n**How to use**\n\nPoll this after upload/sync. indexed indicates readiness; error needs investigation. pending_delete/deleted should not be treated as available search content. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBaseResourceV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseFileResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get one file resource by ID.</p>\n<p><strong>How to use</strong></p>\n<p>Poll this after upload/sync. indexed indicates readiness; error needs investigation. pending_delete/deleted should not be treated as available search content. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"},"delete":{"tags":["endpoint-deleteKnowledgeBaseResourceV2"],"summary":"Delete Resource By Id","description":"Delete a file resource by ID.\n\n**How to use**\n\nDelete the specified resource from its KB. Verify both IDs before removing content used by downstream retrieval. A 204 has no body. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.delete`. Resource and owner access checks also apply.","operationId":"deleteKnowledgeBaseResourceV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Resource Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a file resource by ID.</p>\n<p><strong>How to use</strong></p>\n<p>Delete the specified resource from its KB. Verify both IDs before removing content used by downstream retrieval. A 204 has no body. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/resources/{resource_id}/download":{"get":{"tags":["endpoint-getKnowledgeBaseResourceDownloadUrlV2"],"summary":"Get Resource Download Url","description":"Get a signed URL to download the original file.\n\n**How to use**\n\nReturns a signed URL for the original file. Download separately without forwarding the StackAI Authorization header. Treat the URL as temporary sensitive access, not a permanent public link.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.read`. Resource and owner access checks also apply.","operationId":"getKnowledgeBaseResourceDownloadUrlV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ResourceDownloadResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/resources/${RESOURCE_ID}/download\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a signed URL to download the original file.</p>\n<p><strong>How to use</strong></p>\n<p>Returns a signed URL for the original file. Download separately without forwarding the StackAI Authorization header. Treat the URL as temporary sensitive access, not a permanent public link.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/query":{"post":{"tags":["endpoint-queryKnowledgeBaseV2"],"summary":"Query Knowledge Base","description":"Search a knowledge base and return the most relevant results.\n\n**How to use**\n\nSearch only after the resources you need are indexed. Choose semantic, keyword, or hybrid; top_k is 1–20. This returns retrieval results, not a generated answer. Handle empty results and preserve source attribution.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.query`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"query\": \"What is the refund window?\",\n  \"top_k\": 5,\n  \"strategy\": \"hybrid\",\n  \"retrieval_type\": \"chunks\"\n}\n```","operationId":"queryKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseQueryRequestV2"},"example":{"query":"What is the refund window?","top_k":5,"strategy":"hybrid","retrieval_type":"chunks"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_list_KnowledgeBaseQueryResultV2__"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.query"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/query\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Search a knowledge base and return the most relevant results.</p>\n<p><strong>How to use</strong></p>\n<p>Search only after the resources you need are indexed. Choose semantic, keyword, or hybrid; top_k is 1–20. This returns retrieval results, not a generated answer. Handle empty results and preserve source attribution.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.query</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;query&quot;: &quot;What is the refund window?&quot;,\n  &quot;top_k&quot;: 5,\n  &quot;strategy&quot;: &quot;hybrid&quot;,\n  &quot;retrieval_type&quot;: &quot;chunks&quot;\n}\n</code></pre>\n"}},"/v2/knowledge-bases/{knowledge_base_id}/sync":{"post":{"tags":["endpoint-syncKnowledgeBaseV2"],"summary":"Synchronize Knowledge Base","description":"Start a one-shot synchronization of the knowledge base.\n\n**How to use**\n\nRequests a one-shot synchronization. A 202 means accepted, not that every resource is indexed. Inspect KB/resource status before querying updated source content. Read successful resource payloads under data when a body is returned.\n\n**Authentication and permissions**\n\nRequired permissions: `kbs.sync`. Resource and owner access checks also apply.","operationId":"syncKnowledgeBaseV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Knowledge Base Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_KnowledgeBaseSyncResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["kbs.sync"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X POST \\\n  \"$STACKAI_BASE_URL/v2/knowledge-bases/${KNOWLEDGE_BASE_ID}/sync\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Start a one-shot synchronization of the knowledge base.</p>\n<p><strong>How to use</strong></p>\n<p>Requests a one-shot synchronization. A 202 means accepted, not that every resource is indexed. Inspect KB/resource status before querying updated source content. Read successful resource payloads under data when a body is returned.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>kbs.sync</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/projects/{project_id}/io-schema":{"get":{"tags":["endpoint-getProjectIoSchemaV2"],"summary":"Get Project Io Schema","description":"Describe input keys and output nodes exposed by the selected project version.\n\n**How to use**\n\nCall before constructing run inputs or evaluation contracts. Match the selected saved version to the version you intend to execute. `latest` is newest saved (or draft), not necessarily published. Use returned parameter identifiers, not labels from your UI.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.read`. Resource and owner access checks also apply.","operationId":"getProjectIoSchemaV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"const":"latest","type":"string"},{"const":"draft","type":"string"},{"type":"integer","minimum":0}],"description":"Project version to inspect: the draft, a saved version number, or latest, the newest saved version (the draft until one is saved)","default":"latest","title":"Version","x-gitbook-description-html":"<p>Project version to inspect: the draft, a saved version number, or latest, the newest saved version (the draft until one is saved)</p>\n"},"description":"Project version to inspect: the draft, a saved version number, or latest, the newest saved version (the draft until one is saved)","x-gitbook-description-html":"<p>Project version to inspect: the draft, a saved version number, or latest, the newest saved version (the draft until one is saved)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ProjectIoSchemaResponseV2_"},"example":{"data":{"input_kind":"legacy_input_nodes","inputs":[{"id":"in-0","name":"Question"}],"outputs":[{"id":"out-0","name":"Answer"}]}}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"},"example":{"detail":["The credential does not have the required permission."],"meta":{"required_scope":"projects.read"}}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Project or saved version not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Project or saved version not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"projects.read","x-required-scopes":["projects.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/projects/${PROJECT_ID}/io-schema\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Describe input keys and output nodes exposed by the selected project version.</p>\n<p><strong>How to use</strong></p>\n<p>Call before constructing run inputs or evaluation contracts. Match the selected saved version to the version you intend to execute. <code>latest</code> is newest saved (or draft), not necessarily published. Use returned parameter identifiers, not labels from your UI.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/datasets":{"get":{"tags":["endpoint-listEvalDatasetsV2"],"summary":"List Eval Datasets","description":"List matching project datasets; contract-drift warnings are available on detail reads.\n\n**How to use**\n\nSupply project_id. Use search or feeds_* compatibility filters to narrow the list. Read a dataset detail for current contract-drift warnings rather than assuming a listed dataset still matches the workflow.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvalDatasetsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Case-insensitive name/description match","title":"Search","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},"description":"Case-insensitive name/description match","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},{"name":"feeds_input_kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["start_node","legacy_input_nodes"],"type":"string"},{"type":"null"}],"description":"With the other feeds_* params: keep only datasets whose capture can feed this contract","title":"Feeds Input Kind","x-gitbook-description-html":"<p>With the other feeds_* params: keep only datasets whose capture can feed this contract</p>\n"},"description":"With the other feeds_* params: keep only datasets whose capture can feed this contract","x-gitbook-description-html":"<p>With the other feeds_* params: keep only datasets whose capture can feed this contract</p>\n"},{"name":"feeds_input_keys","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Contract input keys; repeat the param","title":"Feeds Input Keys","x-gitbook-description-html":"<p>Contract input keys; repeat the param</p>\n"},"description":"Contract input keys; repeat the param","x-gitbook-description-html":"<p>Contract input keys; repeat the param</p>\n"},{"name":"feeds_output_node_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Contract output node ids; repeat the param","title":"Feeds Output Node Ids","x-gitbook-description-html":"<p>Contract output node ids; repeat the param</p>\n"},"description":"Contract output node ids; repeat the param","x-gitbook-description-html":"<p>Contract output node ids; repeat the param</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvalDatasetListItemResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS --get \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode \"project_id=${PROJECT_ID}\""}],"x-gitbook-description-html":"<p>List matching project datasets; contract-drift warnings are available on detail reads.</p>\n<p><strong>How to use</strong></p>\n<p>Supply project_id. Use search or feeds_* compatibility filters to narrow the list. Read a dataset detail for current contract-drift warnings rather than assuming a listed dataset still matches the workflow.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createEvalDatasetV2"],"summary":"Create Eval Dataset","description":"Create a dataset with its input/output contract and advisory warnings.\n\n**How to use**\n\nRead project IO first and choose exactly one input key and output node ID for node_contract. Create the dataset, save its ID, then append rows or import finished run traces.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"project_id\": \"YOUR_PROJECT_ID\",\n  \"name\": \"Regression dataset\",\n  \"node_contract\": {\n    \"input_kind\": \"legacy_input_nodes\",\n    \"input_keys\": [\n      \"in-0\"\n    ],\n    \"output_node_ids\": [\n      \"out-0\"\n    ]\n  }\n}\n```","operationId":"createEvalDatasetV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDatasetCreateRequestV2"},"example":{"project_id":"YOUR_PROJECT_ID","name":"Regression dataset","node_contract":{"input_kind":"legacy_input_nodes","input_keys":["in-0"],"output_node_ids":["out-0"]}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalDatasetResponseV2_"}}},"headers":{"Location":{"description":"Created dataset URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Created dataset URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.create","x-required-scopes":["evals.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Create a dataset with its input/output contract and advisory warnings.</p>\n<p><strong>How to use</strong></p>\n<p>Read project IO first and choose exactly one input key and output node ID for node_contract. Create the dataset, save its ID, then append rows or import finished run traces.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;project_id&quot;: &quot;YOUR_PROJECT_ID&quot;,\n  &quot;name&quot;: &quot;Regression dataset&quot;,\n  &quot;node_contract&quot;: {\n    &quot;input_kind&quot;: &quot;legacy_input_nodes&quot;,\n    &quot;input_keys&quot;: [\n      &quot;in-0&quot;\n    ],\n    &quot;output_node_ids&quot;: [\n      &quot;out-0&quot;\n    ]\n  }\n}\n</code></pre>\n"}},"/v2/evals/datasets/{dataset_id}":{"get":{"tags":["endpoint-getEvalDatasetV2"],"summary":"Get Eval Dataset","description":"Read one dataset and current contract-drift warnings.\n\n**How to use**\n\nRead before modifying a dataset or creating a regression experiment. Inspect contract-drift warnings and resolve differences from the workflow version you intend to test.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalDatasetV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalDatasetResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Read one dataset and current contract-drift warnings.</p>\n<p><strong>How to use</strong></p>\n<p>Read before modifying a dataset or creating a regression experiment. Inspect contract-drift warnings and resolve differences from the workflow version you intend to test.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvalDatasetV2"],"summary":"Update Eval Dataset","description":"Update metadata or re-key rows to a replacement contract.\n\n**How to use**\n\nUse this for metadata or a deliberate contract replacement. Changing the contract can re-key stored rows; review the new mapping first. Omit unchanged fields.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Reviewed regression dataset\"\n}\n```","operationId":"updateEvalDatasetV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDatasetUpdateRequestV2"},"example":{"name":"Reviewed regression dataset"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalDatasetResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update metadata or re-key rows to a replacement contract.</p>\n<p><strong>How to use</strong></p>\n<p>Use this for metadata or a deliberate contract replacement. Changing the contract can re-key stored rows; review the new mapping first. Omit unchanged fields.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Reviewed regression dataset&quot;\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteEvalDatasetV2"],"summary":"Delete Eval Dataset","description":"Delete a dataset and its rows and experiments.\n\n**How to use**\n\nDeleting a dataset cascades to its rows and experiments. Retain required results before removal and verify the dataset belongs to the intended project.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.delete`. Resource and owner access checks also apply.","operationId":"deleteEvalDatasetV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.delete","x-required-scopes":["evals.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a dataset and its rows and experiments.</p>\n<p><strong>How to use</strong></p>\n<p>Deleting a dataset cascades to its rows and experiments. Retain required results before removal and verify the dataset belongs to the intended project.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/datasets/{dataset_id}/rows":{"post":{"tags":["endpoint-addEvalDatasetRowsV2"],"summary":"Add Eval Dataset Rows","description":"Append rows as given; Location is the first created row.\n\n**How to use**\n\nAppend 1–100 rows with input keys matching the dataset contract. Include expected_output for reference-based evaluation. This appends as supplied; use imports when inputs/expected output should be extracted from real traces.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"rows\": [\n    {\n      \"inputs\": {\n        \"in-0\": \"What is 2+2?\"\n      },\n      \"expected_output\": {\n        \"out-0\": \"4\"\n      }\n    }\n  ]\n}\n```","operationId":"addEvalDatasetRowsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDatasetRowsAddRequestV2"},"example":{"rows":[{"inputs":{"in-0":"What is 2+2?"},"expected_output":{"out-0":"4"}}]}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_list_EvalDatasetRowResponseV2__"}}},"headers":{"Location":{"description":"First created dataset row URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>First created dataset row URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/rows\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Append rows as given; Location is the first created row.</p>\n<p><strong>How to use</strong></p>\n<p>Append 1–100 rows with input keys matching the dataset contract. Include expected_output for reference-based evaluation. This appends as supplied; use imports when inputs/expected output should be extracted from real traces.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;rows&quot;: [\n    {\n      &quot;inputs&quot;: {\n        &quot;in-0&quot;: &quot;What is 2+2?&quot;\n      },\n      &quot;expected_output&quot;: {\n        &quot;out-0&quot;: &quot;4&quot;\n      }\n    }\n  ]\n}\n</code></pre>\n"},"get":{"tags":["endpoint-listEvalDatasetRowsV2"],"summary":"List Eval Dataset Rows","description":"List dataset rows in position order.\n\n**How to use**\n\nTraverse in position order with offset/limit. Use the parent dataset ID together with returned row IDs for updates or deletes.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvalDatasetRowsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvalDatasetRowResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/rows\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List dataset rows in position order.</p>\n<p><strong>How to use</strong></p>\n<p>Traverse in position order with offset/limit. Use the parent dataset ID together with returned row IDs for updates or deletes.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/datasets/{dataset_id}/imports":{"post":{"tags":["endpoint-importEvalDatasetRowsV2"],"summary":"Import Eval Dataset Rows","description":"Import finished runs atomically, requiring evals.update and analytics.read.\n\nInputs and expected outputs come from each run trace under the dataset contract.\nA run without a usable trace rejects the whole batch; Location is the first row.\n\n**How to use**\n\nImport 1–100 finished run IDs from the dataset project. Requires both evals.update and analytics.read. The whole batch is rejected if a trace is unusable; correct the identified runs before resubmission.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`, `analytics.read`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"run_ids\": [\n    \"00000000-0000-4000-8000-000000000001\"\n  ]\n}\n```","operationId":"importEvalDatasetRowsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDatasetImportRequestV2"},"example":{"run_ids":["00000000-0000-4000-8000-000000000001"]}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_list_EvalDatasetRowResponseV2__"}}},"headers":{"Location":{"description":"First imported dataset row URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>First imported dataset row URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update","analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/imports\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Import finished runs atomically, requiring evals.update and analytics.read.</p>\n<p>Inputs and expected outputs come from each run trace under the dataset contract.\nA run without a usable trace rejects the whole batch; Location is the first row.</p>\n<p><strong>How to use</strong></p>\n<p>Import 1–100 finished run IDs from the dataset project. Requires both evals.update and analytics.read. The whole batch is rejected if a trace is unusable; correct the identified runs before resubmission.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>, <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;run_ids&quot;: [\n    &quot;00000000-0000-4000-8000-000000000001&quot;\n  ]\n}\n</code></pre>\n"}},"/v2/evals/datasets/{dataset_id}/rows/{row_id}":{"get":{"tags":["endpoint-getEvalDatasetRowV2"],"summary":"Get Eval Dataset Row","description":"Read one row after checking its dataset membership and project access.\n\n**How to use**\n\nUse to inspect the exact input and expected-output pair before changing it. The row must belong to the dataset in the path.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalDatasetRowV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalDatasetRowResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/rows/${ROW_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Read one row after checking its dataset membership and project access.</p>\n<p><strong>How to use</strong></p>\n<p>Use to inspect the exact input and expected-output pair before changing it. The row must belong to the dataset in the path.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvalDatasetRowV2"],"summary":"Update Eval Dataset Row","description":"Update row content, allowing an explicit null to clear expected output.\n\n**How to use**\n\nOmit expected_output to retain it; send explicit null to clear it. Keep input keys aligned to the parent dataset contract. Review the modified row before running experiments.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"expected_output\": null\n}\n```","operationId":"updateEvalDatasetRowV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Row Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDatasetRowUpdateRequestV2"},"example":{"expected_output":null}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalDatasetRowResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/rows/${ROW_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update row content, allowing an explicit null to clear expected output.</p>\n<p><strong>How to use</strong></p>\n<p>Omit expected_output to retain it; send explicit null to clear it. Keep input keys aligned to the parent dataset contract. Review the modified row before running experiments.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;expected_output&quot;: null\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteEvalDatasetRowV2"],"summary":"Delete Eval Dataset Row","description":"Delete one row belonging to the selected dataset.\n\n**How to use**\n\nDelete one row from its parent dataset. Verify parent membership and preserve examples needed for future regression coverage.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.delete`. Resource and owner access checks also apply.","operationId":"deleteEvalDatasetRowV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dataset Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Row Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.delete","x-required-scopes":["evals.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/rows/${ROW_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete one row belonging to the selected dataset.</p>\n<p><strong>How to use</strong></p>\n<p>Delete one row from its parent dataset. Verify parent membership and preserve examples needed for future regression coverage.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/evaluators":{"get":{"tags":["endpoint-listEvaluatorsV2"],"summary":"List Evaluators","description":"List project evaluators with optional compatibility and exclusion filters.\n\n**How to use**\n\nSupply project_id. Filter by dataset/experiment compatibility, excluded IDs, or uses_expected_output. Monitors and direct run scoring require reference-free evaluators.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvaluatorsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Case-insensitive name/description match","title":"Search","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},"description":"Case-insensitive name/description match","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},{"name":"compatible_with_dataset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Keep only evaluators this dataset's contract can feed","title":"Compatible With Dataset Id","x-gitbook-description-html":"<p>Keep only evaluators this dataset&#39;s contract can feed</p>\n"},"description":"Keep only evaluators this dataset's contract can feed","x-gitbook-description-html":"<p>Keep only evaluators this dataset&#39;s contract can feed</p>\n"},{"name":"compatible_with_experiment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Keep only evaluators this experiment's pinned contract can feed","title":"Compatible With Experiment Id","x-gitbook-description-html":"<p>Keep only evaluators this experiment&#39;s pinned contract can feed</p>\n"},"description":"Keep only evaluators this experiment's pinned contract can feed","x-gitbook-description-html":"<p>Keep only evaluators this experiment&#39;s pinned contract can feed</p>\n"},{"name":"exclude_evaluator_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Evaluator ids to leave out; repeat the param","title":"Exclude Evaluator Ids","x-gitbook-description-html":"<p>Evaluator ids to leave out; repeat the param</p>\n"},"description":"Evaluator ids to leave out; repeat the param","x-gitbook-description-html":"<p>Evaluator ids to leave out; repeat the param</p>\n"},{"name":"uses_expected_output","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Keep only evaluators that do (true) or don't (false) compare against an expected output","title":"Uses Expected Output","x-gitbook-description-html":"<p>Keep only evaluators that do (true) or don&#39;t (false) compare against an expected output</p>\n"},"description":"Keep only evaluators that do (true) or don't (false) compare against an expected output","x-gitbook-description-html":"<p>Keep only evaluators that do (true) or don&#39;t (false) compare against an expected output</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvaluatorResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS --get \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluators\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode \"project_id=${PROJECT_ID}\""}],"x-gitbook-description-html":"<p>List project evaluators with optional compatibility and exclusion filters.</p>\n<p><strong>How to use</strong></p>\n<p>Supply project_id. Filter by dataset/experiment compatibility, excluded IDs, or uses_expected_output. Monitors and direct run scoring require reference-free evaluators.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createEvaluatorV2"],"summary":"Create Evaluator","description":"Create a validated evaluator and its first immutable configuration version.\n\n**How to use**\n\nChoose a built-in template or validate a judge configuration through preview first. Supply evaluator_type, config, and the project node contract. This creates the first immutable configuration version.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"project_id\": \"YOUR_PROJECT_ID\",\n  \"name\": \"Correct request category\",\n  \"evaluator_type\": \"builtin_rule\",\n  \"config\": {\n    \"rule\": \"exact_match\",\n    \"target_output_node_id\": \"out-0\"\n  },\n  \"node_contract\": {\n    \"input_kind\": \"legacy_input_nodes\",\n    \"input_keys\": [\n      \"in-0\"\n    ],\n    \"output_node_ids\": [\n      \"out-0\"\n    ]\n  }\n}\n```","operationId":"createEvaluatorV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorCreateRequestV2"},"example":{"project_id":"YOUR_PROJECT_ID","name":"Correct request category","evaluator_type":"builtin_rule","config":{"rule":"exact_match","target_output_node_id":"out-0"},"node_contract":{"input_kind":"legacy_input_nodes","input_keys":["in-0"],"output_node_ids":["out-0"]}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvaluatorResponseV2_"}}},"headers":{"Location":{"description":"Created evaluator URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Created evaluator URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.create","x-required-scopes":["evals.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluators\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Create a validated evaluator and its first immutable configuration version.</p>\n<p><strong>How to use</strong></p>\n<p>Choose a built-in template or validate a judge configuration through preview first. Supply evaluator_type, config, and the project node contract. This creates the first immutable configuration version.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;project_id&quot;: &quot;YOUR_PROJECT_ID&quot;,\n  &quot;name&quot;: &quot;Correct request category&quot;,\n  &quot;evaluator_type&quot;: &quot;builtin_rule&quot;,\n  &quot;config&quot;: {\n    &quot;rule&quot;: &quot;exact_match&quot;,\n    &quot;target_output_node_id&quot;: &quot;out-0&quot;\n  },\n  &quot;node_contract&quot;: {\n    &quot;input_kind&quot;: &quot;legacy_input_nodes&quot;,\n    &quot;input_keys&quot;: [\n      &quot;in-0&quot;\n    ],\n    &quot;output_node_ids&quot;: [\n      &quot;out-0&quot;\n    ]\n  }\n}\n</code></pre>\n"}},"/v2/evals/evaluators/{evaluator_id}":{"get":{"tags":["endpoint-getEvaluatorV2"],"summary":"Get Evaluator","description":"Read an evaluator with its current version.\n\n**How to use**\n\nRead the evaluator and its current configuration version before using its ID in an experiment or monitor. Verify whether it expects reference output.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvaluatorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"evaluator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Evaluator Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvaluatorResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluators/${EVALUATOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Read an evaluator with its current version.</p>\n<p><strong>How to use</strong></p>\n<p>Read the evaluator and its current configuration version before using its ID in an experiment or monitor. Verify whether it expects reference output.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvaluatorV2"],"summary":"Update Evaluator","description":"Update metadata and version material changes to judge configuration.\n\n**How to use**\n\nUpdate metadata or judge configuration. Material config changes create a new immutable version; account for this when comparing historical scores.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"name\": \"Reviewed evaluator\"\n}\n```","operationId":"updateEvaluatorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"evaluator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Evaluator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorUpdateRequestV2"},"example":{"name":"Reviewed evaluator"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvaluatorResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluators/${EVALUATOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update metadata and version material changes to judge configuration.</p>\n<p><strong>How to use</strong></p>\n<p>Update metadata or judge configuration. Material config changes create a new immutable version; account for this when comparing historical scores.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;name&quot;: &quot;Reviewed evaluator&quot;\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteEvaluatorV2"],"summary":"Delete Evaluator","description":"Soft-delete an evaluator while retaining its historical scores.\n\n**How to use**\n\nSoft-delete an evaluator that should no longer be selected. Historical scores remain; deleting does not erase the prior evidence.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.delete`. Resource and owner access checks also apply.","operationId":"deleteEvaluatorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"evaluator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Evaluator Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.delete","x-required-scopes":["evals.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluators/${EVALUATOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Soft-delete an evaluator while retaining its historical scores.</p>\n<p><strong>How to use</strong></p>\n<p>Soft-delete an evaluator that should no longer be selected. Historical scores remain; deleting does not erase the prior evidence.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/evaluator-previews":{"post":{"tags":["endpoint-previewEvaluatorV2"],"summary":"Preview Evaluator","description":"Judge up to three samples without saving the evaluator or score rows.\n\n**How to use**\n\nTest 1–3 samples without saving an evaluator or score rows. Use this to check rubric/config behavior before production use. A preview may still consume judge resources; it is not a persistence operation.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"project_id\": \"YOUR_PROJECT_ID\",\n  \"evaluator_type\": \"builtin_rule\",\n  \"config\": {\n    \"rule\": \"exact_match\",\n    \"target_output_node_id\": \"out-0\"\n  },\n  \"samples\": [\n    {\n      \"generated_output\": {\n        \"out-0\": \"billing\"\n      },\n      \"expected_output\": {\n        \"out-0\": \"billing\"\n      }\n    }\n  ]\n}\n```","operationId":"previewEvaluatorV2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatorPreviewRequestV2"},"example":{"project_id":"YOUR_PROJECT_ID","evaluator_type":"builtin_rule","config":{"rule":"exact_match","target_output_node_id":"out-0"},"samples":[{"generated_output":{"out-0":"billing"},"expected_output":{"out-0":"billing"}}]}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_list_EvaluatorPreviewResponseV2__"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"security":[{"HTTPBearer":[]}],"x-required-scope":"evals.run","x-required-scopes":["evals.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluator-previews\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Judge up to three samples without saving the evaluator or score rows.</p>\n<p><strong>How to use</strong></p>\n<p>Test 1–3 samples without saving an evaluator or score rows. Use this to check rubric/config behavior before production use. A preview may still consume judge resources; it is not a persistence operation.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;project_id&quot;: &quot;YOUR_PROJECT_ID&quot;,\n  &quot;evaluator_type&quot;: &quot;builtin_rule&quot;,\n  &quot;config&quot;: {\n    &quot;rule&quot;: &quot;exact_match&quot;,\n    &quot;target_output_node_id&quot;: &quot;out-0&quot;\n  },\n  &quot;samples&quot;: [\n    {\n      &quot;generated_output&quot;: {\n        &quot;out-0&quot;: &quot;billing&quot;\n      },\n      &quot;expected_output&quot;: {\n        &quot;out-0&quot;: &quot;billing&quot;\n      }\n    }\n  ]\n}\n</code></pre>\n"}},"/v2/evals/evaluator-templates":{"get":{"tags":["endpoint-listEvaluatorTemplatesV2"],"summary":"List Evaluator Templates","description":"Return built-in starting points for evaluator configuration.\n\n**How to use**\n\nRead supported starting configurations instead of guessing arbitrary config fields. Adapt a template to the project contract and preview it with representative samples.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvaluatorTemplatesV2","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_list_EvaluatorTemplateResponseV2__"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"security":[{"HTTPBearer":[]}],"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/evaluator-templates\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Return built-in starting points for evaluator configuration.</p>\n<p><strong>How to use</strong></p>\n<p>Read supported starting configurations instead of guessing arbitrary config fields. Adapt a template to the project contract and preview it with representative samples.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/experiments":{"get":{"tags":["endpoint-listEvalExperimentsV2"],"summary":"List Eval Experiments","description":"List a project's experiments and their aggregate scores.\n\n**How to use**\n\nSupply project_id and optionally dataset_id/search. Use aggregates to locate an experiment, then inspect detail and row-level results before comparing quality.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvalExperimentsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Id"}},{"name":"dataset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Dataset Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Case-insensitive name/description match","title":"Search","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},"description":"Case-insensitive name/description match","x-gitbook-description-html":"<p>Case-insensitive name/description match</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvalExperimentSummaryResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS --get \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode \"project_id=${PROJECT_ID}\""}],"x-gitbook-description-html":"<p>List a project&#39;s experiments and their aggregate scores.</p>\n<p><strong>How to use</strong></p>\n<p>Supply project_id and optionally dataset_id/search. Use aggregates to locate an experiment, then inspect detail and row-level results before comparing quality.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createEvalExperimentV2"],"summary":"Create Eval Experiment","description":"Snapshot a dataset and validate the selected workflow version and evaluators.\n\n**How to use**\n\nSnapshot an existing dataset with a selected saved workflow version or draft and compatible evaluators. This creates the experiment; execution starts separately through jobs.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"dataset_id\": \"00000000-0000-4000-8000-000000000001\",\n  \"project_version_id\": 1,\n  \"evaluator_ids\": [\n    \"00000000-0000-4000-8000-000000000001\"\n  ]\n}\n```","operationId":"createEvalExperimentV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalExperimentCreateRequestV2"},"example":{"dataset_id":"00000000-0000-4000-8000-000000000001","project_version_id":1,"evaluator_ids":["00000000-0000-4000-8000-000000000001"]}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentCreateResponseV2_"}}},"headers":{"Location":{"description":"Created experiment URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Created experiment URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.create","x-required-scopes":["evals.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Snapshot a dataset and validate the selected workflow version and evaluators.</p>\n<p><strong>How to use</strong></p>\n<p>Snapshot an existing dataset with a selected saved workflow version or draft and compatible evaluators. This creates the experiment; execution starts separately through jobs.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;dataset_id&quot;: &quot;00000000-0000-4000-8000-000000000001&quot;,\n  &quot;project_version_id&quot;: 1,\n  &quot;evaluator_ids&quot;: [\n    &quot;00000000-0000-4000-8000-000000000001&quot;\n  ]\n}\n</code></pre>\n"}},"/v2/evals/experiments/{experiment_id}":{"get":{"tags":["endpoint-getEvalExperimentV2"],"summary":"Get Eval Experiment","description":"Get experiment metadata, progress, evaluator summaries and aggregate cards.\n\n**How to use**\n\nRead the experiment snapshot metadata, progress and aggregate cards. Aggregate success can coexist with individual row failures; inspect the rows as well.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalExperimentV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentDetailResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Job launch was rejected or job state is temporarily unavailable</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get experiment metadata, progress, evaluator summaries and aggregate cards.</p>\n<p><strong>How to use</strong></p>\n<p>Read the experiment snapshot metadata, progress and aggregate cards. Aggregate success can coexist with individual row failures; inspect the rows as well.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvalExperimentV2"],"summary":"Update Eval Experiment","description":"Update metadata; omitted fields remain unchanged and null clears notes.\n\n**How to use**\n\nUpdate metadata only as permitted by the request schema. Omitted fields stay unchanged; null clears notes. This is not a replacement for creating a new experiment snapshot.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"notes\": \"Reviewed regression run\"\n}\n```","operationId":"updateEvalExperimentV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalExperimentUpdateRequestV2"},"example":{"notes":"Reviewed regression run"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update metadata; omitted fields remain unchanged and null clears notes.</p>\n<p><strong>How to use</strong></p>\n<p>Update metadata only as permitted by the request schema. Omitted fields stay unchanged; null clears notes. This is not a replacement for creating a new experiment snapshot.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;notes&quot;: &quot;Reviewed regression run&quot;\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteEvalExperimentV2"],"summary":"Delete Eval Experiment","description":"Delete an experiment and its row snapshots and scores.\n\n**How to use**\n\nDeletes the experiment with its row snapshots and scores. Export or record required results before removal.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.delete`. Resource and owner access checks also apply.","operationId":"deleteEvalExperimentV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.delete","x-required-scopes":["evals.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete an experiment and its row snapshots and scores.</p>\n<p><strong>How to use</strong></p>\n<p>Deletes the experiment with its row snapshots and scores. Export or record required results before removal.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/experiments/{experiment_id}/rows":{"get":{"tags":["endpoint-listEvalExperimentRowsV2"],"summary":"List Eval Experiment Rows","description":"Page the experiment's rows with every row's score payloads nested together.\n\n**How to use**\n\nPage row snapshots with their nested score payloads. Inspect failures and score reasons; do not evaluate quality from aggregate metrics alone.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvalExperimentRowsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvalExperimentRowResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Job launch was rejected or job state is temporarily unavailable</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}/rows\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Page the experiment&#39;s rows with every row&#39;s score payloads nested together.</p>\n<p><strong>How to use</strong></p>\n<p>Page row snapshots with their nested score payloads. Inspect failures and score reasons; do not evaluate quality from aggregate metrics alone.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/experiments/{experiment_id}/status":{"get":{"tags":["endpoint-getEvalExperimentStatusV2"],"summary":"Get Eval Experiment Status","description":"Read the latest job and current result counts and aggregates.\n\n**How to use**\n\nUse for latest-job overview and current counts/aggregates. For one accepted execution, poll its dedicated job URL so a later job does not change what you are observing.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalExperimentStatusV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentStatusResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Job launch was rejected or job state is temporarily unavailable</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}/status\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Read the latest job and current result counts and aggregates.</p>\n<p><strong>How to use</strong></p>\n<p>Use for latest-job overview and current counts/aggregates. For one accepted execution, poll its dedicated job URL so a later job does not change what you are observing.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/experiments/{experiment_id}/jobs":{"post":{"tags":["endpoint-createEvalExperimentJobV2"],"summary":"Create Eval Experiment Job","description":"Start a job on the experiment. With `mode` `generate` the job produces outputs for the experiment's rows and scores them in the same job when evaluator IDs are passed; with `mode` `score` it scores the existing outputs with the selected evaluators, at least one, and regenerates nothing. The job is queued: the response is 202 with the job URL in `Location` and `status_url`. Poll that URL until the job's `status` is `completed`, `completed_with_failures`, `failed` or `cancelled`. One job runs per experiment at a time; starting another while one is active returns 409. When the active job is known, `Location` and `meta.status_url` point to it, with its IDs in `meta.job_id` and `meta.experiment_id`.\n\n**How to use**\n\nUse generate for new outputs (and optional evaluation), score for existing outputs with at least one evaluator. Persist the returned job ID/status_url. Only one active job is allowed; follow the existing job on 409 instead of starting duplicates.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"mode\": \"generate\",\n  \"evaluator_ids\": [\n    \"00000000-0000-4000-8000-000000000001\"\n  ]\n}\n```","operationId":"createEvalExperimentJobV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalExperimentJobCreateRequestV2"},"example":{"mode":"generate","evaluator_ids":["00000000-0000-4000-8000-000000000001"]}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentJobAcceptedResponseV2_"}}},"headers":{"Location":{"description":"Accepted job URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Accepted job URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"headers":{"Location":{"description":"URL of the active job, when known","schema":{"type":"string"},"x-gitbook-description-html":"<p>URL of the active job, when known</p>\n"}},"description":"The experiment already has an active job. When its identity is known, the error envelope includes meta.job_id, meta.experiment_id, meta.status_url and a matching Location header. Poll that job until it reaches a final status, then retry. Other conflicts omit this metadata and Location.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>The experiment already has an active job. When its identity is known, the error envelope includes meta.job_id, meta.experiment_id, meta.status_url and a matching Location header. Poll that job until it reaches a final status, then retry. Other conflicts omit this metadata and Location.</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Job launch was rejected or job state is temporarily unavailable</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.run","x-required-scopes":["evals.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}/jobs\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Start a job on the experiment. With <code>mode</code> <code>generate</code> the job produces outputs for the experiment&#39;s rows and scores them in the same job when evaluator IDs are passed; with <code>mode</code> <code>score</code> it scores the existing outputs with the selected evaluators, at least one, and regenerates nothing. The job is queued: the response is 202 with the job URL in <code>Location</code> and <code>status_url</code>. Poll that URL until the job&#39;s <code>status</code> is <code>completed</code>, <code>completed_with_failures</code>, <code>failed</code> or <code>cancelled</code>. One job runs per experiment at a time; starting another while one is active returns 409. When the active job is known, <code>Location</code> and <code>meta.status_url</code> point to it, with its IDs in <code>meta.job_id</code> and <code>meta.experiment_id</code>.</p>\n<p><strong>How to use</strong></p>\n<p>Use generate for new outputs (and optional evaluation), score for existing outputs with at least one evaluator. Persist the returned job ID/status_url. Only one active job is allowed; follow the existing job on 409 instead of starting duplicates.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;mode&quot;: &quot;generate&quot;,\n  &quot;evaluator_ids&quot;: [\n    &quot;00000000-0000-4000-8000-000000000001&quot;\n  ]\n}\n</code></pre>\n"}},"/v2/evals/experiments/{experiment_id}/jobs/{job_id}":{"get":{"tags":["endpoint-getEvalExperimentJobV2"],"summary":"Get Eval Experiment Job","description":"A job is one accepted request to generate outputs for an experiment or to score its existing outputs. This route returns the job's lifecycle and, once it has finished, its outcome. Poll it until `status` is `completed`, `completed_with_failures`, `failed` or `cancelled`. The experiment's `/status` route reports its latest job and current result counts. A 503 means the job's live state cannot be read right now; retry the same job URL.\n\n**How to use**\n\nPoll this exact accepted job until completed, completed_with_failures, failed, or cancelled. On 503 retry this GET. Inspect final outcome before deciding whether a new job is warranted.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalExperimentJobV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The experiment the job belongs to.","title":"Experiment Id","x-gitbook-description-html":"<p>The experiment the job belongs to.</p>\n"},"description":"The experiment the job belongs to.","x-gitbook-description-html":"<p>The experiment the job belongs to.</p>\n"},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The job ID returned when the job was created.","title":"Job Id","x-gitbook-description-html":"<p>The job ID returned when the job was created.</p>\n"},"description":"The job ID returned when the job was created.","x-gitbook-description-html":"<p>The job ID returned when the job was created.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalExperimentJobResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"503":{"description":"Job launch was rejected or job state is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Job launch was rejected or job state is temporarily unavailable</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}/jobs/${JOB_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>A job is one accepted request to generate outputs for an experiment or to score its existing outputs. This route returns the job&#39;s lifecycle and, once it has finished, its outcome. Poll it until <code>status</code> is <code>completed</code>, <code>completed_with_failures</code>, <code>failed</code> or <code>cancelled</code>. The experiment&#39;s <code>/status</code> route reports its latest job and current result counts. A 503 means the job&#39;s live state cannot be read right now; retry the same job URL.</p>\n<p><strong>How to use</strong></p>\n<p>Poll this exact accepted job until completed, completed_with_failures, failed, or cancelled. On 503 retry this GET. Inspect final outcome before deciding whether a new job is warranted.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/monitor-limits":{"get":{"tags":["endpoint-getEvalMonitorLimitsV2"],"summary":"Get Eval Monitor Limits","description":"Get server-enforced sampling limits and monitor defaults.\n\n**How to use**\n\nRead enforced sampling limits and defaults before presenting a monitor-creation form. Do not permanently hard-code the policy in your client.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalMonitorLimitsV2","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorLimitsResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"security":[{"HTTPBearer":[]}],"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitor-limits\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get server-enforced sampling limits and monitor defaults.</p>\n<p><strong>How to use</strong></p>\n<p>Read enforced sampling limits and defaults before presenting a monitor-creation form. Do not permanently hard-code the policy in your client.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/monitors":{"get":{"tags":["endpoint-listEvalMonitorsV2"],"summary":"List Eval Monitors","description":"List project monitors with their seven-day score and alert rollups.\n\n**How to use**\n\nSupply project_id and inspect seven-day score/alert rollups. Read individual monitor configuration before changing sampling or notification behavior.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"listEvalMonitorsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Case-insensitive name match","title":"Search","x-gitbook-description-html":"<p>Case-insensitive name match</p>\n"},"description":"Case-insensitive name match","x-gitbook-description-html":"<p>Case-insensitive name match</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_EvalMonitorListItemResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS --get \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  --data-urlencode \"project_id=${PROJECT_ID}\""}],"x-gitbook-description-html":"<p>List project monitors with their seven-day score and alert rollups.</p>\n<p><strong>How to use</strong></p>\n<p>Supply project_id and inspect seven-day score/alert rollups. Read individual monitor configuration before changing sampling or notification behavior.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createEvalMonitorV2"],"summary":"Create Eval Monitor","description":"Create a monitor with one reference-free evaluator and bounded sampling.\n\n**How to use**\n\nChoose one reference-free evaluator and bounded sampling. Read monitor-limits first; save the monitor ID and inspect statistics after representative production runs.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.create`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"project_id\": \"YOUR_PROJECT_ID\",\n  \"evaluator_id\": \"00000000-0000-4000-8000-000000000001\",\n  \"sampling_rate\": 0.1,\n  \"max_runs_daily\": 100\n}\n```","operationId":"createEvalMonitorV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalMonitorCreateRequestV2"},"example":{"project_id":"YOUR_PROJECT_ID","evaluator_id":"00000000-0000-4000-8000-000000000001","sampling_rate":0.1,"max_runs_daily":100}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorResponseV2_"}}},"headers":{"Location":{"description":"Created monitor URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Created monitor URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.create","x-required-scopes":["evals.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Create a monitor with one reference-free evaluator and bounded sampling.</p>\n<p><strong>How to use</strong></p>\n<p>Choose one reference-free evaluator and bounded sampling. Read monitor-limits first; save the monitor ID and inspect statistics after representative production runs.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.create</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;project_id&quot;: &quot;YOUR_PROJECT_ID&quot;,\n  &quot;evaluator_id&quot;: &quot;00000000-0000-4000-8000-000000000001&quot;,\n  &quot;sampling_rate&quot;: 0.1,\n  &quot;max_runs_daily&quot;: 100\n}\n</code></pre>\n"}},"/v2/evals/monitors/{monitor_id}":{"get":{"tags":["endpoint-getEvalMonitorV2"],"summary":"Get Eval Monitor","description":"Get one monitor's configuration and enabled state.\n\n**How to use**\n\nRead the current configuration and enabled state before a partial update. A monitor is a sampling policy, not an evaluation of every run.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalMonitorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get one monitor&#39;s configuration and enabled state.</p>\n<p><strong>How to use</strong></p>\n<p>Read the current configuration and enabled state before a partial update. A monitor is a sampling policy, not an evaluation of every run.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvalMonitorV2"],"summary":"Update Eval Monitor","description":"Update selected monitor fields, retaining omitted settings.\n\n**How to use**\n\nSend only settings to change and retain omitted values. Keep sampling within the current server limits; validate evaluator suitability when changing it.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"sampling_rate\": 0.1\n}\n```","operationId":"updateEvalMonitorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalMonitorUpdateRequestV2"},"example":{"sampling_rate":0.1}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"409":{"description":"Name conflict, concurrent operation, or dataset state prevents the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name conflict, concurrent operation, or dataset state prevents the operation</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Update selected monitor fields, retaining omitted settings.</p>\n<p><strong>How to use</strong></p>\n<p>Send only settings to change and retain omitted values. Keep sampling within the current server limits; validate evaluator suitability when changing it.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;sampling_rate&quot;: 0.1\n}\n</code></pre>\n"},"delete":{"tags":["endpoint-deleteEvalMonitorV2"],"summary":"Delete Eval Monitor","description":"Delete a monitor while retaining existing scores in run history.\n\n**How to use**\n\nRemove the monitor while retaining existing scores in run history. This is not an erasure of historical run evaluations.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.delete`. Resource and owner access checks also apply.","operationId":"deleteEvalMonitorV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.delete","x-required-scopes":["evals.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a monitor while retaining existing scores in run history.</p>\n<p><strong>How to use</strong></p>\n<p>Remove the monitor while retaining existing scores in run history. This is not an erasure of historical run evaluations.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/monitors/{monitor_id}/score-stats":{"get":{"tags":["endpoint-getEvalMonitorScoreStatsV2"],"summary":"Get Eval Monitor Score Stats","description":"Get windowed score trends and the monitor's current queue counters.\n\n**How to use**\n\nChoose 24h, 7d, 30d, or all. Inspect both trends and queue counters; low score volume may reflect sampling or queued work rather than lack of runs.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalMonitorScoreStatsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","all"],"type":"string","default":"7d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorScoreStatsResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}/score-stats\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get windowed score trends and the monitor&#39;s current queue counters.</p>\n<p><strong>How to use</strong></p>\n<p>Choose 24h, 7d, 30d, or all. Inspect both trends and queue counters; low score volume may reflect sampling or queued work rather than lack of runs.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/monitors/{monitor_id}/alert":{"get":{"tags":["endpoint-getEvalMonitorAlertV2"],"summary":"Get Eval Monitor Alert","description":"Read stored alert knobs, severity and resolved server defaults.\n\n**How to use**\n\nRead stored alert settings, current severity, and resolved defaults before tuning. Compare resolved values rather than assuming unset means disabled.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`. Resource and owner access checks also apply.","operationId":"getEvalMonitorAlertV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorAlertResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}/alert\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Read stored alert knobs, severity and resolved server defaults.</p>\n<p><strong>How to use</strong></p>\n<p>Read stored alert settings, current severity, and resolved defaults before tuning. Compare resolved values rather than assuming unset means disabled.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>. Resource and owner access checks also apply.</p>\n"},"patch":{"tags":["endpoint-updateEvalMonitorAlertV2"],"summary":"Update Eval Monitor Alert","description":"Tune alert settings; explicit null resets a knob to the server default.\n\n**How to use**\n\nOmit a knob to retain it; set it to null to restore the server default. Read back resolved settings after updating to verify the intended alert behavior.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.update`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{}\n```","operationId":"updateEvalMonitorAlertV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalMonitorAlertUpdateRequestV2"},"example":{}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalMonitorAlertResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.update","x-required-scopes":["evals.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X PATCH \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}/alert\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Tune alert settings; explicit null resets a knob to the server default.</p>\n<p><strong>How to use</strong></p>\n<p>Omit a knob to retain it; set it to null to restore the server default. Read back resolved settings after updating to verify the intended alert behavior.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.update</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{}\n</code></pre>\n"}},"/v2/evals/monitors/{monitor_id}/sampled-runs":{"get":{"tags":["endpoint-listEvalMonitorSampledRunsV2"],"summary":"List Eval Monitor Sampled Runs","description":"Page sampled runs and latest evaluator verdicts at the traversal's insertion cutoff.\n\n**How to use**\n\nRequires analytics.read as well as evals.read. Follow the cursor with unchanged filters; traversal preserves an insertion cutoff. Inspect the latest verdict associated with each sampled run.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`, `analytics.read`. Resource and owner access checks also apply.","operationId":"listEvalMonitorSampledRunsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Monitor Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["24h","7d","30d","all"],"type":"string","default":"7d","title":"Window"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["ZXhhbXBsZV9jdXJzb3I="],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_EvalMonitorSampledRunResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read","analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/monitors/${MONITOR_ID}/sampled-runs\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Page sampled runs and latest evaluator verdicts at the traversal&#39;s insertion cutoff.</p>\n<p><strong>How to use</strong></p>\n<p>Requires analytics.read as well as evals.read. Follow the cursor with unchanged filters; traversal preserves an insertion cutoff. Inspect the latest verdict associated with each sampled run.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>, <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/runs/{run_id}/scores":{"post":{"tags":["endpoint-createEvalRunScoreV2"],"summary":"Create Eval Run Score","description":"Append one score by evaluating an existing run with a reference-free evaluator.\n\n**How to use**\n\nEvaluate an existing run with a reference-free evaluator. Requires evals.run and analytics.read. Each call appends a score, so an ambiguous retry can add another history entry.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.run`, `analytics.read`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"evaluator_id\": \"00000000-0000-4000-8000-000000000001\"\n}\n```","operationId":"createEvalRunScoreV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunScoreCreateRequestV2"},"example":{"evaluator_id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalRunScoreResponseV2_"}}},"headers":{"Location":{"description":"Created run score URL","schema":{"type":"string"},"x-gitbook-description-html":"<p>Created run score URL</p>\n"}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"422":{"description":"Invalid evaluation contract, row shape, evaluator configuration, or filter combination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid evaluation contract, row shape, evaluator configuration, or filter combination</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.run","x-required-scopes":["evals.run","analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/runs/${RUN_ID}/scores\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Append one score by evaluating an existing run with a reference-free evaluator.</p>\n<p><strong>How to use</strong></p>\n<p>Evaluate an existing run with a reference-free evaluator. Requires evals.run and analytics.read. Each call appends a score, so an ambiguous retry can add another history entry.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.run</code>, <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;evaluator_id&quot;: &quot;00000000-0000-4000-8000-000000000001&quot;\n}\n</code></pre>\n"},"get":{"tags":["endpoint-listEvalRunScoresV2"],"summary":"List Eval Run Scores","description":"Page a run's append-only score history, oldest first.\n\n**How to use**\n\nRead append-only score history oldest first. Requires analytics.read as well as evals.read. Follow cursors and compare evaluator versions before interpreting changed scores.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`, `analytics.read`. Resource and owner access checks also apply.","operationId":"listEvalRunScoresV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","examples":["ZXhhbXBsZV9jdXJzb3I="],"title":"Cursor","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},"description":"Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.","x-gitbook-description-html":"<p>Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of items to be returned in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},"description":"Number of items to be returned in the page.","x-gitbook-description-html":"<p>Number of items to be returned in the page.</p>\n"},{"name":"direction","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationDirection","description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","default":"next","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"},"description":"Direction for pagination: 'next' to advance through pages (older items), 'prev' to go back (newer items)","x-gitbook-description-html":"<p>Direction for pagination: &#39;next&#39; to advance through pages (older items), &#39;prev&#39; to go back (newer items)</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_EvalRunScoreResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read","analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/runs/${RUN_ID}/scores\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Page a run&#39;s append-only score history, oldest first.</p>\n<p><strong>How to use</strong></p>\n<p>Read append-only score history oldest first. Requires analytics.read as well as evals.read. Follow cursors and compare evaluator versions before interpreting changed scores.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>, <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/evals/scores/{score_id}":{"get":{"tags":["endpoint-getEvalRunScoreV2"],"summary":"Get Eval Run Score","description":"Retrieve a retained run score by its unique score ID.\n\n**How to use**\n\nRetrieve one retained score by score ID with evals.read and analytics.read. Use this to link an exact verdict in a review, rather than relying on the latest score.\n\n**Authentication and permissions**\n\nRequired permissions: `evals.read`, `analytics.read`. Resource and owner access checks also apply.","operationId":"getEvalRunScoreV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"score_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Score Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_EvalRunScoreResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request or pagination cursor</p>\n"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Missing or invalid credentials</p>\n"},"403":{"description":"Denied permission, project folder access, or API-key scope (meta.required_scope)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Denied permission, project folder access, or API-key scope (meta.required_scope)</p>\n"},"404":{"description":"Resource not found in the caller's organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resource not found in the caller&#39;s organization</p>\n"},"4XX":{"description":"Client error returned in the public API envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Client error returned in the public API envelope</p>\n"}},"x-required-scope":"evals.read","x-required-scopes":["evals.read","analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/evals/scores/${SCORE_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Retrieve a retained run score by its unique score ID.</p>\n<p><strong>How to use</strong></p>\n<p>Retrieve one retained score by score ID with evals.read and analytics.read. Use this to link an exact verdict in a review, rather than relying on the latest score.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>evals.read</code>, <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n"}},"/analytics/org/{org_id}/flows/{flow_id}":{"get":{"tags":["endpoint-getAnalyticsDataApi"],"summary":"List Flow Runs","description":"List flow run logs matching the given filters.\n\n**How to use**\n\nUse this for existing legacy exports. Read the response as a list. `page` starts at 0; dates should include a timezone. `state` uses uppercase legacy states and may contain comma-separated values. Use a personal key or legacy private organization key, not the legacy public key.\n\n**Authentication and permissions**\n\nAuthentication: personal API key or supported legacy private organization key in the Bearer header. This legacy route does not declare a separate endpoint permission scope in the checked contract.","operationId":"getAnalyticsDataApi","security":[{"LegacyAPIKeyBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}},{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":25,"title":"Page Size"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED","title":"State","x-gitbook-description-html":"<p>Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED</p>\n"},"description":"Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED","x-gitbook-description-html":"<p>Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectRunSummary"},"title":"Response Getanalyticsdataapi"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/analytics/org/${ORG_ID}/flows/${FLOW_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List flow run logs matching the given filters.</p>\n<p><strong>How to use</strong></p>\n<p>Use this for existing legacy exports. Read the response as a list. <code>page</code> starts at 0; dates should include a timezone. <code>state</code> uses uppercase legacy states and may contain comma-separated values. Use a personal key or legacy private organization key, not the legacy public key.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Authentication: personal API key or supported legacy private organization key in the Bearer header. This legacy route does not declare a separate endpoint permission scope in the checked contract.</p>\n"}},"/v2/providers":{"get":{"tags":["endpoint-listProvidersV2"],"summary":"List Providers","description":"List integration providers available in the public catalog.\n\n**How to use**\n\nUse the returned provider IDs to discover actions and triggers; do not guess slugs. Advance offset/limit to inspect the full catalog. Listing a provider does not authorize use of any connection.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"listProvidersV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},"description":"Number of items to skip","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items per page","default":50,"title":"Limit","x-gitbook-description-html":"<p>Number of items per page</p>\n"},"description":"Number of items per page","x-gitbook-description-html":"<p>Number of items per page</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_ProviderResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List integration providers available in the public catalog.</p>\n<p><strong>How to use</strong></p>\n<p>Use the returned provider IDs to discover actions and triggers; do not guess slugs. Advance offset/limit to inspect the full catalog. Listing a provider does not authorize use of any connection.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}":{"get":{"tags":["endpoint-getProviderV2"],"summary":"Get Provider","description":"Get a single provider from the public catalog by id.\n\n**How to use**\n\nRead the descriptor for a provider selected from the catalog. Use its returned identifiers when fetching action and trigger collections.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"getProviderV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ProviderResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a single provider from the public catalog by id.</p>\n<p><strong>How to use</strong></p>\n<p>Read the descriptor for a provider selected from the catalog. Use its returned identifiers when fetching action and trigger collections.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}/actions":{"get":{"tags":["endpoint-listProviderActionsV2"],"summary":"List Provider Actions","description":"List a provider's actions; fetch a single action for its input/output schema.\n\n**How to use**\n\nChoose an action ID here, then fetch its detail before invoking it. List entries are for discovery and need not contain the full input/output contract.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"listProviderActionsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},"description":"Number of items to skip","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items per page","default":50,"title":"Limit","x-gitbook-description-html":"<p>Number of items per page</p>\n"},"description":"Number of items per page","x-gitbook-description-html":"<p>Number of items per page</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_ProviderActionSummaryResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}/actions\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List a provider&#39;s actions; fetch a single action for its input/output schema.</p>\n<p><strong>How to use</strong></p>\n<p>Choose an action ID here, then fetch its detail before invoking it. List entries are for discovery and need not contain the full input/output contract.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}/actions/{action_id}":{"get":{"tags":["endpoint-getProviderActionV2"],"summary":"Get Provider Action","description":"Get a provider action, including its input and output parameters.\n\n**How to use**\n\nUse the action-specific input and output parameter definitions to build inputs. Required fields, connection needs, and runtime behavior differ by action; there is no universal action payload.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"getProviderActionV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ProviderActionResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}/actions/${ACTION_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a provider action, including its input and output parameters.</p>\n<p><strong>How to use</strong></p>\n<p>Use the action-specific input and output parameter definitions to build inputs. Required fields, connection needs, and runtime behavior differ by action; there is no universal action payload.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}/triggers":{"get":{"tags":["endpoint-listProviderTriggersV2"],"summary":"List Provider Triggers","description":"List a provider's triggers; fetch a single trigger for its parameter schema.\n\n**How to use**\n\nDiscover the event sources an integration supports. Listing does not register, activate, or subscribe a workflow to a trigger.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"listProviderTriggersV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},"description":"Number of items to skip","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items per page","default":50,"title":"Limit","x-gitbook-description-html":"<p>Number of items per page</p>\n"},"description":"Number of items per page","x-gitbook-description-html":"<p>Number of items per page</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_ProviderTriggerSummaryResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}/triggers\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List a provider&#39;s triggers; fetch a single trigger for its parameter schema.</p>\n<p><strong>How to use</strong></p>\n<p>Discover the event sources an integration supports. Listing does not register, activate, or subscribe a workflow to a trigger.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}/triggers/{trigger_id}":{"get":{"tags":["endpoint-getProviderTriggerV2"],"summary":"Get Provider Trigger","description":"Get a provider trigger, including its input and output parameters.\n\n**How to use**\n\nRead the trigger-specific parameter contract for configuration in the supported workflow interface. This endpoint only reads a descriptor.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"getProviderTriggerV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_ProviderTriggerResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}/triggers/${TRIGGER_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get a provider trigger, including its input and output parameters.</p>\n<p><strong>How to use</strong></p>\n<p>Read the trigger-specific parameter contract for configuration in the supported workflow interface. This endpoint only reads a descriptor.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/providers/{provider_id}/actions/{action_id}/run":{"post":{"tags":["endpoint-runProviderActionV2"],"summary":"Run Provider Action","description":"Run a provider action synchronously and return its outputs.\n\n**How to use**\n\nSelect a compatible accessible connection and submit inputs matching this action. Omit connection_id only when supported by that action. This synchronous call can change a third-party system; do not automatically repeat an ambiguous write.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.use`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"connection_id\": \"00000000-0000-4000-8000-000000000001\",\n  \"inputs\": {\n    \"ACTION_SPECIFIC_FIELD\": \"VALUE\"\n  }\n}\n```","operationId":"runProviderActionV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunProviderActionRequestV2"},"example":{"connection_id":"00000000-0000-4000-8000-000000000001","inputs":{"ACTION_SPECIFIC_FIELD":"VALUE"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_RunProviderActionResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.use"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/providers/${PROVIDER_ID}/actions/${ACTION_ID}/run\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Run a provider action synchronously and return its outputs.</p>\n<p><strong>How to use</strong></p>\n<p>Select a compatible accessible connection and submit inputs matching this action. Omit connection_id only when supported by that action. This synchronous call can change a third-party system; do not automatically repeat an ambiguous write.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.use</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;connection_id&quot;: &quot;00000000-0000-4000-8000-000000000001&quot;,\n  &quot;inputs&quot;: {\n    &quot;ACTION_SPECIFIC_FIELD&quot;: &quot;VALUE&quot;\n  }\n}\n</code></pre>\n"}},"/v2/connections":{"get":{"tags":["endpoint-listConnectionsV2"],"summary":"List Connections","description":"List connections visible to the caller in their organization.\n\nVisibility follows RBAC: a non-admin sees connections they created, shared with them\n(directly or via a group), or carrying an org-level role; an admin sees the whole\norganization. Degraded connections (rehydration failed) are included with\n`status=\"needs_reconnection\"`, not dropped.\n\n**How to use**\n\nFilter by a catalog provider_id and select a connection you may use. Non-admin results are access-filtered; missing entries may be unshared. needs_reconnection means repair is needed. This API has no connection-create route.\n\n**Authentication and permissions**\n\nRequired permissions: `connections.read`. Resource and owner access checks also apply.","operationId":"listConnectionsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider id","title":"Provider Id","x-gitbook-description-html":"<p>Filter by provider id</p>\n"},"description":"Filter by provider id","x-gitbook-description-html":"<p>Filter by provider id</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},"description":"Number of items to skip","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items per page","default":50,"title":"Limit","x-gitbook-description-html":"<p>Number of items per page</p>\n"},"description":"Number of items per page","x-gitbook-description-html":"<p>Number of items per page</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_ConnectionResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["connections.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/connections\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List connections visible to the caller in their organization.</p>\n<p>Visibility follows RBAC: a non-admin sees connections they created, shared with them\n(directly or via a group), or carrying an org-level role; an admin sees the whole\norganization. Degraded connections (rehydration failed) are included with\n<code>status=&quot;needs_reconnection&quot;</code>, not dropped.</p>\n<p><strong>How to use</strong></p>\n<p>Filter by a catalog provider_id and select a connection you may use. Non-admin results are access-filtered; missing entries may be unshared. needs_reconnection means repair is needed. This API has no connection-create route.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>connections.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/webhooks/subscriptions":{"post":{"tags":["endpoint-createWebhookSubscriptionV2"],"summary":"Create Webhook Subscription","description":"Register a webhook endpoint and return its signing secret.\n\nThe secret is returned only here. It cannot be recovered later, so a caller that loses it\nhas to delete the subscription and create a new one.\n\n**How to use**\n\nConfigure and test an HTTPS receiver first. Capture the returned signing secret immediately; it is returned only at creation. Use an authorized administrator session for org.webhooks.manage, which is not an assignable restricted API-key scope. Verify event emission in your deployment before relying on callbacks.\n\n**Authentication and permissions**\n\nRequired permissions: `org.webhooks.manage`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"url\": \"https://your-service.example.com/webhooks/stackai\",\n  \"event_types\": [\n    \"run.succeeded\",\n    \"run.failed\"\n  ]\n}\n```","operationId":"createWebhookSubscriptionV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookSubscriptionRequestV2"},"example":{"url":"https://your-service.example.com/webhooks/stackai","event_types":["run.succeeded","run.failed"]}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_WebhookSubscriptionWithSecretResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["org.webhooks.manage"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/webhooks/subscriptions\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Register a webhook endpoint and return its signing secret.</p>\n<p>The secret is returned only here. It cannot be recovered later, so a caller that loses it\nhas to delete the subscription and create a new one.</p>\n<p><strong>How to use</strong></p>\n<p>Configure and test an HTTPS receiver first. Capture the returned signing secret immediately; it is returned only at creation. Use an authorized administrator session for org.webhooks.manage, which is not an assignable restricted API-key scope. Verify event emission in your deployment before relying on callbacks.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>org.webhooks.manage</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;url&quot;: &quot;https://your-service.example.com/webhooks/stackai&quot;,\n  &quot;event_types&quot;: [\n    &quot;run.succeeded&quot;,\n    &quot;run.failed&quot;\n  ]\n}\n</code></pre>\n"},"get":{"tags":["endpoint-listWebhookSubscriptionsV2"],"summary":"List Webhook Subscriptions","description":"List the organization's active webhook subscriptions, oldest first.\n\n**How to use**\n\nInventory active subscriptions oldest first using offset/limit. The signing secret is not recoverable here. Subscription existence does not prove your runtime emits every accepted event type.\n\n**Authentication and permissions**\n\nRequired permissions: `org.webhooks.manage`. Resource and owner access checks also apply.","operationId":"listWebhookSubscriptionsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},"description":"Number of items to skip","x-gitbook-description-html":"<p>Number of items to skip</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of items per page","default":50,"title":"Limit","x-gitbook-description-html":"<p>Number of items per page</p>\n"},"description":"Number of items per page","x-gitbook-description-html":"<p>Number of items per page</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_WebhookSubscriptionResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["org.webhooks.manage"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/webhooks/subscriptions\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List the organization&#39;s active webhook subscriptions, oldest first.</p>\n<p><strong>How to use</strong></p>\n<p>Inventory active subscriptions oldest first using offset/limit. The signing secret is not recoverable here. Subscription existence does not prove your runtime emits every accepted event type.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>org.webhooks.manage</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/webhooks/subscriptions/{subscription_id}":{"delete":{"tags":["endpoint-deleteWebhookSubscriptionV2"],"summary":"Delete Webhook Subscription","description":"Delete a webhook subscription: deliveries stop and it leaves the list.\n\n**How to use**\n\nUse the subscription ID returned by create/list. Deleting stops deliveries and removes it from active listing. To change a URL or replace a lost secret, create a replacement and retire the old subscription; no PATCH route is defined.\n\n**Authentication and permissions**\n\nRequired permissions: `org.webhooks.manage`. Resource and owner access checks also apply.","operationId":"deleteWebhookSubscriptionV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["org.webhooks.manage"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/webhooks/subscriptions/${SUBSCRIPTION_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete a webhook subscription: deliveries stop and it leaves the list.</p>\n<p><strong>How to use</strong></p>\n<p>Use the subscription ID returned by create/list. Deleting stops deliveries and removes it from active listing. To change a URL or replace a lost secret, create a replacement and retire the old subscription; no PATCH route is defined.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>org.webhooks.manage</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/runs":{"post":{"tags":["endpoint-startRunV2"],"summary":"Start Run","description":"Start a run of a project version and return its current persisted state.\n\n**How to use**\n\nSend `project_id` and singular `input`. A 201 creates a run but does not mean it succeeded. Persist `data.run_id`, then poll with analytics.read. Omitted/null project_version selects published, -1 selects draft, and a nonnegative integer pins a snapshot. A 500 can occur after execution starts; reconcile instead of automatically retrying.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"project_id\": \"YOUR_PROJECT_ID\",\n  \"input\": {\n    \"in-0\": \"Summarize our refund policy\"\n  },\n  \"project_version\": 1\n}\n```","operationId":"startRunV2","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStartRequestV2"},"example":{"project_id":"YOUR_PROJECT_ID","input":{"in-0":"Summarize our refund policy"},"project_version":1}}}},"responses":{"201":{"description":"Run created. Execution is asynchronous; poll the Location URL for progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_RunResponseV2_"},"examples":{"queued":{"summary":"Run accepted; save the run ID","value":{"data":{"run_id":"5f4c3b2a-1111-4111-8111-123456789abc","project_id":"YOUR_PROJECT_ID","project_version":1,"status":"queued","error":null,"created_at":"2026-10-05T12:00:00Z","started_at":null,"completed_at":null,"run_type":"api","created_by":null,"usage":{"total_tokens":0,"details":[]},"parent_run_id":null,"parent_project_id":null,"input":{"in-0":"Summarize our refund policy"},"output":null,"citations":null,"pending_input":null}}}}}},"x-gitbook-description-html":"<p>Run created. Execution is asynchronous; poll the Location URL for progress.</p>\n"},"400":{"description":"Invalid request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request body.</p>\n"},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required.</p>\n"},"402":{"description":"Organization usage limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Organization usage limit reached.</p>\n"},"403":{"description":"Project run permission or credential scope required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"},"example":{"detail":["The credential does not have the required permission."],"meta":{"required_scope":"projects.run"}}}},"x-gitbook-description-html":"<p>Project run permission or credential scope required.</p>\n"},"404":{"description":"Project or requested project version not found, project not published, or run logging disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Project or requested project version not found, project not published, or run logging disabled.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"},"500":{"description":"Run start or response retrieval failed; execution may already have started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run start or response retrieval failed; execution may already have started.</p>\n"},"503":{"description":"Run reservation failed; execution was not dispatched.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run reservation failed; execution was not dispatched.</p>\n"}},"x-required-scopes":["projects.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/runs\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Start a run of a project version and return its current persisted state.</p>\n<p><strong>How to use</strong></p>\n<p>Send <code>project_id</code> and singular <code>input</code>. A 201 creates a run but does not mean it succeeded. Persist <code>data.run_id</code>, then poll with analytics.read. Omitted/null project_version selects published, -1 selects draft, and a nonnegative integer pins a snapshot. A 500 can occur after execution starts; reconcile instead of automatically retrying.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;project_id&quot;: &quot;YOUR_PROJECT_ID&quot;,\n  &quot;input&quot;: {\n    &quot;in-0&quot;: &quot;Summarize our refund policy&quot;\n  },\n  &quot;project_version&quot;: 1\n}\n</code></pre>\n"},"get":{"tags":["endpoint-listRunsV2"],"summary":"List Runs","description":"List runs in accessible projects newest first.\n\n**How to use**\n\nUse this for run history or reconciliation. Follow next_cursor with unchanged filters. created_by_id is the exact returned actor ID; personal-key runs use the owner ID. Status filters use lowercase v2 values.\n\n**Authentication and permissions**\n\nRequired permissions: `analytics.read`. Resource and owner access checks also apply.","operationId":"listRunsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"project_id","description":"Only return runs of this project.","x-gitbook-description-html":"<p>Only return runs of this project.</p>\n"},"description":"Only return runs of this project.","x-gitbook-description-html":"<p>Only return runs of this project.</p>\n"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunStatusV2"},{"type":"null"}],"title":"status","description":"Only return runs currently in this status.","x-gitbook-description-html":"<p>Only return runs currently in this status.</p>\n"},"description":"Only return runs currently in this status.","x-gitbook-description-html":"<p>Only return runs currently in this status.</p>\n"},{"name":"run_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunTypeV2"},{"type":"null"}],"title":"run_type","description":"Only return runs started this way. `unknown` is not filterable because it represents an unpublished value.","x-gitbook-description-html":"<p>Only return runs started this way. <code>unknown</code> is not filterable because it represents an unpublished value.</p>\n"},"description":"Only return runs started this way. `unknown` is not filterable because it represents an unpublished value.","x-gitbook-description-html":"<p>Only return runs started this way. <code>unknown</code> is not filterable because it represents an unpublished value.</p>\n"},{"name":"created_by_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"created_by_id","description":"Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner's user ID.","x-gitbook-description-html":"<p>Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner&#39;s user ID.</p>\n"},"description":"Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner's user ID.","x-gitbook-description-html":"<p>Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner&#39;s user ID.</p>\n"},{"name":"created_at__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"created_at__gte","description":"Only return runs created at or after this time.","x-gitbook-description-html":"<p>Only return runs created at or after this time.</p>\n"},"description":"Only return runs created at or after this time.","x-gitbook-description-html":"<p>Only return runs created at or after this time.</p>\n"},{"name":"created_at__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"created_at__lte","description":"Only return runs created at or before this time.","x-gitbook-description-html":"<p>Only return runs created at or before this time.</p>\n"},"description":"Only return runs created at or before this time.","x-gitbook-description-html":"<p>Only return runs created at or before this time.</p>\n"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque identifier for the page to return, taken from a previous response's `next_cursor`. Omit it to read the first page.","title":"Cursor","x-gitbook-description-html":"<p>Opaque identifier for the page to return, taken from a previous response&#39;s <code>next_cursor</code>. Omit it to read the first page.</p>\n"},"description":"Opaque identifier for the page to return, taken from a previous response's `next_cursor`. Omit it to read the first page.","x-gitbook-description-html":"<p>Opaque identifier for the page to return, taken from a previous response&#39;s <code>next_cursor</code>. Omit it to read the first page.</p>\n"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of runs to return in the page.","default":50,"title":"Page Size","x-gitbook-description-html":"<p>Number of runs to return in the page.</p>\n"},"description":"Number of runs to return in the page.","x-gitbook-description-html":"<p>Number of runs to return in the page.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_RunSummaryResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid cursor or filter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid cursor or filter.</p>\n"},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required.</p>\n"},"403":{"description":"Analytics read permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Analytics read permission required.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/runs\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List runs in accessible projects newest first.</p>\n<p><strong>How to use</strong></p>\n<p>Use this for run history or reconciliation. Follow next_cursor with unchanged filters. created_by_id is the exact returned actor ID; personal-key runs use the owner ID. Status filters use lowercase v2 values.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/runs/{run_id}":{"get":{"tags":["endpoint-getRunV2"],"summary":"Get Run","description":"Get one of the organization's runs with its full payload.\n\n**How to use**\n\nPoll this after creation and inspect data.status. A 200 response can describe a failed run. The input/output may be null, and logging controls can block detail reads. pending_input is only exposed when the caller can both read and resume the run.\n\n**Authentication and permissions**\n\nRequired permissions: `analytics.read`. Resource and owner access checks also apply.","operationId":"getRunV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_RunResponseV2_"},"examples":{"running":{"summary":"Running run","value":{"data":{"run_id":"5f4c3b2a-1111-4111-8111-123456789abc","project_id":"YOUR_PROJECT_ID","project_version":1,"status":"running","error":null,"created_at":"2026-10-05T12:00:00Z","started_at":"2026-10-05T12:00:01Z","completed_at":null,"run_type":"api","created_by":null,"usage":{"total_tokens":0,"details":[]},"parent_run_id":null,"parent_project_id":null,"input":{"in-0":"Summarize our refund policy"},"output":null,"citations":null,"pending_input":null}}},"succeeded":{"summary":"Succeeded run","value":{"data":{"run_id":"5f4c3b2a-1111-4111-8111-123456789abc","project_id":"YOUR_PROJECT_ID","project_version":1,"status":"succeeded","error":null,"created_at":"2026-10-05T12:00:00Z","started_at":"2026-10-05T12:00:01Z","completed_at":"2026-10-05T12:00:03Z","run_type":"api","created_by":null,"usage":{"total_tokens":0,"details":[]},"parent_run_id":null,"parent_project_id":null,"input":{"in-0":"Summarize our refund policy"},"output":{"out-0":"Eligible purchases can be returned within 30 days."},"citations":null,"pending_input":null}}},"failed":{"summary":"Failed run","value":{"data":{"run_id":"5f4c3b2a-1111-4111-8111-123456789abc","project_id":"YOUR_PROJECT_ID","project_version":1,"status":"failed","error":"The connected service could not complete the request.","created_at":"2026-10-05T12:00:00Z","started_at":"2026-10-05T12:00:01Z","completed_at":"2026-10-05T12:00:03Z","run_type":"api","created_by":null,"usage":{"total_tokens":0,"details":[]},"parent_run_id":null,"parent_project_id":null,"input":{"in-0":"Summarize our refund policy"},"output":null,"citations":null,"pending_input":null}}}}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid run ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid run ID.</p>\n"},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required.</p>\n"},"403":{"description":"Analytics read permission required or run logging disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"},"example":{"detail":["The credential does not have the required permission."],"meta":{"required_scope":"analytics.read"}}}},"x-gitbook-description-html":"<p>Analytics read permission required or run logging disabled.</p>\n"},"404":{"description":"Run not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run not found.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"}},"x-required-scopes":["analytics.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/runs/${RUN_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Get one of the organization&#39;s runs with its full payload.</p>\n<p><strong>How to use</strong></p>\n<p>Poll this after creation and inspect data.status. A 200 response can describe a failed run. The input/output may be null, and logging controls can block detail reads. pending_input is only exposed when the caller can both read and resume the run.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>analytics.read</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/runs/{run_id}/cancel":{"post":{"tags":["endpoint-cancelRunV2"],"summary":"Cancel Run","description":"Request cancellation of an accessible run owned by this authenticated actor.\n\nOwnership matches the actor type and identity that started the run, including\nthe distinction between a personal API key and a platform session. Acceptance\nacknowledges the request; it does not guarantee execution has already stopped.\nPolling the Location URL separately requires analytics read permission.\n\n**How to use**\n\nUse the originating actor type and identity. A 202 acknowledges cancellation signalling, not a stopped execution; poll afterward. A 404 can indicate nonownership. Side effects already performed cannot be undone by cancellation.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.run`. Resource and owner access checks also apply.","operationId":"cancelRunV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"202":{"description":"Cancellation accepted. Poll the Location URL for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIResponse"}}},"x-gitbook-description-html":"<p>Cancellation accepted. Poll the Location URL for the current run state.</p>\n"},"400":{"description":"Invalid run ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid run ID.</p>\n"},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required.</p>\n"},"403":{"description":"Project run permission or credential scope required, or run logging disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Project run permission or credential scope required, or run logging disabled.</p>\n"},"404":{"description":"Run not found, inaccessible, or not owned by the authenticated actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run not found, inaccessible, or not owned by the authenticated actor.</p>\n"},"409":{"description":"Run is no longer cancellable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run is no longer cancellable.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"},"500":{"description":"Cancellation signalling failed; the request may already have changed run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Cancellation signalling failed; the request may already have changed run state.</p>\n"}},"x-required-scopes":["projects.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X POST \\\n  \"$STACKAI_BASE_URL/v2/runs/${RUN_ID}/cancel\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Request cancellation of an accessible run owned by this authenticated actor.</p>\n<p>Ownership matches the actor type and identity that started the run, including\nthe distinction between a personal API key and a platform session. Acceptance\nacknowledges the request; it does not guarantee execution has already stopped.\nPolling the Location URL separately requires analytics read permission.</p>\n<p><strong>How to use</strong></p>\n<p>Use the originating actor type and identity. A 202 acknowledges cancellation signalling, not a stopped execution; poll afterward. A 404 can indicate nonownership. Side effects already performed cannot be undone by cancellation.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.run</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/runs/{run_id}/resume":{"post":{"tags":["endpoint-resumeRunV2"],"summary":"Resume Run","description":"Accept an asynchronous response to a paused ask-human step.\n\n**How to use**\n\nGET the paused run first, handle the human response, and send the issued resume token. Poll after 202. A 409 means state or pause/backend support is incompatible. On 500, usage may already have been charged; read current state before retrying.\n\n**Authentication and permissions**\n\nRequired permissions: `projects.run`. Resource and owner access checks also apply.\n\n**Prepare request.json**\n\nSave the example body below as `request.json` for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.\n\n```json\n{\n  \"resume_token\": \"TOKEN_FROM_PENDING_INPUT\",\n  \"response\": \"THE_HUMAN_ANSWER\",\n  \"response_type\": \"text\"\n}\n```","operationId":"resumeRunV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResumeRequestV2"},"example":{"resume_token":"TOKEN_FROM_PENDING_INPUT","response":"THE_HUMAN_ANSWER","response_type":"text"}}}},"responses":{"202":{"description":"Resume accepted. Poll the Location URL for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIResponse"}}},"x-gitbook-description-html":"<p>Resume accepted. Poll the Location URL for the current run state.</p>\n"},"400":{"description":"Invalid or expired resume token, run ID or request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid or expired resume token, run ID or request body.</p>\n"},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required.</p>\n"},"402":{"description":"Organization usage limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Organization usage limit reached.</p>\n"},"403":{"description":"Project run permission or credential scope required, or run logging disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Project run permission or credential scope required, or run logging disabled.</p>\n"},"404":{"description":"Run not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run not found or inaccessible.</p>\n"},"409":{"description":"Run is not resumable or requires an unsupported pause or backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Run is not resumable or requires an unsupported pause or backend.</p>\n"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"x-gitbook-description-html":"<p>Validation Error</p>\n"},"500":{"description":"Resume failed; usage may already have been charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Resume failed; usage may already have been charged.</p>\n"}},"x-required-scopes":["projects.run"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/runs/${RUN_ID}/resume\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  --data-binary @request.json"}],"x-gitbook-description-html":"<p>Accept an asynchronous response to a paused ask-human step.</p>\n<p><strong>How to use</strong></p>\n<p>GET the paused run first, handle the human response, and send the issued resume token. Poll after 202. A 409 means state or pause/backend support is incompatible. On 500, usage may already have been charged; read current state before retrying.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>projects.run</code>. Resource and owner access checks also apply.</p>\n<p><strong>Prepare request.json</strong></p>\n<p>Save the example body below as <code>request.json</code> for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.</p>\n<pre><code class=\"language-json\">{\n  &quot;resume_token&quot;: &quot;TOKEN_FROM_PENDING_INPUT&quot;,\n  &quot;response&quot;: &quot;THE_HUMAN_ANSWER&quot;,\n  &quot;response_type&quot;: &quot;text&quot;\n}\n</code></pre>\n"}},"/v2/skills":{"get":{"tags":["endpoint-listSkillsV2"],"summary":"List Skills","description":"List visible skills, with builtins first followed by organization skills.\n\n**How to use**\n\nBrowse built-in skills first, followed by visible organization skills. Save the skill ID and fetch a pinned version when reproducibility matters.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.read`. Resource and owner access checks also apply.","operationId":"listSkillsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_SkillListItemResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.read","x-required-scopes":["skills.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>List visible skills, with builtins first followed by organization skills.</p>\n<p><strong>How to use</strong></p>\n<p>Browse built-in skills first, followed by visible organization skills. Save the skill ID and fetch a pinned version when reproducibility matters.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createSkillV2"],"summary":"Create Skill","description":"Create and publish the first version from a multipart bundle or form fields.\n\n**How to use**\n\nPublish the first version using multipart form fields or bundle files. Use files (plural), repeat parts for multiple files, preserve relative paths, or upload a zip. Save the created skill ID and version. A name conflict is 409; invalid/oversized bundles are 422.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.create`. Resource and owner access checks also apply.","operationId":"createSkillV2","security":[{"HTTPBearer":[]}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_createSkillV2"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_SkillResponseV2_"}}},"headers":{"Location":{"description":"URL of the created resource","schema":{"type":"string"},"x-gitbook-description-html":"<p>URL of the created resource</p>\n"}},"x-gitbook-description-html":"<p>Created</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"409":{"description":"Name or version conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name or version conflict</p>\n"},"422":{"description":"Invalid skill bundle, including oversized uploads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid skill bundle, including oversized uploads</p>\n"},"500":{"description":"Skill persistence failed; internal details are not exposed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill persistence failed; internal details are not exposed</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.create","x-required-scopes":["skills.create"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -F 'files=@skill.zip'"}],"x-gitbook-description-html":"<p>Create and publish the first version from a multipart bundle or form fields.</p>\n<p><strong>How to use</strong></p>\n<p>Publish the first version using multipart form fields or bundle files. Use files (plural), repeat parts for multiple files, preserve relative paths, or upload a zip. Save the created skill ID and version. A name conflict is 409; invalid/oversized bundles are 422.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.create</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/skills/{skill_id}":{"get":{"tags":["endpoint-getSkillV2"],"summary":"Get Skill","description":"Retrieve the latest published skill and its public file manifest.\n\n**How to use**\n\nRead the current published instructions and public file manifest. Latest can change; use the version endpoint for an integration pinned to reviewed instructions.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.read`. Resource and owner access checks also apply.","operationId":"getSkillV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},"description":"ID of the skill.","x-gitbook-description-html":"<p>ID of the skill.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_SkillResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill or version not found</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.read","x-required-scopes":["skills.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills/${SKILL_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Retrieve the latest published skill and its public file manifest.</p>\n<p><strong>How to use</strong></p>\n<p>Read the current published instructions and public file manifest. Latest can change; use the version endpoint for an integration pinned to reviewed instructions.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.read</code>. Resource and owner access checks also apply.</p>\n"},"delete":{"tags":["endpoint-deleteSkillV2"],"summary":"Delete Skill","description":"Delete an owned skill and all versions; organization admins may delete any org skill.\n\n**How to use**\n\nThis removes the skill and all versions. It is not a single-version unpublish. Ownership is required unless an organization administrator is deleting an organization skill.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.delete`. Resource and owner access checks also apply.","operationId":"deleteSkillV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},"description":"ID of the skill.","x-gitbook-description-html":"<p>ID of the skill.</p>\n"}],"responses":{"204":{"description":"Successful Response","x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill or version not found</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.delete","x-required-scopes":["skills.delete"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS -X DELETE \\\n  \"$STACKAI_BASE_URL/v2/skills/${SKILL_ID}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Delete an owned skill and all versions; organization admins may delete any org skill.</p>\n<p><strong>How to use</strong></p>\n<p>This removes the skill and all versions. It is not a single-version unpublish. Ownership is required unless an organization administrator is deleting an organization skill.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.delete</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/skills/{skill_id}/versions":{"get":{"tags":["endpoint-listSkillVersionsV2"],"summary":"List Skill Versions","description":"Page through a skill's version history, newest first.\n\n**How to use**\n\nList newest versions first with offset pagination. Choose an explicit version for an auditable release or rollback decision.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.read`. Resource and owner access checks also apply.","operationId":"listSkillVersionsV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},"description":"ID of the skill.","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip.","default":0,"title":"Offset","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},"description":"Number of items to skip.","x-gitbook-description-html":"<p>Number of items to skip.</p>\n"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of items to return.","default":50,"title":"Limit","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"},"description":"Maximum number of items to return.","x-gitbook-description-html":"<p>Maximum number of items to return.</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffsetBasedPaginationResponse_SkillVersionListItemResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill or version not found</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.read","x-required-scopes":["skills.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills/${SKILL_ID}/versions\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Page through a skill&#39;s version history, newest first.</p>\n<p><strong>How to use</strong></p>\n<p>List newest versions first with offset pagination. Choose an explicit version for an auditable release or rollback decision.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.read</code>. Resource and owner access checks also apply.</p>\n"},"post":{"tags":["endpoint-createSkillVersionV2"],"summary":"Create Skill Version","description":"Publish a new version, optionally carrying files from a previous version.\n\n**How to use**\n\nPublish a new revision. Repeat carry_paths for files to keep; base_version selects the source version (current by default). Supplying a different name can rename the skill. Review the assembled bundle before publishing.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.update`. Resource and owner access checks also apply.","operationId":"createSkillVersionV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},"description":"ID of the skill.","x-gitbook-description-html":"<p>ID of the skill.</p>\n"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_createSkillVersionV2"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_SkillVersionResponseV2_"}}},"headers":{"Location":{"description":"URL of the created resource","schema":{"type":"string"},"x-gitbook-description-html":"<p>URL of the created resource</p>\n"}},"x-gitbook-description-html":"<p>Created</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill or version not found</p>\n"},"409":{"description":"Name or version conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Name or version conflict</p>\n"},"422":{"description":"Invalid skill bundle, including oversized uploads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid skill bundle, including oversized uploads</p>\n"},"500":{"description":"Skill persistence failed; internal details are not exposed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill persistence failed; internal details are not exposed</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.update","x-required-scopes":["skills.update"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills/${SKILL_ID}/versions\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\" \\\n  -F 'files=@skill.zip'"}],"x-gitbook-description-html":"<p>Publish a new version, optionally carrying files from a previous version.</p>\n<p><strong>How to use</strong></p>\n<p>Publish a new revision. Repeat carry_paths for files to keep; base_version selects the source version (current by default). Supplying a different name can rename the skill. Review the assembled bundle before publishing.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.update</code>. Resource and owner access checks also apply.</p>\n"}},"/v2/skills/{skill_id}/versions/{version}":{"get":{"tags":["endpoint-getSkillVersionV2"],"summary":"Get Skill Version","description":"Retrieve one published version's instructions and public file manifest.\n\n**How to use**\n\nFetch the exact 1-based version number. The response includes instructions and a public file manifest; retain this version alongside the consuming workflow configuration.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.read`. Resource and owner access checks also apply.","operationId":"getSkillVersionV2","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},"description":"ID of the skill.","x-gitbook-description-html":"<p>ID of the skill.</p>\n"},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"description":"Skill version number (1-based).","title":"Version","x-gitbook-description-html":"<p>Skill version number (1-based).</p>\n"},"description":"Skill version number (1-based).","x-gitbook-description-html":"<p>Skill version number (1-based).</p>\n"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_SkillVersionResponseV2_"}}},"x-gitbook-description-html":"<p>Successful Response</p>\n"},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Invalid request parameters</p>\n"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Authentication required</p>\n"},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Permission denied; insufficient API-key scope includes meta.required_scope</p>\n"},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Skill or version not found</p>\n"},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}},"x-gitbook-description-html":"<p>Other client errors use the same public error envelope</p>\n"}},"x-required-scope":"skills.read","x-required-scopes":["skills.read"],"x-hideTryItPanel":false,"x-codeSamples":[{"lang":"cURL","label":"curl","source":"curl --fail-with-body -sS \\\n  \"$STACKAI_BASE_URL/v2/skills/${SKILL_ID}/versions/${VERSION}\" \\\n  -H \"Authorization: Bearer $STACKAI_API_KEY\""}],"x-gitbook-description-html":"<p>Retrieve one published version&#39;s instructions and public file manifest.</p>\n<p><strong>How to use</strong></p>\n<p>Fetch the exact 1-based version number. The response includes instructions and a public file manifest; retain this version alongside the consuming workflow configuration.</p>\n<p><strong>Authentication and permissions</strong></p>\n<p>Required permissions: <code>skills.read</code>. Resource and owner access checks also apply.</p>\n"}}},"components":{"schemas":{"Body_createSkillV2":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files","description":"Bundle files; each part's filename is its relative POSIX path inside the bundle (optionally under one shared root folder). A single .zip is accepted as an alternative.","x-gitbook-description-html":"<p>Bundle files; each part&#39;s filename is its relative POSIX path inside the bundle (optionally under one shared root folder). A single .zip is accepted as an alternative.</p>\n"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Skill name (form mode); a changed name renames the skill when published.","x-gitbook-description-html":"<p>Skill name (form mode); a changed name renames the skill when published.</p>\n"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Skill description (form mode)."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"SKILL.md body (form mode).","x-gitbook-description-html":"<p>SKILL.md body (form mode).</p>\n"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions","description":"Action refs; repeat the field per item.","x-gitbook-description-html":"<p>Action refs; repeat the field per item.</p>\n"}},"type":"object","title":"Body_createSkillV2"},"Body_createSkillVersionV2":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files","description":"Bundle files; each part's filename is its relative POSIX path inside the bundle (optionally under one shared root folder). A single .zip is accepted as an alternative.","x-gitbook-description-html":"<p>Bundle files; each part&#39;s filename is its relative POSIX path inside the bundle (optionally under one shared root folder). A single .zip is accepted as an alternative.</p>\n"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Skill name (form mode); a changed name renames the skill when published.","x-gitbook-description-html":"<p>Skill name (form mode); a changed name renames the skill when published.</p>\n"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Skill description (form mode)."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"SKILL.md body (form mode).","x-gitbook-description-html":"<p>SKILL.md body (form mode).</p>\n"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions","description":"Action refs; repeat the field per item.","x-gitbook-description-html":"<p>Action refs; repeat the field per item.</p>\n"},"carry_paths":{"items":{"type":"string"},"type":"array","title":"Carry Paths","description":"File paths to carry over unchanged from the current files; repeat the field per item.","x-gitbook-description-html":"<p>File paths to carry over unchanged from the current files; repeat the field per item.</p>\n"},"base_version":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Base Version","description":"Version to copy carry_paths from; defaults to the current version.","x-gitbook-description-html":"<p>Version to copy carry_paths from; defaults to the current version.</p>\n"}},"type":"object","title":"Body_createSkillVersionV2"},"Body_uploadKnowledgeBaseResource":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"The file to upload to the knowledge base","x-gitbook-description-html":"<p>The file to upload to the knowledge base</p>\n"}},"type":"object","required":["file"],"title":"Body_uploadKnowledgeBaseResource"},"Body_uploadKnowledgeBaseResourceV2":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"The file to upload to the knowledge base","x-gitbook-description-html":"<p>The file to upload to the knowledge base</p>\n"}},"type":"object","required":["file"],"title":"Body_uploadKnowledgeBaseResourceV2"},"BooleanProperty":{"properties":{"type":{"type":"string","const":"boolean","title":"Type","default":"boolean"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"order":{"type":"integer","minimum":0,"title":"Order","description":"Display order of this property within the schema.","default":0,"x-gitbook-description-html":"<p>Display order of this property within the schema.</p>\n"}},"type":"object","title":"BooleanProperty"},"CacheMeasurement":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"read_input_tokens":{"type":"integer","minimum":0,"title":"Read Input Tokens"},"observed_input_tokens":{"type":"integer","minimum":0,"title":"Observed Input Tokens"}},"type":"object","required":["read_input_tokens","observed_input_tokens"],"title":"CacheMeasurement","description":"A measured subset of provider input, excluding unobserved calls.","x-gitbook-description-html":"<p>A measured subset of provider input, excluding unobserved calls.</p>\n"},"CacheMetrics":{"properties":{"read_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Read Input Tokens"},"observed_input_tokens":{"type":"integer","minimum":0,"title":"Observed Input Tokens","default":0},"known_input_tokens":{"type":"integer","minimum":0,"title":"Known Input Tokens","default":0},"missing_input_usage_records":{"type":"integer","minimum":0,"title":"Missing Input Usage Records","default":0},"cached_input_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Input Percent","description":"Return cache-read share for precisely the measured subset.","readOnly":true,"x-gitbook-description-html":"<p>Return cache-read share for precisely the measured subset.</p>\n"},"input_coverage_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Coverage Percent","description":"Return observed share of recorded input, not provider-attempt coverage.","readOnly":true,"x-gitbook-description-html":"<p>Return observed share of recorded input, not provider-attempt coverage.</p>\n"}},"type":"object","required":["cached_input_percent","input_coverage_percent"],"title":"CacheMetrics","description":"Weighted cache reads over measured input, including writes but excluding output.","x-gitbook-description-html":"<p>Weighted cache reads over measured input, including writes but excluding output.</p>\n"},"ChunkerType":{"type":"string","enum":["naive","sentence"],"title":"ChunkerType"},"ConnectionResponseV2":{"properties":{"connection_id":{"type":"string","format":"uuid","title":"Connection Id"},"provider_id":{"type":"string","title":"Provider Id"},"auth_method":{"type":"string","title":"Auth Method"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"$ref":"#/components/schemas/ConnectionStatusV2"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["connection_id","provider_id","auth_method","name","status","expires_at","created_at","updated_at"],"title":"ConnectionResponse","description":"A connection on the public v2 surface, deliberately credential-free.","x-gitbook-description-html":"<p>A connection on the public v2 surface, deliberately credential-free.</p>\n"},"ConnectionStatusV2":{"type":"string","enum":["active","needs_reconnection"],"title":"ConnectionStatusV2","description":"Public connection status: healthy vs. needing a reconnect.","x-gitbook-description-html":"<p>Public connection status: healthy vs. needing a reconnect.</p>\n"},"CreateKnowledgeBaseEmbeddingParams":{"properties":{"embedding_model":{"type":"string","title":"Embedding Model","default":"openai.text-embedding-3-small"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"additionalProperties":false,"type":"object","title":"CreateKnowledgeBaseEmbeddingParams","description":"Embedding configuration for a new knowledge base.","x-gitbook-description-html":"<p>Embedding configuration for a new knowledge base.</p>\n"},"CreateKnowledgeBaseRequest":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled","default":false},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"$ref":"#/components/schemas/KnowledgeBaseIndexingParamsRequest"},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"CreateKnowledgeBaseRequest","description":"Payload to create a new knowledge base.","x-gitbook-description-html":"<p>Payload to create a new knowledge base.</p>\n"},"CreateKnowledgeBaseRequestV2":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled","default":false},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"$ref":"#/components/schemas/KnowledgeBaseIndexingParamsRequest"},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"CreateKnowledgeBaseRequest","description":"Payload to create a new knowledge base.","x-gitbook-description-html":"<p>Payload to create a new knowledge base.</p>\n"},"CreateWebhookSubscriptionRequestV2":{"properties":{"url":{"type":"string","title":"Url","description":"The HTTPS endpoint that receives the signed event payloads.","x-gitbook-description-html":"<p>The HTTPS endpoint that receives the signed event payloads.</p>\n"},"event_types":{"items":{"$ref":"#/components/schemas/WebhookEventType"},"type":"array","title":"Event Types","description":"Event types this subscription receives, for example `run.succeeded`.","x-gitbook-description-html":"<p>Event types this subscription receives, for example <code>run.succeeded</code>.</p>\n"}},"additionalProperties":false,"type":"object","required":["url","event_types"],"title":"CreateWebhookSubscriptionRequest","description":"A new webhook subscription on the public v2 surface.","x-gitbook-description-html":"<p>A new webhook subscription on the public v2 surface.</p>\n"},"CursorPaginatedResponse_EvalMonitorSampledRunResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalMonitorSampledRunResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[EvalMonitorSampledRunResponseV2]"},"CursorPaginatedResponse_EvalRunScoreResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalRunScoreResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[EvalRunScoreResponseV2]"},"CursorPaginatedResponse_KnowledgeBaseFileResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/KnowledgeBaseFileResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[KnowledgeBaseFileResponseV2]"},"CursorPaginatedResponse_KnowledgeBaseResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/KnowledgeBaseResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[KnowledgeBaseResponseV2]"},"CursorPaginatedResponse_RunSummaryResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/RunSummaryResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[RunSummaryResponseV2]"},"DateProperty":{"properties":{"type":{"type":"string","const":"date","title":"Type","default":"date"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"order":{"type":"integer","minimum":0,"title":"Order","description":"Display order of this property within the schema.","default":0,"x-gitbook-description-html":"<p>Display order of this property within the schema.</p>\n"}},"type":"object","title":"DateProperty"},"DeploymentStage":{"type":"string","enum":["draft","development","staging","production"],"title":"DeploymentStage","description":"Stages a workflow passes through before production.","x-gitbook-description-html":"<p>Stages a workflow passes through before production.</p>\n"},"EvalAlertEffectiveConfigResponseV2":{"properties":{"threshold":{"type":"number","title":"Threshold"},"warning_threshold":{"type":"number","title":"Warning Threshold"},"min_samples":{"type":"integer","title":"Min Samples"},"window_max_runs":{"type":"integer","title":"Window Max Runs"},"window_hours":{"type":"integer","title":"Window Hours"},"min_effect_size":{"type":"number","title":"Min Effect Size"},"recovery_threshold":{"type":"number","title":"Recovery Threshold"},"renotify_hours":{"type":"integer","title":"Renotify Hours"}},"type":"object","required":["threshold","warning_threshold","min_samples","window_max_runs","window_hours","min_effect_size","recovery_threshold","renotify_hours"],"title":"EvalAlertEffectiveConfig"},"EvalAlertSeverity":{"type":"string","enum":["unknown","ok","warning","alert"],"title":"EvalAlertSeverity","description":"Per-(monitor, evaluator) alert state; notifications fire on transitions, not levels.","x-gitbook-description-html":"<p>Per-(monitor, evaluator) alert state; notifications fire on transitions, not levels.</p>\n"},"EvalChoiceSegmentResponseV2":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"}},"type":"object","required":["label","count","value"],"title":"EvalChoiceSegment"},"EvalDatasetCreateRequestV2":{"properties":{"project_id":{"type":"string","minLength":1,"title":"Project Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractRequestV2"}},"additionalProperties":false,"type":"object","required":["project_id","name","node_contract"],"title":"EvalDatasetCreateRequest"},"EvalDatasetImportRequestV2":{"properties":{"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Run Ids","description":"Finished runs of the dataset's project to import as rows: inputs and expected output are extracted from each run trace under the dataset contract and source_run_id is set. Any run without a usable trace rejects the whole batch with a 422 naming it. Requires evals.update and analytics.read.","x-gitbook-description-html":"<p>Finished runs of the dataset&#39;s project to import as rows: inputs and expected output are extracted from each run trace under the dataset contract and source_run_id is set. Any run without a usable trace rejects the whole batch with a 422 naming it. Requires evals.update and analytics.read.</p>\n"}},"additionalProperties":false,"type":"object","required":["run_ids"],"title":"EvalDatasetImportRequest","examples":[{"run_ids":["6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c"]}]},"EvalDatasetListItemResponseV2":{"properties":{"dataset_id":{"type":"string","format":"uuid","title":"Dataset Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractV2"},"max_rows":{"type":"integer","title":"Max Rows"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["dataset_id","project_id","name","description","node_contract","max_rows","created_by","updated_by","created_at","updated_at"],"title":"EvalDatasetListItem"},"EvalDatasetResponseV2":{"properties":{"dataset_id":{"type":"string","format":"uuid","title":"Dataset Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractV2"},"max_rows":{"type":"integer","title":"Max Rows"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["dataset_id","project_id","name","description","node_contract","max_rows","created_by","updated_by","created_at","updated_at"],"title":"EvalDataset"},"EvalDatasetRowDraftRequestV2":{"properties":{"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"expected_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Expected Output"},"source_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Run Id"}},"additionalProperties":false,"type":"object","required":["inputs"],"title":"EvalDatasetRowDraftRequest"},"EvalDatasetRowResponseV2":{"properties":{"dataset_row_id":{"type":"string","format":"uuid","title":"Dataset Row Id"},"dataset_id":{"type":"string","format":"uuid","title":"Dataset Id"},"url":{"type":"string","title":"Url"},"position":{"type":"integer","title":"Position"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"expected_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Expected Output"},"source_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Run Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["dataset_row_id","dataset_id","url","position","inputs","expected_output","source_run_id","created_by","updated_by","created_at","updated_at"],"title":"EvalDatasetRow"},"EvalDatasetRowUpdateRequestV2":{"properties":{"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"Replacement input object. Omit or send null to keep the current inputs.","x-gitbook-description-html":"<p>Replacement input object. Omit or send null to keep the current inputs.</p>\n"},"expected_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Expected Output","description":"Replacement expected output. Omit to keep the current value; send null or an empty object to clear it to null. Example: `{\"expected_output\": null}`.","x-gitbook-description-html":"<p>Replacement expected output. Omit to keep the current value; send null or an empty object to clear it to null. Example: <code>{&quot;expected_output&quot;: null}</code>.</p>\n"}},"additionalProperties":false,"type":"object","title":"EvalDatasetRowUpdateRequest","examples":[{"inputs":{"in-0":"Updated question"}},{"expected_output":{"out-0":"Expected answer"}},{"expected_output":{}}]},"EvalDatasetRowsAddRequestV2":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/EvalDatasetRowDraftRequestV2"},"type":"array","maxItems":100,"minItems":1,"title":"Rows","description":"Rows to append as given. Use the dataset imports endpoint for run traces.","x-gitbook-description-html":"<p>Rows to append as given. Use the dataset imports endpoint for run traces.</p>\n"}},"additionalProperties":false,"type":"object","required":["rows"],"title":"EvalDatasetRowsAddRequest","examples":[{"rows":[{"expected_output":{"out-0":"4"},"inputs":{"in-0":"What is 2+2?"}}]}]},"EvalDatasetUpdateRequestV2":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name","description":"New name. Omit or send null to keep the current name.","x-gitbook-description-html":"<p>New name. Omit or send null to keep the current name.</p>\n"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"New description. Omit to keep the current description; send null to clear it. Example: `{\"description\": null}`."},"node_contract":{"anyOf":[{"$ref":"#/components/schemas/EvalNodeContractRequestV2"},{"type":"null"}],"description":"Replacement contract. Omit or send null to keep the current contract. Renaming input or output keys also renames those keys in existing dataset rows in the same atomic update.","x-gitbook-description-html":"<p>Replacement contract. Omit or send null to keep the current contract. Renaming input or output keys also renames those keys in existing dataset rows in the same atomic update.</p>\n"}},"additionalProperties":false,"type":"object","title":"EvalDatasetUpdateRequest","examples":[{"name":"Renamed dataset"},{"node_contract":{"input_keys":["new-input"],"input_kind":"legacy_input_nodes","output_node_ids":["new-output"]}}]},"EvalExperimentAggregateCardResponseV2":{"properties":{"evaluator_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Evaluator Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"aggregate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Aggregate"},"scored_count":{"type":"integer","title":"Scored Count"},"judge_failed_count":{"type":"integer","title":"Judge Failed Count"},"has_scores":{"type":"boolean","title":"Has Scores"},"segments":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvalExperimentChoiceSegmentResponseV2"},"type":"array"},{"type":"null"}],"title":"Segments"}},"type":"object","required":["evaluator_id","name","aggregate","scored_count","judge_failed_count","has_scores","segments"],"title":"EvalExperimentAggregateCard"},"EvalExperimentAggregateResponseV2":{"properties":{"evaluator_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Evaluator Id"},"evaluator_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluator Name"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"aggregate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Aggregate"},"scored_count":{"type":"integer","title":"Scored Count"},"judge_failed_count":{"type":"integer","title":"Judge Failed Count"},"choice_counts":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Choice Counts"}},"type":"object","required":["evaluator_id","evaluator_name","score_kind","aggregate","scored_count","judge_failed_count","choice_counts"],"title":"EvalExperimentAggregate"},"EvalExperimentChoiceSegmentResponseV2":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"}},"type":"object","required":["label","count","value"],"title":"EvalExperimentChoiceSegment"},"EvalExperimentCreateRequestV2":{"properties":{"dataset_id":{"type":"string","format":"uuid","title":"Dataset Id"},"project_version_id":{"anyOf":[{"type":"string","const":"draft"},{"type":"integer","minimum":0}],"title":"Project Version Id"},"evaluator_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Evaluator Ids"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["dataset_id","project_version_id"],"title":"EvalExperimentCreateRequest"},"EvalExperimentCreateResponseV2":{"properties":{"experiment":{"$ref":"#/components/schemas/EvalExperimentResponseV2"},"warnings":{"$ref":"#/components/schemas/EvalExperimentWarningsResponseV2"}},"type":"object","required":["experiment","warnings"],"title":"EvalExperimentCreateResponseV2"},"EvalExperimentDetailResponseV2":{"properties":{"experiment":{"$ref":"#/components/schemas/EvalExperimentResponseV2"},"latest_job":{"anyOf":[{"$ref":"#/components/schemas/EvalExperimentJobResponseV2"},{"type":"null"}]},"job_status_available":{"type":"boolean","title":"Job Status Available"},"status_counts":{"$ref":"#/components/schemas/EvalExperimentStatusCountsResponseV2"},"aggregate_cards":{"items":{"$ref":"#/components/schemas/EvalExperimentAggregateCardResponseV2"},"type":"array","title":"Aggregate Cards"},"evaluators":{"items":{"$ref":"#/components/schemas/EvaluatorResponseV2"},"type":"array","title":"Evaluators"},"run_stats":{"$ref":"#/components/schemas/EvalExperimentRunStatsResponseV2"}},"type":"object","required":["experiment","latest_job","job_status_available","status_counts","aggregate_cards","evaluators","run_stats"],"title":"EvalExperimentDetail"},"EvalExperimentJobAcceptedResponseV2":{"properties":{"status":{"type":"string","const":"accepted","title":"Status","description":"The request was accepted. Poll the job for its current state.","default":"accepted","x-gitbook-description-html":"<p>The request was accepted. Poll the job for its current state.</p>\n"},"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"ID of the job that was created. Poll the job route with it.","x-gitbook-description-html":"<p>ID of the job that was created. Poll the job route with it.</p>\n"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id","description":"The experiment the job works on.","x-gitbook-description-html":"<p>The experiment the job works on.</p>\n"},"status_url":{"type":"string","title":"Status Url","description":"Relative URL of the job, the same value as the Location header. Poll it until the job reaches a final status.","x-gitbook-description-html":"<p>Relative URL of the job, the same value as the Location header. Poll it until the job reaches a final status.</p>\n"}},"type":"object","required":["job_id","experiment_id","status_url"],"title":"EvalExperimentJobAccepted"},"EvalExperimentJobCreateRequestV2":{"properties":{"mode":{"$ref":"#/components/schemas/EvalExperimentJobMode"},"evaluator_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Evaluator Ids"}},"additionalProperties":false,"type":"object","required":["mode"],"title":"EvalExperimentJobCreateRequest"},"EvalExperimentJobErrorResponse":{"properties":{"code":{"type":"string","title":"Code","description":"Stable machine-readable reason: job_launch_failed, job_failed, job_cancelled, job_timed_out, job_terminated or job_history_unavailable.","x-gitbook-description-html":"<p>Stable machine-readable reason: job_launch_failed, job_failed, job_cancelled, job_timed_out, job_terminated or job_history_unavailable.</p>\n"},"message":{"type":"string","title":"Message","description":"Short human-readable explanation, safe to show to end users.","x-gitbook-description-html":"<p>Short human-readable explanation, safe to show to end users.</p>\n"}},"type":"object","required":["code","message"],"title":"EvalExperimentJobError"},"EvalExperimentJobMode":{"type":"string","enum":["generate","score"],"title":"EvalExperimentJobMode","description":"What a job does.\n\ngenerate: produce outputs for the experiment's rows, and score them when evaluators were\nselected. score: score existing outputs only; nothing is regenerated.","x-gitbook-description-html":"<p>What a job does.</p>\n<p>generate: produce outputs for the experiment&#39;s rows, and score them when evaluators were\nselected. score: score existing outputs only; nothing is regenerated.</p>\n"},"EvalExperimentJobResponseV2":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"Unique ID of this job. Each accepted job request creates a new one.","x-gitbook-description-html":"<p>Unique ID of this job. Each accepted job request creates a new one.</p>\n"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id","description":"The experiment this job works on.","x-gitbook-description-html":"<p>The experiment this job works on.</p>\n"},"mode":{"$ref":"#/components/schemas/EvalExperimentJobMode","description":"What the job does: generate outputs for the experiment's rows, optionally scoring them, or score existing outputs.","x-gitbook-description-html":"<p>What the job does: generate outputs for the experiment&#39;s rows, optionally scoring them, or score existing outputs.</p>\n"},"evaluator_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Evaluator Ids"},"status":{"$ref":"#/components/schemas/EvalExperimentJobStatus","description":"Lifecycle state. queued and running are in progress; completed, completed_with_failures, failed and cancelled are final.","x-gitbook-description-html":"<p>Lifecycle state. queued and running are in progress; completed, completed_with_failures, failed and cancelled are final.</p>\n"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the request was accepted.","x-gitbook-description-html":"<p>When the request was accepted.</p>\n"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When a worker started the job. Null while the job is queued.","x-gitbook-description-html":"<p>When a worker started the job. Null while the job is queued.</p>\n"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At","description":"When the job reached a final status. Null while queued or running.","x-gitbook-description-html":"<p>When the job reached a final status. Null while queued or running.</p>\n"},"last_activity_at":{"type":"string","format":"date-time","title":"Last Activity At","description":"Last time the job's state changed.","x-gitbook-description-html":"<p>Last time the job&#39;s state changed.</p>\n"},"error":{"anyOf":[{"$ref":"#/components/schemas/EvalExperimentJobErrorResponse"},{"type":"null"}],"description":"Why the job ended early. Null unless status is failed or cancelled.","x-gitbook-description-html":"<p>Why the job ended early. Null unless status is failed or cancelled.</p>\n"}},"type":"object","required":["job_id","experiment_id","mode","evaluator_ids","status","created_at","started_at","finished_at","last_activity_at","error"],"title":"EvalExperimentJob"},"EvalExperimentJobStatus":{"type":"string","enum":["queued","running","completed","completed_with_failures","failed","cancelled"],"title":"EvalExperimentJobStatus","description":"Lifecycle of a job.\n\nqueued and running are in progress. completed, completed_with_failures, failed and cancelled\nare final; completed_with_failures means the job finished but some rows or scores failed.","x-gitbook-description-html":"<p>Lifecycle of a job.</p>\n<p>queued and running are in progress. completed, completed_with_failures, failed and cancelled\nare final; completed_with_failures means the job finished but some rows or scores failed.</p>\n"},"EvalExperimentResponseV2":{"properties":{"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"project_id":{"type":"string","title":"Project Id"},"dataset_id":{"type":"string","format":"uuid","title":"Dataset Id"},"dataset_name":{"type":"string","title":"Dataset Name"},"project_version_id":{"anyOf":[{"type":"string","const":"draft"},{"type":"integer","minimum":0}],"title":"Project Version Id"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractV2"},"name":{"type":"string","title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["experiment_id","project_id","dataset_id","dataset_name","project_version_id","node_contract","name","notes","created_by","created_at","updated_at"],"title":"EvalExperiment"},"EvalExperimentRowResponseV2":{"properties":{"experiment_row_id":{"type":"string","format":"uuid","title":"Experiment Row Id"},"experiment_id":{"type":"string","format":"uuid","title":"Experiment Id"},"dataset_row_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Dataset Row Id"},"position":{"type":"integer","title":"Position"},"inputs":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","title":"Inputs"},"expected_output":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Expected Output"},"generated_output":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}],"title":"Generated Output"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"status":{"$ref":"#/components/schemas/EvalExperimentRowStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"latency_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Seconds"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"scores":{"items":{"$ref":"#/components/schemas/EvalScoreResponseV2"},"type":"array","title":"Scores"}},"type":"object","required":["experiment_row_id","experiment_id","dataset_row_id","position","inputs","expected_output","generated_output","run_id","status","error","latency_seconds","total_tokens","created_at","updated_at"],"title":"EvalExperimentRow"},"EvalExperimentRowStatus":{"type":"string","enum":["pending","running","completed","failed"],"title":"EvalExperimentRowStatus","description":"Generation (workflow) lifecycle of an experiment row; judge failures live on scores.","x-gitbook-description-html":"<p>Generation (workflow) lifecycle of an experiment row; judge failures live on scores.</p>\n"},"EvalExperimentRunStatsResponseV2":{"properties":{"avg_latency_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Latency Seconds"},"avg_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Tokens"}},"type":"object","required":["avg_latency_seconds","avg_tokens"],"title":"EvalExperimentRunStats"},"EvalExperimentStatusCountsResponseV2":{"properties":{"pending":{"type":"integer","title":"Pending"},"running":{"type":"integer","title":"Running"},"completed":{"type":"integer","title":"Completed"},"failed":{"type":"integer","title":"Failed"},"total":{"type":"integer","title":"Total"},"done":{"type":"integer","title":"Done"}},"type":"object","required":["pending","running","completed","failed","total","done"],"title":"EvalExperimentStatusCounts"},"EvalExperimentStatusResponseV2":{"properties":{"latest_job":{"anyOf":[{"$ref":"#/components/schemas/EvalExperimentJobResponseV2"},{"type":"null"}]},"job_status_available":{"type":"boolean","title":"Job Status Available"},"status_counts":{"$ref":"#/components/schemas/EvalExperimentStatusCountsResponseV2"},"aggregate_cards":{"items":{"$ref":"#/components/schemas/EvalExperimentAggregateCardResponseV2"},"type":"array","title":"Aggregate Cards"}},"type":"object","required":["latest_job","job_status_available","status_counts","aggregate_cards"],"title":"EvalExperimentStatus"},"EvalExperimentSummaryResponseV2":{"properties":{"experiment":{"$ref":"#/components/schemas/EvalExperimentResponseV2"},"aggregates":{"items":{"$ref":"#/components/schemas/EvalExperimentAggregateResponseV2"},"type":"array","title":"Aggregates"},"run_stats":{"$ref":"#/components/schemas/EvalExperimentRunStatsResponseV2"}},"type":"object","required":["experiment","aggregates","run_stats"],"title":"EvalExperimentSummary"},"EvalExperimentUpdateRequestV2":{"properties":{"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","title":"EvalExperimentUpdateRequest"},"EvalExperimentWarningsResponseV2":{"properties":{"draft_version":{"type":"boolean","title":"Draft Version","default":false},"rows_without_expected_output":{"type":"integer","title":"Rows Without Expected Output","default":0}},"type":"object","title":"EvalExperimentWarnings"},"EvalMonitorAlertResponseV2":{"properties":{"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"warning_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Warning Threshold"},"min_samples":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Samples"},"window_max_runs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Max Runs"},"window_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Hours"},"min_effect_size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Effect Size"},"recovery_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recovery Threshold"},"renotify_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Renotify Hours"},"notifications_enabled":{"type":"boolean","title":"Notifications Enabled"},"severity":{"$ref":"#/components/schemas/EvalAlertSeverity"},"effective":{"$ref":"#/components/schemas/EvalAlertEffectiveConfigResponseV2"},"defaults":{"$ref":"#/components/schemas/EvalAlertEffectiveConfigResponseV2"}},"type":"object","required":["threshold","warning_threshold","min_samples","window_max_runs","window_hours","min_effect_size","recovery_threshold","renotify_hours","notifications_enabled","severity","effective","defaults"],"title":"EvalMonitorAlertView"},"EvalMonitorAlertUpdateRequestV2":{"properties":{"threshold":{"anyOf":[{"type":"number","maximum":1,"exclusiveMinimum":0},{"type":"null"}],"title":"Threshold"},"warning_threshold":{"anyOf":[{"type":"number","maximum":1,"exclusiveMinimum":0},{"type":"null"}],"title":"Warning Threshold"},"min_samples":{"anyOf":[{"type":"integer","maximum":2147483647,"minimum":1},{"type":"null"}],"title":"Min Samples"},"window_max_runs":{"anyOf":[{"type":"integer","maximum":2147483647,"minimum":1},{"type":"null"}],"title":"Window Max Runs"},"window_hours":{"anyOf":[{"type":"integer","maximum":8760,"minimum":1},{"type":"null"}],"title":"Window Hours"},"min_effect_size":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Min Effect Size"},"recovery_threshold":{"anyOf":[{"type":"number","maximum":1,"exclusiveMinimum":0},{"type":"null"}],"title":"Recovery Threshold"},"renotify_hours":{"anyOf":[{"type":"integer","maximum":2147483647,"minimum":1},{"type":"null"}],"title":"Renotify Hours"},"notifications_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notifications Enabled"}},"additionalProperties":false,"type":"object","title":"EvalMonitorAlertUpdateRequest"},"EvalMonitorCreateRequestV2":{"properties":{"project_id":{"type":"string","minLength":1,"title":"Project Id"},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"},"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"notifications_enabled":{"type":"boolean","title":"Notifications Enabled","default":true},"sampling_rate":{"type":"number","maximum":0.3,"exclusiveMinimum":0,"title":"Sampling Rate","default":0.3},"max_runs_daily":{"type":"integer","maximum":1000,"minimum":1,"title":"Max Runs Daily","default":1000}},"additionalProperties":false,"type":"object","required":["project_id","evaluator_id"],"title":"EvalMonitorCreateRequest"},"EvalMonitorEvaluatorRollupResponseV2":{"properties":{"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"evaluator_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluator Name"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"aggregate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Aggregate"}},"type":"object","required":["evaluator_id","evaluator_name","score_kind","aggregate"],"title":"EvalMonitorEvaluatorRollup"},"EvalMonitorEvaluatorTrendResponseV2":{"properties":{"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"evaluator_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluator Name"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"window_aggregate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Window Aggregate"},"scored_count":{"type":"integer","title":"Scored Count"},"failed_count":{"type":"integer","title":"Failed Count"},"buckets":{"items":{"$ref":"#/components/schemas/EvalMonitorTrendBucketResponseV2"},"type":"array","title":"Buckets"},"choice_segments":{"items":{"$ref":"#/components/schemas/EvalChoiceSegmentResponseV2"},"type":"array","title":"Choice Segments"}},"type":"object","required":["evaluator_id","evaluator_name","score_kind","window_aggregate","scored_count","failed_count","buckets","choice_segments"],"title":"EvalMonitorEvaluatorTrend"},"EvalMonitorLimitsResponseV2":{"properties":{"sampling_rate_limit":{"type":"number","title":"Sampling Rate Limit","default":0.3},"max_runs_daily_limit":{"type":"integer","title":"Max Runs Daily Limit","default":1000},"sampling_rate_default":{"type":"number","title":"Sampling Rate Default","default":0.3},"max_runs_daily_default":{"type":"integer","title":"Max Runs Daily Default","default":1000}},"type":"object","title":"EvalMonitorLimits"},"EvalMonitorListItemResponseV2":{"properties":{"monitor":{"$ref":"#/components/schemas/EvalMonitorResponseV2"},"severity":{"$ref":"#/components/schemas/EvalAlertSeverity"},"runs_scored_in_window":{"type":"integer","title":"Runs Scored In Window"},"runs_enqueued_today":{"type":"integer","title":"Runs Enqueued Today"},"evaluators":{"items":{"$ref":"#/components/schemas/EvalMonitorEvaluatorRollupResponseV2"},"type":"array","title":"Evaluators"}},"type":"object","required":["monitor","severity","runs_scored_in_window","runs_enqueued_today","evaluators"],"title":"EvalMonitorListItem"},"EvalMonitorResponseV2":{"properties":{"monitor_id":{"type":"string","format":"uuid","title":"Monitor Id"},"project_id":{"type":"string","title":"Project Id"},"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"enabled":{"type":"boolean","title":"Enabled"},"sampling_rate":{"type":"number","title":"Sampling Rate"},"max_runs_daily":{"type":"integer","title":"Max Runs Daily"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["monitor_id","project_id","evaluator_id","name","description","enabled","sampling_rate","max_runs_daily","created_by","updated_by","created_at","updated_at"],"title":"EvalMonitor"},"EvalMonitorSampledRunResponseV2":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"input_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Snapshot"},"output_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Snapshot"},"scores":{"items":{"$ref":"#/components/schemas/EvalScoreResponseV2"},"type":"array","title":"Scores"}},"type":"object","required":["run_id","created_at","input_snapshot","output_snapshot","scores"],"title":"EvalMonitorSampledRun"},"EvalMonitorScoreStatsResponseV2":{"properties":{"pending_count":{"type":"integer","title":"Pending Count"},"scored_count":{"type":"integer","title":"Scored Count"},"failed_count":{"type":"integer","title":"Failed Count"},"runs_enqueued_today":{"type":"integer","title":"Runs Enqueued Today"},"evaluators":{"items":{"$ref":"#/components/schemas/EvalMonitorEvaluatorTrendResponseV2"},"type":"array","title":"Evaluators"}},"type":"object","required":["pending_count","scored_count","failed_count","runs_enqueued_today","evaluators"],"title":"EvalMonitorScoreStats"},"EvalMonitorTrendBucketResponseV2":{"properties":{"bucket_start":{"type":"string","format":"date-time","title":"Bucket Start"},"aggregate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Aggregate"},"scored_count":{"type":"integer","title":"Scored Count"},"failed_count":{"type":"integer","title":"Failed Count"}},"type":"object","required":["bucket_start","aggregate","scored_count","failed_count"],"title":"EvalMonitorTrendBucket"},"EvalMonitorUpdateRequestV2":{"properties":{"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"sampling_rate":{"anyOf":[{"type":"number","maximum":0.3,"exclusiveMinimum":0},{"type":"null"}],"title":"Sampling Rate"},"max_runs_daily":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"title":"Max Runs Daily"}},"additionalProperties":false,"type":"object","title":"EvalMonitorUpdateRequest"},"EvalNodeContractRequestV2":{"properties":{"input_kind":{"type":"string","enum":["start_node","legacy_input_nodes"],"title":"Input Kind"},"input_keys":{"items":{"type":"string"},"type":"array","maxItems":1,"minItems":1,"title":"Input Keys"},"output_node_ids":{"items":{"type":"string"},"type":"array","maxItems":1,"minItems":1,"title":"Output Node Ids"}},"additionalProperties":false,"type":"object","required":["input_kind","input_keys","output_node_ids"],"title":"EvalNodeContractRequest"},"EvalNodeContractV2":{"properties":{"input_kind":{"type":"string","enum":["start_node","legacy_input_nodes"],"title":"Input Kind"},"input_keys":{"items":{"type":"string"},"type":"array","title":"Input Keys"},"output_node_ids":{"items":{"type":"string"},"type":"array","title":"Output Node Ids"}},"type":"object","required":["input_kind","input_keys","output_node_ids"],"title":"EvalNodeContract"},"EvalPreviewSampleRequestV2":{"properties":{"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs"},"generated_output":{"additionalProperties":true,"type":"object","title":"Generated Output"},"expected_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Expected Output"}},"additionalProperties":false,"type":"object","required":["generated_output"],"title":"EvalPreviewSampleRequest"},"EvalRunScoreCreateRequestV2":{"properties":{"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"}},"additionalProperties":false,"type":"object","required":["evaluator_id"],"title":"EvalRunScoreCreateRequest"},"EvalRunScoreResponseV2":{"properties":{"score_id":{"type":"string","format":"uuid","title":"Score Id"},"project_id":{"type":"string","title":"Project Id"},"experiment_row_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Experiment Row Id"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"project_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version Id"},"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"choice_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Choice Label"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"status":{"$ref":"#/components/schemas/EvalScoreStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"input_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Snapshot"},"output_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Snapshot"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"evaluator_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluator Name"}},"type":"object","required":["score_id","project_id","experiment_row_id","run_id","project_version_id","evaluator_id","score_kind","score","choice_label","feedback","status","error","input_snapshot","output_snapshot","created_by","created_at","updated_at","evaluator_name"],"title":"EvalRunScore"},"EvalScoreKind":{"type":"string","enum":["numeric","boolean"],"title":"EvalScoreKind","description":"Drives aggregate rendering: mean for numeric, pass-rate for boolean.","x-gitbook-description-html":"<p>Drives aggregate rendering: mean for numeric, pass-rate for boolean.</p>\n"},"EvalScoreResponseV2":{"properties":{"score_id":{"type":"string","format":"uuid","title":"Score Id"},"project_id":{"type":"string","title":"Project Id"},"experiment_row_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Experiment Row Id"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"project_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version Id"},"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"choice_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Choice Label"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"status":{"$ref":"#/components/schemas/EvalScoreStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"input_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Snapshot"},"output_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Snapshot"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["score_id","project_id","experiment_row_id","run_id","project_version_id","evaluator_id","score_kind","score","choice_label","feedback","status","error","input_snapshot","output_snapshot","created_by","created_at","updated_at"],"title":"EvalScore"},"EvalScoreStatus":{"type":"string","enum":["pending","scoring","scored","failed"],"title":"EvalScoreStatus","description":"Judge/rule outcome for a score row; pending/scoring are the monitor queue states.","x-gitbook-description-html":"<p>Judge/rule outcome for a score row; pending/scoring are the monitor queue states.</p>\n"},"EvaluatorCreateRequestV2":{"properties":{"project_id":{"type":"string","minLength":1,"title":"Project Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"evaluator_type":{"$ref":"#/components/schemas/EvaluatorType"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"judge_provider":{"anyOf":[{"$ref":"#/components/schemas/LLMProviderEnum"},{"type":"null"}]},"judge_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Model Id"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractRequestV2"}},"additionalProperties":false,"type":"object","required":["project_id","name","evaluator_type","config","node_contract"],"title":"EvaluatorCreateRequest"},"EvaluatorPreviewRequestV2":{"properties":{"project_id":{"type":"string","minLength":1,"title":"Project Id"},"evaluator_type":{"$ref":"#/components/schemas/EvaluatorType"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"judge_provider":{"anyOf":[{"$ref":"#/components/schemas/LLMProviderEnum"},{"type":"null"}]},"judge_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Model Id"},"samples":{"items":{"$ref":"#/components/schemas/EvalPreviewSampleRequestV2"},"type":"array","maxItems":3,"minItems":1,"title":"Samples"}},"additionalProperties":false,"type":"object","required":["project_id","evaluator_type","config","samples"],"title":"EvaluatorPreviewRequest"},"EvaluatorPreviewResponseV2":{"properties":{"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"choice_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Choice Label"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"status":{"$ref":"#/components/schemas/EvalScoreStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["score_kind","score","choice_label","feedback","status","error"],"title":"EvaluatorPreview"},"EvaluatorResponseV2":{"properties":{"evaluator_id":{"type":"string","format":"uuid","title":"Evaluator Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"evaluator_type":{"$ref":"#/components/schemas/EvaluatorType"},"version_number":{"type":"integer","title":"Version Number"},"node_contract":{"$ref":"#/components/schemas/EvalNodeContractV2"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"score_kind":{"$ref":"#/components/schemas/EvalScoreKind"},"uses_input":{"type":"boolean","title":"Uses Input"},"uses_expected_output":{"type":"boolean","title":"Uses Expected Output"},"judge_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Provider"},"judge_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Model Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["evaluator_id","project_id","name","description","evaluator_type","version_number","node_contract","config","score_kind","uses_input","uses_expected_output","judge_provider","judge_model_id","created_by","updated_by","created_at","updated_at"],"title":"Evaluator"},"EvaluatorTemplateResponseV2":{"properties":{"template_id":{"type":"string","title":"Template Id"},"name":{"type":"string","title":"Name"},"evaluator_type":{"$ref":"#/components/schemas/EvaluatorType"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["template_id","name","evaluator_type","config"],"title":"EvaluatorTemplate"},"EvaluatorType":{"type":"string","enum":["llm_judge","builtin_rule"],"title":"EvaluatorType","description":"How an evaluator scores: LLM judge or built-in rule.","x-gitbook-description-html":"<p>How an evaluator scores: LLM judge or built-in rule.</p>\n"},"EvaluatorUpdateRequestV2":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name","description":"New name. Omit or send null to keep the current name.","x-gitbook-description-html":"<p>New name. Omit or send null to keep the current name.</p>\n"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"New description. Omit to keep the current description; send null to clear it. Example: `{\"description\": null}`."},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Replaces the entire evaluator configuration. Omit or send null to keep the current configuration.","x-gitbook-description-html":"<p>Replaces the entire evaluator configuration. Omit or send null to keep the current configuration.</p>\n"},"judge_provider":{"anyOf":[{"$ref":"#/components/schemas/LLMProviderEnum"},{"type":"null"}],"description":"LLM judge provider override. Omit to keep it; send null to clear it. Any existing judge_model_id override must also be cleared when removing the provider. Example: `{\"judge_provider\": null, \"judge_model_id\": null}`.","x-gitbook-description-html":"<p>LLM judge provider override. Omit to keep it; send null to clear it. Any existing judge_model_id override must also be cleared when removing the provider. Example: <code>{&quot;judge_provider&quot;: null, &quot;judge_model_id&quot;: null}</code>.</p>\n"},"judge_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Model Id","description":"LLM judge model override. Omit to keep it; send null to clear it. A model override requires a provider override in the resulting configuration. Example: `{\"judge_model_id\": null}`.","x-gitbook-description-html":"<p>LLM judge model override. Omit to keep it; send null to clear it. A model override requires a provider override in the resulting configuration. Example: <code>{&quot;judge_model_id&quot;: null}</code>.</p>\n"},"node_contract":{"anyOf":[{"$ref":"#/components/schemas/EvalNodeContractRequestV2"},{"type":"null"}],"description":"Replacement evaluator contract. Omit or send null to keep the current contract. A changed contract creates a new evaluator version.","x-gitbook-description-html":"<p>Replacement evaluator contract. Omit or send null to keep the current contract. A changed contract creates a new evaluator version.</p>\n"}},"additionalProperties":false,"type":"object","title":"EvaluatorUpdateRequest","examples":[{"description":"Updated grading rules"},{"config":{"pattern":"^approved$","rule":"regex"}}]},"ExecutionMode":{"type":"string","enum":["in-memory","remote"],"title":"ExecutionMode","description":"Workflow execution modes.\n\nThese are implementation-agnostic names exposed to clients.","x-gitbook-description-html":"<p>Workflow execution modes.</p>\n<p>These are implementation-agnostic names exposed to clients.</p>\n"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HitlResponseType":{"type":"string","enum":["text","approval","choice"],"title":"HitlResponseType","description":"Response types accepted by the public ask_human resume API.\n\nMirrors the ask_human action's own ``Literal[\"text\", \"approval\", \"choice\"]`` (defined in\nstackflow); kept as a separate enum because apps cannot reuse that stackflow Literal.","x-gitbook-description-html":"<p>Response types accepted by the public ask_human resume API.</p>\n<p>Mirrors the ask_human action&#39;s own <code>Literal[&quot;text&quot;, &quot;approval&quot;, &quot;choice&quot;]</code> (defined in\nstackflow); kept as a separate enum because apps cannot reuse that stackflow Literal.</p>\n"},"JsonValue":{},"KnowledgeBaseChunkerParams":{"properties":{"chunk_size":{"type":"integer","minimum":1,"title":"Chunk Size","default":1500},"chunk_overlap":{"type":"integer","minimum":0,"title":"Chunk Overlap","default":500},"chunker_type":{"$ref":"#/components/schemas/ChunkerType","default":"sentence"}},"type":"object","title":"KnowledgeBaseChunkerParams","description":"Chunking strategy for splitting documents during indexing.","x-gitbook-description-html":"<p>Chunking strategy for splitting documents during indexing.</p>\n"},"KnowledgeBaseFileResponse":{"properties":{"knowledge_base_id":{"type":"string","format":"uuid","title":"Knowledge Base Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"modified_at":{"type":"string","format":"date-time","title":"Modified At"},"indexed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Indexed At"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id"},"resource_path":{"type":"string","minLength":1,"title":"Resource Path"},"dataloader_metadata":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"anyOf":[{},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"Dataloader Metadata"},"user_metadata":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"anyOf":[{},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"User Metadata"},"content_hash":{"type":"string","minLength":1,"title":"Content Hash"},"content_mime":{"type":"string","minLength":1,"title":"Content Mime"},"size":{"type":"integer","minimum":0,"title":"Size"},"status":{"$ref":"#/components/schemas/StackFileStatusEnum"},"effective_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Effective Permissions","description":"Viewer's effective permissions for this file; null when not computed.","x-gitbook-description-html":"<p>Viewer&#39;s effective permissions for this file; null when not computed.</p>\n"}},"type":"object","required":["knowledge_base_id","created_at","modified_at","resource_id","resource_path","content_hash","content_mime","size","status"],"title":"KnowledgeBaseFileResponse","description":"A file stored in a knowledge base.","x-gitbook-description-html":"<p>A file stored in a knowledge base.</p>\n"},"KnowledgeBaseFileResponseV2":{"properties":{"knowledge_base_id":{"type":"string","format":"uuid","title":"Knowledge Base Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"modified_at":{"type":"string","format":"date-time","title":"Modified At"},"indexed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Indexed At"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id"},"resource_path":{"type":"string","minLength":1,"title":"Resource Path"},"acl_target_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acl Target Path"},"dataloader_metadata":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"anyOf":[{},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"Dataloader Metadata"},"user_metadata":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"anyOf":[{},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"User Metadata"},"content_hash":{"type":"string","minLength":1,"title":"Content Hash"},"content_mime":{"type":"string","minLength":1,"title":"Content Mime"},"size":{"type":"integer","minimum":0,"title":"Size"},"status":{"$ref":"#/components/schemas/StackFileStatusEnum"},"effective_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Effective Permissions"}},"type":"object","required":["knowledge_base_id","created_at","modified_at","resource_id","resource_path","content_hash","content_mime","size","status"],"title":"KnowledgeBaseFileResponse","description":"A file stored in a knowledge base.","x-gitbook-description-html":"<p>A file stored in a knowledge base.</p>\n"},"KnowledgeBaseIndexingParamsRequest":{"properties":{"ocr":{"type":"boolean","title":"Ocr","default":false},"embedding_params":{"$ref":"#/components/schemas/CreateKnowledgeBaseEmbeddingParams"},"chunker_params":{"$ref":"#/components/schemas/KnowledgeBaseChunkerParams"}},"type":"object","title":"KnowledgeBaseIndexingParamsRequest","description":"Parameters that control how documents are indexed into a knowledge base.","x-gitbook-description-html":"<p>Parameters that control how documents are indexed into a knowledge base.</p>\n"},"KnowledgeBaseMetadataSchemasResponseV2":{"properties":{"user":{"anyOf":[{"$ref":"#/components/schemas/MetadataSchemaResponseV2"},{"type":"null"}]},"dataloader":{"anyOf":[{"$ref":"#/components/schemas/MetadataSchemaResponseV2"},{"type":"null"}]}},"type":"object","required":["user","dataloader"],"title":"KnowledgeBaseMetadataSchemas","description":"The user and dataloader metadata schemas for a knowledge base on the public v2 surface.","x-gitbook-description-html":"<p>The user and dataloader metadata schemas for a knowledge base on the public v2 surface.</p>\n"},"KnowledgeBaseQueryRequestV2":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"The search query to run against the knowledge base.","x-gitbook-description-html":"<p>The search query to run against the knowledge base.</p>\n"},"top_k":{"type":"integer","maximum":20,"minimum":1,"title":"Top K","description":"Number of top results to return.","default":10,"x-gitbook-description-html":"<p>Number of top results to return.</p>\n"},"strategy":{"$ref":"#/components/schemas/KnowledgeBaseQueryStrategyV2","description":"Retrieval strategy to use for the search.","default":"semantic","x-gitbook-description-html":"<p>Retrieval strategy to use for the search.</p>\n"},"retrieval_type":{"$ref":"#/components/schemas/RetrievalType","description":"Type of retrieval to use for the search.","default":"chunks","x-gitbook-description-html":"<p>Type of retrieval to use for the search.</p>\n"}},"additionalProperties":false,"type":"object","required":["query"],"title":"KnowledgeBaseQueryRequest","description":"A query against a knowledge base on the public v2 surface.","x-gitbook-description-html":"<p>A query against a knowledge base on the public v2 surface.</p>\n"},"KnowledgeBaseQueryResultV2":{"properties":{"content":{"type":"string","title":"Content"},"score":{"type":"number","title":"Score","default":0},"resource_id":{"type":"string","format":"uuid","title":"Resource Id"}},"type":"object","required":["content","resource_id"],"title":"KnowledgeBaseQueryResult","description":"A single retrieved result on the public v2 surface.","x-gitbook-description-html":"<p>A single retrieved result on the public v2 surface.</p>\n"},"KnowledgeBaseQueryStrategyV2":{"type":"string","enum":["semantic","keyword","hybrid"],"title":"KnowledgeBaseQueryStrategyV2","description":"Retrieval strategy for a public v2 knowledge base query.","x-gitbook-description-html":"<p>Retrieval strategy for a public v2 knowledge base query.</p>\n"},"KnowledgeBaseResourcesResponse":{"additionalProperties":true,"type":"object"},"KnowledgeBaseResponse":{"properties":{"knowledge_base_id":{"type":"string","format":"uuid","title":"Knowledge Base Id"},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled"},"connection_provider_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Provider Type"},"is_empty":{"type":"boolean","title":"Is Empty","default":true},"total_size":{"type":"integer","title":"Total Size","description":"Total size of all files in the knowledge base, in bytes.","default":0,"x-gitbook-description-html":"<p>Total size of all files in the knowledge base, in bytes.</p>\n"},"total_files":{"type":"integer","title":"Total Files","description":"Total number of files in the knowledge base.","default":0,"x-gitbook-description-html":"<p>Total number of files in the knowledge base.</p>\n"},"total_indexed_files":{"type":"integer","title":"Total Indexed Files","description":"Total number of successfully indexed files.","default":0,"x-gitbook-description-html":"<p>Total number of successfully indexed files.</p>\n"},"total_error_files":{"type":"integer","title":"Total Error Files","description":"Total number of files that failed indexing.","default":0,"x-gitbook-description-html":"<p>Total number of files that failed indexing.</p>\n"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At","description":"Timestamp when the knowledge base was last successfully synced from its source","x-gitbook-description-html":"<p>Timestamp when the knowledge base was last successfully synced from its source</p>\n"},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"$ref":"#/components/schemas/KnowledgeBaseResponseIndexingParams"},"org_id":{"type":"string","title":"Org Id"},"role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]},"user_metadata_schema":{"anyOf":[{"$ref":"#/components/schemas/MetadataSchema"},{"type":"null"}]},"dataloader_metadata_schema":{"anyOf":[{"$ref":"#/components/schemas/MetadataSchema"},{"type":"null"}]}},"type":"object","required":["knowledge_base_id","connection_id","created_at","updated_at","connection_source_ids","website_sources","source_file_authorization_enabled","indexing_params","org_id"],"title":"KnowledgeBaseResponse","description":"A knowledge base.","x-gitbook-description-html":"<p>A knowledge base.</p>\n"},"KnowledgeBaseResponseEmbeddingParams":{"properties":{"embedding_model":{"type":"string","title":"Embedding Model"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","required":["embedding_model"],"title":"KnowledgeBaseResponseEmbeddingParams","description":"Embedding configuration of a knowledge base.","x-gitbook-description-html":"<p>Embedding configuration of a knowledge base.</p>\n"},"KnowledgeBaseResponseIndexingParams":{"properties":{"ocr":{"type":"boolean","title":"Ocr","default":false},"embedding_params":{"$ref":"#/components/schemas/KnowledgeBaseResponseEmbeddingParams"},"chunker_params":{"$ref":"#/components/schemas/KnowledgeBaseChunkerParams"}},"type":"object","required":["embedding_params"],"title":"KnowledgeBaseResponseIndexingParams","description":"Indexing configuration of a knowledge base.","x-gitbook-description-html":"<p>Indexing configuration of a knowledge base.</p>\n"},"KnowledgeBaseResponseV2":{"properties":{"knowledge_base_id":{"type":"string","format":"uuid","title":"Knowledge Base Id"},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled"},"connection_provider_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Provider Type"},"is_empty":{"type":"boolean","title":"Is Empty","default":true},"total_size":{"type":"integer","title":"Total Size","default":0},"total_files":{"type":"integer","title":"Total Files","default":0},"total_indexed_files":{"type":"integer","title":"Total Indexed Files","default":0},"total_error_files":{"type":"integer","title":"Total Error Files","default":0},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"$ref":"#/components/schemas/KnowledgeBaseResponseIndexingParams"},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]},"role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]}},"type":"object","required":["knowledge_base_id","connection_id","created_at","updated_at","connection_source_ids","website_sources","source_file_authorization_enabled","indexing_params"],"title":"KnowledgeBaseResponse","description":"A knowledge base on the public v2 surface.","x-gitbook-description-html":"<p>A knowledge base on the public v2 surface.</p>\n"},"KnowledgeBaseRole":{"type":"string","enum":["viewer","editor","admin"],"title":"KnowledgeBaseRole","description":"A user's role within a knowledge base.\n\nOrdered by privilege for Python comparisons. All four ordering operators are\ndefined explicitly because StrEnum subclasses str: its inherited lexicographic\ncomparisons would otherwise apply, so e.g. ``max()`` would pick ``\"viewer\"``\nover ``\"admin\"``. The operators only order Python objects; Postgres enum\nordering is governed by the declaration order above.","x-gitbook-description-html":"<p>A user&#39;s role within a knowledge base.</p>\n<p>Ordered by privilege for Python comparisons. All four ordering operators are\ndefined explicitly because StrEnum subclasses str: its inherited lexicographic\ncomparisons would otherwise apply, so e.g. <code>max()</code> would pick <code>&quot;viewer&quot;</code>\nover <code>&quot;admin&quot;</code>. The operators only order Python objects; Postgres enum\nordering is governed by the declaration order above.</p>\n"},"KnowledgeBaseSyncResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Human-readable description of the started task.","x-gitbook-description-html":"<p>Human-readable description of the started task.</p>\n"},"status":{"type":"string","const":"accepted","title":"Status","description":"Task status.","default":"accepted","x-gitbook-description-html":"<p>Task status.</p>\n"}},"type":"object","required":["message"],"title":"KnowledgeBaseSyncResponse","description":"Result of a knowledge base sync or reindex request.","x-gitbook-description-html":"<p>Result of a knowledge base sync or reindex request.</p>\n"},"KnowledgeBaseSyncResponseV2":{"properties":{"message":{"type":"string","title":"Message"},"status":{"type":"string","const":"accepted","title":"Status","default":"accepted"}},"type":"object","required":["message"],"title":"KnowledgeBaseSyncResponse","description":"Acknowledgement that a sync or reindex task was accepted.","x-gitbook-description-html":"<p>Acknowledgement that a sync or reindex task was accepted.</p>\n"},"LLMConnectionOrigin":{"type":"string","enum":["stack_ai","external_db","external_ephemeral"],"title":"LLMConnectionOrigin"},"LLMProviderEnum":{"type":"string","enum":["Anthropic","Azure","Baseten","Bedrock","Cerebras","Core42","FireworksAI","Google","Google_service_account","Groq","Local","Meta","Mistral","Modular","OpenAI","OpenRouter","Perplexity","Replicate","TogetherAI","XAI"],"title":"LLMProviderEnum","description":"LLM provider identifiers.","x-gitbook-description-html":"<p>LLM provider identifiers.</p>\n"},"LLMUsageData":{"properties":{"cache_metrics":{"anyOf":[{"$ref":"#/components/schemas/CacheMetrics"},{"type":"null"}]},"provider":{"$ref":"#/components/schemas/LLMProviderEnum"},"model_id":{"type":"string","title":"Model Id"},"tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Tokens"},"input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Input Tokens","description":"Total prompt tokens processed, INCLUDING any prompt-cache writes and reads (Anthropic reports those outside its raw input counter; they are folded back in before this record is built).","x-gitbook-description-html":"<p>Total prompt tokens processed, INCLUDING any prompt-cache writes and reads (Anthropic reports those outside its raw input counter; they are folded back in before this record is built).</p>\n"},"output_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Output Tokens"},"cache_creation_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cache Creation Input Tokens","description":"Subset of input_tokens written to the provider prompt cache this call. Kept separate so billing can later discount cache traffic (writes bill at a premium, reads at a fraction). None when the provider reported no cache counters.","x-gitbook-description-html":"<p>Subset of input_tokens written to the provider prompt cache this call. Kept separate so billing can later discount cache traffic (writes bill at a premium, reads at a fraction). None when the provider reported no cache counters.</p>\n"},"cache_read_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cache Read Input Tokens","description":"Subset of input_tokens served from the provider prompt cache this call. None when the provider reported no cache counters.","x-gitbook-description-html":"<p>Subset of input_tokens served from the provider prompt cache this call. None when the provider reported no cache counters.</p>\n"},"cache_measurement":{"anyOf":[{"$ref":"#/components/schemas/CacheMeasurement"},{"type":"null"}]},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_origin":{"anyOf":[{"$ref":"#/components/schemas/LLMConnectionOrigin"},{"type":"null"}]},"is_local_model":{"type":"boolean","title":"Is Local Model","description":"Whether this usage record is from a local model.","readOnly":true,"x-gitbook-description-html":"<p>Whether this usage record is from a local model.</p>\n"},"should_charge":{"type":"boolean","title":"Should Charge","description":"Whether this usage record should be charged.","readOnly":true,"x-gitbook-description-html":"<p>Whether this usage record should be charged.</p>\n"}},"type":"object","required":["provider","model_id","is_local_model","should_charge"],"title":"LLMUsageData","description":"Token usage for a single LLM call within a run.","x-gitbook-description-html":"<p>Token usage for a single LLM call within a run.</p>\n"},"MetadataPropertyBaseResponseV2":{"properties":{"type":{"type":"string","enum":["number","boolean","date"],"title":"Type"},"description":{"type":"string","title":"Description"},"order":{"type":"integer","title":"Order"}},"type":"object","required":["type","description","order"],"title":"MetadataPropertyResponse","description":"Shared fields for every metadata property on the public v2 surface.\n\nUsed directly for property types that add no extra fields (number, boolean,\ndate); string and string-list subclass it below for their extra fields.","x-gitbook-description-html":"<p>Shared fields for every metadata property on the public v2 surface.</p>\n<p>Used directly for property types that add no extra fields (number, boolean,\ndate); string and string-list subclass it below for their extra fields.</p>\n"},"MetadataSchema":{"properties":{"properties":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"anyOf":[{"$ref":"#/components/schemas/StringProperty"},{"$ref":"#/components/schemas/NumberProperty"},{"$ref":"#/components/schemas/BooleanProperty"},{"$ref":"#/components/schemas/DateProperty"},{"$ref":"#/components/schemas/StringListProperty"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"Properties"}},"type":"object","required":["properties"],"title":"MetadataSchema"},"MetadataSchemaResponseV2":{"properties":{"properties":{"patternProperties":{"^[^\\t\\n\\r\\f\\v]+$":{"oneOf":[{"$ref":"#/components/schemas/MetadataStringPropertyResponseV2"},{"$ref":"#/components/schemas/MetadataPropertyBaseResponseV2"},{"$ref":"#/components/schemas/MetadataStringListPropertyResponseV2"}],"discriminator":{"propertyName":"type","mapping":{"boolean":"#/components/schemas/MetadataPropertyBaseResponseV2","date":"#/components/schemas/MetadataPropertyBaseResponseV2","number":"#/components/schemas/MetadataPropertyBaseResponseV2","string":"#/components/schemas/MetadataStringPropertyResponseV2","string_list":"#/components/schemas/MetadataStringListPropertyResponseV2"}}}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object","title":"Properties"}},"type":"object","required":["properties"],"title":"MetadataSchema","description":"A metadata schema (user or dataloader) on the public v2 surface.","x-gitbook-description-html":"<p>A metadata schema (user or dataloader) on the public v2 surface.</p>\n"},"MetadataStringListOptionResponseV2":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"color":{"$ref":"#/components/schemas/StringListOptionColor"},"order":{"type":"integer","title":"Order"}},"type":"object","required":["id","label","description","color","order"],"title":"MetadataStringListOptionResponse","description":"A selectable option for a string-list metadata property.","x-gitbook-description-html":"<p>A selectable option for a string-list metadata property.</p>\n"},"MetadataStringListPropertyResponseV2":{"properties":{"type":{"type":"string","const":"string_list","title":"Type","default":"string_list"},"description":{"type":"string","title":"Description"},"order":{"type":"integer","title":"Order"},"options":{"items":{"$ref":"#/components/schemas/MetadataStringListOptionResponseV2"},"type":"array","title":"Options"}},"type":"object","required":["description","order","options"],"title":"MetadataStringListPropertyResponse","description":"A string-list-valued metadata property on the public v2 surface.","x-gitbook-description-html":"<p>A string-list-valued metadata property on the public v2 surface.</p>\n"},"MetadataStringPropertyResponseV2":{"properties":{"type":{"type":"string","const":"string","title":"Type","default":"string"},"description":{"type":"string","title":"Description"},"order":{"type":"integer","title":"Order"},"subtype":{"$ref":"#/components/schemas/StringSubtypeEnum"}},"type":"object","required":["description","order","subtype"],"title":"MetadataStringPropertyResponse","description":"A string-valued metadata property on the public v2 surface.","x-gitbook-description-html":"<p>A string-valued metadata property on the public v2 surface.</p>\n"},"NumberProperty":{"properties":{"type":{"type":"string","const":"number","title":"Type","default":"number"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"order":{"type":"integer","minimum":0,"title":"Order","description":"Display order of this property within the schema.","default":0,"x-gitbook-description-html":"<p>Display order of this property within the schema.</p>\n"}},"type":"object","title":"NumberProperty"},"OffsetBasedPaginationResponse_ConnectionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/ConnectionResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[ConnectionResponseV2]"},"OffsetBasedPaginationResponse_EvalDatasetListItemResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalDatasetListItemResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvalDatasetListItemResponseV2]"},"OffsetBasedPaginationResponse_EvalDatasetRowResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalDatasetRowResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvalDatasetRowResponseV2]"},"OffsetBasedPaginationResponse_EvalExperimentRowResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalExperimentRowResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvalExperimentRowResponseV2]"},"OffsetBasedPaginationResponse_EvalExperimentSummaryResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalExperimentSummaryResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvalExperimentSummaryResponseV2]"},"OffsetBasedPaginationResponse_EvalMonitorListItemResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalMonitorListItemResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvalMonitorListItemResponseV2]"},"OffsetBasedPaginationResponse_EvaluatorResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvaluatorResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[EvaluatorResponseV2]"},"OffsetBasedPaginationResponse_ProviderActionSummaryResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/ProviderActionSummaryResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[ProviderActionSummaryResponseV2]"},"OffsetBasedPaginationResponse_ProviderResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/ProviderResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[ProviderResponseV2]"},"OffsetBasedPaginationResponse_ProviderTriggerSummaryResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/ProviderTriggerSummaryResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[ProviderTriggerSummaryResponseV2]"},"OffsetBasedPaginationResponse_SkillListItemResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/SkillListItemResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[SkillListItemResponseV2]"},"OffsetBasedPaginationResponse_SkillVersionListItemResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/SkillVersionListItemResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[SkillVersionListItemResponseV2]"},"OffsetBasedPaginationResponse_WebhookSubscriptionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/WebhookSubscriptionResponseV2"},"type":"array","title":"Data"},"offset":{"type":"integer","minimum":0,"title":"Offset","default":0},"limit":{"type":"integer","minimum":0,"title":"Limit","default":50},"total":{"type":"integer","minimum":0,"title":"Total","default":0}},"type":"object","title":"OffsetBasedPaginationResponse[WebhookSubscriptionResponseV2]"},"PaginationDirection":{"type":"string","enum":["next","prev"],"title":"PaginationDirection","description":"Direction for cursor-based pagination.","x-gitbook-description-html":"<p>Direction for cursor-based pagination.</p>\n"},"PauseContext":{"properties":{"run_id":{"type":"string","title":"Run Id"},"node_id":{"type":"string","title":"Node Id"},"question":{"type":"string","title":"Question","default":""},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"response_type":{"type":"string","title":"Response Type","default":"text"},"choices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Choices"},"resume_token":{"type":"string","title":"Resume Token"},"resume_endpoint":{"type":"string","title":"Resume Endpoint"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"When the resume token expires (decoded unverified for display; resume re-verifies).","readOnly":true,"x-gitbook-description-html":"<p>When the resume token expires (decoded unverified for display; resume re-verifies).</p>\n"},"response_schema":{"additionalProperties":true,"type":"object","title":"Response Schema","description":"Minimal JSON Schema describing the answer this pause expects.","readOnly":true,"x-gitbook-description-html":"<p>Minimal JSON Schema describing the answer this pause expects.</p>\n"}},"type":"object","required":["run_id","node_id","resume_token","resume_endpoint","expires_at","response_schema"],"title":"PauseContext","description":"What a paused run is waiting on, plus how to resume it.","x-gitbook-description-html":"<p>What a paused run is waiting on, plus how to resume it.</p>\n"},"ProjectIoParameterResponseV2":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"ProjectIoParameter"},"ProjectIoSchemaResponseV2":{"properties":{"input_kind":{"type":"string","enum":["start_node","legacy_input_nodes"],"title":"Input Kind"},"inputs":{"items":{"$ref":"#/components/schemas/ProjectIoParameterResponseV2"},"type":"array","title":"Inputs"},"outputs":{"items":{"$ref":"#/components/schemas/ProjectIoParameterResponseV2"},"type":"array","title":"Outputs"}},"type":"object","required":["input_kind","inputs","outputs"],"title":"ProjectIoSchema"},"ProjectRunSummary":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"date":{"type":"string","format":"date-time","title":"Date"},"is_flow_successful":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Flow Successful"},"state":{"anyOf":[{"$ref":"#/components/schemas/WorkflowState"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"latency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency"},"total_tokens":{"type":"integer","title":"Total Tokens"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"inputs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outputs"},"llms":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llms"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"cache_metrics":{"anyOf":[{"$ref":"#/components/schemas/CacheMetrics"},{"type":"null"}]},"llm_usage":{"items":{"$ref":"#/components/schemas/LLMUsageData"},"type":"array","title":"Llm Usage"},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunType"},{"type":"null"}],"description":"How the run was initiated.","x-gitbook-description-html":"<p>How the run was initiated.</p>\n"},"ran_by_type":{"anyOf":[{"$ref":"#/components/schemas/RanByType"},{"type":"null"}],"description":"Who authenticated the run.","x-gitbook-description-html":"<p>Who authenticated the run.</p>\n"},"ran_by_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ran By Id","description":"Principal the run is attributed to: profiles.id for user and personal_api_key (the key owner), organizations.org_id for org_api_key, end_users.id for end_user. NULL for system runs and legacy rows.","x-gitbook-description-html":"<p>Principal the run is attributed to: profiles.id for user and personal_api_key (the key owner), organizations.org_id for org_api_key, end_users.id for end_user. NULL for system runs and legacy rows.</p>\n"},"ran_by_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ran By Display Name","description":"Display name of the principal: the profile email for user and personal_api_key runs, the organization name for org_api_key runs.","x-gitbook-description-html":"<p>Display name of the principal: the profile email for user and personal_api_key runs, the organization name for org_api_key runs.</p>\n"},"project_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version Id","description":"Project version that executed the run. Non-positive values mean the draft.","x-gitbook-description-html":"<p>Project version that executed the run. Non-positive values mean the draft.</p>\n"},"base_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Version Id","description":"For draft runs, the project's published version at run time. Lets the UI label a draft against the version it was based on (e.g. 'Draft (v3)').","x-gitbook-description-html":"<p>For draft runs, the project&#39;s published version at run time. Lets the UI label a draft against the version it was based on (e.g. &#39;Draft (v3)&#39;).</p>\n"},"deployment_stage":{"anyOf":[{"$ref":"#/components/schemas/DeploymentStage"},{"type":"null"}],"description":"Stage the run executed against (draft/development/staging/production). Lets the UI tell a preview run (draft) from a deployed run for form and batch runs, which otherwise share the same project_version_id sentinel.","x-gitbook-description-html":"<p>Stage the run executed against (draft/development/staging/production). Lets the UI tell a preview run (draft) from a deployed run for form and batch runs, which otherwise share the same project_version_id sentinel.</p>\n"},"parent_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Run Id","description":"Run ID of the parent workflow for sub-workflow runs.","x-gitbook-description-html":"<p>Run ID of the parent workflow for sub-workflow runs.</p>\n"},"parent_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Id","description":"Project ID of the parent workflow for sub-workflow runs.","x-gitbook-description-html":"<p>Project ID of the parent workflow for sub-workflow runs.</p>\n"},"parent_project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Name","description":"Name of the parent project for sub-workflow runs.","x-gitbook-description-html":"<p>Name of the parent project for sub-workflow runs.</p>\n"}},"type":"object","required":["run_id","date","is_flow_successful","state","error","latency","total_tokens","user_id","inputs","outputs","llms","feedback"],"title":"ProjectRunSummary","description":"Summary of a single workflow run.","x-gitbook-description-html":"<p>Summary of a single workflow run.</p>\n"},"ProviderActionInputParameterV2":{"properties":{"name":{"type":"string","title":"Name"},"type":{"$ref":"#/components/schemas/ProviderActionParameterTypeV2"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"required":{"type":"boolean","title":"Required","default":false},"default":{"title":"Default"},"options":{"items":{"$ref":"#/components/schemas/ProviderActionParameterOptionV2"},"type":"array","title":"Options"},"has_dynamic_options":{"type":"boolean","title":"Has Dynamic Options","default":false},"depends_on":{"items":{"type":"string"},"type":"array","title":"Depends On"},"minimum":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Minimum"},"maximum":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Maximum"}},"type":"object","required":["name","type","label","description"],"title":"ProviderActionInputParameter","description":"One input parameter of an action; `name` is the key used in the run `inputs` map.","x-gitbook-description-html":"<p>One input parameter of an action; <code>name</code> is the key used in the run <code>inputs</code> map.</p>\n"},"ProviderActionOutputParameterV2":{"properties":{"name":{"type":"string","title":"Name"},"type":{"$ref":"#/components/schemas/ProviderActionParameterTypeV2"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","type","label","description"],"title":"ProviderActionOutputParameter","description":"One output parameter of an action.","x-gitbook-description-html":"<p>One output parameter of an action.</p>\n"},"ProviderActionParameterOptionV2":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}],"title":"Value"},"label":{"type":"string","title":"Label"}},"type":"object","required":["value","label"],"title":"ProviderActionParameterOption","description":"A selectable value for a parameter with a fixed choice list.","x-gitbook-description-html":"<p>A selectable value for a parameter with a fixed choice list.</p>\n"},"ProviderActionParameterTypeV2":{"type":"string","enum":["string","number","integer","float","boolean","select","secret","secret_multiline","file","binary_file","files","knowledge_base","browser_navigation_replay","browser_navigation_session","connection","textline","textarea","multiple_select","string_array","number_array","date","time","datetime","percentage_slider","object","array","object_array","dict","dict_array","code","expression","file_picker","unknown"],"title":"ProviderActionParameterTypeV2","description":"The public parameter type.\n\nA StackAI-owned copy of the platform's parameter types, kept deliberately decoupled from the\ninternal engine enum (`stackflow`'s `ToolParameterType`) so the public contract does not\nshift when that internal enum changes. An internal type this copy does not list degrades to\n`UNKNOWN` rather than breaking the response.","x-gitbook-description-html":"<p>The public parameter type.</p>\n<p>A StackAI-owned copy of the platform&#39;s parameter types, kept deliberately decoupled from the\ninternal engine enum (<code>stackflow</code>&#39;s <code>ToolParameterType</code>) so the public contract does not\nshift when that internal enum changes. An internal type this copy does not list degrades to\n<code>UNKNOWN</code> rather than breaking the response.</p>\n"},"ProviderActionResponseV2":{"properties":{"action_id":{"type":"string","title":"Action Id"},"provider_id":{"type":"string","title":"Provider Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"deprecated":{"type":"boolean","title":"Deprecated","default":false},"deprecation_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deprecation Message"},"input_parameters":{"items":{"$ref":"#/components/schemas/ProviderActionInputParameterV2"},"type":"array","title":"Input Parameters"},"output_parameters":{"items":{"$ref":"#/components/schemas/ProviderActionOutputParameterV2"},"type":"array","title":"Output Parameters"}},"type":"object","required":["action_id","provider_id","name","description"],"title":"ProviderActionResponse","description":"A provider action on the public v2 catalog, with its input and output parameters.\n\nServes the action-detail endpoint only. The parameters come from the provider cache — the\nsame snapshot as the rest of the catalog — not from a live registry crawl: the cache already\ncarries each action's flattened parameter metadata, so detail is a pure cache read. Output\nparameters are one level deep (nested object shapes surface as `type: \"object\"` without\ntheir sub-fields), which the cached representation does not expand.","x-gitbook-description-html":"<p>A provider action on the public v2 catalog, with its input and output parameters.</p>\n<p>Serves the action-detail endpoint only. The parameters come from the provider cache — the\nsame snapshot as the rest of the catalog — not from a live registry crawl: the cache already\ncarries each action&#39;s flattened parameter metadata, so detail is a pure cache read. Output\nparameters are one level deep (nested object shapes surface as <code>type: &quot;object&quot;</code> without\ntheir sub-fields), which the cached representation does not expand.</p>\n"},"ProviderActionSummaryResponseV2":{"properties":{"action_id":{"type":"string","title":"Action Id"},"provider_id":{"type":"string","title":"Provider Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"deprecated":{"type":"boolean","title":"Deprecated","default":false},"deprecation_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deprecation Message"}},"type":"object","required":["action_id","provider_id","name","description"],"title":"ProviderActionSummaryResponse","description":"A provider action's identity and metadata, without its input/output parameters.\n\nServes the actions-list endpoint. A catalog list is intentionally lean — identity and\nmetadata to scan and pick from, not the full resource — matching how iPaaS platforms expose\naction catalogs (browse the list, then fetch one action for its fields). Callers fetch a\nsingle action's detail (`ProviderActionResponseV2`) for its `input_parameters`/`output_parameters`.","x-gitbook-description-html":"<p>A provider action&#39;s identity and metadata, without its input/output parameters.</p>\n<p>Serves the actions-list endpoint. A catalog list is intentionally lean — identity and\nmetadata to scan and pick from, not the full resource — matching how iPaaS platforms expose\naction catalogs (browse the list, then fetch one action for its fields). Callers fetch a\nsingle action&#39;s detail (<code>ProviderActionResponseV2</code>) for its <code>input_parameters</code>/<code>output_parameters</code>.</p>\n"},"ProviderDeprecationV2":{"properties":{"removal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Removal Date"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"}},"type":"object","required":["removal_date","instructions"],"title":"ProviderDeprecation","description":"Deprecation metadata for a provider on the public v2 surface.","x-gitbook-description-html":"<p>Deprecation metadata for a provider on the public v2 surface.</p>\n"},"ProviderResponseV2":{"properties":{"provider_id":{"type":"string","title":"Provider Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"icon_url":{"type":"string","title":"Icon Url"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"action_count":{"type":"integer","title":"Action Count","default":0},"trigger_count":{"type":"integer","title":"Trigger Count","default":0},"deprecation":{"anyOf":[{"$ref":"#/components/schemas/ProviderDeprecationV2"},{"type":"null"}]}},"type":"object","required":["provider_id","name","description","icon_url"],"title":"ProviderResponse","description":"An integration provider on the public v2 catalog. Serves both list and detail.","x-gitbook-description-html":"<p>An integration provider on the public v2 catalog. Serves both list and detail.</p>\n"},"ProviderTriggerResponseV2":{"properties":{"trigger_id":{"type":"string","title":"Trigger Id"},"provider_id":{"type":"string","title":"Provider Id"},"trigger_type":{"$ref":"#/components/schemas/TriggerTypeV2"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"input_parameters":{"items":{"$ref":"#/components/schemas/ProviderActionInputParameterV2"},"type":"array","title":"Input Parameters"},"output_parameters":{"items":{"$ref":"#/components/schemas/ProviderActionOutputParameterV2"},"type":"array","title":"Output Parameters"}},"type":"object","required":["trigger_id","provider_id","trigger_type","name","description"],"title":"ProviderTriggerResponse","description":"A provider trigger on the public v2 catalog, with its cached parameters.","x-gitbook-description-html":"<p>A provider trigger on the public v2 catalog, with its cached parameters.</p>\n"},"ProviderTriggerSummaryResponseV2":{"properties":{"trigger_id":{"type":"string","title":"Trigger Id"},"provider_id":{"type":"string","title":"Provider Id"},"trigger_type":{"$ref":"#/components/schemas/TriggerTypeV2"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["trigger_id","provider_id","trigger_type","name","description"],"title":"ProviderTriggerSummaryResponse","description":"A provider trigger's identity and metadata, without its parameters.","x-gitbook-description-html":"<p>A provider trigger&#39;s identity and metadata, without its parameters.</p>\n"},"RanByType":{"type":"string","enum":["user","personal_api_key","org_api_key","system","end_user"],"title":"RanByType","description":"Who or what authenticated the run.","x-gitbook-description-html":"<p>Who or what authenticated the run.</p>\n"},"ResourceDownloadResponseV2":{"properties":{"download_url":{"type":"string","title":"Download Url","description":"Signed URL for direct download; expires.","x-gitbook-description-html":"<p>Signed URL for direct download; expires.</p>\n"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["download_url","filename"],"title":"ResourceDownloadResponse","description":"A signed URL to download the original file.","x-gitbook-description-html":"<p>A signed URL to download the original file.</p>\n"},"ResourceUploadResponse":{"properties":{"message":{"type":"string","title":"Message"},"resource_id":{"type":"string","format":"uuid","title":"Resource Id"}},"type":"object","required":["message","resource_id"],"title":"ResourceUploadResponse","description":"Result of a file upload, including the resource ID for status polling.","x-gitbook-description-html":"<p>Result of a file upload, including the resource ID for status polling.</p>\n"},"ResourceUploadResponseV2":{"properties":{"message":{"type":"string","title":"Message"},"resource_id":{"type":"string","format":"uuid","title":"Resource Id"}},"type":"object","required":["message","resource_id"],"title":"ResourceUploadResponse","description":"Result of a file upload, including the resource ID for status polling.","x-gitbook-description-html":"<p>Result of a file upload, including the resource ID for status polling.</p>\n"},"ResumeRunRequest":{"properties":{"resume_token":{"type":"string","title":"Resume Token"},"response":{"type":"string","title":"Response"},"response_type":{"anyOf":[{"$ref":"#/components/schemas/HitlResponseType"},{"type":"null"}],"description":"How to interpret `response`, mirroring the pause's `response_type`.","examples":["text","approval","choice"],"x-gitbook-description-html":"<p>How to interpret <code>response</code>, mirroring the pause&#39;s <code>response_type</code>.</p>\n"}},"type":"object","required":["resume_token","response"],"title":"ResumeRunRequest","description":"Request body to resume a paused run from the public API.","x-gitbook-description-html":"<p>Request body to resume a paused run from the public API.</p>\n"},"RetrievalType":{"type":"string","enum":["docs","pages","chunks"],"title":"RetrievalType","description":"Retrieval type.","x-gitbook-description-html":"<p>Retrieval type.</p>\n"},"RunCitationPositionV2":{"properties":{"page_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Index","description":"Zero-based page the chunk was read from, if recorded.","x-gitbook-description-html":"<p>Zero-based page the chunk was read from, if recorded.</p>\n"},"chunk_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chunk Index","description":"Zero-based index of the chunk within the source, if recorded.","x-gitbook-description-html":"<p>Zero-based index of the chunk within the source, if recorded.</p>\n"},"page_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Number","description":"Page number as printed in the source, if known.","x-gitbook-description-html":"<p>Page number as printed in the source, if known.</p>\n"}},"additionalProperties":false,"type":"object","required":["page_index","chunk_index","page_number"],"title":"RunCitationPosition","description":"Position of a citation within its source.","x-gitbook-description-html":"<p>Position of a citation within its source.</p>\n"},"RunCitationSourceTypeV2":{"type":"string","enum":["knowledge_base","website","document","other"],"title":"RunCitationSourceTypeV2","description":"Type of source cited by the run.","x-gitbook-description-html":"<p>Type of source cited by the run.</p>\n"},"RunCitationV2":{"properties":{"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"Knowledge base the cited source belongs to, if any.","x-gitbook-description-html":"<p>Knowledge base the cited source belongs to, if any.</p>\n"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id","description":"Knowledge base resource that was cited, if any.","x-gitbook-description-html":"<p>Knowledge base resource that was cited, if any.</p>\n"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url","description":"External link to the cited source, if available.","x-gitbook-description-html":"<p>External link to the cited source, if available.</p>\n"},"source_type":{"$ref":"#/components/schemas/RunCitationSourceTypeV2","description":"Kind of source that was cited.","x-gitbook-description-html":"<p>Kind of source that was cited.</p>\n"},"position":{"anyOf":[{"$ref":"#/components/schemas/RunCitationPositionV2"},{"type":"null"}],"description":"Where in the source the cited chunk sits. Null when not recorded.","x-gitbook-description-html":"<p>Where in the source the cited chunk sits. Null when not recorded.</p>\n"}},"additionalProperties":false,"type":"object","required":["knowledge_base_id","resource_id","source_url","source_type","position"],"title":"RunCitation","description":"Source cited by a run.","x-gitbook-description-html":"<p>Source cited by a run.</p>\n"},"RunCreatedByTypeV2":{"type":"string","enum":["user","personal_api_key","org_api_key","system","end_user","unknown"],"title":"RunCreatedByTypeV2","description":"Type of user, API key, or system that started the run.","x-gitbook-description-html":"<p>Type of user, API key, or system that started the run.</p>\n"},"RunCreatedByV2":{"properties":{"type":{"$ref":"#/components/schemas/RunCreatedByTypeV2","description":"Kind of principal that started the run.","x-gitbook-description-html":"<p>Kind of principal that started the run.</p>\n"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"ID of the principal identified by `type`: the user ID for `user` and `personal_api_key`, the organization ID for `org_api_key`, the end-user ID for `end_user`. Null if no ID is available.","x-gitbook-description-html":"<p>ID of the principal identified by <code>type</code>: the user ID for <code>user</code> and <code>personal_api_key</code>, the organization ID for <code>org_api_key</code>, the end-user ID for <code>end_user</code>. Null if no ID is available.</p>\n"}},"additionalProperties":false,"type":"object","required":["type","id"],"title":"RunCreatedBy","description":"Who or what started the run.","x-gitbook-description-html":"<p>Who or what started the run.</p>\n"},"RunPauseResponseTypeV2":{"type":"string","enum":["text","approval","choice","unknown"],"title":"RunPauseResponseTypeV2","description":"Kind of answer requested by a paused ask-human step.","x-gitbook-description-html":"<p>Kind of answer requested by a paused ask-human step.</p>\n"},"RunPendingInputV2":{"properties":{"question":{"type":"string","title":"Question","description":"Question shown to the human responder.","x-gitbook-description-html":"<p>Question shown to the human responder.</p>\n"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context","description":"Additional context, if supplied.","x-gitbook-description-html":"<p>Additional context, if supplied.</p>\n"},"response_type":{"$ref":"#/components/schemas/RunPauseResponseTypeV2","description":"Expected answer kind.","x-gitbook-description-html":"<p>Expected answer kind.</p>\n"},"choices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Choices","description":"Ordered choices, when supplied.","x-gitbook-description-html":"<p>Ordered choices, when supplied.</p>\n"},"resume_token":{"type":"string","title":"Resume Token","description":"Secret token authorizing this pause's resume.","x-gitbook-description-html":"<p>Secret token authorizing this pause&#39;s resume.</p>\n"},"resume_token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resume Token Expires At","description":"When the resume token expires; this is not the pause timeout.","x-gitbook-description-html":"<p>When the resume token expires; this is not the pause timeout.</p>\n"}},"additionalProperties":false,"type":"object","required":["question","context","response_type","choices","resume_token","resume_token_expires_at"],"title":"RunPendingInput","description":"Ask-human input awaiting a response from a caller who may run the project.","x-gitbook-description-html":"<p>Ask-human input awaiting a response from a caller who may run the project.</p>\n"},"RunProviderActionRequestV2":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"}},"additionalProperties":false,"type":"object","required":["inputs"],"title":"RunProviderActionRequest","description":"Body for running a provider action; `inputs` is validated against the action's own schema.","x-gitbook-description-html":"<p>Body for running a provider action; <code>inputs</code> is validated against the action&#39;s own schema.</p>\n"},"RunProviderActionResponseV2":{"properties":{"outputs":{"additionalProperties":true,"type":"object","title":"Outputs"}},"type":"object","required":["outputs"],"title":"RunProviderActionResponse","description":"The result of running a provider action, keyed by the action's own output parameter names.","x-gitbook-description-html":"<p>The result of running a provider action, keyed by the action&#39;s own output parameter names.</p>\n"},"RunResponseV2":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"ID of the run.","x-gitbook-description-html":"<p>ID of the run.</p>\n"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project the run executed. Null for legacy runs.","x-gitbook-description-html":"<p>Project the run executed. Null for legacy runs.</p>\n"},"project_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version","description":"Project version used for this run: -1 for a draft execution, a non-negative integer for a numbered version, or null when the version could not be determined.","x-gitbook-description-html":"<p>Project version used for this run: -1 for a draft execution, a non-negative integer for a numbered version, or null when the version could not be determined.</p>\n"},"status":{"$ref":"#/components/schemas/RunStatusV2","description":"Lifecycle status of the run.","x-gitbook-description-html":"<p>Lifecycle status of the run.</p>\n"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Failure message. Null when the run did not fail.","x-gitbook-description-html":"<p>Failure message. Null when the run did not fail.</p>\n"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was recorded.","x-gitbook-description-html":"<p>When the run was recorded.</p>\n"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When execution started. Null when unknown or not yet started.","x-gitbook-description-html":"<p>When execution started. Null when unknown or not yet started.</p>\n"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When execution finished. Null when unknown or not yet finished.","x-gitbook-description-html":"<p>When execution finished. Null when unknown or not yet finished.</p>\n"},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunTypeV2"},{"type":"null"}],"description":"How the run was started. Null when not recorded.","x-gitbook-description-html":"<p>How the run was started. Null when not recorded.</p>\n"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/RunCreatedByV2"},{"type":"null"}],"description":"Principal that started the run. Null when not recorded.","x-gitbook-description-html":"<p>Principal that started the run. Null when not recorded.</p>\n"},"usage":{"$ref":"#/components/schemas/RunUsageV2","description":"Token usage for the run.","x-gitbook-description-html":"<p>Token usage for the run.</p>\n"},"parent_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Run Id","description":"Run that started this one. Null unless this is a sub-workflow run.","x-gitbook-description-html":"<p>Run that started this one. Null unless this is a sub-workflow run.</p>\n"},"parent_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Id","description":"Project of the parent run. Null unless this is a sub-workflow run.","x-gitbook-description-html":"<p>Project of the parent run. Null unless this is a sub-workflow run.</p>\n"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input","description":"Inputs the run was started with.","x-gitbook-description-html":"<p>Inputs the run was started with.</p>\n"},"output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output","description":"Outputs the run produced.","x-gitbook-description-html":"<p>Outputs the run produced.</p>\n"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/RunCitationV2"},"type":"array"},{"type":"null"}],"title":"Citations","description":"Sources cited by the run. Null when the run recorded none.","x-gitbook-description-html":"<p>Sources cited by the run. Null when the run recorded none.</p>\n"},"pending_input":{"anyOf":[{"$ref":"#/components/schemas/RunPendingInputV2"},{"type":"null"}],"description":"Ask-human input for a paused run. Null unless the caller can both read and resume it.","x-gitbook-description-html":"<p>Ask-human input for a paused run. Null unless the caller can both read and resume it.</p>\n"}},"additionalProperties":false,"type":"object","required":["run_id","project_id","status","error","created_at","started_at","completed_at","run_type","created_by","usage","parent_run_id","parent_project_id","input","output","citations","pending_input"],"title":"RunResponse","description":"A run with its input, output, citations, and token usage.","x-gitbook-description-html":"<p>A run with its input, output, citations, and token usage.</p>\n"},"RunResumeRequestV2":{"properties":{"resume_token":{"type":"string","title":"Resume Token","description":"Token issued for the paused ask-human step.","x-gitbook-description-html":"<p>Token issued for the paused ask-human step.</p>\n"},"response":{"type":"string","title":"Response","description":"Human response to the paused step.","x-gitbook-description-html":"<p>Human response to the paused step.</p>\n"},"response_type":{"anyOf":[{"$ref":"#/components/schemas/RunResumeResponseTypeV2"},{"type":"null"}],"description":"How to interpret the response; defaults to text when omitted.","x-gitbook-description-html":"<p>How to interpret the response; defaults to text when omitted.</p>\n"}},"additionalProperties":false,"type":"object","required":["resume_token","response"],"title":"RunResumeRequest","description":"Body for resuming an ask-human pause.","x-gitbook-description-html":"<p>Body for resuming an ask-human pause.</p>\n"},"RunResumeResponseTypeV2":{"type":"string","enum":["text","approval","choice"],"title":"RunResumeResponseTypeV2","description":"Kind of answer sent to a paused ask-human step.","x-gitbook-description-html":"<p>Kind of answer sent to a paused ask-human step.</p>\n"},"RunStartRequestV2":{"properties":{"project_id":{"type":"string","title":"Project Id"},"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Node inputs keyed by node id, matching the project's input schema.","x-gitbook-description-html":"<p>Node inputs keyed by node id, matching the project&#39;s input schema.</p>\n"},"project_version":{"anyOf":[{"type":"integer","minimum":-1},{"type":"null"}],"title":"Project Version","description":"Project version to run. Omit or use null for the current published version, use -1 for the current draft, or use a non-negative version for an exact snapshot.","x-gitbook-description-html":"<p>Project version to run. Omit or use null for the current published version, use -1 for the current draft, or use a non-negative version for an exact snapshot.</p>\n"}},"additionalProperties":false,"type":"object","required":["project_id","input"],"title":"RunStartRequest","description":"Body for starting a project run.","x-gitbook-description-html":"<p>Body for starting a project run.</p>\n"},"RunStatusResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"state":{"anyOf":[{"$ref":"#/components/schemas/WorkflowState"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"pause":{"anyOf":[{"$ref":"#/components/schemas/PauseContext"},{"type":"null"}]}},"type":"object","required":["run_id"],"title":"RunStatusResponse","description":"Public run status, surfacing the pause context when the run is awaiting a response.","x-gitbook-description-html":"<p>Public run status, surfacing the pause context when the run is awaiting a response.</p>\n"},"RunStatusV2":{"type":"string","enum":["queued","running","paused","succeeded","failed","cancelled"],"title":"RunStatusV2","description":"Lifecycle status exposed by the Runs v2 API.","x-gitbook-description-html":"<p>Lifecycle status exposed by the Runs v2 API.</p>\n"},"RunSummaryResponseV2":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"ID of the run.","x-gitbook-description-html":"<p>ID of the run.</p>\n"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project the run executed. Null for legacy runs.","x-gitbook-description-html":"<p>Project the run executed. Null for legacy runs.</p>\n"},"project_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version","description":"Project version used for this run: -1 for a draft execution, a non-negative integer for a numbered version, or null when the version could not be determined.","x-gitbook-description-html":"<p>Project version used for this run: -1 for a draft execution, a non-negative integer for a numbered version, or null when the version could not be determined.</p>\n"},"status":{"$ref":"#/components/schemas/RunStatusV2","description":"Lifecycle status of the run.","x-gitbook-description-html":"<p>Lifecycle status of the run.</p>\n"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Failure message. Null when the run did not fail.","x-gitbook-description-html":"<p>Failure message. Null when the run did not fail.</p>\n"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was recorded.","x-gitbook-description-html":"<p>When the run was recorded.</p>\n"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When execution started. Null when unknown or not yet started.","x-gitbook-description-html":"<p>When execution started. Null when unknown or not yet started.</p>\n"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When execution finished. Null when unknown or not yet finished.","x-gitbook-description-html":"<p>When execution finished. Null when unknown or not yet finished.</p>\n"},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunTypeV2"},{"type":"null"}],"description":"How the run was started. Null when not recorded.","x-gitbook-description-html":"<p>How the run was started. Null when not recorded.</p>\n"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/RunCreatedByV2"},{"type":"null"}],"description":"Principal that started the run. Null when not recorded.","x-gitbook-description-html":"<p>Principal that started the run. Null when not recorded.</p>\n"},"usage":{"$ref":"#/components/schemas/RunUsageV2","description":"Token usage for the run.","x-gitbook-description-html":"<p>Token usage for the run.</p>\n"},"parent_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Run Id","description":"Run that started this one. Null unless this is a sub-workflow run.","x-gitbook-description-html":"<p>Run that started this one. Null unless this is a sub-workflow run.</p>\n"},"parent_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Id","description":"Project of the parent run. Null unless this is a sub-workflow run.","x-gitbook-description-html":"<p>Project of the parent run. Null unless this is a sub-workflow run.</p>\n"}},"additionalProperties":false,"type":"object","required":["run_id","project_id","status","error","created_at","started_at","completed_at","run_type","created_by","usage","parent_run_id","parent_project_id"],"title":"RunSummaryResponse","description":"A list row without its unbounded input, output, or citations.","x-gitbook-description-html":"<p>A list row without its unbounded input, output, or citations.</p>\n"},"RunType":{"type":"string","enum":["workflow_builder","form","batch","chat_assistant","agent_assistant","trigger","scheduled","sub_workflow","api","eval"],"title":"RunType","description":"How a workflow run was initiated.","x-gitbook-description-html":"<p>How a workflow run was initiated.</p>\n"},"RunTypeV2":{"type":"string","enum":["workflow_builder","form","batch","chat_assistant","agent_assistant","trigger","scheduled","sub_workflow","api","eval","unknown"],"title":"RunTypeV2","description":"How the run was started. Unrecognized types appear as `unknown`.","x-gitbook-description-html":"<p>How the run was started. Unrecognized types appear as <code>unknown</code>.</p>\n"},"RunUsageDetailV2":{"properties":{"provider":{"type":"string","title":"Provider","description":"Stable lowercase identifier of the model provider, e.g. `openai`.","x-gitbook-description-html":"<p>Stable lowercase identifier of the model provider, e.g. <code>openai</code>.</p>\n"},"model_id":{"type":"string","title":"Model Id","description":"Identifier of the model the provider was called with.","x-gitbook-description-html":"<p>Identifier of the model the provider was called with.</p>\n"},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id","description":"ID of the connection used for the model calls. Null if no connection ID is available.","x-gitbook-description-html":"<p>ID of the connection used for the model calls. Null if no connection ID is available.</p>\n"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens","description":"Tokens sent to the model. Null when the provider reported only a total.","x-gitbook-description-html":"<p>Tokens sent to the model. Null when the provider reported only a total.</p>\n"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens","description":"Tokens returned by the model. Null when the provider reported only a total.","x-gitbook-description-html":"<p>Tokens returned by the model. Null when the provider reported only a total.</p>\n"}},"additionalProperties":false,"type":"object","required":["provider","model_id","connection_id","input_tokens","output_tokens"],"title":"RunUsageDetail","description":"Token usage for one provider, model, and connection.","x-gitbook-description-html":"<p>Token usage for one provider, model, and connection.</p>\n"},"RunUsageV2":{"properties":{"total_tokens":{"type":"integer","title":"Total Tokens","description":"Tokens used across every model call in the run.","x-gitbook-description-html":"<p>Tokens used across every model call in the run.</p>\n"},"details":{"items":{"$ref":"#/components/schemas/RunUsageDetailV2"},"type":"array","title":"Details","description":"Usage aggregated per model and connection; models may appear more than once.","x-gitbook-description-html":"<p>Usage aggregated per model and connection; models may appear more than once.</p>\n"}},"additionalProperties":false,"type":"object","required":["total_tokens","details"],"title":"RunUsage","description":"Total and per-model token usage for a run.","x-gitbook-description-html":"<p>Total and per-model token usage for a run.</p>\n"},"SelectedWebsiteSource":{"properties":{"source_type":{"$ref":"#/components/schemas/SelectedWebsiteSourceType","default":"sitemap"},"original_search_term":{"type":"string","title":"Original Search Term"},"selected_resources":{"items":{"type":"string"},"type":"array","title":"Selected Resources"}},"type":"object","required":["original_search_term","selected_resources"],"title":"SelectedWebsiteSource","description":"A set of pages selected for indexing from a website source.","x-gitbook-description-html":"<p>A set of pages selected for indexing from a website source.</p>\n"},"SelectedWebsiteSourceType":{"type":"string","enum":["sitemap","manual"],"title":"SelectedWebsiteSourceType","description":"The type of website source.","x-gitbook-description-html":"<p>The type of website source.</p>\n"},"SkillCreatorResponseV2":{"properties":{"id":{"type":"string","title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["id","full_name"],"title":"SkillCreatorResponse"},"SkillFileResponseV2":{"properties":{"path":{"type":"string","title":"Path"},"content_type":{"type":"string","title":"Content Type"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["path","content_type","size"],"title":"SkillFileResponse"},"SkillListItemResponseV2":{"properties":{"skill_id":{"type":"string","format":"uuid","title":"Skill Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"version":{"type":"integer","title":"Version"},"is_builtin":{"type":"boolean","title":"Is Builtin"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions"},"created_by_user_profile":{"anyOf":[{"$ref":"#/components/schemas/SkillCreatorResponseV2"},{"type":"null"}]},"created_by_org":{"$ref":"#/components/schemas/SkillOrganizationResponseV2"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["skill_id","name","description","version","is_builtin","actions","created_by_user_profile","created_by_org","created_at","updated_at"],"title":"SkillListItemResponse"},"SkillOrganizationResponseV2":{"properties":{"org_id":{"type":"string","title":"Org Id"},"org_name":{"type":"string","title":"Org Name"}},"type":"object","required":["org_id","org_name"],"title":"SkillOrganizationResponse"},"SkillResponseV2":{"properties":{"skill_id":{"type":"string","format":"uuid","title":"Skill Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"version":{"type":"integer","title":"Version"},"is_builtin":{"type":"boolean","title":"Is Builtin"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions"},"created_by_user_profile":{"anyOf":[{"$ref":"#/components/schemas/SkillCreatorResponseV2"},{"type":"null"}]},"created_by_org":{"$ref":"#/components/schemas/SkillOrganizationResponseV2"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"instructions":{"type":"string","title":"Instructions"},"frontmatter":{"additionalProperties":true,"type":"object","title":"Frontmatter"},"files":{"items":{"$ref":"#/components/schemas/SkillFileResponseV2"},"type":"array","title":"Files"}},"type":"object","required":["skill_id","name","description","version","is_builtin","actions","created_by_user_profile","created_by_org","created_at","updated_at","instructions"],"title":"SkillResponse"},"SkillVersionListItemResponseV2":{"properties":{"version":{"type":"integer","title":"Version"},"description":{"type":"string","title":"Description"},"created_by_user_profile":{"anyOf":[{"$ref":"#/components/schemas/SkillCreatorResponseV2"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["version","description","created_by_user_profile","created_at"],"title":"SkillVersionListItemResponse"},"SkillVersionResponseV2":{"properties":{"version":{"type":"integer","title":"Version"},"description":{"type":"string","title":"Description"},"created_by_user_profile":{"anyOf":[{"$ref":"#/components/schemas/SkillCreatorResponseV2"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"instructions":{"type":"string","title":"Instructions"},"frontmatter":{"additionalProperties":true,"type":"object","title":"Frontmatter"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions"},"files":{"items":{"$ref":"#/components/schemas/SkillFileResponseV2"},"type":"array","title":"Files"}},"type":"object","required":["version","description","created_by_user_profile","created_at","instructions"],"title":"SkillVersionResponse"},"StackAIAPIDataResponse_EvalDatasetResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalDatasetResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalDatasetResponseV2]"},"StackAIAPIDataResponse_EvalDatasetRowResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalDatasetRowResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalDatasetRowResponseV2]"},"StackAIAPIDataResponse_EvalExperimentCreateResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentCreateResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentCreateResponseV2]"},"StackAIAPIDataResponse_EvalExperimentDetailResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentDetailResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentDetailResponseV2]"},"StackAIAPIDataResponse_EvalExperimentJobAcceptedResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentJobAcceptedResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentJobAcceptedResponseV2]"},"StackAIAPIDataResponse_EvalExperimentJobResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentJobResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentJobResponseV2]"},"StackAIAPIDataResponse_EvalExperimentResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentResponseV2]"},"StackAIAPIDataResponse_EvalExperimentStatusResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalExperimentStatusResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalExperimentStatusResponseV2]"},"StackAIAPIDataResponse_EvalMonitorAlertResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalMonitorAlertResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalMonitorAlertResponseV2]"},"StackAIAPIDataResponse_EvalMonitorLimitsResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalMonitorLimitsResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalMonitorLimitsResponseV2]"},"StackAIAPIDataResponse_EvalMonitorResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalMonitorResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalMonitorResponseV2]"},"StackAIAPIDataResponse_EvalMonitorScoreStatsResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalMonitorScoreStatsResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalMonitorScoreStatsResponseV2]"},"StackAIAPIDataResponse_EvalRunScoreResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvalRunScoreResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvalRunScoreResponseV2]"},"StackAIAPIDataResponse_EvaluatorResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/EvaluatorResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[EvaluatorResponseV2]"},"StackAIAPIDataResponse_KnowledgeBaseFileResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/KnowledgeBaseFileResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[KnowledgeBaseFileResponseV2]"},"StackAIAPIDataResponse_KnowledgeBaseMetadataSchemasResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/KnowledgeBaseMetadataSchemasResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[KnowledgeBaseMetadataSchemasResponseV2]"},"StackAIAPIDataResponse_KnowledgeBaseResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/KnowledgeBaseResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[KnowledgeBaseResponseV2]"},"StackAIAPIDataResponse_KnowledgeBaseSyncResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/KnowledgeBaseSyncResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[KnowledgeBaseSyncResponseV2]"},"StackAIAPIDataResponse_ProjectIoSchemaResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ProjectIoSchemaResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ProjectIoSchemaResponseV2]"},"StackAIAPIDataResponse_ProviderActionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ProviderActionResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ProviderActionResponseV2]"},"StackAIAPIDataResponse_ProviderResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ProviderResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ProviderResponseV2]"},"StackAIAPIDataResponse_ProviderTriggerResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ProviderTriggerResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ProviderTriggerResponseV2]"},"StackAIAPIDataResponse_ResourceDownloadResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ResourceDownloadResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ResourceDownloadResponseV2]"},"StackAIAPIDataResponse_ResourceUploadResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/ResourceUploadResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[ResourceUploadResponseV2]"},"StackAIAPIDataResponse_RunProviderActionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/RunProviderActionResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[RunProviderActionResponseV2]"},"StackAIAPIDataResponse_RunResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/RunResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[RunResponseV2]"},"StackAIAPIDataResponse_SkillResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/SkillResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[SkillResponseV2]"},"StackAIAPIDataResponse_SkillVersionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/SkillVersionResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[SkillVersionResponseV2]"},"StackAIAPIDataResponse_WebhookSubscriptionWithSecretResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"$ref":"#/components/schemas/WebhookSubscriptionWithSecretResponseV2","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[WebhookSubscriptionWithSecretResponseV2]"},"StackAIAPIDataResponse_list_EvalDatasetRowResponseV2__":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvalDatasetRowResponseV2"},"type":"array","title":"Data","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[list[EvalDatasetRowResponseV2]]"},"StackAIAPIDataResponse_list_EvaluatorPreviewResponseV2__":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvaluatorPreviewResponseV2"},"type":"array","title":"Data","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[list[EvaluatorPreviewResponseV2]]"},"StackAIAPIDataResponse_list_EvaluatorTemplateResponseV2__":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/EvaluatorTemplateResponseV2"},"type":"array","title":"Data","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[list[EvaluatorTemplateResponseV2]]"},"StackAIAPIDataResponse_list_KnowledgeBaseQueryResultV2__":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"data":{"items":{"$ref":"#/components/schemas/KnowledgeBaseQueryResultV2"},"type":"array","title":"Data","description":"Data returned by the API service","x-gitbook-description-html":"<p>Data returned by the API service</p>\n"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[list[KnowledgeBaseQueryResultV2]]"},"StackAIAPIError":{"properties":{"message":{"type":"string","title":"Message","description":"Message describing the error","x-gitbook-description-html":"<p>Message describing the error</p>\n"}},"type":"object","required":["message"],"title":"StackAIAPIError","description":"Error detail model.","x-gitbook-description-html":"<p>Error detail model.</p>\n"},"StackAIAPIErrorResponse":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"},"errors":{"items":{"$ref":"#/components/schemas/StackAIAPIError"},"type":"array","title":"Errors","description":"List of errors","x-gitbook-description-html":"<p>List of errors</p>\n"},"detail":{"items":{"type":"string"},"type":"array","title":"Detail","description":"Human-readable error messages. Use the HTTP status and error metadata to decide how to handle the failure.","readOnly":true,"x-gitbook-description-html":"<p>Human-readable error messages. Use the HTTP status and error metadata to decide how to handle the failure.</p>\n"}},"type":"object","required":["detail"],"title":"StackAIAPIErrorResponse","description":"Error response model with status code and error list.","x-gitbook-description-html":"<p>Error response model with status code and error list.</p>\n"},"StackAIAPIResponse":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided.","x-gitbook-description-html":"<p>Machine-readable response code, when provided.</p>\n"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{},"x-gitbook-description-html":"<p>Additional metadata</p>\n"}},"type":"object","title":"StackAIAPIResponse","description":"Base response model for StackAI API endpoints.\n\nProvides Pydantic validation and serialization with a helper method\nto convert to FastAPI's JSONResponse when needed.\n\nSerialization contract: `status_code` never reaches the body (it only feeds\n`to_json_response`), and `response_code`/`meta` are omitted when unset so\nsuccess bodies carry no filler. Error handlers that set them keep them.","x-gitbook-description-html":"<p>Base response model for StackAI API endpoints.</p>\n<p>Provides Pydantic validation and serialization with a helper method\nto convert to FastAPI&#39;s JSONResponse when needed.</p>\n<p>Serialization contract: <code>status_code</code> never reaches the body (it only feeds\n<code>to_json_response</code>), and <code>response_code</code>/<code>meta</code> are omitted when unset so\nsuccess bodies carry no filler. Error handlers that set them keep them.</p>\n"},"StackFileStatusEnum":{"type":"string","enum":["resource","parsed","indexed","pending","pending_delete","deleted","error"],"title":"StackFileStatusEnum","description":"Processing status of a file in a knowledge base.","x-gitbook-description-html":"<p>Processing status of a file in a knowledge base.</p>\n"},"StringListOption":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"color":{"$ref":"#/components/schemas/StringListOptionColor","default":"gray"},"order":{"type":"integer","maximum":10000000,"minimum":0,"title":"Order","default":0}},"type":"object","required":["label"],"title":"StringListOption"},"StringListOptionColor":{"type":"string","enum":["red","green","blue","yellow","purple","gray"],"title":"StringListOptionColor","description":"Store the different colors that can be used for the string list options.","x-gitbook-description-html":"<p>Store the different colors that can be used for the string list options.</p>\n"},"StringListProperty":{"properties":{"type":{"type":"string","const":"string_list","title":"Type","default":"string_list"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"order":{"type":"integer","minimum":0,"title":"Order","description":"Display order of this property within the schema.","default":0,"x-gitbook-description-html":"<p>Display order of this property within the schema.</p>\n"},"options":{"items":{"$ref":"#/components/schemas/StringListOption"},"type":"array","title":"Options"}},"type":"object","title":"StringListProperty","description":"A property that contains a list of strings. Can be used to store tags as well.","x-gitbook-description-html":"<p>A property that contains a list of strings. Can be used to store tags as well.</p>\n"},"StringProperty":{"properties":{"type":{"type":"string","const":"string","title":"Type","default":"string"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""},"order":{"type":"integer","minimum":0,"title":"Order","description":"Display order of this property within the schema.","default":0,"x-gitbook-description-html":"<p>Display order of this property within the schema.</p>\n"},"subtype":{"$ref":"#/components/schemas/StringSubtypeEnum","default":"plain"}},"type":"object","title":"StringProperty"},"StringSubtypeEnum":{"type":"string","enum":["plain","email","url","phone","file_path"],"title":"StringSubtypeEnum"},"TriggerTypeV2":{"type":"string","enum":["polling","webhook","scheduled"],"title":"TriggerTypeV2","description":"The trigger types exposed by the public Providers catalog.","x-gitbook-description-html":"<p>The trigger types exposed by the public Providers catalog.</p>\n"},"UpdateKnowledgeBaseRequest":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled","default":false},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseIndexingParamsRequest"},{"type":"null"}]},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"UpdateKnowledgeBaseRequest","description":"Updates to apply to an existing knowledge base.","x-gitbook-description-html":"<p>Updates to apply to an existing knowledge base.</p>\n"},"UpdateKnowledgeBaseRequestV2":{"properties":{"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_source_ids":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Connection Source Ids"},"website_sources":{"items":{"$ref":"#/components/schemas/SelectedWebsiteSource"},"type":"array","title":"Website Sources"},"source_file_authorization_enabled":{"type":"boolean","title":"Source File Authorization Enabled","default":false},"name":{"type":"string","maxLength":2048,"minLength":1,"title":"Name","default":"Unnamed Knowledge Base"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"indexing_params":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseIndexingParamsRequest"},{"type":"null"}]},"org_level_role":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseRole"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"UpdateKnowledgeBaseRequest","description":"Updates to apply to an existing knowledge base.","x-gitbook-description-html":"<p>Updates to apply to an existing knowledge base.</p>\n"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookEventType":{"type":"string","enum":["run.started","run.step.succeeded","run.step.failed","run.succeeded","run.failed","run.cancelled"],"title":"WebhookEventType","description":"Event types a subscription may register for; producers emit these (runs producer lands separately).","x-gitbook-description-html":"<p>Event types a subscription may register for; producers emit these (runs producer lands separately).</p>\n"},"WebhookSubscriptionResponseV2":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"$ref":"#/components/schemas/WebhookEventType"},"type":"array","title":"Event Types"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["subscription_id","url","event_types","created_at"],"title":"WebhookSubscriptionResponse","description":"A webhook subscription on the public v2 surface.\n\nNo `status` field: the surface only ever returns active subscriptions, so the value\ncould never vary.","x-gitbook-description-html":"<p>A webhook subscription on the public v2 surface.</p>\n<p>No <code>status</code> field: the surface only ever returns active subscriptions, so the value\ncould never vary.</p>\n"},"WebhookSubscriptionWithSecretResponseV2":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"$ref":"#/components/schemas/WebhookEventType"},"type":"array","title":"Event Types"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"secret":{"type":"string","title":"Secret","description":"The signing secret for verifying deliveries. Shown only in this response and never retrievable afterwards; store it now, or delete the subscription and create a new one to get another secret.","x-gitbook-description-html":"<p>The signing secret for verifying deliveries. Shown only in this response and never retrievable afterwards; store it now, or delete the subscription and create a new one to get another secret.</p>\n"}},"type":"object","required":["subscription_id","url","event_types","created_at","secret"],"title":"WebhookSubscriptionWithSecretResponse","description":"A freshly created subscription, carrying its one-time signing secret.","x-gitbook-description-html":"<p>A freshly created subscription, carrying its one-time signing secret.</p>\n"},"WorkflowState":{"type":"string","enum":["PENDING","RUNNING","PAUSED","RESUMED","COMPLETED","FAILED","CANCELLED"],"title":"WorkflowState","description":"Enum representing the possible states of a workflow.","x-gitbook-description-html":"<p>Enum representing the possible states of a workflow.</p>\n"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer","description":"Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.","x-gitbook-description-html":"<p>Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.</p>\n"},"LegacyAPIKeyBearer":{"type":"http","scheme":"bearer","description":"Personal API key or the endpoint-specific legacy organization API key. Legacy inference uses the public organization key; legacy analytics uses the private organization key. This is not a password-grant login flow.","x-gitbook-description-html":"<p>Personal API key or the endpoint-specific legacy organization API key. Legacy inference uses the public organization key; legacy analytics uses the private organization key. This is not a password-grant login flow.</p>\n"}}},"tags":[{"name":"v2","x-page-title":"REST API v2"},{"name":"v1","x-page-title":"Knowledge Bases v1"},{"name":"legacy","x-page-title":"Legacy inference and analytics"},{"name":"legacy-inference","x-page-title":"Inference v0","x-parent":"legacy","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-getRun","x-page-title":"GET /inference/v0/runs/{org_id}/{run_id}","x-parent":"legacy-inference"},{"name":"endpoint-resumeRun","x-page-title":"POST /inference/v0/runs/{org_id}/{run_id}/resume","x-parent":"legacy-inference"},{"name":"endpoint-runDeployedFlow","x-page-title":"POST /inference/v0/run/{org_id}/{flow_id}","x-parent":"legacy-inference"},{"name":"knowledge-bases-v1","x-page-title":"Lifecycle, resources and sync","x-parent":"v1","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listKnowledgeBaseResources","x-page-title":"GET /v1/knowledge-bases/{knowledge_base_id}/resources","x-parent":"knowledge-bases-v1"},{"name":"endpoint-uploadKnowledgeBaseResource","x-page-title":"POST /v1/knowledge-bases/{knowledge_base_id}/resources","x-parent":"knowledge-bases-v1"},{"name":"endpoint-getKnowledgeBaseResource","x-page-title":"GET /v1/knowledge-bases/{knowledge_base_id}/resources/{resource_id}","x-parent":"knowledge-bases-v1"},{"name":"endpoint-deleteKnowledgeBaseResource","x-page-title":"DELETE /v1/knowledge-bases/{knowledge_base_id}/resources/{resource_id}","x-parent":"knowledge-bases-v1"},{"name":"endpoint-syncKnowledgeBase","x-page-title":"POST /v1/knowledge-bases/{knowledge_base_id}/sync","x-parent":"knowledge-bases-v1"},{"name":"endpoint-listKnowledgeBases","x-page-title":"GET /v1/knowledge-bases","x-parent":"knowledge-bases-v1"},{"name":"endpoint-createKnowledgeBase","x-page-title":"POST /v1/knowledge-bases","x-parent":"knowledge-bases-v1"},{"name":"endpoint-getKnowledgeBase","x-page-title":"GET /v1/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases-v1"},{"name":"endpoint-updateKnowledgeBase","x-page-title":"PATCH /v1/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases-v1"},{"name":"endpoint-deleteKnowledgeBase","x-page-title":"DELETE /v1/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases-v1"},{"name":"knowledge-bases","x-page-title":"Knowledge bases","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listKnowledgeBasesV2","x-page-title":"GET /v2/knowledge-bases","x-parent":"knowledge-bases"},{"name":"endpoint-createKnowledgeBaseV2","x-page-title":"POST /v2/knowledge-bases","x-parent":"knowledge-bases"},{"name":"endpoint-getKnowledgeBaseV2","x-page-title":"GET /v2/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases"},{"name":"endpoint-updateKnowledgeBaseV2","x-page-title":"PATCH /v2/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases"},{"name":"endpoint-deleteKnowledgeBaseV2","x-page-title":"DELETE /v2/knowledge-bases/{knowledge_base_id}","x-parent":"knowledge-bases"},{"name":"endpoint-getKnowledgeBaseMetadataSchemasV2","x-page-title":"GET /v2/knowledge-bases/{knowledge_base_id}/metadata-schemas","x-parent":"knowledge-bases"},{"name":"endpoint-listKnowledgeBaseResourcesV2","x-page-title":"GET /v2/knowledge-bases/{knowledge_base_id}/resources","x-parent":"knowledge-bases"},{"name":"endpoint-uploadKnowledgeBaseResourceV2","x-page-title":"POST /v2/knowledge-bases/{knowledge_base_id}/resources","x-parent":"knowledge-bases"},{"name":"endpoint-getKnowledgeBaseResourceV2","x-page-title":"GET /v2/knowledge-bases/{knowledge_base_id}/resources/{resource_id}","x-parent":"knowledge-bases"},{"name":"endpoint-deleteKnowledgeBaseResourceV2","x-page-title":"DELETE /v2/knowledge-bases/{knowledge_base_id}/resources/{resource_id}","x-parent":"knowledge-bases"},{"name":"endpoint-getKnowledgeBaseResourceDownloadUrlV2","x-page-title":"GET /v2/knowledge-bases/{knowledge_base_id}/resources/{resource_id}/download","x-parent":"knowledge-bases"},{"name":"endpoint-queryKnowledgeBaseV2","x-page-title":"POST /v2/knowledge-bases/{knowledge_base_id}/query","x-parent":"knowledge-bases"},{"name":"endpoint-syncKnowledgeBaseV2","x-page-title":"POST /v2/knowledge-bases/{knowledge_base_id}/sync","x-parent":"knowledge-bases"},{"name":"projects","x-page-title":"Project IO schemas","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-getProjectIoSchemaV2","x-page-title":"GET /v2/projects/{project_id}/io-schema","x-parent":"projects"},{"name":"eval-datasets","x-page-title":"Evaluation datasets","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listEvalDatasetsV2","x-page-title":"GET /v2/evals/datasets","x-parent":"eval-datasets"},{"name":"endpoint-createEvalDatasetV2","x-page-title":"POST /v2/evals/datasets","x-parent":"eval-datasets"},{"name":"endpoint-getEvalDatasetV2","x-page-title":"GET /v2/evals/datasets/{dataset_id}","x-parent":"eval-datasets"},{"name":"endpoint-updateEvalDatasetV2","x-page-title":"PATCH /v2/evals/datasets/{dataset_id}","x-parent":"eval-datasets"},{"name":"endpoint-deleteEvalDatasetV2","x-page-title":"DELETE /v2/evals/datasets/{dataset_id}","x-parent":"eval-datasets"},{"name":"endpoint-addEvalDatasetRowsV2","x-page-title":"POST /v2/evals/datasets/{dataset_id}/rows","x-parent":"eval-datasets"},{"name":"endpoint-listEvalDatasetRowsV2","x-page-title":"GET /v2/evals/datasets/{dataset_id}/rows","x-parent":"eval-datasets"},{"name":"endpoint-importEvalDatasetRowsV2","x-page-title":"POST /v2/evals/datasets/{dataset_id}/imports","x-parent":"eval-datasets"},{"name":"endpoint-getEvalDatasetRowV2","x-page-title":"GET /v2/evals/datasets/{dataset_id}/rows/{row_id}","x-parent":"eval-datasets"},{"name":"endpoint-updateEvalDatasetRowV2","x-page-title":"PATCH /v2/evals/datasets/{dataset_id}/rows/{row_id}","x-parent":"eval-datasets"},{"name":"endpoint-deleteEvalDatasetRowV2","x-page-title":"DELETE /v2/evals/datasets/{dataset_id}/rows/{row_id}","x-parent":"eval-datasets"},{"name":"eval-evaluators","x-page-title":"Evaluators and previews","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listEvaluatorsV2","x-page-title":"GET /v2/evals/evaluators","x-parent":"eval-evaluators"},{"name":"endpoint-createEvaluatorV2","x-page-title":"POST /v2/evals/evaluators","x-parent":"eval-evaluators"},{"name":"endpoint-getEvaluatorV2","x-page-title":"GET /v2/evals/evaluators/{evaluator_id}","x-parent":"eval-evaluators"},{"name":"endpoint-updateEvaluatorV2","x-page-title":"PATCH /v2/evals/evaluators/{evaluator_id}","x-parent":"eval-evaluators"},{"name":"endpoint-deleteEvaluatorV2","x-page-title":"DELETE /v2/evals/evaluators/{evaluator_id}","x-parent":"eval-evaluators"},{"name":"endpoint-previewEvaluatorV2","x-page-title":"POST /v2/evals/evaluator-previews","x-parent":"eval-evaluators"},{"name":"endpoint-listEvaluatorTemplatesV2","x-page-title":"GET /v2/evals/evaluator-templates","x-parent":"eval-evaluators"},{"name":"eval-experiments","x-page-title":"Experiments and jobs","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listEvalExperimentsV2","x-page-title":"GET /v2/evals/experiments","x-parent":"eval-experiments"},{"name":"endpoint-createEvalExperimentV2","x-page-title":"POST /v2/evals/experiments","x-parent":"eval-experiments"},{"name":"endpoint-getEvalExperimentV2","x-page-title":"GET /v2/evals/experiments/{experiment_id}","x-parent":"eval-experiments"},{"name":"endpoint-updateEvalExperimentV2","x-page-title":"PATCH /v2/evals/experiments/{experiment_id}","x-parent":"eval-experiments"},{"name":"endpoint-deleteEvalExperimentV2","x-page-title":"DELETE /v2/evals/experiments/{experiment_id}","x-parent":"eval-experiments"},{"name":"endpoint-listEvalExperimentRowsV2","x-page-title":"GET /v2/evals/experiments/{experiment_id}/rows","x-parent":"eval-experiments"},{"name":"endpoint-getEvalExperimentStatusV2","x-page-title":"GET /v2/evals/experiments/{experiment_id}/status","x-parent":"eval-experiments"},{"name":"endpoint-createEvalExperimentJobV2","x-page-title":"POST /v2/evals/experiments/{experiment_id}/jobs","x-parent":"eval-experiments"},{"name":"endpoint-getEvalExperimentJobV2","x-page-title":"GET /v2/evals/experiments/{experiment_id}/jobs/{job_id}","x-parent":"eval-experiments"},{"name":"eval-monitors","x-page-title":"Production monitors","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-getEvalMonitorLimitsV2","x-page-title":"GET /v2/evals/monitor-limits","x-parent":"eval-monitors"},{"name":"endpoint-listEvalMonitorsV2","x-page-title":"GET /v2/evals/monitors","x-parent":"eval-monitors"},{"name":"endpoint-createEvalMonitorV2","x-page-title":"POST /v2/evals/monitors","x-parent":"eval-monitors"},{"name":"endpoint-getEvalMonitorV2","x-page-title":"GET /v2/evals/monitors/{monitor_id}","x-parent":"eval-monitors"},{"name":"endpoint-updateEvalMonitorV2","x-page-title":"PATCH /v2/evals/monitors/{monitor_id}","x-parent":"eval-monitors"},{"name":"endpoint-deleteEvalMonitorV2","x-page-title":"DELETE /v2/evals/monitors/{monitor_id}","x-parent":"eval-monitors"},{"name":"endpoint-getEvalMonitorScoreStatsV2","x-page-title":"GET /v2/evals/monitors/{monitor_id}/score-stats","x-parent":"eval-monitors"},{"name":"endpoint-getEvalMonitorAlertV2","x-page-title":"GET /v2/evals/monitors/{monitor_id}/alert","x-parent":"eval-monitors"},{"name":"endpoint-updateEvalMonitorAlertV2","x-page-title":"PATCH /v2/evals/monitors/{monitor_id}/alert","x-parent":"eval-monitors"},{"name":"endpoint-listEvalMonitorSampledRunsV2","x-page-title":"GET /v2/evals/monitors/{monitor_id}/sampled-runs","x-parent":"eval-monitors"},{"name":"eval-scores","x-page-title":"Run scores","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-createEvalRunScoreV2","x-page-title":"POST /v2/evals/runs/{run_id}/scores","x-parent":"eval-scores"},{"name":"endpoint-listEvalRunScoresV2","x-page-title":"GET /v2/evals/runs/{run_id}/scores","x-parent":"eval-scores"},{"name":"endpoint-getEvalRunScoreV2","x-page-title":"GET /v2/evals/scores/{score_id}","x-parent":"eval-scores"},{"name":"legacy-analytics","x-page-title":"Analytics","x-parent":"legacy","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-getAnalyticsDataApi","x-page-title":"GET /analytics/org/{org_id}/flows/{flow_id}","x-parent":"legacy-analytics"},{"name":"providers","x-page-title":"Providers and actions","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listProvidersV2","x-page-title":"GET /v2/providers","x-parent":"providers"},{"name":"endpoint-getProviderV2","x-page-title":"GET /v2/providers/{provider_id}","x-parent":"providers"},{"name":"endpoint-listProviderActionsV2","x-page-title":"GET /v2/providers/{provider_id}/actions","x-parent":"providers"},{"name":"endpoint-getProviderActionV2","x-page-title":"GET /v2/providers/{provider_id}/actions/{action_id}","x-parent":"providers"},{"name":"endpoint-listProviderTriggersV2","x-page-title":"GET /v2/providers/{provider_id}/triggers","x-parent":"providers"},{"name":"endpoint-getProviderTriggerV2","x-page-title":"GET /v2/providers/{provider_id}/triggers/{trigger_id}","x-parent":"providers"},{"name":"endpoint-runProviderActionV2","x-page-title":"POST /v2/providers/{provider_id}/actions/{action_id}/run","x-parent":"providers"},{"name":"connections","x-page-title":"Connections","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listConnectionsV2","x-page-title":"GET /v2/connections","x-parent":"connections"},{"name":"webhooks","x-page-title":"Webhook subscriptions","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-createWebhookSubscriptionV2","x-page-title":"POST /v2/webhooks/subscriptions","x-parent":"webhooks"},{"name":"endpoint-listWebhookSubscriptionsV2","x-page-title":"GET /v2/webhooks/subscriptions","x-parent":"webhooks"},{"name":"endpoint-deleteWebhookSubscriptionV2","x-page-title":"DELETE /v2/webhooks/subscriptions/{subscription_id}","x-parent":"webhooks"},{"name":"runs","x-page-title":"Runs","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-startRunV2","x-page-title":"POST /v2/runs","x-parent":"runs"},{"name":"endpoint-listRunsV2","x-page-title":"GET /v2/runs","x-parent":"runs"},{"name":"endpoint-getRunV2","x-page-title":"GET /v2/runs/{run_id}","x-parent":"runs"},{"name":"endpoint-cancelRunV2","x-page-title":"POST /v2/runs/{run_id}/cancel","x-parent":"runs"},{"name":"endpoint-resumeRunV2","x-page-title":"POST /v2/runs/{run_id}/resume","x-parent":"runs"},{"name":"skills","x-page-title":"Skills and versions","x-parent":"v2","description":"Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.","x-gitbook-description-html":"<p>Use the guides for end-to-end patterns, then the operations below for exact request and response contracts.</p>\n"},{"name":"endpoint-listSkillsV2","x-page-title":"GET /v2/skills","x-parent":"skills"},{"name":"endpoint-createSkillV2","x-page-title":"POST /v2/skills","x-parent":"skills"},{"name":"endpoint-getSkillV2","x-page-title":"GET /v2/skills/{skill_id}","x-parent":"skills"},{"name":"endpoint-deleteSkillV2","x-page-title":"DELETE /v2/skills/{skill_id}","x-parent":"skills"},{"name":"endpoint-listSkillVersionsV2","x-page-title":"GET /v2/skills/{skill_id}/versions","x-parent":"skills"},{"name":"endpoint-createSkillVersionV2","x-page-title":"POST /v2/skills/{skill_id}/versions","x-parent":"skills"},{"name":"endpoint-getSkillVersionV2","x-page-title":"GET /v2/skills/{skill_id}/versions/{version}","x-parent":"skills"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations.","x-gitbook-description-html":"<p>Hosted API. Use your deployment-specific origin for private installations.</p>\n"}]}