{
  "openapi": "3.1.0",
  "info": {
    "title": "Proxycept API",
    "version": "0.1.0"
  },
  "paths": {
    "/api/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Register",
        "description": "Register a new user (email + password).",
        "operationId": "register_api_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apps__control_api__auth__schemas__UserOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login",
        "description": "Login with email/password; returns JWT access_token.",
        "operationId": "login_api_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/verify-email": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify Email",
        "description": "Confirm an email address from a verification token (called by the SPA verify page).",
        "operationId": "verify_email_api_auth_verify_email_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Verify Email Api Auth Verify Email Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Resend Verification",
        "description": "Resend the verification email to the logged-in user (no-op if already verified).",
        "operationId": "resend_verification_api_auth_resend_verification_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Resend Verification Api Auth Resend Verification Post"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Me",
        "description": "Return the currently authenticated user (requires Bearer token). Includes is_proxy_admin for SPA.",
        "operationId": "me_api_auth_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/auth/check-role/{workspace_id}": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Check Workspace Role",
        "description": "Require current user to have at least min_role in workspace (for RBAC tests). Returns 403 if insufficient.",
        "operationId": "check_workspace_role_api_auth_check_role__workspace_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "min_role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Minimum role required",
              "default": "viewer",
              "title": "Min Role"
            },
            "description": "Minimum role required"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/account": {
      "get": {
        "tags": [
          "account"
        ],
        "summary": "Get Account Info",
        "description": "The current user's account: tier, entitlements, and live usage vs limits.",
        "operationId": "get_account_info_api_account_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/billing/checkout": {
      "post": {
        "tags": [
          "account"
        ],
        "summary": "Create Checkout",
        "description": "Create a Stripe Checkout session to upgrade to a paid tier; returns its URL.",
        "operationId": "create_checkout_api_billing_checkout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Create Checkout Api Billing Checkout Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/billing/portal": {
      "post": {
        "tags": [
          "account"
        ],
        "summary": "Create Portal",
        "description": "Create a Stripe customer-portal session so the user can manage/cancel; returns its URL.",
        "operationId": "create_portal_api_billing_portal_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Create Portal Api Billing Portal Post"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/billing/webhook": {
      "post": {
        "tags": [
          "account"
        ],
        "summary": "Stripe Webhook",
        "description": "Receive Stripe events and apply them to the account's tier/subscription.",
        "operationId": "stripe_webhook_api_billing_webhook_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Stripe Webhook Api Billing Webhook Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit-log": {
      "get": {
        "tags": [
          "audit"
        ],
        "summary": "List Audit Log",
        "description": "Return recent audit log entries (JSON). Any authenticated user.",
        "operationId": "list_audit_log_api_audit_log_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "from_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date or datetime (inclusive)",
              "title": "From Date"
            },
            "description": "ISO date or datetime (inclusive)"
          },
          {
            "name": "to_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date or datetime (inclusive)",
              "title": "To Date"
            },
            "description": "ISO date or datetime (inclusive)"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by action (exact match)",
              "title": "Action"
            },
            "description": "Filter by action (exact match)"
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional workspace_id (workspace-scoped mode)",
              "title": "Workspace Id"
            },
            "description": "Optional workspace_id (workspace-scoped mode)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit-log/stats": {
      "get": {
        "tags": [
          "audit"
        ],
        "summary": "Audit Log Stats",
        "description": "Return audit event counts by date and by action for the given range (max 365 days).",
        "operationId": "audit_log_stats_api_audit_log_stats_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "from_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (inclusive)",
              "title": "From Date"
            },
            "description": "ISO date (inclusive)"
          },
          {
            "name": "to_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (inclusive)",
              "title": "To Date"
            },
            "description": "ISO date (inclusive)"
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional workspace_id (workspace-scoped mode)",
              "title": "Workspace Id"
            },
            "description": "Optional workspace_id (workspace-scoped mode)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogStatsOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/analytics/flows": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Flow Analytics",
        "description": "Flow counts by date / status class / method (max range 365 days).",
        "operationId": "flow_analytics_api_analytics_flows_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "from_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (inclusive)",
              "title": "From Date"
            },
            "description": "ISO date (inclusive)"
          },
          {
            "name": "to_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO date (inclusive)",
              "title": "To Date"
            },
            "description": "ISO date (inclusive)"
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Scope to a workspace",
              "title": "Workspace Id"
            },
            "description": "Scope to a workspace"
          },
          {
            "name": "profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Scope to a profile (within the workspace)",
              "title": "Profile Id"
            },
            "description": "Scope to a profile (within the workspace)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowStatsOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/ca/install-token": {
      "post": {
        "tags": [
          "ca"
        ],
        "summary": "Create Ca Install Token",
        "description": "Issue a one-time token for mobile Safari to open /ca/certificate without Bearer auth.",
        "operationId": "create_ca_install_token_api_ca_install_token_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "type": "object",
                  "title": "Response Create Ca Install Token Api Ca Install Token Post"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/ca/certificate": {
      "get": {
        "tags": [
          "ca"
        ],
        "summary": "Download Ca Certificate",
        "description": "Return the deployment CA certificate. Generates on first use.",
        "operationId": "download_ca_certificate_api_ca_certificate_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "pem",
                "cer",
                "mobileconfig"
              ],
              "type": "string",
              "description": "pem: desktop download; cer: DER for Android; mobileconfig: iOS profile install",
              "default": "pem",
              "title": "Format"
            },
            "description": "pem: desktop download; cer: DER for Android; mobileconfig: iOS profile install"
          },
          {
            "name": "install_token",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Install Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces": {
      "get": {
        "summary": "List Workspaces",
        "description": "List workspaces the current user is a member of.\n\nProxy Admin is a deployment-wide capability: return all workspaces.",
        "operationId": "list_workspaces_api_workspaces_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceOut"
                  },
                  "type": "array",
                  "title": "Response List Workspaces Api Workspaces Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "summary": "Create Workspace",
        "description": "Create a workspace and add the current user as admin.",
        "operationId": "create_workspace_api_workspaces_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/workspaces/{workspace_id}": {
      "get": {
        "summary": "Get Workspace",
        "description": "Get a workspace by id (requires membership).",
        "operationId": "get_workspace_api_workspaces__workspace_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update Workspace",
        "description": "Update a workspace (e.g. name). Requires editor.",
        "operationId": "update_workspace_api_workspaces__workspace_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Workspace",
        "description": "Delete a workspace. Stops all profile workers, clears intercept held flows, then deletes the workspace (cascade removes profiles, sessions, flows, members). Admin only.",
        "operationId": "delete_workspace_api_workspaces__workspace_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/profiles": {
      "get": {
        "summary": "List Profiles",
        "description": "List profiles in a workspace (requires membership).",
        "operationId": "list_profiles_api_workspaces__workspace_id__profiles_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileOut"
                  },
                  "title": "Response List Profiles Api Workspaces  Workspace Id  Profiles Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Profile",
        "description": "Create a profile (requires editor). Port unique globally; auto-assigned when edge mode.",
        "operationId": "create_profile_api_workspaces__workspace_id__profiles_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}": {
      "get": {
        "summary": "Get Profile",
        "description": "Get a profile by id (requires workspace membership).",
        "operationId": "get_profile_api_profiles__profile_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update Profile",
        "description": "Update a profile (requires editor). Port must remain unique if changed.",
        "operationId": "update_profile_api_profiles__profile_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Profile",
        "description": "Delete a profile (requires editor).",
        "operationId": "delete_profile_api_profiles__profile_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/polymorphism-rules": {
      "get": {
        "summary": "List Profile Polymorphism Rules",
        "operationId": "list_profile_polymorphism_rules_api_profiles__profile_id__polymorphism_rules_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PolymorphismRuleOut"
                  },
                  "title": "Response List Profile Polymorphism Rules Api Profiles  Profile Id  Polymorphism Rules Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Profile Polymorphism Rule",
        "operationId": "create_profile_polymorphism_rule_api_profiles__profile_id__polymorphism_rules_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolymorphismRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolymorphismRuleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/polymorphism-rules/{rule_id}": {
      "patch": {
        "summary": "Update Profile Polymorphism Rule",
        "operationId": "update_profile_polymorphism_rule_api_profiles__profile_id__polymorphism_rules__rule_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Rule Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolymorphismRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolymorphismRuleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Profile Polymorphism Rule",
        "operationId": "delete_profile_polymorphism_rule_api_profiles__profile_id__polymorphism_rules__rule_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Rule Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/start": {
      "post": {
        "summary": "Start Profile",
        "description": "Start the profile's proxy worker. Calls Proxy Manager if PROXY_MANAGER_URL is set.",
        "operationId": "start_profile_api_profiles__profile_id__start_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileStartOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/stop": {
      "post": {
        "summary": "Stop Profile",
        "description": "Stop the profile's proxy worker. Calls Proxy Manager if PROXY_MANAGER_URL is set.\nClears intercept patterns and in-memory held flows for this profile so that after\nrestart, new requests are not intercepted unless the user adds rules/patterns again.",
        "operationId": "stop_profile_api_profiles__profile_id__stop_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Stop Profile Api Profiles  Profile Id  Stop Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/profiles/{profile_id}/mock-routes": {
      "get": {
        "summary": "List Profile Mock Routes",
        "description": "List mock routes for this profile's mock server (Task 20). Requires workspace viewer.",
        "operationId": "list_profile_mock_routes_api_workspaces__workspace_id__profiles__profile_id__mock_routes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MockRouteOut"
                  },
                  "title": "Response List Profile Mock Routes Api Workspaces  Workspace Id  Profiles  Profile Id  Mock Routes Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Profile Mock Route",
        "description": "Add a manual mock route to this profile's mock server (Task 24). Requires editor.",
        "operationId": "create_profile_mock_route_api_workspaces__workspace_id__profiles__profile_id__mock_routes_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MockRouteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MockRouteOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/mock-routes/{mock_route_id}": {
      "patch": {
        "summary": "Update Mock Route",
        "description": "Update a mock route (Task 21/24). Requires editor in the route's profile workspace.",
        "operationId": "update_mock_route_api_mock_routes__mock_route_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "mock_route_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mock Route Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MockRouteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MockRouteOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Mock Route",
        "description": "Delete a mock route (Task 21). Requires editor in the route's profile workspace.",
        "operationId": "delete_mock_route_api_mock_routes__mock_route_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "mock_route_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mock Route Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/profiles/{profile_id}/mock-server/collections/openapi/{collection_id}": {
      "post": {
        "summary": "Add Openapi Collection To Mock Server",
        "description": "Copy OpenAPI collection's mock routes to this profile's mock server (Task 21). Requires editor.",
        "operationId": "add_openapi_collection_to_mock_server_api_workspaces__workspace_id__profiles__profile_id__mock_server_collections_openapi__collection_id__post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          },
          {
            "name": "collection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Collection Id"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Add Openapi Collection To Mock Server Api Workspaces  Workspace Id  Profiles  Profile Id  Mock Server Collections Openapi  Collection Id  Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/profiles/{profile_id}/mock-server/collections/postman": {
      "post": {
        "summary": "Upload Postman Collection To Mock Server",
        "description": "Upload a Postman collection and add its mock routes to this profile's mock server (Task 22). Requires editor.",
        "operationId": "upload_postman_collection_to_mock_server_api_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Name"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_postman_collection_to_mock_server_api_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Upload Postman Collection To Mock Server Api Workspaces  Workspace Id  Profiles  Profile Id  Mock Server Collections Postman Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/sessions/import": {
      "post": {
        "summary": "Import Session",
        "description": "Import a session from JSON (our export format) or HAR 1.2. Creates a new session and flows. Requires workspace editor. Max 500 flows (V2-T11).",
        "operationId": "import_session_api_workspaces__workspace_id__sessions_import_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Import Session Api Workspaces  Workspace Id  Sessions Import Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/permissions/catalog": {
      "get": {
        "summary": "Workspace Permissions Catalog",
        "description": "Stable permission codes for building custom roles (any workspace member).",
        "operationId": "workspace_permissions_catalog_api_workspaces__workspace_id__permissions_catalog_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "title": "Response Workspace Permissions Catalog Api Workspaces  Workspace Id  Permissions Catalog Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/permissions/me": {
      "get": {
        "summary": "Workspace Permissions Me",
        "description": "Effective permissions for the current user in this workspace.",
        "operationId": "workspace_permissions_me_api_workspaces__workspace_id__permissions_me_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspacePermissionsMeOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/roles": {
      "get": {
        "summary": "List Workspace Roles",
        "description": "List assignable roles: global system templates plus workspace-only custom roles.",
        "operationId": "list_workspace_roles_api_workspaces__workspace_id__roles_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceRoleOut"
                  },
                  "title": "Response List Workspace Roles Api Workspaces  Workspace Id  Roles Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Workspace Role",
        "description": "Create a custom role (requires workspace:roles:manage).",
        "operationId": "create_workspace_role_api_workspaces__workspace_id__roles_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceRoleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRoleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/roles/{role_id}": {
      "patch": {
        "summary": "Update Workspace Role",
        "description": "Update a custom role's name and/or permissions. System roles cannot be edited.",
        "operationId": "update_workspace_role_api_workspaces__workspace_id__roles__role_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "role_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Role Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceRoleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRoleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Workspace Role",
        "description": "Delete a custom role if no member uses it.",
        "operationId": "delete_workspace_role_api_workspaces__workspace_id__roles__role_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "role_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Role Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/members": {
      "get": {
        "summary": "List Workspace Members",
        "description": "List members with emails (requires workspace:members:manage).",
        "operationId": "list_workspace_members_api_workspaces__workspace_id__members_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceMemberOut"
                  },
                  "title": "Response List Workspace Members Api Workspaces  Workspace Id  Members Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add Workspace Member",
        "description": "Add an existing user to a workspace and assign a role/template.",
        "operationId": "add_workspace_member_api_workspaces__workspace_id__members_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceMemberAdd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMemberOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/members/{user_id}": {
      "patch": {
        "summary": "Update Workspace Member Role",
        "description": "Assign a workspace role to a member.",
        "operationId": "update_workspace_member_role_api_workspaces__workspace_id__members__user_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceMemberRoleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMemberOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/openapi/upload": {
      "post": {
        "summary": "Upload Openapi",
        "description": "Upload an OpenAPI spec; parse paths and generate mock_routes. Requires editor.",
        "operationId": "upload_openapi_api_workspaces__workspace_id__openapi_upload_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_openapi_api_workspaces__workspace_id__openapi_upload_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAPIUploadOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/openapi": {
      "get": {
        "summary": "List Openapi Collections",
        "description": "List OpenAPI collections in the workspace. Requires viewer.",
        "operationId": "list_openapi_collections_api_workspaces__workspace_id__openapi_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenAPICollectionOut"
                  },
                  "title": "Response List Openapi Collections Api Workspaces  Workspace Id  Openapi Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/mock_routes": {
      "get": {
        "summary": "List Mock Routes",
        "description": "List mock routes in the workspace. Requires viewer.",
        "operationId": "list_mock_routes_api_workspaces__workspace_id__mock_routes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MockRouteOut"
                  },
                  "title": "Response List Mock Routes Api Workspaces  Workspace Id  Mock Routes Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/rules": {
      "get": {
        "summary": "List Rules",
        "description": "List rules for a profile, ordered by priority (lower first). Requires workspace viewer.",
        "operationId": "list_rules_api_profiles__profile_id__rules_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RuleOut"
                  },
                  "title": "Response List Rules Api Profiles  Profile Id  Rules Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create Rule",
        "description": "Create a rule (match/action validated per shared models). Requires editor.",
        "operationId": "create_rule_api_profiles__profile_id__rules_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/{rule_id}": {
      "patch": {
        "summary": "Update Rule",
        "description": "Update a rule (partial). Requires editor.",
        "operationId": "update_rule_api_rules__rule_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Rule Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Rule",
        "description": "Delete a rule. Requires editor.",
        "operationId": "delete_rule_api_rules__rule_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Rule Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/shared/{token}": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Shared Session",
        "description": "Resolve a share token and return session + flows (read-only). No auth required. 404 if invalid or expired.",
        "operationId": "get_shared_session_api_sessions_shared__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedSessionDetailOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "List Sessions",
        "description": "List sessions. Filter by workspace_id and/or profile_id. Requires workspace viewer.",
        "operationId": "list_sessions_api_sessions_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SessionOut"
                  },
                  "title": "Response List Sessions Api Sessions Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/active": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Active Session",
        "description": "Resolve active session: current open session first, otherwise latest session.",
        "operationId": "get_active_session_api_sessions_active_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workspace Id"
            }
          },
          {
            "name": "profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveSessionOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Session",
        "description": "Get one session. Requires workspace viewer.",
        "operationId": "get_session_api_sessions__session_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sessions"
        ],
        "summary": "Delete Session",
        "description": "Delete a session and its flows. Requires workspace editor.",
        "operationId": "delete_session_api_sessions__session_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/share": {
      "post": {
        "tags": [
          "sessions"
        ],
        "summary": "Create Share Link",
        "description": "Create a shareable read-only link for the session (V2-T4). Requires workspace viewer. Max 10 tokens per session.",
        "operationId": "create_share_link_api_sessions__session_id__share_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareCreateBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareCreateOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "List Flows",
        "description": "List flows for a session. Requires workspace viewer.",
        "operationId": "list_flows_api_sessions__session_id__flows_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FlowOut"
                  },
                  "title": "Response List Flows Api Sessions  Session Id  Flows Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows/{flow_id}/morphed_flow": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Morphed Flow",
        "description": "Return the polymorphism morphed child flow for a given root flow (404 if missing).",
        "operationId": "get_morphed_flow_api_sessions__session_id__flows__flow_id__morphed_flow_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetailOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows/{flow_id}/curl": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Export Flow Curl",
        "description": "Export the stored flow request as a curl command.",
        "operationId": "export_flow_curl_api_sessions__session_id__flows__flow_id__curl_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Export Flow Curl Api Sessions  Session Id  Flows  Flow Id  Curl Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/shared/{token}/flows/{flow_id}/morphed_flow": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Shared Morphed Flow",
        "description": "Shared (read-only): return the polymorphism morphed child flow for the given root flow.",
        "operationId": "get_shared_morphed_flow_api_sessions_shared__token__flows__flow_id__morphed_flow_get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetailOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/shared/{token}/flows/{flow_id}/curl": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Export Shared Flow Curl",
        "description": "Shared (read-only): export the stored flow request as a curl command.",
        "operationId": "export_shared_flow_curl_api_sessions_shared__token__flows__flow_id__curl_get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Export Shared Flow Curl Api Sessions Shared  Token  Flows  Flow Id  Curl Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows/stream": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Flows Stream",
        "description": "V2-T5: SSE stream of new flows for a session. Requires workspace viewer. Connection limit per session (see user-manual).",
        "operationId": "flows_stream_api_sessions__session_id__flows_stream_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/export": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Export Session",
        "description": "Export session and flows as JSON or HAR (V2-T1). Requires workspace viewer. Max flows: 500.",
        "operationId": "export_session_api_sessions__session_id__export_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Export format: json or har",
              "default": "json",
              "title": "Format"
            },
            "description": "Export format: json or har"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/trace": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Session Trace",
        "description": "Return recent trace entries for this session's profile (for intercept debugging).",
        "operationId": "get_session_trace_api_sessions__session_id__trace_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Session Trace Api Sessions  Session Id  Trace Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows/{flow_id}": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get Flow",
        "description": "Get one flow with full request/response detail. Requires workspace viewer.",
        "operationId": "get_flow_api_sessions__session_id__flows__flow_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetailOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sessions"
        ],
        "summary": "Delete Flow",
        "description": "Delete a single flow. Requires workspace editor.",
        "operationId": "delete_flow_api_sessions__session_id__flows__flow_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sessions/{session_id}/flows/{flow_id}/replay": {
      "post": {
        "tags": [
          "sessions"
        ],
        "summary": "Replay Flow",
        "description": "Trigger replay of a flow through the session's proxy. Returns 202 when replay is started.",
        "operationId": "replay_flow_api_sessions__session_id__flows__flow_id__replay_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Session Id"
            }
          },
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Replay Flow Api Sessions  Session Id  Flows  Flow Id  Replay Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/intercept_patterns": {
      "get": {
        "tags": [
          "intercepts"
        ],
        "summary": "List Intercept Patterns",
        "description": "List intercept path prefixes for a profile. Requires workspace viewer.",
        "operationId": "list_intercept_patterns_api_profiles__profile_id__intercept_patterns_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Intercept Patterns Api Profiles  Profile Id  Intercept Patterns Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "intercepts"
        ],
        "summary": "Add Intercept Pattern",
        "description": "Add an intercept pattern (e.g. from 'Intercept this URL' in Sessions). Requires editor.",
        "operationId": "add_intercept_pattern_api_profiles__profile_id__intercept_patterns_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterceptPatternAdd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Add Intercept Pattern Api Profiles  Profile Id  Intercept Patterns Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/intercept_patterns/{pattern_id}": {
      "delete": {
        "tags": [
          "intercepts"
        ],
        "summary": "Delete Intercept Pattern",
        "description": "Remove an intercept pattern. Requires editor.",
        "operationId": "delete_intercept_pattern_api_profiles__profile_id__intercept_patterns__pattern_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          },
          {
            "name": "pattern_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Pattern Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspace_id}/intercept-presets": {
      "get": {
        "tags": [
          "intercepts"
        ],
        "summary": "List Intercept Presets",
        "description": "List saved intercept presets for a workspace. Requires workspace viewer.",
        "operationId": "list_intercept_presets_api_workspaces__workspace_id__intercept_presets_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Intercept Presets Api Workspaces  Workspace Id  Intercept Presets Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "intercepts"
        ],
        "summary": "Create Intercept Preset",
        "description": "Create a saved intercept preset. Requires workspace editor.",
        "operationId": "create_intercept_preset_api_workspaces__workspace_id__intercept_presets_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterceptPresetAdd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Intercept Preset Api Workspaces  Workspace Id  Intercept Presets Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/intercept-presets/{preset_id}": {
      "patch": {
        "tags": [
          "intercepts"
        ],
        "summary": "Update Intercept Preset",
        "description": "Update a saved intercept preset. Requires workspace editor.",
        "operationId": "update_intercept_preset_api_intercept_presets__preset_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Preset Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterceptPresetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Intercept Preset Api Intercept Presets  Preset Id  Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "intercepts"
        ],
        "summary": "Delete Intercept Preset",
        "description": "Delete a saved intercept preset. Requires workspace editor.",
        "operationId": "delete_intercept_preset_api_intercept_presets__preset_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Preset Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/system/intercept-presets": {
      "get": {
        "tags": [
          "intercepts"
        ],
        "summary": "List System Intercept Presets",
        "description": "List intercept presets across all workspaces (system permission).",
        "operationId": "list_system_intercept_presets_api_system_intercept_presets_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List System Intercept Presets Api System Intercept Presets Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/profiles/{profile_id}/held_flows": {
      "get": {
        "tags": [
          "intercepts"
        ],
        "summary": "List Held Flows",
        "description": "List currently held flows for a profile (for Sessions UI). Requires workspace viewer.",
        "operationId": "list_held_flows_api_profiles__profile_id__held_flows_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Profile Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {},
                  "title": "Response List Held Flows Api Profiles  Profile Id  Held Flows Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/held_flows/{flow_id}": {
      "get": {
        "tags": [
          "intercepts"
        ],
        "summary": "Get Held Flow",
        "description": "Get one held flow for editing. Requires workspace viewer for the flow's profile.",
        "operationId": "get_held_flow_api_held_flows__flow_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Flow Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Held Flow Api Held Flows  Flow Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/held_flows/{flow_id}/request": {
      "patch": {
        "tags": [
          "intercepts"
        ],
        "summary": "Submit Held Request",
        "description": "Submit edited request to release the hold (user clicked 'Send request'). Requires editor.",
        "operationId": "submit_held_request_api_held_flows__flow_id__request_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Flow Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldFlowRequestRelease"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Submit Held Request Api Held Flows  Flow Id  Request Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/held_flows/{flow_id}/response": {
      "patch": {
        "tags": [
          "intercepts"
        ],
        "summary": "Submit Held Response",
        "description": "Submit edited response to release the hold (user clicked 'Send response'). Requires editor.",
        "operationId": "submit_held_response_api_held_flows__flow_id__response_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "flow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Flow Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldFlowResponseRelease"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Submit Held Response Api Held Flows  Flow Id  Response Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActiveSessionOut": {
        "properties": {
          "session": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "session"
        ],
        "title": "ActiveSessionOut",
        "description": "Resolved active session for UI intercept ownership."
      },
      "AuditEntryOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "resource_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Type"
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "user_id",
          "action",
          "resource_type",
          "resource_id",
          "details",
          "ip_address",
          "user_agent"
        ],
        "title": "AuditEntryOut"
      },
      "AuditLogListOut": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/AuditEntryOut"
            },
            "type": "array",
            "title": "Entries"
          }
        },
        "type": "object",
        "required": [
          "entries"
        ],
        "title": "AuditLogListOut"
      },
      "AuditLogStatsOut": {
        "properties": {
          "by_date": {
            "items": {
              "$ref": "#/components/schemas/ByDateItem"
            },
            "type": "array",
            "title": "By Date"
          },
          "by_action": {
            "items": {
              "$ref": "#/components/schemas/ByActionItem"
            },
            "type": "array",
            "title": "By Action"
          }
        },
        "type": "object",
        "required": [
          "by_date",
          "by_action"
        ],
        "title": "AuditLogStatsOut"
      },
      "AuditProxyEventIn": {
        "properties": {
          "action": {
            "type": "string",
            "title": "Action"
          },
          "client_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Ip"
          },
          "proxy_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Username"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "type": "object",
        "required": [
          "action"
        ],
        "title": "AuditProxyEventIn",
        "description": "POST /internal/audit-proxy-event \u2014 edge/manager security events."
      },
      "Body_admin_users_create_ui_admin_users_post": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "Body_admin_users_create_ui_admin_users_post"
      },
      "Body_held_flow_send_request_ui_held_flows__flow_id__send_request_post": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method",
            "default": "GET"
          },
          "host": {
            "type": "string",
            "title": "Host",
            "default": ""
          },
          "path": {
            "type": "string",
            "title": "Path",
            "default": "/"
          },
          "body": {
            "type": "string",
            "title": "Body",
            "default": ""
          },
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          }
        },
        "type": "object",
        "title": "Body_held_flow_send_request_ui_held_flows__flow_id__send_request_post"
      },
      "Body_held_flow_send_response_ui_held_flows__flow_id__send_response_post": {
        "properties": {
          "status": {
            "type": "integer",
            "title": "Status",
            "default": 200
          },
          "body": {
            "type": "string",
            "title": "Body",
            "default": ""
          },
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          }
        },
        "type": "object",
        "title": "Body_held_flow_send_response_ui_held_flows__flow_id__send_response_post"
      },
      "Body_login_submit_ui_login_post": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "Body_login_submit_ui_login_post"
      },
      "Body_mock_server_add_openapi_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_openapi_post": {
        "properties": {
          "collection_id": {
            "type": "integer",
            "title": "Collection Id"
          }
        },
        "type": "object",
        "required": [
          "collection_id"
        ],
        "title": "Body_mock_server_add_openapi_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_openapi_post"
      },
      "Body_mock_server_config_ui_workspaces__workspace_id__profiles__profile_id__mock_server_config_post": {
        "properties": {
          "mock_server_host": {
            "type": "string",
            "title": "Mock Server Host",
            "default": ""
          },
          "mock_server_path_prefix": {
            "type": "string",
            "title": "Mock Server Path Prefix",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_mock_server_config_ui_workspaces__workspace_id__profiles__profile_id__mock_server_config_post"
      },
      "Body_mock_server_route_add_ui_workspaces__workspace_id__profiles__profile_id__mock_server_routes_post": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method",
            "default": "GET"
          },
          "path_pattern": {
            "type": "string",
            "title": "Path Pattern",
            "default": "/"
          },
          "response_status": {
            "type": "integer",
            "title": "Response Status",
            "default": 200
          },
          "response_headers": {
            "type": "string",
            "title": "Response Headers",
            "default": ""
          },
          "response_body": {
            "type": "string",
            "title": "Response Body",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_mock_server_route_add_ui_workspaces__workspace_id__profiles__profile_id__mock_server_routes_post"
      },
      "Body_mock_server_route_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__mock_server_routes__route_id__edit_post": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method",
            "default": "GET"
          },
          "path_pattern": {
            "type": "string",
            "title": "Path Pattern",
            "default": "/"
          },
          "response_status": {
            "type": "integer",
            "title": "Response Status",
            "default": 200
          },
          "response_headers": {
            "type": "string",
            "title": "Response Headers",
            "default": ""
          },
          "response_body": {
            "type": "string",
            "title": "Response Body",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_mock_server_route_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__mock_server_routes__route_id__edit_post"
      },
      "Body_mock_server_upload_openapi_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_openapi_upload_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_mock_server_upload_openapi_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_openapi_upload_post"
      },
      "Body_mock_server_upload_postman_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_mock_server_upload_postman_ui_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post"
      },
      "Body_profile_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__edit_post": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "port": {
            "type": "integer",
            "title": "Port"
          }
        },
        "type": "object",
        "required": [
          "name",
          "port"
        ],
        "title": "Body_profile_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__edit_post"
      },
      "Body_profile_new_submit_ui_workspaces__workspace_id__profiles_new_post": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "port": {
            "type": "integer",
            "title": "Port"
          }
        },
        "type": "object",
        "required": [
          "name",
          "port"
        ],
        "title": "Body_profile_new_submit_ui_workspaces__workspace_id__profiles_new_post"
      },
      "Body_rule_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__rules__rule_id__edit_post": {
        "properties": {
          "path_prefix": {
            "type": "string",
            "title": "Path Prefix",
            "default": ""
          },
          "method": {
            "type": "string",
            "title": "Method",
            "default": ""
          },
          "action_kind": {
            "type": "string",
            "title": "Action Kind",
            "default": "mock_response"
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "enabled": {
            "type": "string",
            "title": "Enabled",
            "default": "on"
          },
          "mock_status": {
            "type": "string",
            "title": "Mock Status",
            "default": "200"
          },
          "mock_body": {
            "type": "string",
            "title": "Mock Body",
            "default": ""
          },
          "mock_headers_json": {
            "type": "string",
            "title": "Mock Headers Json",
            "default": "{}"
          },
          "rewrite_host": {
            "type": "string",
            "title": "Rewrite Host",
            "default": ""
          },
          "rewrite_path": {
            "type": "string",
            "title": "Rewrite Path",
            "default": ""
          },
          "rewrite_scheme": {
            "type": "string",
            "title": "Rewrite Scheme",
            "default": ""
          },
          "header_add_json": {
            "type": "string",
            "title": "Header Add Json",
            "default": "{}"
          },
          "header_remove": {
            "type": "string",
            "title": "Header Remove",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_rule_edit_submit_ui_workspaces__workspace_id__profiles__profile_id__rules__rule_id__edit_post"
      },
      "Body_rule_new_submit_ui_workspaces__workspace_id__profiles__profile_id__rules_new_post": {
        "properties": {
          "path_prefix": {
            "type": "string",
            "title": "Path Prefix",
            "default": ""
          },
          "method": {
            "type": "string",
            "title": "Method",
            "default": ""
          },
          "action_kind": {
            "type": "string",
            "title": "Action Kind",
            "default": "mock_response"
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "enabled": {
            "type": "string",
            "title": "Enabled",
            "default": "on"
          },
          "mock_status": {
            "type": "string",
            "title": "Mock Status",
            "default": "200"
          },
          "mock_body": {
            "type": "string",
            "title": "Mock Body",
            "default": ""
          },
          "mock_headers_json": {
            "type": "string",
            "title": "Mock Headers Json",
            "default": "{}"
          },
          "rewrite_host": {
            "type": "string",
            "title": "Rewrite Host",
            "default": ""
          },
          "rewrite_path": {
            "type": "string",
            "title": "Rewrite Path",
            "default": ""
          },
          "rewrite_scheme": {
            "type": "string",
            "title": "Rewrite Scheme",
            "default": ""
          },
          "header_add_json": {
            "type": "string",
            "title": "Header Add Json",
            "default": "{}"
          },
          "header_remove": {
            "type": "string",
            "title": "Header Remove",
            "default": ""
          }
        },
        "type": "object",
        "title": "Body_rule_new_submit_ui_workspaces__workspace_id__profiles__profile_id__rules_new_post"
      },
      "Body_session_intercept_url_ui_sessions__session_id__intercept_url_post": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          }
        },
        "type": "object",
        "required": [
          "path"
        ],
        "title": "Body_session_intercept_url_ui_sessions__session_id__intercept_url_post"
      },
      "Body_upload_openapi_api_workspaces__workspace_id__openapi_upload_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File",
            "description": "OpenAPI 3.x spec (YAML or JSON)"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Optional collection name (default: filename)"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_openapi_api_workspaces__workspace_id__openapi_upload_post"
      },
      "Body_upload_postman_collection_to_mock_server_api_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_postman_collection_to_mock_server_api_workspaces__workspace_id__profiles__profile_id__mock_server_collections_postman_post"
      },
      "Body_workspace_edit_submit_ui_workspaces__workspace_id__edit_post": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "Body_workspace_edit_submit_ui_workspaces__workspace_id__edit_post"
      },
      "Body_workspace_new_submit_ui_workspaces_new_post": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "Body_workspace_new_submit_ui_workspaces_new_post"
      },
      "ByActionItem": {
        "properties": {
          "action": {
            "type": "string",
            "title": "Action"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "action",
          "count"
        ],
        "title": "ByActionItem"
      },
      "ByDateItem": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "date",
          "count"
        ],
        "title": "ByDateItem"
      },
      "ByMethodItem": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "method",
          "count"
        ],
        "title": "ByMethodItem"
      },
      "ByStatusItem": {
        "properties": {
          "status_class": {
            "type": "string",
            "title": "Status Class"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "status_class",
          "count"
        ],
        "title": "ByStatusItem"
      },
      "CheckoutIn": {
        "properties": {
          "tier": {
            "type": "string",
            "title": "Tier"
          }
        },
        "type": "object",
        "required": [
          "tier"
        ],
        "title": "CheckoutIn"
      },
      "DataMaskingOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "mask_headers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mask Headers",
            "default": []
          },
          "mask_body_keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mask Body Keys",
            "default": []
          },
          "mask_value_patterns": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mask Value Patterns",
            "default": []
          },
          "placeholder": {
            "type": "string",
            "title": "Placeholder",
            "default": "***REDACTED***"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "DataMaskingOut",
        "description": "Sensitive-data masking settings (V4-T4)."
      },
      "DataMaskingUpdate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "mask_headers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mask Headers"
          },
          "mask_body_keys": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mask Body Keys"
          },
          "mask_value_patterns": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mask Value Patterns"
          },
          "placeholder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Placeholder"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "DataMaskingUpdate"
      },
      "DataRetentionOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "default": 30
          },
          "run_interval_hours": {
            "type": "integer",
            "title": "Run Interval Hours",
            "default": 6
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "DataRetentionOut",
        "description": "Data retention / auto-purge settings (V4 data governance)."
      },
      "DataRetentionUpdate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "retention_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention Days"
          },
          "run_interval_hours": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Interval Hours"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "DataRetentionUpdate"
      },
      "FlowDetailOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "host": {
            "type": "string",
            "title": "Host"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "polymorphism_morph_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Polymorphism Morph Group Id"
          },
          "polymorphism_morphed": {
            "type": "boolean",
            "title": "Polymorphism Morphed",
            "default": false
          },
          "request_headers": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Headers"
          },
          "response_headers": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Headers"
          },
          "request_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Body"
          },
          "response_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Body"
          },
          "intercepted": {
            "type": "boolean",
            "title": "Intercepted",
            "default": false
          },
          "request_modified": {
            "type": "boolean",
            "title": "Request Modified",
            "default": false
          },
          "response_modified": {
            "type": "boolean",
            "title": "Response Modified",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "session_id",
          "timestamp",
          "method",
          "host",
          "path",
          "status",
          "duration_ms"
        ],
        "title": "FlowDetailOut",
        "description": "Full flow with request/response for detail view."
      },
      "FlowIn": {
        "properties": {
          "method": {
            "type": "string",
            "maxLength": 16,
            "title": "Method"
          },
          "host": {
            "type": "string",
            "maxLength": 512,
            "title": "Host"
          },
          "path": {
            "type": "string",
            "maxLength": 2048,
            "title": "Path"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          },
          "request_headers": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Headers"
          },
          "response_headers": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Headers"
          },
          "request_body": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 65536
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Body"
          },
          "response_body": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 65536
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Body"
          },
          "intercepted": {
            "type": "boolean",
            "title": "Intercepted",
            "default": false
          },
          "request_modified": {
            "type": "boolean",
            "title": "Request Modified",
            "default": false
          },
          "response_modified": {
            "type": "boolean",
            "title": "Response Modified",
            "default": false
          },
          "polymorphism_morph_group_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Polymorphism Morph Group Id"
          },
          "polymorphism_morphed": {
            "type": "boolean",
            "title": "Polymorphism Morphed",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "method",
          "host",
          "path"
        ],
        "title": "FlowIn",
        "description": "POST /internal/flows \u2014 one flow summary (Task 17: optional headers/body; Task 19: intercept flags)."
      },
      "FlowOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "host": {
            "type": "string",
            "title": "Host"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "polymorphism_morph_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Polymorphism Morph Group Id"
          },
          "polymorphism_morphed": {
            "type": "boolean",
            "title": "Polymorphism Morphed",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "session_id",
          "timestamp",
          "method",
          "host",
          "path",
          "status",
          "duration_ms"
        ],
        "title": "FlowOut"
      },
      "FlowStatsOut": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "by_date": {
            "items": {
              "$ref": "#/components/schemas/ByDateItem"
            },
            "type": "array",
            "title": "By Date"
          },
          "by_status": {
            "items": {
              "$ref": "#/components/schemas/ByStatusItem"
            },
            "type": "array",
            "title": "By Status"
          },
          "by_method": {
            "items": {
              "$ref": "#/components/schemas/ByMethodItem"
            },
            "type": "array",
            "title": "By Method"
          }
        },
        "type": "object",
        "required": [
          "total",
          "by_date",
          "by_status",
          "by_method"
        ],
        "title": "FlowStatsOut"
      },
      "FlowsBatchIn": {
        "properties": {
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          },
          "flows": {
            "items": {
              "$ref": "#/components/schemas/FlowIn"
            },
            "type": "array",
            "title": "Flows"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "flows"
        ],
        "title": "FlowsBatchIn",
        "description": "POST /internal/flows \u2014 session_id + list of flow summaries."
      },
      "GlobalReplaceRuleCreate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "type": "string",
            "pattern": "^(exact|prefix)$",
            "title": "Host Match Type",
            "default": "prefix"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Header Match"
          },
          "query_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Query Match"
          },
          "body_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Headers"
          },
          "replace_query": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Query"
          },
          "replace_body": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Body"
          }
        },
        "type": "object",
        "title": "GlobalReplaceRuleCreate"
      },
      "GlobalReplaceRuleOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "type": "string",
            "pattern": "^(exact|prefix)$",
            "title": "Host Match Type",
            "default": "prefix"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Header Match"
          },
          "query_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Query Match"
          },
          "body_match": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
            },
            "type": "array",
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Headers"
          },
          "replace_query": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Query"
          },
          "replace_body": {
            "items": {
              "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
            },
            "type": "array",
            "title": "Replace Body"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at"
        ],
        "title": "GlobalReplaceRuleOut"
      },
      "GlobalReplaceRuleUpdate": {
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(exact|prefix)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Host Match Type"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Match"
          },
          "query_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query Match"
          },
          "body_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleKeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Headers"
          },
          "replace_query": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Query"
          },
          "replace_body": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceRuleReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Body"
          }
        },
        "type": "object",
        "title": "GlobalReplaceRuleUpdate"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HeaderInjectAction": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "header_inject",
            "title": "Kind",
            "default": "header_inject"
          },
          "add": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Add"
          },
          "remove": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Remove"
          }
        },
        "type": "object",
        "title": "HeaderInjectAction",
        "description": "Add or remove headers."
      },
      "HeldFlowRequestRelease": {
        "properties": {
          "method": {
            "type": "string",
            "maxLength": 16,
            "title": "Method"
          },
          "host": {
            "type": "string",
            "maxLength": 512,
            "title": "Host"
          },
          "path": {
            "type": "string",
            "maxLength": 2048,
            "title": "Path"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Headers"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          }
        },
        "type": "object",
        "required": [
          "method",
          "host",
          "path"
        ],
        "title": "HeldFlowRequestRelease"
      },
      "HeldFlowResponseRelease": {
        "properties": {
          "status": {
            "type": "integer",
            "maximum": 599.0,
            "minimum": 100.0,
            "title": "Status"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Headers"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "HeldFlowResponseRelease"
      },
      "ImpersonationOptInOut": {
        "properties": {
          "allow_admin_impersonation": {
            "type": "boolean",
            "title": "Allow Admin Impersonation"
          }
        },
        "type": "object",
        "required": [
          "allow_admin_impersonation"
        ],
        "title": "ImpersonationOptInOut"
      },
      "ImpersonationOptInUpdate": {
        "properties": {
          "allow_admin_impersonation": {
            "type": "boolean",
            "title": "Allow Admin Impersonation",
            "description": "If true, admins may impersonate this user."
          }
        },
        "type": "object",
        "required": [
          "allow_admin_impersonation"
        ],
        "title": "ImpersonationOptInUpdate"
      },
      "InterceptPatternAdd": {
        "properties": {
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          }
        },
        "type": "object",
        "title": "InterceptPatternAdd"
      },
      "InterceptPresetAdd": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "InterceptPresetAdd"
      },
      "InterceptPresetUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          }
        },
        "type": "object",
        "title": "InterceptPresetUpdate"
      },
      "KeyValueMatch": {
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Key"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "key"
        ],
        "title": "KeyValueMatch"
      },
      "LoginIn": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginIn"
      },
      "MeOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "is_proxy_admin": {
            "type": "boolean",
            "title": "Is Proxy Admin"
          },
          "system_permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "System Permissions",
            "default": []
          },
          "has_system_console": {
            "type": "boolean",
            "title": "Has System Console",
            "default": false
          },
          "allow_admin_impersonation": {
            "type": "boolean",
            "title": "Allow Admin Impersonation",
            "default": false
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified",
            "default": false
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "account_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Name"
          },
          "tier": {
            "type": "string",
            "title": "Tier",
            "default": "individual"
          },
          "entitlements": {
            "additionalProperties": true,
            "type": "object",
            "title": "Entitlements",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "is_proxy_admin"
        ],
        "title": "MeOut",
        "description": "Current user with is_proxy_admin for SPA nav, plus SaaS account/tier/entitlements."
      },
      "MockResponseAction": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "mock_response",
            "title": "Kind",
            "default": "mock_response"
          },
          "status": {
            "type": "integer",
            "maximum": 599.0,
            "minimum": 100.0,
            "title": "Status"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Headers"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string",
                "format": "binary"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "delay_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Ms"
          },
          "error_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Status"
          },
          "dribble_chunks": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Chunks"
          },
          "dribble_duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Duration Ms"
          },
          "delay_min_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Min Ms"
          },
          "delay_max_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Max Ms"
          },
          "delay_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Percent"
          },
          "error_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Percent"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "MockResponseAction",
        "description": "Return a mock response (optional delay and fault injection; V2-T2 + extensions)."
      },
      "MockRouteCreate": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method",
            "default": "GET"
          },
          "path_pattern": {
            "type": "string",
            "title": "Path Pattern",
            "default": "/"
          },
          "response": {
            "additionalProperties": true,
            "type": "object",
            "title": "Response"
          },
          "delay_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Ms"
          },
          "error_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Status"
          },
          "dribble_chunks": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Chunks"
          },
          "dribble_duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Duration Ms"
          },
          "delay_min_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Min Ms"
          },
          "delay_max_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Max Ms"
          },
          "delay_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Percent"
          },
          "error_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Percent"
          }
        },
        "type": "object",
        "title": "MockRouteCreate",
        "description": "Create a manual mock route (Task 20/24)."
      },
      "MockRouteOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "openapi_collection_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Openapi Collection Id"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path_pattern": {
            "type": "string",
            "title": "Path Pattern"
          },
          "response": {
            "additionalProperties": true,
            "type": "object",
            "title": "Response"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "delay_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Ms"
          },
          "error_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Status"
          },
          "dribble_chunks": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Chunks"
          },
          "dribble_duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Duration Ms"
          },
          "delay_min_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Min Ms"
          },
          "delay_max_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Max Ms"
          },
          "delay_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Percent"
          },
          "error_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Percent"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "openapi_collection_id",
          "source",
          "method",
          "path_pattern",
          "response",
          "enabled"
        ],
        "title": "MockRouteOut"
      },
      "MockRouteUpdate": {
        "properties": {
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "path_pattern": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Pattern"
          },
          "response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "delay_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Ms"
          },
          "error_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Status"
          },
          "dribble_chunks": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Chunks"
          },
          "dribble_duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dribble Duration Ms"
          },
          "delay_min_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Min Ms"
          },
          "delay_max_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Max Ms"
          },
          "delay_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delay Percent"
          },
          "error_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Percent"
          }
        },
        "type": "object",
        "title": "MockRouteUpdate",
        "description": "Update a mock route (partial)."
      },
      "OpenAPICollectionOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "name",
          "created_at"
        ],
        "title": "OpenAPICollectionOut"
      },
      "OpenAPIUploadOut": {
        "properties": {
          "collection": {
            "$ref": "#/components/schemas/OpenAPICollectionOut"
          },
          "mock_routes_created": {
            "type": "integer",
            "title": "Mock Routes Created"
          }
        },
        "type": "object",
        "required": [
          "collection",
          "mock_routes_created"
        ],
        "title": "OpenAPIUploadOut",
        "description": "Response after uploading an OpenAPI spec."
      },
      "PolymorphismRuleCreate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "type": "string",
            "pattern": "^(exact|prefix)$",
            "title": "Host Match Type",
            "default": "prefix"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Header Match"
          },
          "query_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Query Match"
          },
          "body_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Headers"
          },
          "replace_query": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Query"
          },
          "replace_body": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Body"
          }
        },
        "type": "object",
        "title": "PolymorphismRuleCreate"
      },
      "PolymorphismRuleOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "default": 0
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "type": "string",
            "pattern": "^(exact|prefix)$",
            "title": "Host Match Type",
            "default": "prefix"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Header Match"
          },
          "query_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Query Match"
          },
          "body_match": {
            "items": {
              "$ref": "#/components/schemas/KeyValueMatch"
            },
            "type": "array",
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Headers"
          },
          "replace_query": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Query"
          },
          "replace_body": {
            "items": {
              "$ref": "#/components/schemas/ReplaceItem"
            },
            "type": "array",
            "title": "Replace Body"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "profile_id": {
            "type": "integer",
            "title": "Profile Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "profile_id",
          "created_at",
          "updated_at"
        ],
        "title": "PolymorphismRuleOut"
      },
      "PolymorphismRuleUpdate": {
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "host_match_type": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(exact|prefix)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Host Match Type"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/KeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Match"
          },
          "query_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/KeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query Match"
          },
          "body_match": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/KeyValueMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Match"
          },
          "set_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Host"
          },
          "set_scheme": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(http|https)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Scheme"
          },
          "set_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Method"
          },
          "replace_headers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Headers"
          },
          "replace_query": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Query"
          },
          "replace_body": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ReplaceItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replace Body"
          }
        },
        "type": "object",
        "title": "PolymorphismRuleUpdate"
      },
      "PolymorphismSettingsOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "PolymorphismSettingsOut"
      },
      "PolymorphismSettingsUpdate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "PolymorphismSettingsUpdate"
      },
      "ProfileCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "port": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 65535.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Port"
          },
          "mode": {
            "type": "string",
            "enum": [
              "passthrough",
              "record",
              "mock",
              "mixed"
            ],
            "title": "Mode",
            "default": "passthrough"
          },
          "upstream_base_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Base Url"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "ProfileCreate"
      },
      "ProfileListOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "workspace_name": {
            "type": "string",
            "title": "Workspace Name"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "port": {
            "type": "integer",
            "title": "Port"
          },
          "mode": {
            "type": "string",
            "title": "Mode"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "workspace_name",
          "name",
          "port",
          "mode",
          "is_active"
        ],
        "title": "ProfileListOut",
        "description": "Profile row for GET /admin/profiles."
      },
      "ProfileOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "port": {
            "type": "integer",
            "title": "Port"
          },
          "mode": {
            "type": "string",
            "title": "Mode"
          },
          "upstream_base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Base Url"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "proxy_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Username"
          },
          "proxy_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Password"
          },
          "internal_listen_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internal Listen Port"
          },
          "mock_server_enabled": {
            "type": "boolean",
            "title": "Mock Server Enabled",
            "default": false
          },
          "mock_server_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Host"
          },
          "mock_server_path_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Path Prefix"
          },
          "mock_server_fault_enabled": {
            "type": "boolean",
            "title": "Mock Server Fault Enabled",
            "default": false
          },
          "mock_server_fault_delay_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Delay Ms"
          },
          "mock_server_fault_delay_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Delay Percent"
          },
          "mock_server_fault_error_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Error Status"
          },
          "mock_server_fault_error_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Error Percent"
          },
          "catch_mode_enabled": {
            "type": "boolean",
            "title": "Catch Mode Enabled",
            "default": false
          },
          "catch_mode_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Host"
          },
          "catch_mode_path_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Path Prefix"
          },
          "catch_mode_status": {
            "type": "integer",
            "title": "Catch Mode Status",
            "default": 503
          },
          "polymorphism_enabled": {
            "type": "boolean",
            "title": "Polymorphism Enabled",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "name",
          "port",
          "mode",
          "upstream_base_url",
          "is_active"
        ],
        "title": "ProfileOut"
      },
      "ProfileStartOut": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "profile_id": {
            "type": "integer",
            "title": "Profile Id"
          },
          "proxy_auth_required": {
            "type": "boolean",
            "title": "Proxy Auth Required",
            "default": false
          },
          "proxy_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Host"
          },
          "proxy_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Port"
          },
          "proxy_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Username"
          },
          "proxy_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Password"
          },
          "proxy_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Url"
          },
          "internal_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internal Port"
          },
          "port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Port"
          },
          "listen_host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listen Host"
          }
        },
        "type": "object",
        "required": [
          "message",
          "profile_id"
        ],
        "title": "ProfileStartOut",
        "description": "Response when starting a profile (includes connection details when edge enabled)."
      },
      "ProfileUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "port": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 65535.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Port"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "passthrough",
                  "record",
                  "mock",
                  "mixed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Mode"
          },
          "upstream_base_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Base Url"
          },
          "mock_server_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Enabled"
          },
          "mock_server_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Host"
          },
          "mock_server_path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Path Prefix"
          },
          "mock_server_fault_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Enabled"
          },
          "mock_server_fault_delay_ms": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 30000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Delay Ms"
          },
          "mock_server_fault_delay_percent": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Delay Percent"
          },
          "mock_server_fault_error_status": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 599.0,
                "minimum": 100.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Error Status"
          },
          "mock_server_fault_error_percent": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Mock Server Fault Error Percent"
          },
          "catch_mode_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Enabled"
          },
          "catch_mode_host": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Host"
          },
          "catch_mode_path_prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Path Prefix"
          },
          "catch_mode_status": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 599.0,
                "minimum": 100.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Catch Mode Status"
          },
          "polymorphism_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Polymorphism Enabled"
          }
        },
        "type": "object",
        "title": "ProfileUpdate"
      },
      "ProxyAdminUpdate": {
        "properties": {
          "is_proxy_admin": {
            "type": "boolean",
            "title": "Is Proxy Admin"
          }
        },
        "type": "object",
        "required": [
          "is_proxy_admin"
        ],
        "title": "ProxyAdminUpdate",
        "description": "PATCH /admin/users/{id}/proxy-admin."
      },
      "ProxySettingsOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "upstream_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Url"
          },
          "upstream_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Username"
          },
          "has_upstream_password": {
            "type": "boolean",
            "title": "Has Upstream Password",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "ProxySettingsOut",
        "description": "Global upstream proxy settings (V4-T11). Password is never returned."
      },
      "ProxySettingsUpdate": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "upstream_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Url"
          },
          "upstream_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Username"
          },
          "upstream_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Password"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "ProxySettingsUpdate",
        "description": "upstream_password: None keeps the stored password; empty string clears it."
      },
      "PurgeResult": {
        "properties": {
          "flows_deleted": {
            "type": "integer",
            "title": "Flows Deleted"
          },
          "sessions_deleted": {
            "type": "integer",
            "title": "Sessions Deleted"
          }
        },
        "type": "object",
        "required": [
          "flows_deleted",
          "sessions_deleted"
        ],
        "title": "PurgeResult",
        "description": "Result of a retention purge (manual or scheduled)."
      },
      "RecordAction": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "record",
            "title": "Kind",
            "default": "record"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "type": "object",
        "title": "RecordAction",
        "description": "Record request/response."
      },
      "RegisterIn": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "RegisterIn"
      },
      "ReplaceItem": {
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Key"
          },
          "match_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Match Value"
          },
          "value": {
            "type": "string",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "title": "ReplaceItem"
      },
      "ReplaceRuleKeyValueMatch": {
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Key"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "key"
        ],
        "title": "ReplaceRuleKeyValueMatch"
      },
      "ReplaceRuleReplaceItem": {
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Key"
          },
          "match_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Match Value"
          },
          "value": {
            "type": "string",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "title": "ReplaceRuleReplaceItem"
      },
      "RewriteUrlAction": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "rewrite_url",
            "title": "Kind",
            "default": "rewrite_url"
          },
          "new_host": {
            "type": "string",
            "title": "New Host"
          },
          "new_path": {
            "type": "string",
            "title": "New Path"
          },
          "new_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Scheme"
          }
        },
        "type": "object",
        "required": [
          "new_host",
          "new_path"
        ],
        "title": "RewriteUrlAction",
        "description": "Rewrite request URL."
      },
      "RuleCreate": {
        "properties": {
          "match": {
            "$ref": "#/components/schemas/RuleMatch"
          },
          "action": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MockResponseAction"
              },
              {
                "$ref": "#/components/schemas/RewriteUrlAction"
              },
              {
                "$ref": "#/components/schemas/HeaderInjectAction"
              },
              {
                "$ref": "#/components/schemas/RecordAction"
              },
              {
                "$ref": "#/components/schemas/TagAction"
              }
            ],
            "title": "Action",
            "discriminator": {
              "propertyName": "kind",
              "mapping": {
                "header_inject": "#/components/schemas/HeaderInjectAction",
                "mock_response": "#/components/schemas/MockResponseAction",
                "record": "#/components/schemas/RecordAction",
                "rewrite_url": "#/components/schemas/RewriteUrlAction",
                "tag": "#/components/schemas/TagAction"
              }
            }
          },
          "priority": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Priority",
            "default": 0
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "match",
          "action"
        ],
        "title": "RuleCreate"
      },
      "RuleMatch": {
        "properties": {
          "host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Host"
          },
          "path_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Prefix"
          },
          "path_regex": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path Regex"
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "header_contains": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Contains"
          },
          "query_contains": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query Contains"
          }
        },
        "type": "object",
        "title": "RuleMatch",
        "description": "Match conditions for a rule. At least one field must be set.\npath_prefix and path_regex are mutually exclusive."
      },
      "RuleOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "profile_id": {
            "type": "integer",
            "title": "Profile Id"
          },
          "priority": {
            "type": "integer",
            "title": "Priority"
          },
          "match": {
            "additionalProperties": true,
            "type": "object",
            "title": "Match"
          },
          "action": {
            "additionalProperties": true,
            "type": "object",
            "title": "Action"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "id",
          "profile_id",
          "priority",
          "match",
          "action",
          "enabled"
        ],
        "title": "RuleOut"
      },
      "RuleUpdate": {
        "properties": {
          "match": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RuleMatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "action": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/MockResponseAction"
                  },
                  {
                    "$ref": "#/components/schemas/RewriteUrlAction"
                  },
                  {
                    "$ref": "#/components/schemas/HeaderInjectAction"
                  },
                  {
                    "$ref": "#/components/schemas/RecordAction"
                  },
                  {
                    "$ref": "#/components/schemas/TagAction"
                  }
                ],
                "discriminator": {
                  "propertyName": "kind",
                  "mapping": {
                    "header_inject": "#/components/schemas/HeaderInjectAction",
                    "mock_response": "#/components/schemas/MockResponseAction",
                    "record": "#/components/schemas/RecordAction",
                    "rewrite_url": "#/components/schemas/RewriteUrlAction",
                    "tag": "#/components/schemas/TagAction"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Action"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          }
        },
        "type": "object",
        "title": "RuleUpdate"
      },
      "SessionEndIn": {
        "properties": {
          "tags": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "type": "object",
        "title": "SessionEndIn",
        "description": "POST /internal/sessions/end \u2014 optional tags."
      },
      "SessionListOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "workspace_name": {
            "type": "string",
            "title": "Workspace Name"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "profile_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Name"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "workspace_name",
          "profile_id",
          "profile_name",
          "user_email",
          "started_at",
          "ended_at"
        ],
        "title": "SessionListOut",
        "description": "Session row for GET /admin/sessions."
      },
      "SessionOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "profile_id",
          "created_by",
          "started_at",
          "ended_at",
          "tags"
        ],
        "title": "SessionOut"
      },
      "SessionStartIn": {
        "properties": {
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          }
        },
        "type": "object",
        "required": [
          "workspace_id"
        ],
        "title": "SessionStartIn",
        "description": "POST /internal/sessions/start."
      },
      "SessionStartOut": {
        "properties": {
          "session_id": {
            "type": "integer",
            "title": "Session Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "workspace_id",
          "profile_id",
          "started_at"
        ],
        "title": "SessionStartOut"
      },
      "ShareCreateBody": {
        "properties": {
          "expires_in_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Seconds"
          }
        },
        "type": "object",
        "title": "ShareCreateBody",
        "description": "Optional expiry when creating a share link (V2-T4)."
      },
      "ShareCreateOut": {
        "properties": {
          "share_url": {
            "type": "string",
            "title": "Share Url"
          },
          "token": {
            "type": "string",
            "title": "Token"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "share_url",
          "token",
          "expires_at"
        ],
        "title": "ShareCreateOut",
        "description": "Response after creating a share link."
      },
      "SharedSessionDetailOut": {
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionOut"
          },
          "flows": {
            "items": {
              "$ref": "#/components/schemas/FlowDetailOut"
            },
            "type": "array",
            "title": "Flows"
          }
        },
        "type": "object",
        "required": [
          "session",
          "flows"
        ],
        "title": "SharedSessionDetailOut",
        "description": "Session + flows with full flow details for shared view."
      },
      "SystemRoleGrantsUpdate": {
        "properties": {
          "system_role_template_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "System Role Template Ids",
            "default": []
          }
        },
        "type": "object",
        "title": "SystemRoleGrantsUpdate",
        "description": "PATCH /admin/users/{id}/system-role-grants."
      },
      "SystemRoleTemplateCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "SystemRoleTemplateCreate"
      },
      "SystemRoleTemplateOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "is_builtin": {
            "type": "boolean",
            "title": "Is Builtin"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "is_builtin",
          "permissions"
        ],
        "title": "SystemRoleTemplateOut"
      },
      "SystemRoleTemplateUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "permissions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permissions"
          }
        },
        "type": "object",
        "title": "SystemRoleTemplateUpdate"
      },
      "TagAction": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "tag",
            "title": "Kind",
            "default": "tag"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Labels"
          }
        },
        "type": "object",
        "title": "TagAction",
        "description": "Tag or annotate traffic."
      },
      "TokenOut": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "bearer"
          }
        },
        "type": "object",
        "required": [
          "access_token"
        ],
        "title": "TokenOut"
      },
      "UsageOut": {
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "entitlements": {
            "additionalProperties": true,
            "type": "object",
            "title": "Entitlements"
          },
          "usage": {
            "additionalProperties": true,
            "type": "object",
            "title": "Usage"
          },
          "billing_enabled": {
            "type": "boolean",
            "title": "Billing Enabled"
          },
          "subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Status"
          }
        },
        "type": "object",
        "required": [
          "account_id",
          "name",
          "tier",
          "entitlements",
          "usage",
          "billing_enabled"
        ],
        "title": "UsageOut"
      },
      "UserCreate": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "UserCreate",
        "description": "POST /admin/users."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerifyEmailIn": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "token"
        ],
        "title": "VerifyEmailIn"
      },
      "WorkspaceCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "WorkspaceCreate"
      },
      "WorkspaceMemberAdd": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "workspace_role_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Role Id"
          },
          "system_role_template_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Role Template Id"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "WorkspaceMemberAdd",
        "description": "Add an existing user to a workspace and assign exactly one role source."
      },
      "WorkspaceMemberOut": {
        "properties": {
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "workspace_role_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Role Id"
          },
          "system_role_template_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Role Template Id"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "role"
        ],
        "title": "WorkspaceMemberOut"
      },
      "WorkspaceMemberRoleUpdate": {
        "properties": {
          "workspace_role_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Role Id"
          },
          "system_role_template_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Role Template Id"
          }
        },
        "type": "object",
        "title": "WorkspaceMemberRoleUpdate"
      },
      "WorkspaceOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "title": "WorkspaceOut"
      },
      "WorkspacePermissionsMeOut": {
        "properties": {
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "workspace_role_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Role Id"
          },
          "system_role_template_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Role Template Id"
          },
          "is_proxy_admin": {
            "type": "boolean",
            "title": "Is Proxy Admin",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "permissions",
          "role"
        ],
        "title": "WorkspacePermissionsMeOut"
      },
      "WorkspaceRoleCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "WorkspaceRoleCreate"
      },
      "WorkspaceRoleOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "system_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Slug"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          },
          "source": {
            "type": "string",
            "enum": [
              "system_template",
              "workspace"
            ],
            "title": "Source",
            "default": "workspace"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "name",
          "permissions"
        ],
        "title": "WorkspaceRoleOut"
      },
      "WorkspaceRoleUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "permissions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permissions"
          }
        },
        "type": "object",
        "title": "WorkspaceRoleUpdate"
      },
      "WorkspaceUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "type": "object",
        "title": "WorkspaceUpdate"
      },
      "apps__control_api__admin__schemas__UserOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "is_proxy_admin": {
            "type": "boolean",
            "title": "Is Proxy Admin",
            "default": false
          },
          "is_bootstrap_proxy_admin": {
            "type": "boolean",
            "title": "Is Bootstrap Proxy Admin",
            "default": false
          },
          "allow_admin_impersonation": {
            "type": "boolean",
            "title": "Allow Admin Impersonation",
            "default": false
          },
          "system_role_template_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "System Role Template Ids",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "created_at"
        ],
        "title": "UserOut",
        "description": "User list/detail for admin.\n\nis_proxy_admin: effective Proxy Admin (env bootstrap OR DB flag).\nis_bootstrap_proxy_admin: email in PROXY_ADMIN_EMAILS (cannot revoke via API)."
      },
      "apps__control_api__auth__schemas__UserOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email"
        ],
        "title": "UserOut"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
