{
  "openapi": "3.1.0",
  "info": {
    "title": "PlanVault.ai",
    "version": "1.0"
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Health check",
        "description": "JSON status: DB connectivity, deployment env, apiVersion, optional gitSha/buildTime. Same payload as GET /api/health.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Health check (under /api)",
        "description": "Same JSON as GET /health for reverse proxies that only forward /api/*.",
        "operationId": "getApiHealth",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/admin/v1/me/bootstrap": {
      "post": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Bootstrap default org and project",
        "description": "First-time onboarding only: creates a default organisation and project. Returns org id, project id, and a new project API key (plaintext once). Returns **409 Conflict** if the user already belongs to any organisation (use `POST /admin/v1/orgs` for additional orgs). Subject to org quota. Errors use RFC 7807 ProblemDetail.",
        "operationId": "postAdminV1MeBootstrap",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BootstrapResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/ui-preferences": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Get UI preferences",
        "description": "Returns persisted UI preferences for the current user.",
        "operationId": "getAdminV1MeUi-preferences",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UiPreferencesDto"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Update UI preferences",
        "description": "Partially updates UI preferences for the current user.",
        "operationId": "patchAdminV1MeUi-preferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchUiPreferencesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UiPreferencesDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/policy-consent": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Policy consent status",
        "description": "Returns whether the user must accept the current privacy policy (and optional demo disclaimer when demo-mode is enabled). Requires the signed-in user's Keycloak access JWT.",
        "operationId": "getAdminV1MePolicy-consent",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyConsentStatusDto"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Accept privacy policy and optional demo disclaimer",
        "description": "Appends a consent row for the current deployment privacy version. When demo-mode is enabled, demoAcknowledged must be true. Requires the signed-in user's Keycloak access JWT. The server records the client IP (resolved from `CF-Connecting-IP`, falling back to `X-Forwarded-For`) and the `User-Agent` header inline with the consent row as GDPR Art.7(1) evidence; these fields are taken from headers, never from the request body.",
        "operationId": "postAdminV1MePolicy-consent",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "CF-Connecting-IP",
            "in": "header",
            "description": "Set by Cloudflare Tunnel to the originating client IP; preferred source for the consent-evidence IP.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Forwarded-For",
            "in": "header",
            "description": "Fallback proxy chain; the first parsable IP is used only when `CF-Connecting-IP` is absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyConsentAcceptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/data-export": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Export my account data (GDPR)",
        "description": "Portable JSON: UI preferences, memberships, workspaces (your org role + memberSince), audit rows where you are the actor, project API key metadata (no secrets; lastUsed not stored), LLM token sums for sessions linked to HMAC(JWT sub), keycloakAccountExport (realm user snapshot from Keycloak Admin API when configured), IdP security-events footnote, policyConsentHistory (append-only acceptance log), and Runtime session exports unioning HMAC(JWT sub) with sessions where created_by is this console user (jwt_user). Per-org skip reasons in `runtimeSessionsByExternalIdSkippedOrgs` when an org cannot be exported. exportVersion 10. Requires Keycloak JWT.",
        "operationId": "getAdminV1MeData-export",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/data-erasure-preview": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Preview account data erasure (GDPR)",
        "description": "Returns whether self-service erasure is allowed (`canErase`), sole-owner orgs that block erasure, and what would be removed. Requires Keycloak JWT.",
        "operationId": "getAdminV1MeData-erasure-preview",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataErasurePreviewResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/data-erasure": {
      "post": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Erase my account data (GDPR)",
        "description": "Removes your org memberships (does not delete organizations), sessions tied to HMAC(JWT sub) or created as jwt_user with your user id, UI preferences, and policy consent rows. Audit logs are not deleted. Blocked with **409** if you are the sole OWNER of any organization. Requires Keycloak JWT.",
        "operationId": "postAdminV1MeData-erasure",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of running the destructive erasure a second time.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GdprMyDataErasureResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs": {
      "get": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "List organisations",
        "description": "Returns organisations the user belongs to, with offset pagination.",
        "operationId": "getAdminV1Orgs",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "0-based offset for offset pagination (default 0). Must be 0 or omitted when `cursor` is set.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: query parameter limit, Invalid value for: query parameter offset",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Create organisation",
        "description": "Creates a new organisation owned by the current user.",
        "operationId": "postAdminV1Orgs",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrgRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrgResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/dashboard": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Dashboard overview",
        "description": "Aggregated overview for the authenticated user (orgs, projects, spend hints).",
        "operationId": "getAdminV1Dashboard",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/me/search": {
      "get": {
        "tags": [
          "Admin — Me & dashboard"
        ],
        "summary": "Global search",
        "description": "Returns categorized hits across organizations, projects, and sessions visible to the caller. Empty `q` yields empty lists. Intended for command palette / navbar search.",
        "operationId": "getAdminV1MeSearch",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text; matches org/project names, session id, external user id, or session tags.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max hits per category (default 8, max 25).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: query parameter q, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}": {
      "get": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Get organisation detail",
        "description": "Full organisation record including configuration fields.",
        "operationId": "getAdminV1OrgsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Delete organisation",
        "description": "Deletes the organisation and dependent data. Irreversible.",
        "operationId": "deleteAdminV1OrgsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Update organisation",
        "description": "Updates organisation metadata (e.g. name). Requires org owner or admin.",
        "operationId": "patchAdminV1OrgsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrgRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/audit-logs": {
      "get": {
        "tags": [
          "Admin — Audit logs"
        ],
        "summary": "List organisation audit logs",
        "description": "Owner/admin only. Append-only audit trail; keyset pagination via `cursor`.",
        "operationId": "getAdminV1OrgsIdAudit-logs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/audit-webhooks": {
      "get": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "List organisation audit log webhooks",
        "description": "Enterprise outbound webhooks for audit events (SIEM). Org owner/admin only.",
        "operationId": "getAdminV1OrgsIdAudit-webhooks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditLogWebhookDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Create audit log webhook subscription",
        "operationId": "postAdminV1OrgsIdAudit-webhooks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuditLogWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogWebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/audit-webhooks/{webhookId}": {
      "delete": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Delete audit log webhook",
        "operationId": "deleteAdminV1OrgsOrgidAudit-webhooksWebhookid",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: path parameter webhookId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Update audit log webhook",
        "operationId": "patchAdminV1OrgsOrgidAudit-webhooksWebhookid",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAuditLogWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogWebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: path parameter webhookId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/audit-webhooks/{webhookId}/rotate-secret": {
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Rotate audit webhook signing secret",
        "operationId": "postAdminV1OrgsOrgidAudit-webhooksWebhookidRotate-secret",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateAuditLogWebhookSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: path parameter webhookId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/audit-webhooks/{webhookId}/test": {
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Send test audit.ping to webhook URL",
        "operationId": "postAdminV1OrgsOrgidAudit-webhooksWebhookidTest",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogWebhookTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: path parameter webhookId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/audit-webhooks/{webhookId}/requeue-dead-letter": {
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Re-queue dead-letter audit webhook deliveries",
        "description": "Returns JSON {\"rows\": N} with count requeued.",
        "operationId": "postAdminV1OrgsOrgidAudit-webhooksWebhookidRequeue-dead-letter",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: path parameter webhookId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/spend": {
      "get": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Organisation LLM spend",
        "description": "Usage and spend aggregates for the organisation.",
        "operationId": "getAdminV1OrgsIdSpend",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgSpendResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/settings": {
      "patch": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Update organisation settings",
        "description": "Patches org settings (retention, planner defaults, etc.). May return 409 while DEK rotation is IN_PROGRESS.",
        "operationId": "patchAdminV1OrgsIdSettings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrgSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/debug-content-access": {
      "patch": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Enable or disable debug content access",
        "description": "OWNER only. When enabling, `confirmationPhrase` must exactly match the documented sentence. Audited. Allows JWT runtime users to use debug/replay endpoints that decrypt session payloads.",
        "operationId": "patchAdminV1OrgsIdDebug-content-access",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDebugContentAccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/settings/semantic-cache": {
      "post": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Enable or disable Semantic Routing Cache",
        "description": "OWNER only. Toggles anonymized query-vector storage for routing optimization; audited. Disabling deletes stored vectors immediately.",
        "operationId": "postAdminV1OrgsIdSettingsSemantic-cache",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetAutoScenarioEnabledRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/secrets": {
      "get": {
        "tags": [
          "Admin — Org secrets"
        ],
        "summary": "List organisation secret keys",
        "description": "Returns secret key names only; values are never exposed.",
        "operationId": "getAdminV1OrgsIdSecrets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Org secrets"
        ],
        "summary": "Upsert organisation secret",
        "description": "Stores an encrypted org-level secret. Rejected with 409 while org DEK rotation is in progress.",
        "operationId": "postAdminV1OrgsIdSecrets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/secrets/{key}": {
      "delete": {
        "tags": [
          "Admin — Org secrets"
        ],
        "summary": "Delete organisation secret",
        "description": "Removes one org-level secret by key.",
        "operationId": "deleteAdminV1OrgsIdSecretsKey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "description": "Secret key name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/catalog/{provider}": {
      "get": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Org-scoped LiteLLM model catalog",
        "description": "Bundled model list for a provider, filtered from the org context.",
        "operationId": "getAdminV1OrgsIdLlmCatalogProvider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "description": "Provider id (e.g. openai)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modelType",
            "in": "query",
            "description": "Filter LiteLLM catalog: `chat` or `embedding`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/models": {
      "get": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "List org LLM model allow-list",
        "description": "Models allowed at org level plus LiteLLM model names from /model/info.",
        "operationId": "getAdminV1OrgsIdLlmModels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectLlmModelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Add org LLM model",
        "description": "Adds a model to the organisation allow-list; validated against provider catalog when available.",
        "operationId": "postAdminV1OrgsIdLlmModels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProjectModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddProjectModelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/models/{modelName}": {
      "delete": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Remove org LLM model",
        "description": "Deletes a model entry from the organisation allow-list.",
        "operationId": "deleteAdminV1OrgsIdLlmModelsModelname",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelName",
            "in": "path",
            "description": "Model id to remove",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/providers": {
      "get": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "List org cloud LLM providers",
        "description": "Named cloud credentials (metadata only). Use cloud:{id} in model provider field.",
        "operationId": "getAdminV1OrgsIdLlmProviders",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgCloudProviderListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Create org cloud LLM provider",
        "description": "Creates a named cloud credential, verifies the API key, and returns status.",
        "operationId": "postAdminV1OrgsIdLlmProviders",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrgCloudProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyCloudProviderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/providers/{providerId}": {
      "delete": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Delete org cloud LLM provider",
        "description": "409 if the credential is still referenced from org or project models.",
        "operationId": "deleteAdminV1OrgsIdLlmProvidersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Update org cloud LLM provider",
        "description": "Optional name and/or API key (re-verifies when key is sent).",
        "operationId": "patchAdminV1OrgsIdLlmProvidersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrgCloudProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgCloudProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/custom-providers": {
      "get": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "List org custom LLM providers",
        "description": "Named backends (api_base, vendor type) referenced as provider=custom:{id} in model entries.",
        "operationId": "getAdminV1OrgsIdLlmCustom-providers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgCustomProviderListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Create org custom LLM provider",
        "operationId": "postAdminV1OrgsIdLlmCustom-providers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrgCustomProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgCustomProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/custom-providers/{providerId}/models": {
      "get": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "List models from custom provider api_base",
        "description": "Vendor-specific listing (OpenAI /v1/models, Ollama /api/tags, local=both, anthropic/gemini/cohere native list APIs). Empty when unreachable, disallowed, or unsupported.",
        "operationId": "getAdminV1OrgsIdLlmCustom-providersProvideridModels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelType",
            "in": "query",
            "description": "Filter LiteLLM catalog: `chat` or `embedding`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/custom-providers/{providerId}": {
      "put": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Update org custom LLM provider",
        "operationId": "putAdminV1OrgsIdLlmCustom-providersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrgCustomProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgCustomProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Delete org custom LLM provider",
        "operationId": "deleteAdminV1OrgsIdLlmCustom-providersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm/providers/{providerId}/verify": {
      "post": {
        "tags": [
          "Admin — LLM (organisation)"
        ],
        "summary": "Verify org cloud LLM provider",
        "description": "Tests stored credentials against the vendor.",
        "operationId": "postAdminV1OrgsIdLlmProvidersProvideridVerify",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyCloudProviderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/rotate-dek": {
      "post": {
        "tags": [
          "Admin — Organizations"
        ],
        "summary": "Start organisation DEK rotation",
        "description": "Starts background re-encryption with a new data encryption key. Secret-changing operations return 409 while IN_PROGRESS. Idempotency-Key protects against duplicate simultaneous starts.",
        "operationId": "postAdminV1OrgsIdRotate-dek",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateDekResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/export": {
      "get": {
        "tags": [
          "Admin — GDPR & export"
        ],
        "summary": "Export organisation data (GDPR)",
        "description": "JSON GDPR-style export for **subject-access** style requests (org owners with Admin API access). Modes (mutually exclusive; omit all query parameters for full organisation export):\n- **No query:** org metadata, tool ids, organisation secret key names, nested per-project session history (decrypted events).\n- **projectId:** same payload shape as single-project export (`kind`: project).\n- **externalUserId:** sessions for one end-user id in this org (`kind`: user).\n- **tag:** sessions containing the tag (`kind`: tag).\nSend **at most one** of projectId, externalUserId, or tag. Requests with more than one filter return **400** at the HTTP layer.\nIdP: end-user profile in Keycloak is not included here — use GET /admin/v1/me/data-export for the signed-in console user Keycloak snapshot, or Keycloak Admin for other subjects.",
        "operationId": "getAdminV1OrgsOrgidExport",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "description": "Export a single project (must belong to orgId). Mutually exclusive with externalUserId and tag.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "externalUserId",
            "in": "query",
            "description": "Export all sessions for this external user within the org. Mutually exclusive with projectId and tag.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Export sessions whose tags contain this value (exact, case-sensitive). Mutually exclusive with projectId and externalUserId.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: query parameter projectId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/users/data-erasure": {
      "post": {
        "tags": [
          "Admin — GDPR & export"
        ],
        "summary": "Erase user data globally (operator)",
        "description": "Deletes sessions by external_user_id and removes Keycloak user memberships. Requires Keycloak JWT with a realm role from keycloak.gdpr-operator-realm-roles.",
        "operationId": "postAdminV1UsersData-erasure",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of running the destructive global erasure a second time.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GdprEraseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GdprEraseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/users/{externalUserId}/data": {
      "delete": {
        "tags": [
          "Admin — GDPR & export"
        ],
        "summary": "Erase user data in org",
        "description": "Deletes all sessions (and cascaded data) for the external user within this organisation. Prefer this (and GET …/export?externalUserId=) for per-user GDPR export/erase; do not rely on tags as a pseudonym.",
        "operationId": "deleteAdminV1OrgsOrgidUsersExternaluseridData",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "externalUserId",
            "in": "path",
            "description": "End-user id in your system",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of running this destructive erasure a second time.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GdprEraseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/tags/{tag}/data": {
      "delete": {
        "tags": [
          "Admin — GDPR & export"
        ],
        "summary": "Erase sessions by tag in org",
        "description": "Deletes every session that contains this tag in the organisation. Each session is removed entirely (including other tags on that session). Not a substitute for externalUserId / HMAC pseudonymization — use user-scoped routes for personal data.",
        "operationId": "deleteAdminV1OrgsOrgidTagsTagData",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tag",
            "in": "path",
            "description": "Session tag (case-sensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of running this destructive erasure a second time.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GdprEraseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{orgId}/gdpr/deletion-log/ops-reveal": {
      "post": {
        "tags": [
          "Admin — GDPR & export"
        ],
        "summary": "Reveal cleartext subject id from short-lived ops channel (GDPR)",
        "description": "When `gdpr-deletion-log.ops-channel-enabled` is true, per-org erasure dual-writes envelope-encrypted identifiers to Postgres keyed by the DynamoDB `deletion_id`. Org OWNER/ADMIN may call this once per row before `expires_at` to recover the cleartext for operational reconciliation. The append-only Dynamo payload remains hash-only.",
        "operationId": "postAdminV1OrgsOrgidGdprDeletion-logOps-reveal",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GdprDeletionLogOpsRevealRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GdprDeletionLogOpsRevealResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/members": {
      "get": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "List organisation members",
        "description": "Paginated org membership with optional keyset cursor. Non-zero offset with cursor returns 400.",
        "operationId": "getAdminV1OrgsIdMembers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "0-based offset for offset pagination (default 0). Must be 0 or omitted when `cursor` is set.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit, Invalid value for: query parameter offset",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "Add organisation member",
        "description": "Invites or attaches a user to the org with a role.",
        "operationId": "postAdminV1OrgsIdMembers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrgMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgMemberDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/members/me": {
      "get": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "Get my org role",
        "description": "Current user's role in the organisation.",
        "operationId": "getAdminV1OrgsIdMembersMe",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgMemberSelfResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/members/{userId}": {
      "delete": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "Remove organisation member",
        "description": "Removes a user from the organisation.",
        "operationId": "deleteAdminV1OrgsIdMembersUserid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "description": "Target user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter userId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "Update member role",
        "description": "Changes role for an organisation member.",
        "operationId": "patchAdminV1OrgsIdMembersUserid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "description": "Target user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrgMemberRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter userId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/transfer-ownership": {
      "post": {
        "tags": [
          "Admin — Members"
        ],
        "summary": "Transfer organization ownership",
        "description": "OWNER only: target member becomes OWNER; initiator becomes ADMIN. Single locked transaction (SELECT organization FOR UPDATE).",
        "operationId": "postAdminV1OrgsIdTransfer-ownership",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOrgOwnershipRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/projects": {
      "get": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "List projects",
        "description": "All projects in the organisation the caller can access.",
        "operationId": "getAdminV1OrgsIdProjects",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Create project",
        "description": "Creates a project with a new Runtime API key returned once in plaintext.",
        "operationId": "postAdminV1OrgsIdProjects",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateProjectResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}": {
      "get": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Get project detail",
        "description": "Project configuration and metadata.",
        "operationId": "getAdminV1ProjectsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Delete project",
        "description": "Deletes the project and dependent sessions/data.",
        "operationId": "deleteAdminV1ProjectsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Update project",
        "description": "Patches project name, prompts, models, planner mode, etc.",
        "operationId": "patchAdminV1ProjectsId",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/rotate-key": {
      "post": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Rotate project API key",
        "description": "Owner/admin only. Issues a new Runtime API key; previous key stops working immediately. Plaintext shown once.",
        "operationId": "postAdminV1ProjectsIdRotate-key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/api-keys": {
      "get": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "List project API keys",
        "description": "Returns key id, preview (e.g. sk_live_…abcd), scopes, optional name, and whether each row is the primary key. Full secrets are never returned.",
        "operationId": "getAdminV1ProjectsIdApi-keys",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectApiKeyDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Create additional project API key",
        "description": "Owner/admin only. Adds a scoped Runtime key (quota comes from deployment config). Plaintext `apiKey` is shown once; choose scopes from the documented HRN allow-list.",
        "operationId": "postAdminV1ProjectsIdApi-keys",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/api-keys/{keyId}": {
      "delete": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Delete a non-primary project API key",
        "description": "Owner/admin only. Cannot delete the primary key; rotate it instead (`POST …/api-keys/{keyId}/rotate` or legacy `POST …/rotate-key`).",
        "operationId": "deleteAdminV1ProjectsIdApi-keysKeyid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "API key row id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter keyId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Update a non-primary project API key",
        "description": "Owner/admin only. Changes display name and/or scopes on additional keys. The primary key cannot be updated here (rotate only).",
        "operationId": "patchAdminV1ProjectsIdApi-keysKeyid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "API key row id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectApiKeyDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter keyId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/api-keys/{keyId}/rotate": {
      "post": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Rotate one project API key",
        "description": "Owner/admin only. Replaces the selected key (primary or additional). Previous secret stops working immediately. Plaintext shown once. Rotating the primary row also updates the legacy `projects.api_key_hash`.",
        "operationId": "postAdminV1ProjectsIdApi-keysKeyidRotate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "API key row id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateProjectApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter keyId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/notification-webhook": {
      "get": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Get project lifecycle notification webhook",
        "description": "Outbound session lifecycle webhook config: HTTPS URL, enabled, subscribed event types (session.completed | session.failed | session.requires_action | session.interrupted | session.recovery_required), secretConfigured, updatedAt. Delivery is push-only (POST to your URL); there is no separate event-feed API in V1. Full semantics, limits, and signature rules are documented in the product API reference.",
        "operationId": "getAdminV1ProjectsIdNotification-webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectNotificationWebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Update project lifecycle notification webhook",
        "description": "Set URL, enabled, and eventTypes. If enabled with an empty eventTypes array, the server normalizes to all supported lifecycle event types. A signing secret must exist (use rotate-secret first). Outbound deliveries POST camelCase JSON; clients verify HMAC-SHA256 of the raw body via X-Signature. Any non-2xx response consumes a retry (~4 attempts with backoff); treat duplicate eventId as idempotent. Payload does not include chat history or externalUserId; use metadata and tags at session create.",
        "operationId": "patchAdminV1ProjectsIdNotification-webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectNotificationWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/notification-webhook/rotate-secret": {
      "post": {
        "tags": [
          "Admin — Projects"
        ],
        "summary": "Rotate lifecycle webhook signing secret",
        "description": "Returns webhookSecret plaintext once in JSON; copy to your secrets manager — it cannot be shown again. Previous secret is invalidated immediately (in-flight retries may still use the old signature until they finish). Use the secret to verify X-Signature on each outbound POST body.",
        "operationId": "postAdminV1ProjectsIdNotification-webhookRotate-secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateNotificationWebhookSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/secrets": {
      "get": {
        "tags": [
          "Admin — Project secrets"
        ],
        "summary": "List project secret keys",
        "description": "Secret key names only.",
        "operationId": "getAdminV1ProjectsIdSecrets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Project secrets"
        ],
        "summary": "Upsert project secret",
        "description": "Stores an encrypted project-level secret for tool/runtime use.",
        "operationId": "postAdminV1ProjectsIdSecrets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/secrets/{key}": {
      "delete": {
        "tags": [
          "Admin — Project secrets"
        ],
        "summary": "Delete project secret",
        "description": "Removes one project secret by key.",
        "operationId": "deleteAdminV1ProjectsIdSecretsKey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "description": "Secret key name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/sessions": {
      "get": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "List project sessions",
        "description": "Cursor-based session listing. MEMBER role only sees sessions they created in the console (jwt_user provenance); OWNER/ADMIN see all sessions in the project including legacy rows without provenance.",
        "operationId": "getAdminV1ProjectsIdSessions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "Create session (admin)",
        "description": "Creates a Runtime session in the project; same contract as public Runtime API.",
        "operationId": "postAdminV1ProjectsIdSessions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "Delete all project sessions",
        "description": "Removes every session in the project. **OWNER or ADMIN org role only** (MEMBER receives access denied).",
        "operationId": "deleteAdminV1ProjectsIdSessions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/audit-logs": {
      "get": {
        "tags": [
          "Admin — Audit logs"
        ],
        "summary": "List project audit logs",
        "description": "Owner/admin only. Rows scoped to this project (`project_id` match).",
        "operationId": "getAdminV1ProjectsIdAudit-logs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/operations/overview": {
      "get": {
        "tags": [
          "Admin — Operations"
        ],
        "summary": "Project operations overview",
        "description": "Owner/admin only. Session counts by DB status, run volume and failure rate in the last 24h, and average terminal run duration where available.",
        "operationId": "getAdminV1ProjectsIdOperationsOverview",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOperationsOverviewDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/operations/session-incidents": {
      "get": {
        "tags": [
          "Admin — Operations"
        ],
        "summary": "List session incidents",
        "description": "Owner/admin only. Recent failed / interrupted / needs_manual_recovery run outcomes (one row per run, no PII in summary fields).",
        "operationId": "getAdminV1ProjectsIdOperationsSession-incidents",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/operations/privileged-session-list/consent": {
      "post": {
        "tags": [
          "Admin — Operations"
        ],
        "summary": "Consent to view full project session list",
        "description": "Owner/admin only. Records an audit log entry and authorizes the next hour of GET …/privileged-session-list requests for this user and project.",
        "operationId": "postAdminV1ProjectsIdOperationsPrivileged-session-listConsent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/operations/privileged-session-list": {
      "get": {
        "tags": [
          "Admin — Operations"
        ],
        "summary": "List all project sessions (privileged)",
        "description": "Owner/admin only. Returns every session in the project with author summary. Requires a recent POST …/privileged-session-list/consent from the same user (time-limited).",
        "operationId": "getAdminV1ProjectsIdOperationsPrivileged-session-list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{projectId}/sessions/{sessionId}/actions": {
      "post": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "Session HITL action (admin JWT)",
        "description": "Same as Runtime `actions` but actor is taken from JWT `sub` for audit (no spoofing). `reportedOperator` in body is ignored.",
        "operationId": "postAdminV1ProjectsProjectidSessionsSessionidActions",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_String"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter sessionId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{projectId}/debug/execute-session-script": {
      "post": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "Debug: execute session script (admin JWT)",
        "description": "Runs `planFromScriptText` + execute for an existing session. Owner/admin only. Not available with a project API key — use the console signed in as an org member.",
        "operationId": "postAdminV1ProjectsProjectidDebugExecute-session-script",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DebugExecuteSessionScriptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/sessions/{sessionId}": {
      "delete": {
        "tags": [
          "Admin — Sessions"
        ],
        "summary": "Delete session",
        "description": "Deletes one session and cascaded data. Same provenance rules as listing: MEMBER may delete only their own jwt_user sessions; OWNER/ADMIN may delete any session in the project.",
        "operationId": "deleteAdminV1ProjectsIdSessionsSessionid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sessionId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/llm/models": {
      "get": {
        "tags": [
          "Admin — LLM (global)"
        ],
        "summary": "LiteLLM /v1/models proxy",
        "description": "Lists models exposed by the configured LiteLLM gateway.",
        "operationId": "getAdminV1LlmModels",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelListResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/llm/model-info": {
      "get": {
        "tags": [
          "Admin — LLM (global)"
        ],
        "summary": "LiteLLM model info",
        "description": "Detailed model entries from LiteLLM /model/info.",
        "operationId": "getAdminV1LlmModel-info",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiteLlmModelInfoResponse"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/llm/providers": {
      "get": {
        "tags": [
          "Admin — LLM (global)"
        ],
        "summary": "LiteLLM providers and models",
        "description": "Grouped provider/model list for admin UI.",
        "operationId": "getAdminV1LlmProviders",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProviderModels"
                  }
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/llm/catalog/{provider}": {
      "get": {
        "tags": [
          "Admin — LLM (project)"
        ],
        "summary": "Project-scoped LiteLLM catalog",
        "description": "Bundled model catalog slice for UI model pickers.",
        "operationId": "getAdminV1ProjectsIdLlmCatalogProvider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "description": "Provider id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modelType",
            "in": "query",
            "description": "Filter LiteLLM catalog: `chat` or `embedding`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/llm/models": {
      "get": {
        "tags": [
          "Admin — LLM (project)"
        ],
        "summary": "List project LLM models",
        "description": "Project allow-list, org allow-list, and LiteLLM model names.",
        "operationId": "getAdminV1ProjectsIdLlmModels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectLlmModelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — LLM (project)"
        ],
        "summary": "Add project LLM model",
        "description": "Adds a model to the project subset of allowed models.",
        "operationId": "postAdminV1ProjectsIdLlmModels",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProjectModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddProjectModelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/llm/models/{modelName}": {
      "delete": {
        "tags": [
          "Admin — LLM (project)"
        ],
        "summary": "Remove project LLM model",
        "description": "Deletes a model from the project allow-list.",
        "operationId": "deleteAdminV1ProjectsIdLlmModelsModelname",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelName",
            "in": "path",
            "description": "Model id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/import-openapi": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Start an OpenAPI import job (async)",
        "description": "Queues an asynchronous import of tool definitions from a Swagger/OpenAPI URL. Returns immediately with `202 Accepted` and a `jobId`. Clients must poll `GET /admin/v1/orgs/{id}/tools/import-openapi/jobs/{jobId}` to observe progress (`queued` → `running` → `succeeded`|`failed`). This avoids holding the HTTP connection open while very large specs (hundreds of operations + LLM enrichment) are processed.",
        "operationId": "postAdminV1OrgsIdToolsImport-openapi",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgImportOpenApiRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgImportOpenApiAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/import-openapi/jobs/{jobId}": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get OpenAPI import job status",
        "description": "Returns the current state of an OpenAPI import job started via `POST .../tools/import-openapi`. Status is one of `queued`, `running`, `succeeded`, `failed`. On success, `result` contains the imported counts and lifecycle snapshot. On failure, `errorMessage` describes the cause. Job records are kept in memory and are not durable across API restarts; if the job is no longer known the endpoint responds with `404`.",
        "operationId": "getAdminV1OrgsIdToolsImport-openapiJobsJobid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "description": "Import job ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgImportOpenApiJobDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter jobId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "List OpenAPI integration sources",
        "description": "Org-level OpenAPI document sources (`org_openapi_sources`) with runtime URL overrides and lifecycle snapshot.",
        "operationId": "getAdminV1OrgsIdOpenapi-sources",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenApiSourceDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources/{sourceId}": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get OpenAPI integration source",
        "operationId": "getAdminV1OrgsIdOpenapi-sourcesSourceid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiSourceDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Update org-level OpenAPI runtime base URL override",
        "description": "Sets or clears `server_url_override` for all projects unless a project-level override exists. Does not mutate imported tool specs or create new revisions. Use `clearServerUrlOverride=true` to clear.",
        "operationId": "patchAdminV1OrgsIdOpenapi-sourcesSourceid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOpenApiSourceRuntimeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiSourceDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/openapi-sources/{sourceId}/runtime-config": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get project OpenAPI runtime URL config",
        "description": "Effective runtime URL resolution: project override → org override → imported spec base URL.",
        "operationId": "getAdminV1ProjectsIdOpenapi-sourcesSourceidRuntime-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOpenApiSourceRuntimeConfigDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Update project OpenAPI runtime URL override",
        "operationId": "patchAdminV1ProjectsIdOpenapi-sourcesSourceidRuntime-config",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectOpenApiSourceRuntimeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOpenApiSourceRuntimeConfigDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources/{sourceId}/sync-preview": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Preview OpenAPI document drift vs catalog",
        "description": "Compares live `swagger_url` operations to active org tools for this source; reports binding/scenario impact hints.",
        "operationId": "postAdminV1OrgsIdOpenapi-sourcesSourceidSync-preview",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiSourceSyncPreviewDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources/{sourceId}/sync": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Apply OpenAPI source sync (re-import)",
        "description": "Runs the same path as import-from-URL for the stored document. When `dryRun=true`, records a sync run with preview only.",
        "operationId": "postAdminV1OrgsIdOpenapi-sourcesSourceidSync",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenApiSourceSyncApplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiSourceSyncRunDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources/{sourceId}/sync-runs/{runId}": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get OpenAPI source sync run",
        "operationId": "getAdminV1OrgsIdOpenapi-sourcesSourceidSync-runsRunid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Sync run id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiSourceSyncRunDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/openapi-sources/{sourceId}/snapshots": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "List OpenAPI source snapshots",
        "description": "Recent normalized source snapshots captured by immutable OpenAPI sync/import.",
        "operationId": "getAdminV1OrgsIdOpenapi-sourcesSourceidSnapshots",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "description": "OpenAPI source id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenApiSourceSnapshotDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter sourceId, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "List org tools",
        "description": "Keyset-paginated org-level tool catalog.",
        "operationId": "getAdminV1OrgsIdTools",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Ingest manual org tool",
        "description": "Creates a new tool definition in the org catalog. Returns the server-generated tool id.",
        "operationId": "postAdminV1OrgsIdTools",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestToolRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestToolResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/heal-events": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "List OpenAPI auto-heal events",
        "description": "Operator queue of detected/proposed/applied spec heal events (keyset pagination).",
        "operationId": "getAdminV1OrgsIdToolsHeal-events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque keyset cursor from a previous `nextCursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter projectId, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/heal-events/{eventId}": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get OpenAPI auto-heal event",
        "description": "Returns full heal evidence, diagnosis and decision trail.",
        "operationId": "getAdminV1OrgsIdToolsHeal-eventsEventid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "description": "Heal event ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApiHealEventDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter eventId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/heal-events/{eventId}/action": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Apply action to OpenAPI auto-heal event",
        "description": "Actions: retry, apply, reject, review.",
        "operationId": "postAdminV1OrgsIdToolsHeal-eventsEventidAction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "description": "Heal event ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenApiHealEventActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter eventId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/{toolId}": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get org tool detail",
        "description": "Full tool definition including schema.",
        "operationId": "getAdminV1OrgsIdToolsToolid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter toolId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Update org tool",
        "description": "Creates a new active revision for the same logical tool and rebinds integrations. Optional compatibilityHint controls whether migrated scenario refs remain compatible or become needs_review.",
        "operationId": "putAdminV1OrgsIdToolsToolid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgUpdateToolRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter toolId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Delete org tool",
        "description": "Removes one tool revision from the organisation catalog. If saved scenarios still reference that revision, responds with 409 and problem type TOOL_DELETE_BLOCKED_BY_SCENARIOS until `confirmDeleteScenarios=true`, which applies scenario impact handling (mark/migrate refs) before delete.",
        "operationId": "deleteAdminV1OrgsIdToolsToolid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "confirmDeleteScenarios",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter toolId, Invalid value for: query parameter confirmDeleteScenarios",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/{toolId}/lineage": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Get org tool revision lineage",
        "description": "Returns the logical tool revision chain, semantic compatibility assessments, and scenario compatibility counters.",
        "operationId": "getAdminV1OrgsIdToolsToolidLineage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRevisionLineageDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter toolId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/service/{serviceName}/delete-impact": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Preview scenario impact for deleting a service",
        "description": "Returns impact breakdown and sample scenarios that would be updated if this service is deleted.",
        "operationId": "getAdminV1OrgsIdToolsServiceServicenameDelete-impact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceName",
            "in": "path",
            "description": "Service/group name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolScenarioImpactReportDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/{toolId}/delete-impact": {
      "get": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Preview scenario impact for deleting a tool revision",
        "description": "Returns impact breakdown and sample scenarios that would be updated if this tool revision is deleted.",
        "operationId": "getAdminV1OrgsIdToolsToolidDelete-impact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolScenarioImpactReportDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter toolId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/service/{serviceName}": {
      "put": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Rename org service",
        "description": "Renames a tool service/group for all tools in that group.",
        "operationId": "putAdminV1OrgsIdToolsServiceServicename",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceName",
            "in": "path",
            "description": "Current service name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgRenameServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_Int"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Delete org service tools",
        "description": "Deletes all tools belonging to a service name. If saved scenarios still reference revisions in that service, responds with 409 and problem type TOOL_DELETE_BLOCKED_BY_SCENARIOS until `confirmDeleteScenarios=true`, which applies scenario impact handling (mark/migrate refs) before delete.",
        "operationId": "deleteAdminV1OrgsIdToolsServiceServicename",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serviceName",
            "in": "path",
            "description": "Service/group name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirmDeleteScenarios",
            "in": "query",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_Int"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter confirmDeleteScenarios",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/mcp/servers": {
      "get": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "List MCP servers",
        "description": "Registered MCP server connections for the organisation.",
        "operationId": "getAdminV1OrgsIdMcpServers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrgMcpServerDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "Register MCP server",
        "description": "Adds an MCP server endpoint for tool sync.",
        "operationId": "postAdminV1OrgsIdMcpServers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrgMcpServerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgMcpServerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/mcp/servers/{serverId}": {
      "put": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "Update MCP server",
        "description": "Patches MCP server URL, transport, or metadata.",
        "operationId": "putAdminV1OrgsIdMcpServersServerid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serverId",
            "in": "path",
            "description": "MCP server ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrgMcpServerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgMcpServerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter serverId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "Delete MCP server",
        "description": "Removes an MCP server registration.",
        "operationId": "deleteAdminV1OrgsIdMcpServersServerid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serverId",
            "in": "path",
            "description": "MCP server ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter serverId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/mcp/servers/{serverId}/test": {
      "post": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "Test MCP server connectivity",
        "description": "Probes the MCP server URL and returns status.",
        "operationId": "postAdminV1OrgsIdMcpServersServeridTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serverId",
            "in": "path",
            "description": "MCP server ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter serverId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/mcp/servers/{serverId}/sync": {
      "post": {
        "tags": [
          "Admin — MCP servers"
        ],
        "summary": "Sync MCP tools",
        "description": "Imports or updates tools from the MCP server into the org catalog.",
        "operationId": "postAdminV1OrgsIdMcpServersServeridSync",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "serverId",
            "in": "path",
            "description": "MCP server ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerSyncResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter serverId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/knowledge-providers": {
      "get": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "List knowledge providers",
        "description": "Org-scoped BYO knowledge providers: `custom_http` (your HTTP contract), `dify_dataset` (Dify dataset retrieve API), `ragflow_retrieval` (RAGFlow POST /api/v1/retrieval). Non-secret JSON goes in `providerConfig`; API keys are write-only (`apiKeyConfigured`).",
        "operationId": "getAdminV1OrgsIdKnowledge-providers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KnowledgeProviderDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Create knowledge provider",
        "description": "Registers a provider. Use `providerType` `custom_http` with full retrieval endpoint URL, `dify_dataset` with Dify API base ending in `/v1`, or `ragflow_retrieval` with RAGFlow server root URL. Put adapter ids and options in `providerConfig` / binding `providerConfig` (e.g. `datasetId` for Dify, `datasetIds` array for RAGFlow). Endpoint must be https unless local/private URLs are enabled server-side.",
        "operationId": "postAdminV1OrgsIdKnowledge-providers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/knowledge-providers/{providerId}": {
      "get": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Get knowledge provider",
        "description": "Returns provider configuration without any API key material.",
        "operationId": "getAdminV1OrgsIdKnowledge-providersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "description": "Knowledge provider ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Update knowledge provider",
        "description": "Patch metadata, limits, auth mode, rotate API key, or replace `providerConfig`. Changing `providerType` after creation is not supported. Use `clearApiKey` with authMode `none`.",
        "operationId": "putAdminV1OrgsIdKnowledge-providersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "description": "Knowledge provider ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKnowledgeProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeProviderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Delete knowledge provider",
        "description": "Deletes provider if not bound to any project.",
        "operationId": "deleteAdminV1OrgsIdKnowledge-providersProviderid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "description": "Knowledge provider ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/knowledge-providers/{providerId}/test": {
      "post": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Test knowledge provider retrieval",
        "description": "POSTs a sample retrieval payload to the provider and returns normalized chunks plus a bounded context preview.",
        "operationId": "postAdminV1OrgsIdKnowledge-providersProvideridTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "providerId",
            "in": "path",
            "description": "Knowledge provider ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestKnowledgeProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestKnowledgeProviderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter providerId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/knowledge-provider": {
      "get": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Get project knowledge provider binding",
        "description": "Returns binding + overrides, or `bound=false` when not configured.",
        "operationId": "getAdminV1ProjectsIdKnowledge-provider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKnowledgeProviderBindingDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Update project knowledge provider binding",
        "description": "Binds an org provider and sets optional overrides plus binding-level `providerConfig` (e.g. per-project dataset id).",
        "operationId": "patchAdminV1ProjectsIdKnowledge-provider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectKnowledgeProviderBindingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectKnowledgeProviderBindingDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/knowledge-provider/test": {
      "post": {
        "tags": [
          "Admin — Knowledge providers"
        ],
        "summary": "Test project knowledge provider binding",
        "description": "Runs retrieval using the bound provider and effective per-project overrides.",
        "operationId": "postAdminV1ProjectsIdKnowledge-providerTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestKnowledgeProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestKnowledgeProviderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/integration-sources/{sourceType}/{sourceKey}/lifecycle-action": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Apply manual integration lifecycle action",
        "description": "Operator action for source lifecycle: quarantine, unquarantine, approve.",
        "operationId": "postAdminV1OrgsIdIntegration-sourcesSourcetypeSourcekeyLifecycle-action",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceType",
            "in": "path",
            "description": "Source type (mcp|openapi|webhook)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceKey",
            "in": "path",
            "description": "Source key (UUID for mcp/webhook, normalized service name for openapi)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationLifecycleActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLifecycleDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/webhooks/outbound": {
      "get": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "List outbound webhooks",
        "description": "Agent-initiated HTTP callbacks configured at org level.",
        "operationId": "getAdminV1OrgsIdWebhooksOutbound",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutboundWebhookDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Create outbound webhook",
        "description": "Registers a new outbound webhook target.",
        "operationId": "postAdminV1OrgsIdWebhooksOutbound",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutboundWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundWebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/webhooks/outbound/{webhookId}": {
      "put": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Update outbound webhook",
        "description": "Patches URL, headers, or signing for an outbound webhook.",
        "operationId": "putAdminV1OrgsIdWebhooksOutboundWebhookid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "Webhook ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutboundWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundWebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter webhookId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Delete outbound webhook",
        "description": "Removes an outbound webhook configuration.",
        "operationId": "deleteAdminV1OrgsIdWebhooksOutboundWebhookid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "Webhook ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter webhookId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/webhooks/outbound/{webhookId}/test": {
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Test outbound webhook",
        "description": "Sends a sample payload to verify connectivity and signing.",
        "operationId": "postAdminV1OrgsIdWebhooksOutboundWebhookidTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "Webhook ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter webhookId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/webhooks/triggers": {
      "get": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "List inbound webhook triggers (org)",
        "description": "All inbound trigger definitions for projects under this organisation.",
        "operationId": "getAdminV1OrgsIdWebhooksTriggers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectWebhookTriggerDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{projectId}/webhooks/triggers": {
      "post": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Create inbound webhook trigger",
        "description": "Defines a public trigger URL key and mapping for inbound webhooks.",
        "operationId": "postAdminV1ProjectsProjectidWebhooksTriggers",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectWebhookTriggerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectWebhookTriggerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{projectId}/webhooks/triggers/{triggerId}": {
      "put": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Update inbound webhook trigger",
        "description": "Patches trigger auth, enabled flag, or template mapping.",
        "operationId": "putAdminV1ProjectsProjectidWebhooksTriggersTriggerid",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "triggerId",
            "in": "path",
            "description": "Trigger ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectWebhookTriggerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectWebhookTriggerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter triggerId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Webhooks"
        ],
        "summary": "Delete inbound webhook trigger",
        "description": "Removes a public inbound trigger.",
        "operationId": "deleteAdminV1ProjectsProjectidWebhooksTriggersTriggerid",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "triggerId",
            "in": "path",
            "description": "Trigger ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter triggerId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/scenarios": {
      "get": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "List scenarios",
        "description": "Keyset pagination: pass `cursor` from the previous page `nextCursor` (same filters).",
        "operationId": "getAdminV1OrgsIdScenarios",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "description": "Filter scenarios associated with this project.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Filter by scenario source label.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "description": "If true, return only active scenarios.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "organizationScoped",
            "in": "query",
            "description": "If true and projectId is omitted, return only organization-wide scenarios (project_id IS NULL). Ignored when projectId is set.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque keyset cursor from a previous `nextCursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: query parameter projectId, Invalid value for: query parameter activeOnly, Invalid value for: query parameter organizationScoped, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Create scenario",
        "description": "Adds a manual or template scenario for adaptive tool retrieval.",
        "operationId": "postAdminV1OrgsIdScenarios",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/scenarios/{scenarioId}": {
      "get": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Get scenario",
        "description": "Returns one scenario by id.",
        "operationId": "getAdminV1OrgsIdScenariosScenarioid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Update scenario",
        "description": "Patches scenario query pattern, tools, or activation. Returns the updated scenario.",
        "operationId": "putAdminV1OrgsIdScenariosScenarioid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Delete scenario",
        "description": "Removes a scenario from the organisation.",
        "operationId": "deleteAdminV1OrgsIdScenariosScenarioid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/scenarios/{scenarioId}/vector-diversity": {
      "get": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Routing vector diversity",
        "description": "Min/max pairwise cosine similarity between stored query embeddings (requires at least two vectors).",
        "operationId": "getAdminV1OrgsIdScenariosScenarioidVector-diversity",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioVectorDiversityDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/scenarios/{scenarioId}/promote": {
      "post": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Promote auto scenario to CompositeTool",
        "description": "Owner/admin only. Creates a tool_definitions row from the scenario canonical plan.",
        "operationId": "postAdminV1OrgsIdScenariosScenarioidPromote",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompositeToolDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/scenarios/{scenarioId}/dismiss": {
      "post": {
        "tags": [
          "Admin — Scenarios"
        ],
        "summary": "Dismiss auto scenario",
        "description": "Owner/admin only. Deactivates the scenario and removes semantic routing vectors.",
        "operationId": "postAdminV1OrgsIdScenariosScenarioidDismiss",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "description": "Scenario ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: path parameter scenarioId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/tools/reindex-embeddings": {
      "post": {
        "tags": [
          "Admin — Tools"
        ],
        "summary": "Reindex tool embeddings",
        "description": "Rebuilds vector embeddings for org tools (adaptive retrieval).",
        "operationId": "postAdminV1OrgsIdToolsReindex-embeddings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis-backed idempotency enabled, retries with the same key within TTL replay the first response instead of re-running this mutation.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_Int"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/llm-budget": {
      "get": {
        "tags": [
          "Admin — LLM budgets"
        ],
        "summary": "Get organisation LLM budget",
        "description": "Returns configured caps and current usage for the org LLM budget.",
        "operationId": "getAdminV1OrgsIdLlm-budget",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmBudgetBundleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — LLM budgets"
        ],
        "summary": "Replace organisation LLM budget",
        "description": "Sets org-level token/USD limits; clients hitting limits receive HTTP 403.",
        "operationId": "putAdminV1OrgsIdLlm-budget",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/llm-budget": {
      "get": {
        "tags": [
          "Admin — LLM budgets"
        ],
        "summary": "Get project LLM budget",
        "description": "Returns configured caps and usage for the project.",
        "operationId": "getAdminV1ProjectsIdLlm-budget",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LlmBudgetBundleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — LLM budgets"
        ],
        "summary": "Replace project LLM budget",
        "description": "Sets project-level limits in addition to org caps.",
        "operationId": "putAdminV1ProjectsIdLlm-budget",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/orgs/{id}/session-typed-registry-policy": {
      "get": {
        "tags": [
          "Admin — Session typed registry"
        ],
        "summary": "Get organisation session typed registry TTL policy",
        "description": "Returns the organisation default TTL policy for session typed variables.",
        "operationId": "getAdminV1OrgsIdSession-typed-registry-policy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionTypedRegistryPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — Session typed registry"
        ],
        "summary": "Replace organisation session typed registry TTL policy",
        "description": "Sets the organisation default TTL policy for session typed variables.",
        "operationId": "putAdminV1OrgsIdSession-typed-registry-policy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Organisation ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTypedRegistryPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionTypedRegistryPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/admin/v1/projects/{id}/session-typed-registry-policy": {
      "get": {
        "tags": [
          "Admin — Session typed registry"
        ],
        "summary": "Get project session typed registry TTL policy",
        "description": "Returns the project default TTL policy and inherited organisation policy.",
        "operationId": "getAdminV1ProjectsIdSession-typed-registry-policy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionTypedRegistryPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Admin — Session typed registry"
        ],
        "summary": "Replace project session typed registry TTL policy",
        "description": "Sets the project default TTL policy for session typed variables.",
        "operationId": "putAdminV1ProjectsIdSession-typed-registry-policy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Project ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTypedRegistryPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionTypedRegistryPolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools": {
      "get": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "List project tools or integrations",
        "description": "Keyset list. Default: project tools. Use query `type=integration` for enabled integration rows. Organisation catalog: Admin `GET /admin/v1/orgs/{orgId}/tools`.",
        "operationId": "getApiV1ProjectsProjectidTools",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Set to `integration` to list project integrations instead of tools.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum items per page (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous response `nextCursor` field.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/test-selection": {
      "post": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Debug: tool selection",
        "description": "Simulates adaptive retrieval + scenario merge for a query without running the planner.",
        "operationId": "postApiV1ProjectsProjectidToolsTest-selection",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestToolSelectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestToolSelectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/test-execute": {
      "post": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Debug: execute tool",
        "description": "Runs a single tool call outside a session (for integration testing).",
        "operationId": "postApiV1ProjectsProjectidToolsTest-execute",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestToolExecuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestToolExecuteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/integrations/{alias}": {
      "put": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Enable or update integration",
        "description": "Idempotent: enables a service from the org catalog for this project. Optional **`settings`** JSON is merged over catalog defaults (e.g. `confirmationRequired`, `isTransactional`, `approvalPolicy`, `sessionTypedRegistry`). **Evidence replan (opt-in):** under `settings`, set **`postSuccessReplan`** with ``{\"enabled\":true,\"reason\":\"evidence_discovered\",\"maxPerRun\":1,\"maxOutputChars\":4000,\"blockSameCallFingerprint\":true}` (all keys optional except `enabled`). Optional nested **`redaction`** (e.g. `{\"enabled\":true,\"allowKeys\":[\"body\"],\"dropKeys\":[\"password\"],\"maxDepth\":4,\"maxStringChars\":1000,\"maskSecretPatterns\":true}`) sanitizes structured tool output before the second planner call. When enabled on a **non-transactional** tool, a successful read may emit SSE/history event **`evidence_replan`**, cancel remaining steps of the current plan, and replan using bounded tool output as evidence. **Transactional** tools (`isTransactional: true`) never trigger this path.",
        "operationId": "putApiV1ProjectsProjectidToolsIntegrationsAlias",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "alias",
            "in": "path",
            "description": "Integration alias (service key)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableIntegrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Disable integration",
        "description": "Turns off a service for the project.",
        "operationId": "deleteApiV1ProjectsProjectidToolsIntegrationsAlias",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "alias",
            "in": "path",
            "description": "Integration alias",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/integrations/batch-enable": {
      "post": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Batch enable integrations",
        "description": "Enables multiple integrations by tool id list.",
        "operationId": "postApiV1ProjectsProjectidToolsIntegrationsBatch-enable",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchEnableIntegrationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchEnableIntegrationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/integrations/batch-disable": {
      "post": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Batch disable integrations",
        "description": "Disables integrations by alias list and/or whole service name.",
        "operationId": "postApiV1ProjectsProjectidToolsIntegrationsBatch-disable",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchDisableIntegrationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchDisableIntegrationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/tools/{toolId}": {
      "get": {
        "tags": [
          "Runtime — Tools"
        ],
        "summary": "Get tool detail",
        "description": "Full tool definition visible to the project.",
        "operationId": "getApiV1ProjectsProjectidToolsToolid",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "description": "Tool UUID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter toolId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Create session",
        "description": "Starts a new chat session. Optional `contextVars` (omit or `{}` to skip storing context). Optional `externalUserId`, `tags`, secrets. Send the first user turn via POST .../messages.",
        "operationId": "postApiV1ProjectsProjectidSessions",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/scheduled-jobs": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Create one-shot scheduled job",
        "description": "Schedules deferred prompt execution. Without `targetSessionId`, the job uses `new_session_prompt`: at due time it creates a deterministic session and sends the prompt. With `targetSessionId`, the job uses `resume_session` and enqueues the prompt into that existing session (must belong to this project and must not be `CLOSED`).",
        "operationId": "postApiV1ProjectsProjectidScheduled-jobs",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduledJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/scheduled-jobs/{id}": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Get scheduled job",
        "description": "Returns current scheduled job status and dispatch metadata.",
        "operationId": "getApiV1ProjectsProjectidScheduled-jobsId",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled job ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/scheduled-jobs/{id}/cancel": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Cancel scheduled job",
        "description": "Cancels a scheduled or claimed job before dispatch starts. Dispatching and terminal jobs cannot be cancelled.",
        "operationId": "postApiV1ProjectsProjectidScheduled-jobsIdCancel",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Scheduled job ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelScheduledJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/recurring-schedules": {
      "get": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "List recurring schedules",
        "description": "Returns recurring schedules for the project (newest first), keyset-paginated.",
        "operationId": "getApiV1ProjectsProjectidRecurring-schedules",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Keyset cursor from a previous `nextCursor` (newest first).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPage_A"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: query parameter limit",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "Create recurring schedule",
        "description": "Creates a timezone-aware recurring schedule that spawns one-shot scheduled jobs at each fire time (hourly/daily/weekly).",
        "operationId": "postApiV1ProjectsProjectidRecurring-schedules",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecurringScheduleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringScheduleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/recurring-schedules/{id}": {
      "get": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "Get recurring schedule",
        "description": "Returns one recurring schedule row including next fire time and status.",
        "operationId": "getApiV1ProjectsProjectidRecurring-schedulesId",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Recurring schedule ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringScheduleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/recurring-schedules/{id}/pause": {
      "post": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "Pause recurring schedule",
        "description": "Pauses an active schedule; no child jobs are spawned until resumed.",
        "operationId": "postApiV1ProjectsProjectidRecurring-schedulesIdPause",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Recurring schedule ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringScheduleActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/recurring-schedules/{id}/resume": {
      "post": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "Resume recurring schedule",
        "description": "Re-activates a paused schedule and recomputes the next fire time.",
        "operationId": "postApiV1ProjectsProjectidRecurring-schedulesIdResume",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Recurring schedule ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringScheduleActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/recurring-schedules/{id}/disable": {
      "post": {
        "tags": [
          "Runtime — Recurring schedules"
        ],
        "summary": "Disable recurring schedule",
        "description": "Permanently disables a schedule (operator stop).",
        "operationId": "postApiV1ProjectsProjectidRecurring-schedulesIdDisable",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Recurring schedule ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringScheduleActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}": {
      "patch": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Update session status",
        "description": "Use `{\"status\":\"closed\"}` to mark a session closed (DB status + session secrets removed). `{\"status\":\"paused\"}` sets user pause (POST /messages returns 409 until resumed). `{\"status\":\"active\"}` clears user pause. Clients should stop sending messages after close; the API does not currently reject `POST .../messages` based on `CLOSED` alone.",
        "operationId": "patchApiV1ProjectsProjectidSessionsId",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_String"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/actions": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Session HITL action",
        "description": "Unified endpoint: `approve`, `reject`, or `fill_slots` with optional `values` map.",
        "operationId": "postApiV1ProjectsProjectidSessionsIdActions",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis enabled, retries within TTL replay the first JSON response without re-running the action.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Operator-Id",
            "in": "header",
            "description": "Optional operator hint when using project API key (audit only).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_String"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/feedback": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Submit explicit run feedback",
        "description": "Records explicit post-run feedback (`like`/`dislike`) for a terminal run and updates adaptive scenario ranking.",
        "operationId": "postApiV1ProjectsProjectidSessionsIdFeedback",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Operator-Id",
            "in": "header",
            "description": "Optional operator hint when using project API key (audit only).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionFeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map_String"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/messages": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Send user message",
        "description": "Accepts the user message and returns **202 Accepted** with `messageId` while processing continues asynchronously. Use SSE `/chat` or GET `/history` for the full trace (the `prompt` event meta repeats `messageId`). Human-in-the-loop pauses are controlled by tool settings, not the request body.",
        "operationId": "postApiV1ProjectsProjectidSessionsIdMessages",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional; with Redis enabled, the same key for this session replays the first `PromptResponse` within TTL instead of starting a second LLM turn.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/history": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Get session history",
        "description": "Persisted timeline of session events (alternative to SSE for polling clients). Each item has `eventType` and `payload` analogous to SSE `event` + `data` where the row was produced from the live stream; additional types exist only here (e.g. `prompt`, `tool_selection`, `plan_summary`, `slots_cancelled`, `llm_reply`). No `ping` rows.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdHistory",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/timeline": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Get run timeline",
        "description": "Product-safe, graph-normalized timeline for a single run.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidTimeline",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTimelineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/diagnostics": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Get run diagnostics",
        "description": "Admin/support diagnostics with correlation IDs and strict-redacted details.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidDiagnostics",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDiagnosticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/debug-content": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Debug run content (audited)",
        "description": "JWT only. Returns plan snapshot and session events scoped to this run. When org `debugContentAccessEnabled` is false, each `meta`, `payload`, and `planSnapshot` JSON value is full-strip redacted (single object with only `content: <redacted>`; no preserved keys or nesting). Always writes an audit log entry.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidDebug-content",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DebugRunContentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/replay": {
      "post": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Replay a run (JWT, org debug policy)",
        "description": "Requires org debug content access. Modes: `frozen`, `live`, `replan_frozen`, `replan_live`. Returns 202 with the new `replayRunId`; stream via existing SSE.",
        "operationId": "postApiV1ProjectsProjectidSessionsIdRunsRunidReplay",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Source run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayRunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/replay-status": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Replay / run status (JWT, org debug policy)",
        "description": "Poll lifecycle fields for a run (including replay runs created via POST .../replay).",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidReplay-status",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Run ID (e.g. replay run id)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayRunStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/replay-runs": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "List replay runs for a source run (JWT, org debug policy)",
        "description": "Returns replay runs in this session whose `sourceRunId` matches the path `runId`, newest first. Same access model as replay-status (JWT + org debug content access).",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidReplay-runs",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Source run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayRunsForSourceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/runs/{runId}/diff": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Diff two runs (JWT, org debug policy)",
        "operationId": "getApiV1ProjectsProjectidSessionsIdRunsRunidDiff",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "compareWith",
            "in": "query",
            "description": "Other run id in the same session to diff against",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDiffResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: path parameter runId, Invalid value for: query parameter compareWith",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/typed-variables": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "List session typed variables (metadata only)",
        "description": "JWT only. Returns names, types, source, timestamps, TTL status, and staleness without raw values.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdTyped-variables",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionTypedVariableDebugResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Invalidate session typed variables",
        "description": "JWT only. Idempotently deletes named typed variables, or all typed variables when names is omitted/empty. If a run is already active, invalidation applies to the actor checkpoint and the next run/turn; it does not interrupt the active run.",
        "operationId": "deleteApiV1ProjectsProjectidSessionsIdTyped-variables",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvalidateSessionTypedVariablesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidateSessionTypedVariablesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/secrets": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "List session secret keys",
        "description": "Key names only for per-session credentials.",
        "operationId": "getApiV1ProjectsProjectidSessionsIdSecrets",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSecretKeysResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Upsert session secrets",
        "description": "Stores short-lived per-user tokens scoped to this session.",
        "operationId": "putApiV1ProjectsProjectidSessionsIdSecrets",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSessionSecretsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Delete all session secrets",
        "description": "Clears per-session secrets; session and history remain.",
        "operationId": "deleteApiV1ProjectsProjectidSessionsIdSecrets",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/secrets/{key}": {
      "delete": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Delete session secret",
        "description": "Removes one session-scoped secret.",
        "operationId": "deleteApiV1ProjectsProjectidSessionsIdSecretsKey",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "description": "Secret key name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/projects/{projectId}/callbacks/{tokenId}": {
      "post": {
        "tags": [
          "Runtime — Callbacks"
        ],
        "summary": "Deliver external signal (`wait_for_signal`)",
        "description": "Authenticates with the per-signal secret (never logged). Idempotent: repeating the same canonical JSON body returns 200 with `SIGNAL_ALREADY_DELIVERED`.",
        "operationId": "postApiV1ProjectsProjectidCallbacksTokenid",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Project UUID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tokenId",
            "in": "path",
            "description": "Signal token from `wait_for_signal` tool output",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer `{tokenId}:{secret}` (same token as path)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "JSON object delivered as the signal payload",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter tokenId, Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{orgId}/webhooks/{triggerKey}": {
      "post": {
        "tags": [
          "Runtime — Inbound webhooks"
        ],
        "summary": "Invoke inbound webhook trigger",
        "description": "Public endpoint (no project API key). Caller must satisfy trigger auth (e.g. HMAC). Many failures return HTTP 404 with a generic problem body. Raw body, headers, and query params are forwarded to the scenario.",
        "operationId": "postApiV1OrgsOrgidWebhooksTriggerkey",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "description": "Organisation UUID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "triggerKey",
            "in": "path",
            "description": "Trigger key from console; keep secret — URL is unauthenticated.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundWebhookInvokeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter orgId, Invalid value for: headers, Invalid value for: query parameters",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{projectId}/sessions/{id}/chat": {
      "get": {
        "tags": [
          "Runtime — Sessions"
        ],
        "summary": "Subscribe to session SSE",
        "description": "Server-Sent Events (`text/event-stream`): plan graph (`started`), progress (`run_phase`, `tool_start`/`tool_end`), slot collection (`slots_required`, optional plain-language `slots_plan_summary` shortly after), HITL (`confirm_plan_required`/`confirm_plan_result`), HTTP-error replans (`replan`), evidence-driven replans within the same turn (`evidence_replan`), crash/recovery signals (`run_interrupted`, `run_recovery_required`), completion (`done`/`error`), keep-alive (`ping`). OpenAPI cannot fully describe the stream; use GET /sessions/{id}/history for persisted rows (includes additional event types not pushed on SSE, e.g. `plan_summary`, `slots_cancelled`, `prompt`).",
        "operationId": "getApiV1ProjectsProjectidSessionsIdChat",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Target project. For `sk_live_…` / `sk-test-…` keys this must match the key's project and the key's scopes must allow this operation; for admin tokens you must be a member of the project's organisation.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Session ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid value for: path parameter projectId, Invalid value for: path parameter id",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "httpAuth": []
          }
        ]
      }
    },
    "/api/v1/demo-request": {
      "post": {
        "tags": [
          "Public"
        ],
        "summary": "Submit demo request",
        "description": "Public marketing form: stores a demo request and sends notification emails.",
        "operationId": "postApiV1Demo-request",
        "parameters": [
          {
            "name": "CF-Connecting-IP",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Forwarded-For",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Real-IP",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DemoRequestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Invalid value for: body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddOrgMemberRequest": {
        "title": "AddOrgMemberRequest",
        "type": "object",
        "required": [
          "email",
          "role"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      },
      "AddProjectModelRequest": {
        "title": "AddProjectModelRequest",
        "type": "object",
        "required": [
          "provider",
          "model"
        ],
        "properties": {
          "provider": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "modelName": {
            "type": "string"
          },
          "modelType": {
            "type": "string"
          },
          "apiBase": {
            "type": "string"
          },
          "litellmParams": {}
        }
      },
      "AddProjectModelResponse": {
        "title": "AddProjectModelResponse",
        "type": "object",
        "required": [
          "modelName"
        ],
        "properties": {
          "modelName": {
            "type": "string"
          }
        }
      },
      "AuditLogItemDto": {
        "title": "AuditLogItemDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "actorId",
          "actorType",
          "action",
          "details",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "actorId": {
            "type": "string"
          },
          "actorType": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "details": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AuditLogWebhookDto": {
        "title": "AuditLogWebhookDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "name",
          "url",
          "enabled",
          "filters",
          "secretConfigured",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "filters": {
            "$ref": "#/components/schemas/AuditLogWebhookFilters"
          },
          "secretConfigured": {
            "type": "boolean"
          },
          "lastDeliveryAt": {
            "type": "string"
          },
          "lastSuccessAt": {
            "type": "string"
          },
          "lastFailureAt": {
            "type": "string"
          },
          "lastError": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "AuditLogWebhookFilters": {
        "title": "AuditLogWebhookFilters",
        "type": "object",
        "required": [
          "includeProjectless"
        ],
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "actorTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projectIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "includeProjectless": {
            "type": "boolean"
          }
        }
      },
      "AuditLogWebhookTestResponse": {
        "title": "AuditLogWebhookTestResponse",
        "type": "object",
        "required": [
          "httpStatus",
          "body"
        ],
        "properties": {
          "httpStatus": {
            "type": "integer",
            "format": "int32"
          },
          "body": {
            "type": "string"
          }
        }
      },
      "BatchDisableIntegrationsRequest": {
        "title": "BatchDisableIntegrationsRequest",
        "type": "object",
        "properties": {
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "serviceName": {
            "type": "string"
          }
        }
      },
      "BatchDisableIntegrationsResponse": {
        "title": "BatchDisableIntegrationsResponse",
        "type": "object",
        "required": [
          "disabled"
        ],
        "properties": {
          "disabled": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "BatchEnableIntegrationsRequest": {
        "title": "BatchEnableIntegrationsRequest",
        "type": "object",
        "properties": {
          "toolIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "serviceName": {
            "type": "string"
          }
        }
      },
      "BatchEnableIntegrationsResponse": {
        "title": "BatchEnableIntegrationsResponse",
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "BootstrapResponse": {
        "title": "BootstrapResponse",
        "type": "object",
        "required": [
          "orgId",
          "projectId",
          "apiKey"
        ],
        "properties": {
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "CancelScheduledJobResponse": {
        "title": "CancelScheduledJobResponse",
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "CatalogModelEntry": {
        "title": "CatalogModelEntry",
        "type": "object",
        "required": [
          "id",
          "mode"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          }
        }
      },
      "CompositeToolDto": {
        "title": "CompositeToolDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "name",
          "description",
          "sourceScenarioId",
          "revisionId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "sourceScenarioId": {
            "type": "string",
            "format": "uuid"
          },
          "revisionId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "CreateAuditLogWebhookRequest": {
        "title": "CreateAuditLogWebhookRequest",
        "type": "object",
        "required": [
          "name",
          "url",
          "enabled",
          "filters"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "filters": {
            "$ref": "#/components/schemas/AuditLogWebhookFilters"
          }
        }
      },
      "CreateKnowledgeProviderRequest": {
        "title": "CreateKnowledgeProviderRequest",
        "type": "object",
        "required": [
          "name",
          "endpointUrl",
          "providerType",
          "providerConfig",
          "enabled",
          "timeoutMs",
          "topK",
          "maxContextChars",
          "toolSelectionKbChars",
          "failurePolicy",
          "authMode"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "endpointUrl": {
            "type": "string"
          },
          "providerType": {
            "type": "string"
          },
          "providerConfig": {},
          "enabled": {
            "type": "boolean"
          },
          "timeoutMs": {
            "type": "integer",
            "format": "int32"
          },
          "topK": {
            "type": "integer",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "format": "double"
          },
          "maxContextChars": {
            "type": "integer",
            "format": "int32"
          },
          "toolSelectionKbChars": {
            "type": "integer",
            "format": "int32"
          },
          "failurePolicy": {
            "type": "string"
          },
          "authMode": {
            "type": "string"
          },
          "authHeaderName": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "CreateOrgCloudProviderRequest": {
        "title": "CreateOrgCloudProviderRequest",
        "type": "object",
        "required": [
          "name",
          "vendor",
          "apiKey"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "CreateOrgCustomProviderRequest": {
        "title": "CreateOrgCustomProviderRequest",
        "type": "object",
        "required": [
          "name",
          "vendorType"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "vendorType": {
            "type": "string"
          },
          "apiBase": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "litellmParams": {}
        }
      },
      "CreateOrgMcpServerRequest": {
        "title": "CreateOrgMcpServerRequest",
        "type": "object",
        "required": [
          "name",
          "transport",
          "command",
          "env",
          "enabled",
          "syncEnabled"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "env": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          },
          "syncEnabled": {
            "type": "boolean"
          }
        }
      },
      "CreateOrgRequest": {
        "title": "CreateOrgRequest",
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "CreateOrgResponse": {
        "title": "CreateOrgResponse",
        "type": "object",
        "required": [
          "id",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CreateOutboundWebhookRequest": {
        "title": "CreateOutboundWebhookRequest",
        "type": "object",
        "required": [
          "name",
          "method",
          "url",
          "headers",
          "query",
          "authType",
          "authConfig",
          "signRequest"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "headers": {
            "$ref": "#/components/schemas/Map_String"
          },
          "query": {
            "$ref": "#/components/schemas/Map_String"
          },
          "bodyTemplate": {},
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "signRequest": {
            "type": "boolean"
          },
          "signatureHeader": {
            "type": "string"
          },
          "signatureSecretRef": {
            "type": "string"
          }
        }
      },
      "CreateProjectApiKeyRequest": {
        "title": "CreateProjectApiKeyRequest",
        "type": "object",
        "properties": {
          "name": {
            "description": "Optional label in the admin console.",
            "type": "string"
          },
          "scopes": {
            "description": "HRN scopes for this key; each must be from the server allow-list (e.g. hrn:project:session:create).",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateProjectApiKeyResponse": {
        "title": "CreateProjectApiKeyResponse",
        "type": "object",
        "required": [
          "id",
          "apiKey",
          "keyPreview"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "apiKey": {
            "description": "Full secret; shown once.",
            "type": "string"
          },
          "keyPreview": {
            "type": "string"
          }
        }
      },
      "CreateProjectRequest": {
        "title": "CreateProjectRequest",
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "description": "Display name of the project.",
            "type": "string"
          },
          "description": {
            "description": "Optional short description.",
            "type": "string"
          },
          "systemPrompt": {
            "description": "Default system prompt for new sessions.",
            "type": "string"
          },
          "defaultModel": {
            "description": "Preferred LiteLLM model id, e.g. openai/gpt-4o-mini.",
            "type": "string"
          },
          "defaultProvider": {
            "description": "Provider id when not using defaultModel alone.",
            "type": "string"
          },
          "defaultProviderModel": {
            "description": "Model name under defaultProvider.",
            "type": "string"
          },
          "allowedModels": {
            "description": "Subset of org-allowed models this project may use.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateProjectResponse": {
        "title": "CreateProjectResponse",
        "type": "object",
        "required": [
          "id",
          "apiKey"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "CreateProjectWebhookTriggerRequest": {
        "title": "CreateProjectWebhookTriggerRequest",
        "type": "object",
        "required": [
          "name",
          "triggerKey",
          "sessionSecretPaths",
          "contextPaths",
          "authType",
          "authConfig",
          "enabled"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "triggerKey": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "promptTemplate": {
            "type": "string"
          },
          "sessionUserPath": {
            "type": "string"
          },
          "sessionSecretPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "contextPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "CreateRecurringScheduleRequest": {
        "title": "CreateRecurringScheduleRequest",
        "type": "object",
        "required": [
          "targetType",
          "scheduleKind",
          "timezone",
          "rule",
          "prompt"
        ],
        "properties": {
          "targetType": {
            "description": "One of: `new_session_prompt`, `resume_session`.",
            "type": "string"
          },
          "targetSessionId": {
            "description": "Required when targetType is `resume_session`: session to enqueue prompts into.",
            "type": "string",
            "format": "uuid"
          },
          "scheduleKind": {
            "description": "One of: `hourly`, `daily`, `weekly`.",
            "type": "string"
          },
          "timezone": {
            "description": "IANA timezone id, e.g. `Europe/Kyiv`.",
            "type": "string"
          },
          "rule": {
            "description": "Recurrence rule JSON. Examples: hourly `{\"minuteOfHour\":30}`; daily `{\"hour\":9,\"minute\":0}`; weekly `{\"dayOfWeek\":1,\"hour\":9,\"minute\":0}` (1=Monday … 7=Sunday)."
          },
          "prompt": {
            "description": "Prompt payload: same shape as scheduled jobs (prompt, optional context, secrets, metadata).",
            "type": "string"
          },
          "contextVars": {},
          "externalUserId": {
            "type": "string"
          },
          "secrets": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Optional secrets stored encrypted for this schedule; each spawned child job receives a copy at fire time."
          },
          "metadata": {
            "$ref": "#/components/schemas/Map_String"
          },
          "idempotencyKey": {
            "type": "string"
          }
        }
      },
      "CreateScenarioRequest": {
        "title": "CreateScenarioRequest",
        "type": "object",
        "required": [
          "queryText"
        ],
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "queryText": {
            "type": "string"
          },
          "toolRevisionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "toolRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioToolRefDto"
            }
          },
          "systemInstruction": {
            "description": "Optional agent instructions; may use `{{var}}` placeholders filled from session contextVars.",
            "type": "string"
          }
        }
      },
      "CreateScheduledJobRequest": {
        "title": "CreateScheduledJobRequest",
        "type": "object",
        "required": [
          "prompt"
        ],
        "properties": {
          "delaySeconds": {
            "description": "Delay in seconds. Provide either this field or `runAt`, but not both.",
            "type": "integer",
            "format": "int64"
          },
          "runAt": {
            "description": "Absolute UTC execution time (ISO-8601). Provide either this field or `delaySeconds`.",
            "type": "string"
          },
          "prompt": {
            "description": "Prompt that will be sent when the job fires.",
            "type": "string"
          },
          "contextVars": {
            "description": "Optional context vars used to create the new session."
          },
          "externalUserId": {
            "description": "Optional stable external user id for the created session.",
            "type": "string"
          },
          "secrets": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Optional session-scoped secrets attached to the created session."
          },
          "metadata": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Optional metadata echoed in lifecycle webhooks."
          },
          "idempotencyKey": {
            "description": "Optional deduplication key scoped by project.",
            "type": "string"
          },
          "maxAttempts": {
            "description": "Optional retry limit for dispatch infrastructure failures.",
            "type": "integer",
            "format": "int32"
          },
          "targetSessionId": {
            "description": "When set, the job uses `resume_session` target: enqueue the prompt into this existing session (serialized with other messages) instead of creating a new session.",
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "CreateSessionRequest": {
        "title": "CreateSessionRequest",
        "type": "object",
        "properties": {
          "contextVars": {
            "description": "Optional template variables; omit or use {} to skip storing session context."
          },
          "externalUserId": {
            "description": "Optional stable end-user id in your application (audit, GDPR). Omit for anonymous sessions.",
            "type": "string"
          },
          "tags": {
            "description": "Optional labels for filtering and org-scoped export/erase by tag (case-sensitive).",
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "secrets": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Per-session secrets merged at execution (session wins on key clash)."
          },
          "metadata": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Infrastructure metadata echoed in lifecycle webhooks only (not sent to LLM). Max 16 keys; key ≤64, value ≤512 chars."
          },
          "autoApprovePlan": {
            "description": "Opt-in: bypass HITL plan confirmation for this session. Ignored when the project planApprovalMode is 'require'. Tools with approvalPolicy=always still require manual confirmation regardless.",
            "type": "boolean"
          }
        }
      },
      "CursorPage_A": {
        "title": "CursorPage_A",
        "type": "object",
        "required": [
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditLogItemDto"
            }
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "DashboardDailyCount": {
        "title": "DashboardDailyCount",
        "type": "object",
        "required": [
          "date",
          "promptCount"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "promptCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DashboardDailyLlmTokens": {
        "title": "DashboardDailyLlmTokens",
        "type": "object",
        "required": [
          "date",
          "totalTokens"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "totalTokens": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DashboardDailySpend": {
        "title": "DashboardDailySpend",
        "type": "object",
        "required": [
          "date",
          "estimatedSpendUsd"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "estimatedSpendUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DashboardModelTokens": {
        "title": "DashboardModelTokens",
        "type": "object",
        "required": [
          "model",
          "promptTokens",
          "completionTokens",
          "totalTokens"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "promptTokens": {
            "type": "integer",
            "format": "int64"
          },
          "completionTokens": {
            "type": "integer",
            "format": "int64"
          },
          "totalTokens": {
            "type": "integer",
            "format": "int64"
          },
          "estimatedSpendUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DashboardOrgNav": {
        "title": "DashboardOrgNav",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardProjectNav"
            }
          }
        }
      },
      "DashboardOverview": {
        "title": "DashboardOverview",
        "type": "object",
        "required": [
          "organizationCount",
          "projectCount",
          "sessionCountTotal",
          "sessionCountLast7Days",
          "sessionCountLast30Days",
          "uniqueExternalUsersLast30Days",
          "adminMembersDistinct",
          "promptsLast7Days",
          "promptsLast30Days",
          "llmPromptTokens7d",
          "llmCompletionTokens7d",
          "llmTotalTokens7d",
          "llmPromptTokens30d",
          "llmCompletionTokens30d",
          "llmTotalTokens30d",
          "llmEstimatedSpendUsd7d",
          "llmEstimatedSpendUsd30d",
          "llmUnpricedPromptTokens7d",
          "llmUnpricedCompletionTokens7d",
          "llmUnpricedPromptTokens30d",
          "llmUnpricedCompletionTokens30d",
          "hasSessionTags"
        ],
        "properties": {
          "organizationCount": {
            "type": "integer",
            "format": "int32"
          },
          "projectCount": {
            "type": "integer",
            "format": "int64"
          },
          "sessionCountTotal": {
            "type": "integer",
            "format": "int64"
          },
          "sessionCountLast7Days": {
            "type": "integer",
            "format": "int64"
          },
          "sessionCountLast30Days": {
            "type": "integer",
            "format": "int64"
          },
          "uniqueExternalUsersLast30Days": {
            "type": "integer",
            "format": "int64"
          },
          "adminMembersDistinct": {
            "type": "integer",
            "format": "int64"
          },
          "promptsLast7Days": {
            "type": "integer",
            "format": "int64"
          },
          "promptsLast30Days": {
            "type": "integer",
            "format": "int64"
          },
          "promptsByDay": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardDailyCount"
            }
          },
          "llmPromptTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmCompletionTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTotalTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmPromptTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmCompletionTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTotalTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmEstimatedSpendUsd7d": {
            "type": "number",
            "format": "double"
          },
          "llmEstimatedSpendUsd30d": {
            "type": "number",
            "format": "double"
          },
          "llmUnpricedPromptTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedCompletionTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedPromptTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedCompletionTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTokensByDay": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardDailyLlmTokens"
            }
          },
          "llmEstimatedSpendUsdByDay": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardDailySpend"
            }
          },
          "llmTokensByModel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardModelTokens"
            }
          },
          "llmTokensByProjectModel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardProjectModelTokens"
            }
          },
          "hasSessionTags": {
            "type": "boolean"
          },
          "llmTokensByTag": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LlmTagTokenBucket"
            }
          }
        }
      },
      "DashboardProjectModelTokens": {
        "title": "DashboardProjectModelTokens",
        "type": "object",
        "required": [
          "projectId",
          "model",
          "totalTokens"
        ],
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "projectName": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "totalTokens": {
            "type": "integer",
            "format": "int64"
          },
          "estimatedSpendUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DashboardProjectNav": {
        "title": "DashboardProjectNav",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DashboardResponse": {
        "title": "DashboardResponse",
        "type": "object",
        "required": [
          "overview"
        ],
        "properties": {
          "overview": {
            "$ref": "#/components/schemas/DashboardOverview"
          },
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardOrgNav"
            }
          },
          "defaultPlanSlug": {
            "type": "string"
          },
          "defaultPlanLimits": {
            "$ref": "#/components/schemas/PlanLimitsDto"
          }
        }
      },
      "DataErasurePreviewResponse": {
        "title": "DataErasurePreviewResponse",
        "type": "object",
        "required": [
          "canErase",
          "sessionsWithExternalIdCount",
          "willDeleteUiPreferences"
        ],
        "properties": {
          "canErase": {
            "type": "boolean"
          },
          "soleOwnerOrganizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SoleOwnerOrganizationRef"
            }
          },
          "membershipsToRemove": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MembershipRemovalPreview"
            }
          },
          "sessionsWithExternalIdCount": {
            "type": "integer",
            "format": "int32"
          },
          "willDeleteUiPreferences": {
            "type": "boolean"
          }
        }
      },
      "DebugExecuteSessionScriptRequest": {
        "title": "DebugExecuteSessionScriptRequest",
        "type": "object",
        "required": [
          "sessionId",
          "script"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "script": {
            "type": "string"
          },
          "userMessage": {
            "type": "string"
          }
        }
      },
      "DebugHistoryItem": {
        "title": "DebugHistoryItem",
        "type": "object",
        "required": [
          "id",
          "eventType",
          "meta",
          "payload",
          "timestamp"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "meta": {},
          "payload": {},
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DebugRunContentResponse": {
        "title": "DebugRunContentResponse",
        "type": "object",
        "required": [
          "sessionId",
          "runId",
          "debugContentAccessEnabled"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "debugContentAccessEnabled": {
            "type": "boolean"
          },
          "planSnapshot": {},
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DebugHistoryItem"
            }
          }
        }
      },
      "DemoRequestInput": {
        "title": "DemoRequestInput",
        "type": "object",
        "required": [
          "name",
          "email"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "honeypot": {
            "type": "string"
          }
        }
      },
      "EnableIntegrationRequest": {
        "title": "EnableIntegrationRequest",
        "type": "object",
        "required": [
          "toolId",
          "alias"
        ],
        "properties": {
          "toolId": {
            "type": "string",
            "format": "uuid"
          },
          "alias": {
            "type": "string"
          },
          "settings": {}
        }
      },
      "GdprDeletionLogOpsRevealRequest": {
        "title": "GdprDeletionLogOpsRevealRequest",
        "type": "object",
        "required": [
          "deletionId",
          "identifierType"
        ],
        "properties": {
          "deletionId": {
            "type": "string",
            "format": "uuid"
          },
          "identifierType": {
            "type": "string"
          }
        }
      },
      "GdprDeletionLogOpsRevealResponse": {
        "title": "GdprDeletionLogOpsRevealResponse",
        "type": "object",
        "required": [
          "orgId",
          "deletionId",
          "identifierType",
          "identifierValue",
          "expiresAt"
        ],
        "properties": {
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "deletionId": {
            "type": "string",
            "format": "uuid"
          },
          "identifierType": {
            "type": "string"
          },
          "identifierValue": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GdprEraseRequest": {
        "title": "GdprEraseRequest",
        "type": "object",
        "properties": {
          "externalUserId": {
            "type": "string"
          },
          "keycloakUserId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprEraseResponse": {
        "title": "GdprEraseResponse",
        "type": "object",
        "required": [
          "sessionsDeleted"
        ],
        "properties": {
          "sessionsDeleted": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "GdprMyDataErasureResponse": {
        "title": "GdprMyDataErasureResponse",
        "type": "object",
        "required": [
          "sessionsDeleted",
          "membershipsRemoved"
        ],
        "properties": {
          "sessionsDeleted": {
            "type": "integer",
            "format": "int32"
          },
          "membershipsRemoved": {
            "type": "integer",
            "format": "int32"
          },
          "identityProviderUserRemoved": {
            "type": "boolean"
          }
        }
      },
      "GlobalSearchItem": {
        "title": "GlobalSearchItem",
        "description": "Single search hit for command palette / global search.",
        "type": "object",
        "required": [
          "kind",
          "id",
          "title",
          "orgId"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "subtitle": {
            "type": "string"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GlobalSearchResponse": {
        "title": "GlobalSearchResponse",
        "description": "Grouped global search results (organizations, projects, sessions).",
        "type": "object",
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalSearchItem"
            }
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalSearchItem"
            }
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalSearchItem"
            }
          }
        }
      },
      "HistoryItem": {
        "title": "HistoryItem",
        "type": "object",
        "required": [
          "id",
          "eventType",
          "meta",
          "payload",
          "timestamp"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "meta": {},
          "payload": {},
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InboundWebhookInvokeResponse": {
        "title": "InboundWebhookInvokeResponse",
        "type": "object",
        "required": [
          "status",
          "sessionId",
          "projectId"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IngestToolRequest": {
        "title": "IngestToolRequest",
        "type": "object",
        "required": [
          "name",
          "version",
          "spec"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "spec": {}
        }
      },
      "IngestToolResponse": {
        "title": "IngestToolResponse",
        "type": "object",
        "required": [
          "toolId"
        ],
        "properties": {
          "toolId": {
            "description": "Server-generated tool UUID; use as path segment for full updates.",
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IntegrationLifecycleActionRequest": {
        "title": "IntegrationLifecycleActionRequest",
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "IntegrationLifecycleDto": {
        "title": "IntegrationLifecycleDto",
        "type": "object",
        "required": [
          "sourceType",
          "sourceKey",
          "failureStreak",
          "degradedStatus",
          "authStatus",
          "catalogFreshnessStatus"
        ],
        "properties": {
          "sourceType": {
            "type": "string"
          },
          "sourceKey": {
            "type": "string"
          },
          "lastSyncAt": {
            "type": "string"
          },
          "lastSyncStatus": {
            "type": "string"
          },
          "lastSyncMessage": {
            "type": "string"
          },
          "lastTestAt": {
            "type": "string"
          },
          "lastTestStatus": {
            "type": "string"
          },
          "lastTestMessage": {
            "type": "string"
          },
          "lastExecutionAt": {
            "type": "string"
          },
          "lastExecutionStatus": {
            "type": "string"
          },
          "lastExecutionMessage": {
            "type": "string"
          },
          "lastSuccessfulExecutionAt": {
            "type": "string"
          },
          "failureStreak": {
            "type": "integer",
            "format": "int32"
          },
          "degradedStatus": {
            "type": "string"
          },
          "authStatus": {
            "type": "string"
          },
          "catalogFreshnessStatus": {
            "type": "string"
          },
          "latestDriftSummary": {}
        }
      },
      "InvalidateSessionTypedVariablesRequest": {
        "title": "InvalidateSessionTypedVariablesRequest",
        "type": "object",
        "properties": {
          "names": {
            "description": "Names to invalidate. Omit or send an empty list to clear all typed variables in the session.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "description": "Optional operator-supplied reason stored in the audit log.",
            "type": "string"
          }
        }
      },
      "InvalidateSessionTypedVariablesResponse": {
        "title": "InvalidateSessionTypedVariablesResponse",
        "type": "object",
        "properties": {
          "deleted": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "KnowledgeChunkDto": {
        "title": "KnowledgeChunkDto",
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "section": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "score": {
            "type": "number",
            "format": "double"
          },
          "updatedAt": {
            "type": "string"
          },
          "metadata": {}
        }
      },
      "KnowledgeProviderDto": {
        "title": "KnowledgeProviderDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "providerType",
          "providerConfig",
          "endpointUrl",
          "enabled",
          "timeoutMs",
          "topK",
          "maxContextChars",
          "toolSelectionKbChars",
          "failurePolicy",
          "authMode",
          "apiKeyConfigured"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "providerType": {
            "type": "string"
          },
          "providerConfig": {},
          "endpointUrl": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "timeoutMs": {
            "type": "integer",
            "format": "int32"
          },
          "topK": {
            "type": "integer",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "format": "double"
          },
          "maxContextChars": {
            "type": "integer",
            "format": "int32"
          },
          "toolSelectionKbChars": {
            "type": "integer",
            "format": "int32"
          },
          "failurePolicy": {
            "type": "string"
          },
          "authMode": {
            "type": "string"
          },
          "authHeaderName": {
            "type": "string"
          },
          "apiKeyConfigured": {
            "type": "boolean"
          },
          "lastTestStatus": {
            "type": "string"
          },
          "lastTestAt": {
            "type": "string"
          }
        }
      },
      "LiteLlmModelInfoItem": {
        "title": "LiteLlmModelInfoItem",
        "type": "object",
        "required": [
          "model_name"
        ],
        "properties": {
          "model_name": {
            "type": "string"
          },
          "litellm_params": {
            "$ref": "#/components/schemas/LiteLlmParams"
          },
          "model_info": {}
        }
      },
      "LiteLlmModelInfoResponse": {
        "title": "LiteLlmModelInfoResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiteLlmModelInfoItem"
            }
          }
        }
      },
      "LiteLlmParams": {
        "title": "LiteLlmParams",
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          }
        }
      },
      "LlmBudgetBundleResponse": {
        "title": "LlmBudgetBundleResponse",
        "type": "object",
        "properties": {
          "budget": {},
          "usage": {}
        }
      },
      "LlmProviderHealthDto": {
        "title": "LlmProviderHealthDto",
        "type": "object",
        "required": [
          "providerKind",
          "providerRef",
          "providerVendor",
          "model",
          "status",
          "observedAt"
        ],
        "properties": {
          "providerKind": {
            "type": "string"
          },
          "providerRef": {
            "type": "string"
          },
          "providerVendor": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "errorClass": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "observedAt": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer",
            "format": "int32"
          },
          "safeMessage": {
            "type": "string"
          }
        }
      },
      "LlmProviderPolicyDto": {
        "title": "LlmProviderPolicyDto",
        "type": "object",
        "required": [
          "restrictHostedProviders",
          "allowCustomProviders"
        ],
        "properties": {
          "restrictHostedProviders": {
            "type": "boolean"
          },
          "allowedCloudVendors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowCustomProviders": {
            "type": "boolean"
          }
        }
      },
      "LlmQuotaDto": {
        "title": "LlmQuotaDto",
        "type": "object",
        "required": [
          "usedTokens",
          "reservedTokens",
          "effectiveUsedTokens",
          "periodStart",
          "isNearLimit",
          "isExceeded"
        ],
        "properties": {
          "limitTokens": {
            "type": "integer",
            "format": "int64"
          },
          "usedTokens": {
            "type": "integer",
            "format": "int64"
          },
          "reservedTokens": {
            "type": "integer",
            "format": "int64"
          },
          "effectiveUsedTokens": {
            "type": "integer",
            "format": "int64"
          },
          "remainingTokens": {
            "type": "integer",
            "format": "int64"
          },
          "periodReset": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "isNearLimit": {
            "type": "boolean"
          },
          "isExceeded": {
            "type": "boolean"
          }
        }
      },
      "LlmTagTokenBucket": {
        "title": "LlmTagTokenBucket",
        "type": "object",
        "required": [
          "promptTokens",
          "completionTokens",
          "totalTokens"
        ],
        "properties": {
          "tag": {
            "type": "string"
          },
          "promptTokens": {
            "type": "integer",
            "format": "int64"
          },
          "completionTokens": {
            "type": "integer",
            "format": "int64"
          },
          "totalTokens": {
            "type": "integer",
            "format": "int64"
          },
          "estimatedSpendUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Map_Int": {
        "title": "Map_Int",
        "type": "object",
        "additionalProperties": {
          "type": "integer",
          "format": "int32"
        }
      },
      "Map_String": {
        "title": "Map_String",
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "McpServerSyncResponse": {
        "title": "McpServerSyncResponse",
        "type": "object",
        "required": [
          "imported",
          "updated",
          "disabled"
        ],
        "properties": {
          "imported": {
            "type": "integer",
            "format": "int32"
          },
          "updated": {
            "type": "integer",
            "format": "int32"
          },
          "disabled": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "driftSummary": {},
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "McpServerTestResponse": {
        "title": "McpServerTestResponse",
        "type": "object",
        "required": [
          "status",
          "serverName",
          "toolCount"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "serverName": {
            "type": "string"
          },
          "toolCount": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "MembershipRemovalPreview": {
        "title": "MembershipRemovalPreview",
        "type": "object",
        "required": [
          "organizationId",
          "organizationName",
          "role"
        ],
        "properties": {
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "organizationName": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      },
      "ModelData": {
        "title": "ModelData",
        "type": "object",
        "required": [
          "id",
          "object",
          "created",
          "owned_by"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "owned_by": {
            "type": "string"
          }
        }
      },
      "ModelListResponse": {
        "title": "ModelListResponse",
        "type": "object",
        "required": [
          "object"
        ],
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelData"
            }
          }
        }
      },
      "OpenApiHealEventActionRequest": {
        "title": "OpenApiHealEventActionRequest",
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "reviewNotes": {
            "type": "string"
          }
        }
      },
      "OpenApiHealEventDto": {
        "title": "OpenApiHealEventDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "projectId",
          "toolRevisionId",
          "toolName",
          "statusCode",
          "eventStatus",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "toolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "toolName": {
            "type": "string"
          },
          "bindingAlias": {
            "type": "string"
          },
          "httpMethod": {
            "type": "string"
          },
          "pathTemplate": {
            "type": "string"
          },
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "eventStatus": {
            "type": "string"
          },
          "policyMode": {
            "type": "string"
          },
          "failureFingerprint": {
            "type": "string"
          },
          "diagnosis": {},
          "verification": {},
          "proposedPatch": {},
          "appliedToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "reviewedBy": {
            "type": "string",
            "format": "uuid"
          },
          "reviewNotes": {
            "type": "string"
          },
          "lastError": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OpenApiSourceDto": {
        "title": "OpenApiSourceDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "serviceName",
          "activeToolCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceName": {
            "type": "string"
          },
          "swaggerUrl": {
            "type": "string"
          },
          "serverUrlOverride": {
            "type": "string"
          },
          "defaultSpecBaseUrl": {
            "type": "string"
          },
          "lastImportedVersion": {
            "type": "string"
          },
          "activeToolCount": {
            "type": "integer",
            "format": "int32"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OpenApiSourceSnapshotDto": {
        "title": "OpenApiSourceSnapshotDto",
        "type": "object",
        "required": [
          "id",
          "sourceId",
          "specHash",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "specHash": {
            "type": "string"
          },
          "openapiVersion": {
            "type": "string"
          },
          "serviceVersion": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OpenApiSourceSyncApplyRequest": {
        "title": "OpenApiSourceSyncApplyRequest",
        "type": "object",
        "properties": {
          "dryRun": {
            "type": "boolean"
          },
          "autoApplyCompatible": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "ticketRef": {
            "type": "string"
          }
        }
      },
      "OpenApiSourceSyncOperationDiffDto": {
        "title": "OpenApiSourceSyncOperationDiffDto",
        "type": "object",
        "required": [
          "operationKey",
          "changeType",
          "compatibility",
          "reason"
        ],
        "properties": {
          "operationKey": {
            "type": "string"
          },
          "changeType": {
            "type": "string"
          },
          "compatibility": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "oldToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "newToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "oldContractHash": {
            "type": "string"
          },
          "newContractHash": {
            "type": "string"
          },
          "reasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolRevisionCompatibilityReasonDto"
            }
          }
        }
      },
      "OpenApiSourceSyncPreviewDto": {
        "title": "OpenApiSourceSyncPreviewDto",
        "type": "object",
        "required": [
          "sourceId",
          "impactedEnabledBindings",
          "impactedScenarioRefs",
          "canAutoApply"
        ],
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "swaggerUrl": {
            "type": "string"
          },
          "serviceVersion": {
            "type": "string"
          },
          "sourceSpecHash": {
            "type": "string"
          },
          "addedOperations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "changedOperations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "removedOperations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unchangedOperations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "impactedEnabledBindings": {
            "type": "integer",
            "format": "int32"
          },
          "impactedScenarioRefs": {
            "type": "integer",
            "format": "int32"
          },
          "operationDiffs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpenApiSourceSyncOperationDiffDto"
            }
          },
          "canAutoApply": {
            "type": "boolean"
          }
        }
      },
      "OpenApiSourceSyncRunDto": {
        "title": "OpenApiSourceSyncRunDto",
        "type": "object",
        "required": [
          "id",
          "sourceId",
          "status",
          "startedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "summaryJson": {},
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrgCloudProviderDto": {
        "title": "OrgCloudProviderDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "vendor",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "OrgCloudProviderListResponse": {
        "title": "OrgCloudProviderListResponse",
        "type": "object",
        "required": [
          "policy"
        ],
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgCloudProviderDto"
            }
          },
          "policy": {
            "$ref": "#/components/schemas/LlmProviderPolicyDto"
          }
        }
      },
      "OrgCustomProviderDto": {
        "title": "OrgCustomProviderDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "vendorType",
          "litellmParams"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "vendorType": {
            "type": "string"
          },
          "apiBase": {
            "type": "string"
          },
          "litellmParams": {}
        }
      },
      "OrgCustomProviderListResponse": {
        "title": "OrgCustomProviderListResponse",
        "type": "object",
        "required": [
          "policy"
        ],
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgCustomProviderDto"
            }
          },
          "policy": {
            "$ref": "#/components/schemas/LlmProviderPolicyDto"
          }
        }
      },
      "OrgDetailDto": {
        "title": "OrgDetailDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "sessionRetentionDays",
          "auditRetentionDays",
          "debugContentAccessEnabled",
          "autoScenarioEnabled",
          "outboundUrlPolicyAllowHttpUrls",
          "outboundUrlPolicyOrgHttpDeploymentAllowed"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "systemPrompt": {
            "type": "string"
          },
          "defaultModel": {
            "type": "string"
          },
          "allowedModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retrievalEnabled": {
            "type": "boolean"
          },
          "embeddingModel": {
            "type": "string"
          },
          "planSlug": {
            "type": "string"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimitsDto"
          },
          "usage": {
            "$ref": "#/components/schemas/PlanUsageDto"
          },
          "llmQuota": {
            "$ref": "#/components/schemas/LlmQuotaDto"
          },
          "sessionRetentionDays": {
            "type": "integer",
            "format": "int32"
          },
          "auditRetentionDays": {
            "type": "integer",
            "format": "int32"
          },
          "plannerMode": {
            "type": "string"
          },
          "dekRotationStatus": {
            "type": "string"
          },
          "currentDekVersion": {
            "type": "integer",
            "format": "int32"
          },
          "targetDekVersion": {
            "type": "integer",
            "format": "int32"
          },
          "dekRotationError": {
            "type": "string"
          },
          "resolvedChatModel": {
            "type": "string"
          },
          "supportsStructuredOutputs": {
            "type": "boolean"
          },
          "debugContentAccessEnabled": {
            "type": "boolean"
          },
          "debugContentAccessEnabledAt": {
            "type": "string"
          },
          "debugContentAccessEnabledBy": {
            "type": "string",
            "format": "uuid"
          },
          "autoScenarioEnabled": {
            "type": "boolean"
          },
          "autoScenarioEnabledAt": {
            "type": "string"
          },
          "autoScenarioEnabledBy": {
            "type": "string",
            "format": "uuid"
          },
          "llmProviderHealth": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LlmProviderHealthDto"
            }
          },
          "outboundUrlPolicyAllowHttpUrls": {
            "type": "boolean"
          },
          "outboundUrlPolicyOrgHttpDeploymentAllowed": {
            "type": "boolean"
          }
        }
      },
      "OrgDto": {
        "title": "OrgDto",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "OrgImportOpenApiAcceptedResponse": {
        "title": "OrgImportOpenApiAcceptedResponse",
        "type": "object",
        "required": [
          "jobId",
          "status"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "OrgImportOpenApiJobDto": {
        "title": "OrgImportOpenApiJobDto",
        "type": "object",
        "required": [
          "jobId",
          "orgId",
          "status",
          "swaggerUrl",
          "includeDeprecated",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "swaggerUrl": {
            "type": "string"
          },
          "includeDeprecated": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "result": {
            "$ref": "#/components/schemas/OrgImportOpenApiResponse"
          },
          "errorMessage": {
            "type": "string"
          }
        }
      },
      "OrgImportOpenApiRequest": {
        "title": "OrgImportOpenApiRequest",
        "type": "object",
        "required": [
          "swaggerUrl"
        ],
        "properties": {
          "swaggerUrl": {
            "type": "string"
          },
          "includeDeprecated": {
            "type": "boolean"
          }
        }
      },
      "OrgImportOpenApiResponse": {
        "title": "OrgImportOpenApiResponse",
        "type": "object",
        "required": [
          "imported",
          "serviceName",
          "version"
        ],
        "properties": {
          "imported": {
            "type": "integer",
            "format": "int32"
          },
          "serviceName": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "OrgMcpServerDto": {
        "title": "OrgMcpServerDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "transport",
          "command",
          "env",
          "enabled",
          "syncEnabled",
          "toolCount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "env": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          },
          "syncEnabled": {
            "type": "boolean"
          },
          "lastSyncAt": {
            "type": "string"
          },
          "lastSyncStatus": {
            "type": "string"
          },
          "lastSyncMessage": {
            "type": "string"
          },
          "toolCount": {
            "type": "integer",
            "format": "int32"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "OrgMemberDto": {
        "title": "OrgMemberDto",
        "type": "object",
        "required": [
          "userId",
          "role",
          "createdAt"
        ],
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrgMemberSelfResponse": {
        "title": "OrgMemberSelfResponse",
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string"
          }
        }
      },
      "OrgRenameServiceRequest": {
        "title": "OrgRenameServiceRequest",
        "type": "object",
        "required": [
          "newName"
        ],
        "properties": {
          "newName": {
            "type": "string"
          }
        }
      },
      "OrgSpendResponse": {
        "title": "OrgSpendResponse",
        "type": "object",
        "required": [
          "orgId",
          "orgName",
          "llmPromptTokens7d",
          "llmCompletionTokens7d",
          "llmTotalTokens7d",
          "llmPromptTokens30d",
          "llmCompletionTokens30d",
          "llmTotalTokens30d",
          "llmEstimatedSpendUsd7d",
          "llmEstimatedSpendUsd30d",
          "llmUnpricedPromptTokens7d",
          "llmUnpricedCompletionTokens7d",
          "llmUnpricedPromptTokens30d",
          "llmUnpricedCompletionTokens30d",
          "hasSessionTags"
        ],
        "properties": {
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "orgName": {
            "type": "string"
          },
          "llmPromptTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmCompletionTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTotalTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmPromptTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmCompletionTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTotalTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmEstimatedSpendUsd7d": {
            "type": "number",
            "format": "double"
          },
          "llmEstimatedSpendUsd30d": {
            "type": "number",
            "format": "double"
          },
          "llmUnpricedPromptTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedCompletionTokens7d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedPromptTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmUnpricedCompletionTokens30d": {
            "type": "integer",
            "format": "int64"
          },
          "llmTokensByDay": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardDailyLlmTokens"
            }
          },
          "llmTokensByModel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardModelTokens"
            }
          },
          "llmTokensByProjectModel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardProjectModelTokens"
            }
          },
          "llmTokensBySource": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgSpendSourceTokens"
            }
          },
          "hasSessionTags": {
            "type": "boolean"
          },
          "llmCostByTag": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LlmTagTokenBucket"
            }
          },
          "llmQuota": {
            "$ref": "#/components/schemas/LlmQuotaDto"
          }
        }
      },
      "OrgSpendSourceTokens": {
        "title": "OrgSpendSourceTokens",
        "type": "object",
        "required": [
          "source",
          "promptTokens",
          "completionTokens",
          "totalTokens"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "promptTokens": {
            "type": "integer",
            "format": "int64"
          },
          "completionTokens": {
            "type": "integer",
            "format": "int64"
          },
          "totalTokens": {
            "type": "integer",
            "format": "int64"
          },
          "estimatedSpendUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "OrgToolDto": {
        "title": "OrgToolDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "version",
          "logicalToolId",
          "revisionStatus"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "serviceName": {
            "type": "string"
          },
          "serviceVersion": {
            "type": "string"
          },
          "sourceType": {
            "type": "string"
          },
          "executionMode": {
            "type": "string"
          },
          "sourceRefId": {
            "type": "string",
            "format": "uuid"
          },
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "revisionStatus": {
            "type": "string"
          },
          "supersedesToolId": {
            "type": "string",
            "format": "uuid"
          },
          "isTransactional": {
            "type": "boolean"
          },
          "isDeprecated": {
            "description": "From org tool spec `settings.isDeprecated` when present.",
            "type": "boolean"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "OrgUpdateToolRequest": {
        "title": "OrgUpdateToolRequest",
        "type": "object",
        "required": [
          "name",
          "version",
          "spec"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "spec": {},
          "compatibilityHint": {
            "type": "string"
          }
        }
      },
      "OutboundWebhookDto": {
        "title": "OutboundWebhookDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "method",
          "url",
          "headers",
          "query",
          "authType",
          "authConfig",
          "enabled",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "headers": {
            "$ref": "#/components/schemas/Map_String"
          },
          "query": {
            "$ref": "#/components/schemas/Map_String"
          },
          "bodyTemplate": {},
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          },
          "toolId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "lifecycle": {
            "$ref": "#/components/schemas/IntegrationLifecycleDto"
          }
        }
      },
      "PaginatedResponse_A": {
        "title": "PaginatedResponse_A",
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgDto"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          },
          "offset": {
            "type": "integer",
            "format": "int32"
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "PatchOrgCloudProviderRequest": {
        "title": "PatchOrgCloudProviderRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "PatchUiPreferencesRequest": {
        "title": "PatchUiPreferencesRequest",
        "type": "object",
        "properties": {
          "theme": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "tableDensity": {
            "type": "string"
          },
          "contentWidth": {
            "type": "string"
          },
          "runtimeProjectApiKeys": {
            "$ref": "#/components/schemas/Map_String"
          }
        }
      },
      "PlanLimitsDto": {
        "title": "PlanLimitsDto",
        "type": "object",
        "properties": {
          "maxProjectsPerOrg": {
            "type": "integer",
            "format": "int32"
          },
          "maxMembersPerOrg": {
            "type": "integer",
            "format": "int32"
          },
          "maxOrgsAsOwnerPerUser": {
            "type": "integer",
            "format": "int32"
          },
          "maxProjectApiKeysPerProject": {
            "type": "integer",
            "format": "int32"
          },
          "maxTokensPerPeriod": {
            "type": "integer",
            "format": "int64"
          },
          "periodReset": {
            "type": "string"
          }
        }
      },
      "PlanUsageDto": {
        "title": "PlanUsageDto",
        "type": "object",
        "required": [
          "projectCount",
          "memberCount"
        ],
        "properties": {
          "projectCount": {
            "type": "integer",
            "format": "int64"
          },
          "memberCount": {
            "type": "integer",
            "format": "int64"
          },
          "llmTokensCurrentPeriod": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PolicyConsentAcceptRequest": {
        "title": "PolicyConsentAcceptRequest",
        "type": "object",
        "required": [
          "privacyVersion",
          "termsOfServiceVersion",
          "demoAcknowledged"
        ],
        "properties": {
          "privacyVersion": {
            "type": "string"
          },
          "termsOfServiceVersion": {
            "type": "string"
          },
          "demoAcknowledged": {
            "type": "boolean"
          }
        }
      },
      "PolicyConsentStatusDto": {
        "title": "PolicyConsentStatusDto",
        "type": "object",
        "required": [
          "needsAcceptance",
          "requiredPrivacyVersion",
          "requiredTermsOfServiceVersion",
          "demoMode"
        ],
        "properties": {
          "needsAcceptance": {
            "type": "boolean"
          },
          "requiredPrivacyVersion": {
            "type": "string"
          },
          "requiredTermsOfServiceVersion": {
            "type": "string"
          },
          "demoMode": {
            "type": "boolean"
          },
          "requiredDemoDisclaimerVersion": {
            "type": "string"
          },
          "lastAcceptedPrivacyVersion": {
            "type": "string"
          },
          "lastAcceptedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastAcceptedTermsOfServiceVersion": {
            "type": "string"
          },
          "lastDemoDisclaimerVersion": {
            "type": "string"
          },
          "lastDemoAck": {
            "type": "boolean"
          }
        }
      },
      "ProblemDetail": {
        "title": "ProblemDetail",
        "type": "object",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationFieldError"
            }
          },
          "extensions": {}
        }
      },
      "ProjectApiKeyDto": {
        "title": "ProjectApiKeyDto",
        "type": "object",
        "required": [
          "id",
          "keyPreview",
          "createdAt",
          "isPrimary"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "keyPreview": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "isPrimary": {
            "type": "boolean"
          }
        }
      },
      "ProjectDetailDto": {
        "title": "ProjectDetailDto",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "systemPrompt": {
            "type": "string"
          },
          "defaultModel": {
            "type": "string"
          },
          "allowedModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "swaggerUrl": {
            "type": "string"
          },
          "maxReplans": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalEnabled": {
            "type": "boolean"
          },
          "retrievalMaxTools": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier1Max": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier2Max": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier3Max": {
            "type": "integer",
            "format": "int32"
          },
          "toolRetrievalMode": {
            "type": "string"
          },
          "embeddingModel": {
            "type": "string"
          },
          "maxPlannerAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "utilityModel": {
            "type": "string"
          },
          "plannerMode": {
            "type": "string"
          },
          "resolvedChatModel": {
            "type": "string"
          },
          "supportsStructuredOutputs": {
            "type": "boolean"
          },
          "planApprovalMode": {
            "type": "string"
          }
        }
      },
      "ProjectDto": {
        "title": "ProjectDto",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "ProjectKnowledgeProviderBindingDto": {
        "title": "ProjectKnowledgeProviderBindingDto",
        "type": "object",
        "required": [
          "bound",
          "projectId",
          "providerConfig",
          "enabled",
          "includePlannerKbContext"
        ],
        "properties": {
          "bound": {
            "type": "boolean"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerName": {
            "type": "string"
          },
          "providerConfig": {},
          "enabled": {
            "type": "boolean"
          },
          "timeoutMs": {
            "type": "integer",
            "format": "int32"
          },
          "topK": {
            "type": "integer",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "format": "double"
          },
          "maxContextChars": {
            "type": "integer",
            "format": "int32"
          },
          "toolSelectionKbChars": {
            "type": "integer",
            "format": "int32"
          },
          "failurePolicy": {
            "type": "string"
          },
          "includePlannerKbContext": {
            "type": "boolean"
          }
        }
      },
      "ProjectLlmModelsResponse": {
        "title": "ProjectLlmModelsResponse",
        "type": "object",
        "properties": {
          "localModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projectModels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectModelEntry"
            }
          },
          "orgModels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectModelEntry"
            }
          }
        }
      },
      "ProjectModelEntry": {
        "title": "ProjectModelEntry",
        "type": "object",
        "required": [
          "modelName",
          "provider",
          "providerModel"
        ],
        "properties": {
          "modelName": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerModel": {
            "type": "string"
          },
          "modelType": {
            "type": "string"
          },
          "apiBase": {
            "type": "string"
          },
          "litellmParams": {}
        }
      },
      "ProjectNotificationWebhookDto": {
        "title": "ProjectNotificationWebhookDto",
        "type": "object",
        "required": [
          "enabled",
          "secretConfigured",
          "updatedAt"
        ],
        "properties": {
          "url": {
            "description": "HTTPS URL PlanVault POSTs lifecycle JSON to; empty when not set.",
            "type": "string"
          },
          "enabled": {
            "description": "When false, no outbound lifecycle webhooks are sent.",
            "type": "boolean"
          },
          "eventTypes": {
            "description": "Subscribed types: session.completed, session.failed, session.requires_action, session.interrupted, session.recovery_required. Empty save while enabled is normalized server-side to all supported types.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "secretConfigured": {
            "description": "Whether a signing secret exists (rotate-secret to issue or replace). Required before deliveries.",
            "type": "boolean"
          },
          "updatedAt": {
            "description": "Last update time (ISO-8601).",
            "type": "string"
          }
        }
      },
      "ProjectOpenApiSourceRuntimeConfigDto": {
        "title": "ProjectOpenApiSourceRuntimeConfigDto",
        "type": "object",
        "required": [
          "projectId",
          "sourceId"
        ],
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "swaggerUrl": {
            "type": "string"
          },
          "sourceServerUrlOverride": {
            "type": "string"
          },
          "projectServerUrlOverride": {
            "type": "string"
          },
          "defaultSpecBaseUrl": {
            "type": "string"
          },
          "specBaseUrlFallback": {
            "type": "string"
          },
          "effectiveServerUrl": {
            "type": "string"
          }
        }
      },
      "ProjectOperationsOverviewDto": {
        "title": "ProjectOperationsOverviewDto",
        "type": "object",
        "required": [
          "windowHours",
          "windowStart",
          "runsInWindow",
          "failedRunsInWindow"
        ],
        "properties": {
          "windowHours": {
            "type": "integer",
            "format": "int32"
          },
          "windowStart": {
            "type": "string",
            "format": "date-time"
          },
          "sessionStatusCounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionStatusCountDto"
            }
          },
          "runsInWindow": {
            "type": "integer",
            "format": "int64"
          },
          "failedRunsInWindow": {
            "type": "integer",
            "format": "int64"
          },
          "errorRate": {
            "type": "number",
            "format": "double"
          },
          "avgRunDurationSeconds": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProjectWebhookTriggerDto": {
        "title": "ProjectWebhookTriggerDto",
        "type": "object",
        "required": [
          "id",
          "orgId",
          "projectId",
          "name",
          "triggerKey",
          "enabled",
          "sessionSecretPaths",
          "contextPaths",
          "authType",
          "authConfig",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "projectName": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "triggerKey": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "promptTemplate": {
            "type": "string"
          },
          "sessionUserPath": {
            "type": "string"
          },
          "sessionSecretPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "contextPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "PromoteScenarioRequest": {
        "title": "PromoteScenarioRequest",
        "type": "object",
        "properties": {
          "overrideName": {
            "type": "string"
          },
          "overrideDescription": {
            "type": "string"
          }
        }
      },
      "PromptRequest": {
        "title": "PromptRequest",
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "description": "User message text sent to the planner.",
            "type": "string"
          }
        }
      },
      "PromptResponse": {
        "title": "PromptResponse",
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "description": "Immediate acknowledgement, e.g. Processing started.",
            "type": "string"
          },
          "messageId": {
            "description": "Correlation id for this user message; matches `meta.messageId` on the `prompt` row in GET /history and the session timeline. Present for POST .../messages (202 Accepted); omitted for script-only paths.",
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ProviderCatalogResponse": {
        "title": "ProviderCatalogResponse",
        "type": "object",
        "required": [
          "provider"
        ],
        "properties": {
          "provider": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogModelEntry"
            }
          }
        }
      },
      "ProviderModel": {
        "title": "ProviderModel",
        "type": "object",
        "required": [
          "modelName"
        ],
        "properties": {
          "modelName": {
            "type": "string"
          },
          "routedModel": {
            "type": "string"
          }
        }
      },
      "ProviderModels": {
        "title": "ProviderModels",
        "type": "object",
        "required": [
          "provider"
        ],
        "properties": {
          "provider": {
            "type": "string"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderModel"
            }
          }
        }
      },
      "RecurringScheduleActionResponse": {
        "title": "RecurringScheduleActionResponse",
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "RecurringScheduleResponse": {
        "title": "RecurringScheduleResponse",
        "type": "object",
        "required": [
          "id",
          "projectId",
          "status",
          "targetType",
          "scheduleKind",
          "timezone",
          "rule",
          "nextFireAt",
          "catchupPolicy",
          "consecutiveFailures",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "targetType": {
            "type": "string"
          },
          "targetSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "scheduleKind": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "rule": {},
          "nextFireAt": {
            "type": "string"
          },
          "lastFiredAt": {
            "type": "string"
          },
          "lastCatchupAt": {
            "type": "string"
          },
          "catchupPolicy": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "format": "int32"
          },
          "lastError": {
            "type": "string"
          },
          "lastSpawnedJobId": {
            "type": "string",
            "format": "uuid"
          },
          "pausedAt": {
            "type": "string"
          },
          "disabledAt": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "ReplayRunListItem": {
        "title": "ReplayRunListItem",
        "type": "object",
        "required": [
          "runId",
          "sourceRunId",
          "status",
          "createdAt"
        ],
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceRunId": {
            "type": "string",
            "format": "uuid"
          },
          "replayMode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "terminalReason": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "terminalAt": {
            "type": "string",
            "format": "date-time"
          },
          "replayCheckpointGraphNodeId": {
            "type": "string"
          },
          "replayCheckpointOccurrence": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReplayRunRequest": {
        "title": "ReplayRunRequest",
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string"
          },
          "parameterOverrides": {},
          "toolOverrides": {
            "$ref": "#/components/schemas/Map_String"
          },
          "startFromGraphNodeId": {
            "type": "string"
          },
          "startFromCompletionIndex": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReplayRunResponse": {
        "title": "ReplayRunResponse",
        "type": "object",
        "required": [
          "replayRunId",
          "sourceRunId",
          "mode"
        ],
        "properties": {
          "replayRunId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceRunId": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "type": "string"
          }
        }
      },
      "ReplayRunStatusResponse": {
        "title": "ReplayRunStatusResponse",
        "type": "object",
        "required": [
          "runId",
          "sessionId",
          "status",
          "createdAt"
        ],
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceRunId": {
            "type": "string",
            "format": "uuid"
          },
          "replayMode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "terminalReason": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "terminalAt": {
            "type": "string",
            "format": "date-time"
          },
          "replayCheckpointGraphNodeId": {
            "type": "string"
          },
          "replayCheckpointOccurrence": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReplayRunsForSourceResponse": {
        "title": "ReplayRunsForSourceResponse",
        "type": "object",
        "required": [
          "sessionId",
          "sourceRunId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceRunId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplayRunListItem"
            }
          }
        }
      },
      "RotateAuditLogWebhookSecretResponse": {
        "title": "RotateAuditLogWebhookSecretResponse",
        "type": "object",
        "required": [
          "webhookSecret"
        ],
        "properties": {
          "webhookSecret": {
            "type": "string"
          }
        }
      },
      "RotateDekResponse": {
        "title": "RotateDekResponse",
        "type": "object",
        "required": [
          "status",
          "currentDekVersion",
          "targetDekVersion"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "currentDekVersion": {
            "type": "integer",
            "format": "int32"
          },
          "targetDekVersion": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RotateNotificationWebhookSecretResponse": {
        "title": "RotateNotificationWebhookSecretResponse",
        "type": "object",
        "required": [
          "webhookSecret"
        ],
        "properties": {
          "webhookSecret": {
            "description": "Plaintext HMAC key for X-Signature verification; store in your secret manager; shown once only.",
            "type": "string"
          }
        }
      },
      "RotateProjectApiKeyResponse": {
        "title": "RotateProjectApiKeyResponse",
        "type": "object",
        "required": [
          "apiKey"
        ],
        "properties": {
          "apiKey": {
            "description": "New Runtime API key (sk_live_…); store securely; not shown again.",
            "type": "string"
          }
        }
      },
      "RunDiagnosticsItem": {
        "title": "RunDiagnosticsItem",
        "type": "object",
        "required": [
          "id",
          "seqNo",
          "occurredAt",
          "visibility",
          "eventKind",
          "payload"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "seqNo": {
            "type": "integer",
            "format": "int64"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "visibility": {
            "type": "string"
          },
          "eventKind": {
            "type": "string"
          },
          "phase": {
            "type": "string"
          },
          "graphStepType": {
            "type": "string"
          },
          "graphNodeId": {
            "type": "string"
          },
          "graphEdgeId": {
            "type": "string"
          },
          "graphVersion": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          },
          "messageId": {
            "type": "string",
            "format": "uuid"
          },
          "llmCallId": {
            "type": "string"
          },
          "toolExecutionId": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer",
            "format": "int32"
          },
          "outcome": {
            "type": "string"
          },
          "errorClass": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "payload": {}
        }
      },
      "RunDiagnosticsResponse": {
        "title": "RunDiagnosticsResponse",
        "type": "object",
        "required": [
          "sessionId",
          "runId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunDiagnosticsItem"
            }
          }
        }
      },
      "RunDiffResponse": {
        "title": "RunDiffResponse",
        "type": "object",
        "required": [
          "originalRunId",
          "replayRunId",
          "planChanged",
          "summaryDiff"
        ],
        "properties": {
          "originalRunId": {
            "type": "string",
            "format": "uuid"
          },
          "replayRunId": {
            "type": "string",
            "format": "uuid"
          },
          "planChanged": {
            "type": "boolean"
          },
          "stepDiffs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepDiff"
            }
          },
          "summaryDiff": {
            "$ref": "#/components/schemas/SummaryDiff"
          }
        }
      },
      "RunTimelineItem": {
        "title": "RunTimelineItem",
        "type": "object",
        "required": [
          "id",
          "seqNo",
          "occurredAt",
          "eventKind",
          "payload"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "seqNo": {
            "type": "integer",
            "format": "int64"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "eventKind": {
            "type": "string"
          },
          "phase": {
            "type": "string"
          },
          "graphStepType": {
            "type": "string"
          },
          "graphNodeId": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer",
            "format": "int32"
          },
          "outcome": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "payload": {}
        }
      },
      "RunTimelineResponse": {
        "title": "RunTimelineResponse",
        "type": "object",
        "required": [
          "sessionId",
          "runId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunTimelineItem"
            }
          }
        }
      },
      "ScenarioDto": {
        "title": "ScenarioDto",
        "type": "object",
        "required": [
          "id",
          "source",
          "queryText",
          "compatibilityStatus",
          "priority",
          "usageCount",
          "successRate",
          "isActive",
          "createdAt",
          "updatedAt",
          "suggestionEligible",
          "canonicalPlanScore",
          "vectorCount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "queryText": {
            "type": "string"
          },
          "toolNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "toolRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioToolRefDto"
            }
          },
          "compatibilityStatus": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "usageCount": {
            "type": "integer",
            "format": "int32"
          },
          "successRate": {
            "type": "number",
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "systemInstruction": {
            "type": "string"
          },
          "structuralHash": {
            "type": "string"
          },
          "suggestionEligible": {
            "type": "boolean"
          },
          "canonicalPlan": {},
          "canonicalPlanScore": {
            "type": "number",
            "format": "double"
          },
          "vectorCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ScenarioImpactPreviewDto": {
        "title": "ScenarioImpactPreviewDto",
        "type": "object",
        "required": [
          "id",
          "queryPreview",
          "impact"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "queryPreview": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "impact": {
            "type": "string"
          }
        }
      },
      "ScenarioToolRefDto": {
        "title": "ScenarioToolRefDto",
        "type": "object",
        "required": [
          "displayName",
          "compatibilityStatus"
        ],
        "properties": {
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "toolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "displayName": {
            "type": "string"
          },
          "dslAlias": {
            "type": "string"
          },
          "compatibilityStatus": {
            "type": "string"
          }
        }
      },
      "ScenarioVectorDiversityDto": {
        "title": "ScenarioVectorDiversityDto",
        "type": "object",
        "properties": {
          "minInterVectorCosine": {
            "type": "number",
            "format": "double"
          },
          "maxInterVectorCosine": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ScheduledJobResponse": {
        "title": "ScheduledJobResponse",
        "type": "object",
        "required": [
          "id",
          "projectId",
          "status",
          "targetType",
          "fireAt",
          "attemptCount",
          "maxAttempts",
          "nextAttemptAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "targetType": {
            "type": "string"
          },
          "fireAt": {
            "type": "string"
          },
          "attemptCount": {
            "type": "integer",
            "format": "int32"
          },
          "maxAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "nextAttemptAt": {
            "type": "string"
          },
          "claimedAt": {
            "type": "string"
          },
          "cancelledAt": {
            "type": "string"
          },
          "dispatchedAt": {
            "type": "string"
          },
          "dispatchedSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "completedAt": {
            "type": "string"
          },
          "failedAt": {
            "type": "string"
          },
          "lastError": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "SecretListResponse": {
        "title": "SecretListResponse",
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SessionActionRequest": {
        "title": "SessionActionRequest",
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "description": "One of: approve, reject, fill_slots.",
            "type": "string"
          },
          "stepId": {
            "description": "Optional plan step id when the FSM requires it.",
            "type": "string"
          },
          "values": {
            "$ref": "#/components/schemas/Map_String",
            "description": "Slot key-value map when action is fill_slots."
          },
          "reportedOperator": {
            "description": "When using project API key only: optional operator hint for audit (untrusted). Ignored when using admin JWT.",
            "type": "string"
          }
        }
      },
      "SessionFeedbackRequest": {
        "title": "SessionFeedbackRequest",
        "type": "object",
        "required": [
          "feedback"
        ],
        "properties": {
          "feedback": {
            "description": "One of: like, dislike.",
            "type": "string"
          },
          "runId": {
            "description": "Optional run id; if omitted the latest run or messageId-derived run is used.",
            "type": "string",
            "format": "uuid"
          },
          "messageId": {
            "description": "Optional prompt message id for run lookup; useful when runId is unknown.",
            "type": "string",
            "format": "uuid"
          },
          "comment": {
            "description": "Optional short feedback note.",
            "type": "string"
          },
          "reportedOperator": {
            "description": "When using project API key only: optional operator hint for audit/attribution.",
            "type": "string"
          }
        }
      },
      "SessionHistoryResponse": {
        "title": "SessionHistoryResponse",
        "type": "object",
        "required": [
          "sessionId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryItem"
            }
          }
        }
      },
      "SessionIncidentListItemDto": {
        "title": "SessionIncidentListItemDto",
        "type": "object",
        "required": [
          "id",
          "sessionId",
          "runId",
          "errorType",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "errorType": {
            "type": "string"
          },
          "errorSummary": {
            "type": "string"
          },
          "terminalReason": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SessionListItem": {
        "title": "SessionListItem",
        "type": "object",
        "required": [
          "id",
          "externalUserId",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "externalUserId": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SessionPrivilegedListItem": {
        "title": "SessionPrivilegedListItem",
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "externalUserId",
          "status",
          "authorSummary"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "externalUserId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdByType": {
            "type": "string"
          },
          "authorSummary": {
            "type": "string"
          }
        }
      },
      "SessionResponse": {
        "title": "SessionResponse",
        "type": "object",
        "required": [
          "id",
          "status",
          "usage"
        ],
        "properties": {
          "id": {
            "description": "Session UUID.",
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "description": "Initial lifecycle status, e.g. PLANNING.",
            "type": "string"
          },
          "usage": {
            "description": "Token/cost usage object; often empty at creation."
          }
        }
      },
      "SessionSecretKeysResponse": {
        "title": "SessionSecretKeysResponse",
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SessionStatusCountDto": {
        "title": "SessionStatusCountDto",
        "type": "object",
        "required": [
          "status",
          "count"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SessionTypedRegistryPolicyRequest": {
        "title": "SessionTypedRegistryPolicyRequest",
        "type": "object",
        "required": [
          "defaultTtlPolicy"
        ],
        "properties": {
          "defaultTtlPolicy": {
            "$ref": "#/components/schemas/SessionTypedVariableTtlPolicy"
          }
        }
      },
      "SessionTypedRegistryPolicyResponse": {
        "title": "SessionTypedRegistryPolicyResponse",
        "type": "object",
        "required": [
          "scope",
          "effectiveDefaultTtlPolicy",
          "clampedToSessionRetention"
        ],
        "properties": {
          "scope": {
            "type": "string"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "defaultTtlPolicy": {
            "$ref": "#/components/schemas/SessionTypedVariableTtlPolicy"
          },
          "inheritedDefaultTtlPolicy": {
            "$ref": "#/components/schemas/SessionTypedVariableTtlPolicy"
          },
          "effectiveDefaultTtlPolicy": {
            "$ref": "#/components/schemas/SessionTypedVariableTtlPolicy"
          },
          "clampedToSessionRetention": {
            "type": "boolean"
          }
        }
      },
      "SessionTypedVariableDebugItem": {
        "title": "SessionTypedVariableDebugItem",
        "type": "object",
        "required": [
          "name",
          "typeName",
          "source",
          "updatedAt",
          "status",
          "expired"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "typeName": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "sourceRunId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "expired": {
            "type": "boolean"
          }
        }
      },
      "SessionTypedVariableDebugResponse": {
        "title": "SessionTypedVariableDebugResponse",
        "type": "object",
        "required": [
          "sessionId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionTypedVariableDebugItem"
            }
          }
        }
      },
      "SessionTypedVariableTtlPolicy": {
        "title": "SessionTypedVariableTtlPolicy",
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string"
          },
          "seconds": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SetAutoScenarioEnabledRequest": {
        "title": "SetAutoScenarioEnabledRequest",
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "SetDebugContentAccessRequest": {
        "title": "SetDebugContentAccessRequest",
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "confirmationPhrase": {
            "type": "string"
          }
        }
      },
      "SoleOwnerOrganizationRef": {
        "title": "SoleOwnerOrganizationRef",
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "StepDiff": {
        "title": "StepDiff",
        "type": "object",
        "required": [
          "changed"
        ],
        "properties": {
          "graphNodeId": {
            "type": "string"
          },
          "toolName": {
            "type": "string"
          },
          "originalOutcome": {
            "type": "string"
          },
          "replayOutcome": {
            "type": "string"
          },
          "originalDurationMs": {
            "type": "integer",
            "format": "int32"
          },
          "replayDurationMs": {
            "type": "integer",
            "format": "int32"
          },
          "changed": {
            "type": "boolean"
          }
        }
      },
      "SummaryDiff": {
        "title": "SummaryDiff",
        "type": "object",
        "required": [
          "originalStatus",
          "replayStatus"
        ],
        "properties": {
          "originalStatus": {
            "type": "string"
          },
          "replayStatus": {
            "type": "string"
          },
          "originalDurationMs": {
            "type": "integer",
            "format": "int64"
          },
          "replayDurationMs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "TestKnowledgeProviderRequest": {
        "title": "TestKnowledgeProviderRequest",
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "TestKnowledgeProviderResponse": {
        "title": "TestKnowledgeProviderResponse",
        "type": "object",
        "required": [
          "status",
          "latencyMs",
          "contextPreview"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "chunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KnowledgeChunkDto"
            }
          },
          "latencyMs": {
            "type": "integer",
            "format": "int32"
          },
          "contextPreview": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "TestToolExecuteRequest": {
        "title": "TestToolExecuteRequest",
        "type": "object",
        "required": [
          "toolId",
          "params"
        ],
        "properties": {
          "toolId": {
            "type": "string"
          },
          "params": {}
        }
      },
      "TestToolExecuteResponse": {
        "title": "TestToolExecuteResponse",
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {}
        }
      },
      "TestToolSelectionRequest": {
        "title": "TestToolSelectionRequest",
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "toolRetrievalMode": {
            "type": "string"
          }
        }
      },
      "TestToolSelectionResponse": {
        "title": "TestToolSelectionResponse",
        "type": "object",
        "required": [
          "strategy",
          "totalCount"
        ],
        "properties": {
          "strategy": {
            "type": "string"
          },
          "scenarioTools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scenarioToolRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSelectionItemEntry"
            }
          },
          "retrievalTools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retrievalToolRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSelectionItemEntry"
            }
          },
          "finalTools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSelectionItemEntry"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ToolDetailDto": {
        "title": "ToolDetailDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "version",
          "spec",
          "logicalToolId",
          "revisionStatus"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "spec": {},
          "sourceType": {
            "type": "string"
          },
          "executionMode": {
            "type": "string"
          },
          "sourceRefId": {
            "type": "string",
            "format": "uuid"
          },
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "revisionStatus": {
            "type": "string"
          },
          "supersedesToolId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ToolRevisionCompatibilityAssessmentDto": {
        "title": "ToolRevisionCompatibilityAssessmentDto",
        "type": "object",
        "required": [
          "id",
          "semanticVerdict",
          "effectiveStatus",
          "summary",
          "analyzerVersion",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "oldToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "newToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "semanticVerdict": {
            "type": "string"
          },
          "effectiveStatus": {
            "type": "string"
          },
          "policyHint": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "reasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolRevisionCompatibilityReasonDto"
            }
          },
          "analyzerVersion": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ToolRevisionCompatibilityReasonDto": {
        "title": "ToolRevisionCompatibilityReasonDto",
        "type": "object",
        "required": [
          "code",
          "severity",
          "message",
          "section"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "section": {
            "type": "string"
          },
          "fieldPath": {
            "type": "string"
          },
          "oldValue": {
            "type": "string"
          },
          "newValue": {
            "type": "string"
          }
        }
      },
      "ToolRevisionLineageDto": {
        "title": "ToolRevisionLineageDto",
        "type": "object",
        "required": [
          "logicalToolId"
        ],
        "properties": {
          "logicalToolId": {
            "type": "string",
            "format": "uuid"
          },
          "activeToolRevisionId": {
            "type": "string",
            "format": "uuid"
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolRevisionLineageNodeDto"
            }
          }
        }
      },
      "ToolRevisionLineageNodeDto": {
        "title": "ToolRevisionLineageNodeDto",
        "type": "object",
        "required": [
          "id",
          "name",
          "version",
          "revisionStatus",
          "scenarioCompatibilityCounts"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "revisionStatus": {
            "type": "string"
          },
          "sourceType": {
            "type": "string"
          },
          "sourceRefId": {
            "type": "string",
            "format": "uuid"
          },
          "supersedesToolId": {
            "type": "string",
            "format": "uuid"
          },
          "scenarioCompatibilityCounts": {
            "$ref": "#/components/schemas/ToolRevisionScenarioCompatibilityCountsDto"
          },
          "assessmentFromPrevious": {
            "$ref": "#/components/schemas/ToolRevisionCompatibilityAssessmentDto"
          }
        }
      },
      "ToolRevisionScenarioCompatibilityCountsDto": {
        "title": "ToolRevisionScenarioCompatibilityCountsDto",
        "type": "object",
        "required": [
          "compatible",
          "needsReview",
          "stale"
        ],
        "properties": {
          "compatible": {
            "type": "integer",
            "format": "int32"
          },
          "needsReview": {
            "type": "integer",
            "format": "int32"
          },
          "stale": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ToolScenarioImpactReportDto": {
        "title": "ToolScenarioImpactReportDto",
        "type": "object",
        "required": [
          "scenariosImpacted",
          "scenarioRefsUpdated",
          "refsToRebind",
          "refsToMarkNeedsReview",
          "refsToMarkStale"
        ],
        "properties": {
          "scenariosImpacted": {
            "type": "integer",
            "format": "int32"
          },
          "scenarioRefsUpdated": {
            "type": "integer",
            "format": "int32"
          },
          "refsToRebind": {
            "type": "integer",
            "format": "int32"
          },
          "refsToMarkNeedsReview": {
            "type": "integer",
            "format": "int32"
          },
          "refsToMarkStale": {
            "type": "integer",
            "format": "int32"
          },
          "scenarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioImpactPreviewDto"
            }
          }
        }
      },
      "ToolSelectionItemEntry": {
        "title": "ToolSelectionItemEntry",
        "type": "object",
        "required": [
          "id",
          "name",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "score": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "TransferOrgOwnershipRequest": {
        "title": "TransferOrgOwnershipRequest",
        "type": "object",
        "required": [
          "targetUserId"
        ],
        "properties": {
          "targetUserId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "UiPreferencesDto": {
        "title": "UiPreferencesDto",
        "type": "object",
        "required": [
          "runtimeProjectApiKeys"
        ],
        "properties": {
          "theme": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "tableDensity": {
            "type": "string"
          },
          "contentWidth": {
            "type": "string"
          },
          "runtimeProjectApiKeys": {
            "$ref": "#/components/schemas/Map_String"
          }
        }
      },
      "UpdateAuditLogWebhookRequest": {
        "title": "UpdateAuditLogWebhookRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "filters": {
            "$ref": "#/components/schemas/AuditLogWebhookFilters"
          }
        }
      },
      "UpdateKnowledgeProviderRequest": {
        "title": "UpdateKnowledgeProviderRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "endpointUrl": {
            "type": "string"
          },
          "providerType": {
            "type": "string"
          },
          "providerConfig": {},
          "enabled": {
            "type": "boolean"
          },
          "timeoutMs": {
            "type": "integer",
            "format": "int32"
          },
          "topK": {
            "type": "integer",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "format": "double"
          },
          "maxContextChars": {
            "type": "integer",
            "format": "int32"
          },
          "toolSelectionKbChars": {
            "type": "integer",
            "format": "int32"
          },
          "failurePolicy": {
            "type": "string"
          },
          "authMode": {
            "type": "string"
          },
          "authHeaderName": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "clearApiKey": {
            "type": "boolean"
          }
        }
      },
      "UpdateOpenApiSourceRuntimeRequest": {
        "title": "UpdateOpenApiSourceRuntimeRequest",
        "type": "object",
        "properties": {
          "serverUrlOverride": {
            "type": "string"
          },
          "clearServerUrlOverride": {
            "type": "boolean"
          }
        }
      },
      "UpdateOrgCustomProviderRequest": {
        "title": "UpdateOrgCustomProviderRequest",
        "type": "object",
        "required": [
          "name",
          "vendorType"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "vendorType": {
            "type": "string"
          },
          "apiBase": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "litellmParams": {}
        }
      },
      "UpdateOrgMcpServerRequest": {
        "title": "UpdateOrgMcpServerRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "env": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          },
          "syncEnabled": {
            "type": "boolean"
          }
        }
      },
      "UpdateOrgMemberRoleRequest": {
        "title": "UpdateOrgMemberRoleRequest",
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string"
          }
        }
      },
      "UpdateOrgRequest": {
        "title": "UpdateOrgRequest",
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateOrgSettingsRequest": {
        "title": "UpdateOrgSettingsRequest",
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "systemPrompt": {
            "type": "string"
          },
          "defaultModel": {
            "type": "string"
          },
          "defaultProvider": {
            "type": "string"
          },
          "defaultProviderModel": {
            "type": "string"
          },
          "allowedModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "plannerMode": {
            "type": "string"
          },
          "retrievalEnabled": {
            "type": "boolean"
          },
          "embeddingModel": {
            "type": "string"
          },
          "sessionRetentionDays": {
            "type": "integer",
            "format": "int32"
          },
          "auditRetentionDays": {
            "type": "integer",
            "format": "int32"
          },
          "outboundUrlPolicyAllowHttpUrls": {
            "type": "boolean"
          }
        }
      },
      "UpdateOutboundWebhookRequest": {
        "title": "UpdateOutboundWebhookRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "headers": {
            "$ref": "#/components/schemas/Map_String"
          },
          "query": {
            "$ref": "#/components/schemas/Map_String"
          },
          "bodyTemplate": {},
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "signRequest": {
            "type": "boolean"
          },
          "signatureHeader": {
            "type": "string"
          },
          "signatureSecretRef": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UpdateProjectApiKeyRequest": {
        "title": "UpdateProjectApiKeyRequest",
        "type": "object",
        "properties": {
          "name": {
            "description": "Optional display name (omit or empty to clear).",
            "type": "string"
          },
          "scopes": {
            "description": "Replaces scopes; must be from the server HRN allow-list.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateProjectKnowledgeProviderBindingRequest": {
        "title": "UpdateProjectKnowledgeProviderBindingRequest",
        "type": "object",
        "properties": {
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerConfig": {},
          "enabled": {
            "type": "boolean"
          },
          "timeoutMs": {
            "type": "integer",
            "format": "int32"
          },
          "topK": {
            "type": "integer",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "format": "double"
          },
          "maxContextChars": {
            "type": "integer",
            "format": "int32"
          },
          "toolSelectionKbChars": {
            "type": "integer",
            "format": "int32"
          },
          "failurePolicy": {
            "type": "string"
          },
          "includePlannerKbContext": {
            "type": "boolean"
          }
        }
      },
      "UpdateProjectNotificationWebhookRequest": {
        "title": "UpdateProjectNotificationWebhookRequest",
        "type": "object",
        "properties": {
          "url": {
            "description": "Outbound webhook URL or null to clear. Use HTTPS.",
            "type": "string"
          },
          "enabled": {
            "description": "Enable or disable outbound lifecycle webhooks for this project.",
            "type": "boolean"
          },
          "eventTypes": {
            "description": "Event types to subscribe to. If enabled becomes true and this is empty or omitted, server may normalize to all supported lifecycle types.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateProjectOpenApiSourceRuntimeRequest": {
        "title": "UpdateProjectOpenApiSourceRuntimeRequest",
        "type": "object",
        "properties": {
          "serverUrlOverride": {
            "type": "string"
          },
          "clearServerUrlOverride": {
            "type": "boolean"
          }
        }
      },
      "UpdateProjectRequest": {
        "title": "UpdateProjectRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "systemPrompt": {
            "type": "string"
          },
          "defaultModel": {
            "type": "string"
          },
          "defaultProvider": {
            "type": "string"
          },
          "defaultProviderModel": {
            "type": "string"
          },
          "allowedModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "swaggerUrl": {
            "type": "string"
          },
          "maxReplans": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalEnabled": {
            "type": "boolean"
          },
          "retrievalMaxTools": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier1Max": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier2Max": {
            "type": "integer",
            "format": "int32"
          },
          "retrievalTier3Max": {
            "type": "integer",
            "format": "int32"
          },
          "toolRetrievalMode": {
            "type": "string"
          },
          "embeddingModel": {
            "type": "string"
          },
          "maxPlannerAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "utilityModel": {
            "type": "string"
          },
          "plannerMode": {
            "type": "string"
          },
          "inheritPlannerMode": {
            "type": "boolean"
          },
          "planApprovalMode": {
            "type": "string"
          }
        }
      },
      "UpdateProjectWebhookTriggerRequest": {
        "title": "UpdateProjectWebhookTriggerRequest",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "triggerKey": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "promptTemplate": {
            "type": "string"
          },
          "sessionUserPath": {
            "type": "string"
          },
          "sessionSecretPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "contextPaths": {
            "$ref": "#/components/schemas/Map_String"
          },
          "authType": {
            "type": "string"
          },
          "authConfig": {
            "$ref": "#/components/schemas/Map_String"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UpdateScenarioRequest": {
        "title": "UpdateScenarioRequest",
        "type": "object",
        "properties": {
          "queryText": {
            "type": "string"
          },
          "toolRevisionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "toolRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScenarioToolRefDto"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "systemInstruction": {
            "type": "string"
          }
        }
      },
      "UpdateSessionStatusRequest": {
        "title": "UpdateSessionStatusRequest",
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "UpsertSecretRequest": {
        "title": "UpsertSecretRequest",
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "UpsertSessionSecretsRequest": {
        "title": "UpsertSessionSecretsRequest",
        "type": "object",
        "required": [
          "secrets"
        ],
        "properties": {
          "secrets": {
            "$ref": "#/components/schemas/Map_String"
          }
        }
      },
      "ValidationFieldError": {
        "title": "ValidationFieldError",
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "VerifyCloudProviderResponse": {
        "title": "VerifyCloudProviderResponse",
        "type": "object",
        "required": [
          "id",
          "name",
          "vendor",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "WebhookTestRequest": {
        "title": "WebhookTestRequest",
        "type": "object",
        "required": [
          "headers",
          "query",
          "params"
        ],
        "properties": {
          "headers": {
            "$ref": "#/components/schemas/Map_String"
          },
          "query": {
            "$ref": "#/components/schemas/Map_String"
          },
          "body": {},
          "params": {
            "$ref": "#/components/schemas/Map_String"
          }
        }
      },
      "WebhookTestResponse": {
        "title": "WebhookTestResponse",
        "type": "object",
        "required": [
          "statusCode",
          "body",
          "headers"
        ],
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "body": {},
          "headers": {
            "$ref": "#/components/schemas/Map_String"
          }
        }
      }
    },
    "securitySchemes": {
      "httpAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}