{
  "components": {
    "schemas": {
      "AdminMailHealResult": {
        "description": "Result of a mailbox heal (backfill) run.",
        "properties": {
          "provisioned": {
            "title": "Provisioned",
            "type": "integer"
          },
          "provisioning_enabled": {
            "default": true,
            "title": "Provisioning Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "provisioned"
        ],
        "title": "AdminMailHealResult",
        "type": "object"
      },
      "AdminMailboxRow": {
        "description": "One mailbox row in the SuperAdmin cluster-wide roster.\n\n`is_paused` is the documented field name in `docs/content/mail.md`. The\nunderlying column today is `mailbox.is_active` (default true); the read\nsurface inverts it so paused == not active. Pause/resume mutation\nendpoints have their own tracking issue.",
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_paused": {
            "title": "Is Paused",
            "type": "boolean"
          },
          "last_message_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Message At"
          },
          "message_count": {
            "title": "Message Count",
            "type": "integer"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "tenant_name": {
            "title": "Tenant Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "tenant_id",
          "tenant_name",
          "agent_name",
          "message_count",
          "last_message_at",
          "is_paused"
        ],
        "title": "AdminMailboxRow",
        "type": "object"
      },
      "AdminModelUpdate": {
        "description": "SuperAdmin-only patch: allows setting `is_free`, `failover_chain`, and\n`available_to_all_tenants` (the \"available to every tenant\" switch).",
        "properties": {
          "available_to_all_tenants": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Available To All Tenants"
          },
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "failover_chain": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 25,
                  "minLength": 25,
                  "pattern": "^c[a-z0-9]{24}$",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failover Chain"
          },
          "is_free": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Free"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "pricing": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "disabled",
                  "experimental",
                  "deprecated"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "AdminModelUpdate",
        "type": "object"
      },
      "AdminTenantDetailRead": {
        "description": "Full per-tenant detail for SuperAdmin: includes plan, 30-day aggregates.",
        "properties": {
          "agent_count": {
            "title": "Agent Count",
            "type": "integer"
          },
          "allow_superadmin_access": {
            "default": true,
            "title": "Allow Superadmin Access",
            "type": "boolean"
          },
          "billing_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "default_skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Default Skill Visibility Scope",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_suspended": {
            "default": false,
            "title": "Is Suspended",
            "type": "boolean"
          },
          "last_active_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Active At"
          },
          "member_count": {
            "title": "Member Count",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "paid": {
            "default": false,
            "title": "Paid",
            "type": "boolean"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanRead"
          },
          "plan_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Plan Id",
            "type": "string"
          },
          "plan_status": {
            "enum": [
              "trialing",
              "active",
              "past_due",
              "canceled"
            ],
            "title": "Plan Status",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TenantStatus",
            "default": "active"
          },
          "task_summary_30d": {
            "$ref": "#/components/schemas/TaskSummary30d"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "usage_summary_30d": {
            "$ref": "#/components/schemas/UsageSummary30d"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan_id",
          "billing_email",
          "created_at",
          "updated_at",
          "member_count",
          "agent_count",
          "plan",
          "plan_status",
          "usage_summary_30d",
          "task_summary_30d",
          "last_active_at"
        ],
        "title": "AdminTenantDetailRead",
        "type": "object"
      },
      "AdminTenantRead": {
        "description": "TenantRead with computed counts for the super-admin listing.",
        "properties": {
          "agent_count": {
            "title": "Agent Count",
            "type": "integer"
          },
          "allow_superadmin_access": {
            "default": true,
            "title": "Allow Superadmin Access",
            "type": "boolean"
          },
          "billing_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "default_skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Default Skill Visibility Scope",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_suspended": {
            "default": false,
            "title": "Is Suspended",
            "type": "boolean"
          },
          "member_count": {
            "title": "Member Count",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "paid": {
            "default": false,
            "title": "Paid",
            "type": "boolean"
          },
          "plan_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Plan Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TenantStatus",
            "default": "active"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan_id",
          "billing_email",
          "created_at",
          "updated_at",
          "member_count",
          "agent_count"
        ],
        "title": "AdminTenantRead",
        "type": "object"
      },
      "AdminUserPrimaryTenant": {
        "description": "Lightweight tenant reference for the SuperAdmin users listing.",
        "properties": {
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "role"
        ],
        "title": "AdminUserPrimaryTenant",
        "type": "object"
      },
      "AdminUserRow": {
        "description": "One row in the SuperAdmin \"Users\" listing (``GET /api/v1/admin/users``).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_super_admin": {
            "title": "Is Super Admin",
            "type": "boolean"
          },
          "is_suspended": {
            "title": "Is Suspended",
            "type": "boolean"
          },
          "last_login_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "primary_tenant": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdminUserPrimaryTenant"
              },
              {
                "type": "null"
              }
            ]
          },
          "tenant_count": {
            "title": "Tenant Count",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "is_super_admin",
          "is_suspended",
          "tenant_count",
          "primary_tenant",
          "created_at",
          "last_login_at"
        ],
        "title": "AdminUserRow",
        "type": "object"
      },
      "AgentAttachmentRow": {
        "description": "Attachment metadata returned by the list/get endpoints.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "message_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Message Id",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "message_id",
          "filename",
          "content_type",
          "size_bytes",
          "created_at"
        ],
        "title": "AgentAttachmentRow",
        "type": "object"
      },
      "AgentBudgetRead": {
        "properties": {
          "hourly_limit_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hourly Limit Usd"
          }
        },
        "required": [
          "hourly_limit_usd"
        ],
        "title": "AgentBudgetRead",
        "type": "object"
      },
      "AgentBudgetUpdate": {
        "properties": {
          "hourly_limit_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hourly Limit Usd"
          }
        },
        "title": "AgentBudgetUpdate",
        "type": "object"
      },
      "AgentCanAuthorSkillsUpdate": {
        "description": "Toggle the agent-level ``can_author_skills`` flag.\n\nField name matches the underlying column (``agent.can_author_skills``)\nand the read-side schema (``AgentRead.can_author_skills``), so operators\nnever see a second name for the same boolean.",
        "properties": {
          "can_author_skills": {
            "title": "Can Author Skills",
            "type": "boolean"
          }
        },
        "required": [
          "can_author_skills"
        ],
        "title": "AgentCanAuthorSkillsUpdate",
        "type": "object"
      },
      "AgentClone": {
        "description": "Request body for ``POST /agents/{source_id}/clone``.",
        "properties": {
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9 -]+$",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "AgentClone",
        "type": "object"
      },
      "AgentCodeRefUpdate": {
        "description": "PATCH body for pinning ``agent.code_ref``.\n\nThe value is validated server-side against the project's real branch +\ntag set; an unknown ref returns 422. Length matches the DB column\n(``agent.code_ref VARCHAR(128)``).",
        "properties": {
          "code_ref": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Code Ref",
            "type": "string"
          }
        },
        "required": [
          "code_ref"
        ],
        "title": "AgentCodeRefUpdate",
        "type": "object"
      },
      "AgentCostRow": {
        "description": "One row in the per-agent cost breakdown table.",
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "agent_name": {
            "title": "Agent Name",
            "type": "string"
          },
          "anomaly": {
            "default": false,
            "title": "Anomaly",
            "type": "boolean"
          },
          "cost_usd": {
            "title": "Cost Usd",
            "type": "number"
          },
          "input_tokens": {
            "title": "Input Tokens",
            "type": "integer"
          },
          "output_tokens": {
            "title": "Output Tokens",
            "type": "integer"
          },
          "requests": {
            "title": "Requests",
            "type": "integer"
          },
          "top_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top Model"
          }
        },
        "required": [
          "agent_id",
          "agent_name",
          "requests",
          "input_tokens",
          "output_tokens",
          "cost_usd"
        ],
        "title": "AgentCostRow",
        "type": "object"
      },
      "AgentCostsResponse": {
        "description": "Full response for ``GET /tenant/{tenant_id}/billing/agent-costs``.",
        "properties": {
          "agents": {
            "items": {
              "$ref": "#/components/schemas/AgentCostRow"
            },
            "title": "Agents",
            "type": "array"
          },
          "period": {
            "$ref": "#/components/schemas/CostPeriod"
          },
          "total_cost_usd": {
            "title": "Total Cost Usd",
            "type": "number"
          }
        },
        "required": [
          "period",
          "agents",
          "total_cost_usd"
        ],
        "title": "AgentCostsResponse",
        "type": "object"
      },
      "AgentCreate": {
        "properties": {
          "can_author_skills": {
            "default": false,
            "title": "Can Author Skills",
            "type": "boolean"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "description_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description Prompt"
          },
          "environment_mode": {
            "enum": [
              "shared",
              "isolated"
            ],
            "title": "Environment Mode",
            "type": "string"
          },
          "image_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Ref"
          },
          "initial_greeting": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Greeting"
          },
          "is_admin_only": {
            "default": false,
            "title": "Is Admin Only",
            "type": "boolean"
          },
          "iteration_warn_threshold": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iteration Warn Threshold"
          },
          "kind": {
            "enum": [
              "user",
              "coding",
              "analyst",
              "dba"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9 -]+$",
            "title": "Name",
            "type": "string"
          },
          "resource_class": {
            "default": "small",
            "title": "Resource Class",
            "type": "string"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
            "title": "Slug",
            "type": "string"
          },
          "voice": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          }
        },
        "required": [
          "name",
          "slug"
        ],
        "title": "AgentCreate",
        "type": "object"
      },
      "AgentFavoriteRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "agent_id"
        ],
        "title": "AgentFavoriteRead",
        "type": "object"
      },
      "AgentGrantRequest": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "role": {
            "anyOf": [
              {
                "enum": [
                  "VIEWER",
                  "EDITOR"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "agent_id"
        ],
        "title": "AgentGrantRequest",
        "type": "object"
      },
      "AgentIntegrationRead": {
        "description": "Public projection of a per-agent integration.",
        "properties": {
          "connected": {
            "title": "Connected",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "label",
          "connected"
        ],
        "title": "AgentIntegrationRead",
        "type": "object"
      },
      "AgentListRead": {
        "properties": {
          "can_author_skills": {
            "title": "Can Author Skills",
            "type": "boolean"
          },
          "code_ref": {
            "title": "Code Ref",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Agent Id"
          },
          "created_by_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "image_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Ref"
          },
          "initial_greeting": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Greeting"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_admin_only": {
            "title": "Is Admin Only",
            "type": "boolean"
          },
          "is_favorite": {
            "default": false,
            "title": "Is Favorite",
            "type": "boolean"
          },
          "is_seed": {
            "title": "Is Seed",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Url"
          },
          "resource_class": {
            "title": "Resource Class",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "voice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "zoom_managed": {
            "default": false,
            "title": "Zoom Managed",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "slug",
          "description",
          "initial_greeting",
          "is_active",
          "is_admin_only",
          "is_seed",
          "can_author_skills",
          "image_ref",
          "resource_class",
          "repo_url",
          "code_ref",
          "created_at",
          "updated_at"
        ],
        "title": "AgentListRead",
        "type": "object"
      },
      "AgentMailboxRow": {
        "description": "One mailbox belonging to an agent.",
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "internal",
              "external"
            ],
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "kind",
          "is_active",
          "created_at"
        ],
        "title": "AgentMailboxRow",
        "type": "object"
      },
      "AgentModelChainUpdate": {
        "description": "PUT body for setting the ordered model chain on an agent (#614).\n\n``model_ids`` is the ordered list of model CUIDs. The first element is\npriority 0 (primary), the second priority 1, etc. Minimum 1, maximum\n``MAX_AGENT_MODEL_CHAIN_LEN``.",
        "properties": {
          "model_ids": {
            "items": {
              "maxLength": 25,
              "minLength": 25,
              "pattern": "^c[a-z0-9]{24}$",
              "type": "string"
            },
            "maxItems": 5,
            "minItems": 1,
            "title": "Model Ids",
            "type": "array"
          }
        },
        "required": [
          "model_ids"
        ],
        "title": "AgentModelChainUpdate",
        "type": "object"
      },
      "AgentModelGrant": {
        "properties": {
          "access": {
            "enum": [
              "full",
              "read_only"
            ],
            "title": "Access",
            "type": "string"
          },
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "priority": {
            "default": 0,
            "maximum": 4.0,
            "minimum": 0.0,
            "title": "Priority",
            "type": "integer"
          }
        },
        "required": [
          "agent_id"
        ],
        "title": "AgentModelGrant",
        "type": "object"
      },
      "AgentModelRead": {
        "properties": {
          "access": {
            "title": "Access",
            "type": "string"
          },
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          },
          "priority": {
            "default": 0,
            "title": "Priority",
            "type": "integer"
          }
        },
        "required": [
          "agent_id",
          "model_id",
          "access",
          "created_at"
        ],
        "title": "AgentModelRead",
        "type": "object"
      },
      "AgentOwnershipTransfer": {
        "properties": {
          "new_owner_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "New Owner Id",
            "type": "string"
          }
        },
        "required": [
          "new_owner_id"
        ],
        "title": "AgentOwnershipTransfer",
        "type": "object"
      },
      "AgentRead": {
        "properties": {
          "can_author_skills": {
            "title": "Can Author Skills",
            "type": "boolean"
          },
          "code_ref": {
            "title": "Code Ref",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Agent Id"
          },
          "created_by_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "environment_mode": {
            "enum": [
              "shared",
              "isolated"
            ],
            "title": "Environment Mode",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "image_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Ref"
          },
          "initial_greeting": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Greeting"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_admin_only": {
            "title": "Is Admin Only",
            "type": "boolean"
          },
          "is_seed": {
            "title": "Is Seed",
            "type": "boolean"
          },
          "iteration_warn_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iteration Warn Threshold"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Url"
          },
          "resource_class": {
            "title": "Resource Class",
            "type": "string"
          },
          "skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Skill Visibility Scope",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "voice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "zoom_managed": {
            "default": false,
            "title": "Zoom Managed",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "slug",
          "description",
          "initial_greeting",
          "is_active",
          "is_admin_only",
          "is_seed",
          "can_author_skills",
          "image_ref",
          "resource_class",
          "repo_url",
          "code_ref",
          "created_at",
          "updated_at"
        ],
        "title": "AgentRead",
        "type": "object"
      },
      "AgentRepoRefs": {
        "description": "Branches + tags on the agent's GitLab project.\n\nFeeds the code-tab ``code_ref`` typeahead so the operator can only pin\n``agent.code_ref`` to a ref that actually exists. See issue #1835.\n\nBoth lists may be empty when GitLab is unreachable or the project is\nmissing \u2014 the front-end falls back to a free-form input with a clear\n\"couldn't load refs\" banner in that case.\n\n``complete`` is ``True`` only when both branch and tag listings finished\nwithout error and without hitting their hard-cap walk. When ``False``,\nthe cached set is partial; the front-end treats it as \"refs unavailable\"\nfor typeahead-strict purposes, and the PATCH ``code_ref`` route falls\nback to a direct single-ref GitLab lookup rather than 422-rejecting a\nvalid ref that was simply truncated.",
        "properties": {
          "branches": {
            "items": {
              "type": "string"
            },
            "title": "Branches",
            "type": "array"
          },
          "complete": {
            "default": false,
            "title": "Complete",
            "type": "boolean"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "branches",
          "tags"
        ],
        "title": "AgentRepoRefs",
        "type": "object"
      },
      "AgentRoleAssignmentCreate": {
        "description": "Set a user's role for a specific agent.",
        "properties": {
          "role": {
            "enum": [
              "VIEWER",
              "MANAGER",
              "OWNER"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "AgentRoleAssignmentCreate",
        "type": "object"
      },
      "AgentRoleAssignmentRead": {
        "description": "Response for a role assignment.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "role": {
            "enum": [
              "VIEWER",
              "MANAGER",
              "OWNER"
            ],
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          },
          "user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Name"
          }
        },
        "required": [
          "agent_id",
          "user_id",
          "tenant_id",
          "role",
          "created_at",
          "updated_at"
        ],
        "title": "AgentRoleAssignmentRead",
        "type": "object"
      },
      "AgentRolePermissionGrid": {
        "description": "The full permissions grid for the frontend.",
        "properties": {
          "roles": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "default": {
              "MANAGER": [
                "View",
                "Chat (read-only)",
                "Assign work",
                "Edit settings",
                "Edit skills",
                "Edit tools"
              ],
              "OWNER": [
                "View",
                "Chat (read-only)",
                "Assign work",
                "Edit settings",
                "Edit skills",
                "Edit tools",
                "Transfer ownership",
                "Delete agent",
                "Manage roles"
              ],
              "VIEWER": [
                "View",
                "Chat (read-only)"
              ]
            },
            "title": "Roles",
            "type": "object"
          }
        },
        "title": "AgentRolePermissionGrid",
        "type": "object"
      },
      "AgentSkillConfigRead": {
        "description": "Decrypted config readback. Issued under the same write RBAC gate\n(``agent:skills:write``) since the blob may contain sensitive settings.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "skill_id"
        ],
        "title": "AgentSkillConfigRead",
        "type": "object"
      },
      "AgentSkillConfigUpdate": {
        "description": "PATCH body for ``/skills/{skill_id}/config`` \u2014 replaces the whole blob.\n\nA ``None`` (or absent) ``config`` clears the column. Any JSON-serialisable\ndict is accepted; the route encrypts before writing.",
        "properties": {
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          }
        },
        "title": "AgentSkillConfigUpdate",
        "type": "object"
      },
      "AgentSkillGrant": {
        "properties": {
          "is_enabled": {
            "default": true,
            "title": "Is Enabled",
            "type": "boolean"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "skill_id"
        ],
        "title": "AgentSkillGrant",
        "type": "object"
      },
      "AgentSkillPermissionEntry": {
        "description": "One skill+action permission row.\n\n``action`` is ``\"use\"`` \u2014 the only currently supported per-skill action.\n``create`` would be semantically incoherent on a row keyed by\n``skill_id``, so authoring stays gated on ``agent.can_author_skills``.",
        "properties": {
          "action": {
            "default": "use",
            "title": "Action",
            "type": "string"
          },
          "allowed": {
            "default": true,
            "title": "Allowed",
            "type": "boolean"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "skill_id"
        ],
        "title": "AgentSkillPermissionEntry",
        "type": "object"
      },
      "AgentSkillPermissionRead": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "allowed": {
            "title": "Allowed",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "skill_id",
          "action",
          "allowed",
          "created_at"
        ],
        "title": "AgentSkillPermissionRead",
        "type": "object"
      },
      "AgentSkillPermissionUpdate": {
        "description": "Bulk-replace the skill permission allowlist for an agent.\n\nThe ``permissions`` list is a complete replacement: any existing rows not\nin the list are removed. This keeps the API surface simple and avoids\npartial-update ambiguity.",
        "properties": {
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/AgentSkillPermissionEntry"
            },
            "title": "Permissions",
            "type": "array"
          }
        },
        "required": [
          "permissions"
        ],
        "title": "AgentSkillPermissionUpdate",
        "type": "object"
      },
      "AgentSkillRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "has_config": {
            "default": false,
            "title": "Has Config",
            "type": "boolean"
          },
          "is_enabled": {
            "title": "Is Enabled",
            "type": "boolean"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "skill_id",
          "is_enabled",
          "created_at"
        ],
        "title": "AgentSkillRead",
        "type": "object"
      },
      "AgentSkillVisibilityScopeUpdate": {
        "description": "PUT body for ``/tenant/{id}/agents/{id}/skill-visibility-scope``.\n\n``private_only`` \u2014 agent may only author ``visibility='private'`` skills.\n``tenant_allowed`` \u2014 agent may also author ``visibility='public'`` skills.\nSee issue #550 and SkillVisibilityScope in models/agent.py.",
        "properties": {
          "skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Skill Visibility Scope",
            "type": "string"
          }
        },
        "required": [
          "skill_visibility_scope"
        ],
        "title": "AgentSkillVisibilityScopeUpdate",
        "type": "object"
      },
      "AgentSlackConfigRead": {
        "properties": {
          "slack_rph_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slack Rph Limit"
          },
          "slack_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slack Rpm Limit"
          },
          "working_hours_days": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "Mon",
                    "Tue",
                    "Wed",
                    "Thu",
                    "Fri",
                    "Sat",
                    "Sun"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Days"
          },
          "working_hours_enabled": {
            "default": false,
            "title": "Working Hours Enabled",
            "type": "boolean"
          },
          "working_hours_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours End"
          },
          "working_hours_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Start"
          },
          "working_hours_tz": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Tz"
          }
        },
        "title": "AgentSlackConfigRead",
        "type": "object"
      },
      "AgentSlackConfigUpdate": {
        "description": "Partial update body for `PUT /slack-config`.\n\nFields are forwarded only when the client included them in the request\nbody (see the route handler's use of ``model_fields_set``). Sending a\nfield as ``null`` clears the corresponding column; omitting a field\nleaves the column untouched. ``working_hours_days`` is constrained to\n3-letter English weekday codes (Mon\u2013Sun); ``working_hours_end`` must be\nstrictly after ``working_hours_start`` because the schedule gate does\nnot support overnight windows.",
        "properties": {
          "slack_rph_limit": {
            "anyOf": [
              {
                "maximum": 86400.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slack Rph Limit"
          },
          "slack_rpm_limit": {
            "anyOf": [
              {
                "maximum": 3600.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slack Rpm Limit"
          },
          "working_hours_days": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "Mon",
                    "Tue",
                    "Wed",
                    "Thu",
                    "Fri",
                    "Sat",
                    "Sun"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Days"
          },
          "working_hours_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Enabled"
          },
          "working_hours_end": {
            "anyOf": [
              {
                "pattern": "^\\d{2}:\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours End"
          },
          "working_hours_start": {
            "anyOf": [
              {
                "pattern": "^\\d{2}:\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Start"
          },
          "working_hours_tz": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Hours Tz"
          }
        },
        "title": "AgentSlackConfigUpdate",
        "type": "object"
      },
      "AgentToolGrant": {
        "properties": {
          "configuration": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Configuration"
          },
          "is_enabled": {
            "default": true,
            "title": "Is Enabled",
            "type": "boolean"
          },
          "tool_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tool Id",
            "type": "string"
          }
        },
        "required": [
          "tool_id"
        ],
        "title": "AgentToolGrant",
        "type": "object"
      },
      "AgentToolRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "configuration": {
            "title": "Configuration",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "is_enabled": {
            "title": "Is Enabled",
            "type": "boolean"
          },
          "tool_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tool Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "tool_id",
          "configuration",
          "is_enabled",
          "created_at",
          "updated_at"
        ],
        "title": "AgentToolRead",
        "type": "object"
      },
      "AgentUpdate": {
        "properties": {
          "can_author_skills": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Author Skills"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "description_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description Prompt"
          },
          "environment_mode": {
            "anyOf": [
              {
                "enum": [
                  "shared",
                  "isolated"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment Mode"
          },
          "image_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Ref"
          },
          "initial_greeting": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Greeting"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "is_admin_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Admin Only"
          },
          "iteration_warn_threshold": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iteration Warn Threshold"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "pattern": "^[A-Za-z0-9 -]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "resource_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Class"
          },
          "voice": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          }
        },
        "title": "AgentUpdate",
        "type": "object"
      },
      "AgentUserGrant": {
        "properties": {
          "role": {
            "default": "VIEWER",
            "title": "Role",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "AgentUserGrant",
        "type": "object"
      },
      "AgentUserGrantRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "user_id",
          "role",
          "created_at"
        ],
        "title": "AgentUserGrantRead",
        "type": "object"
      },
      "AllowedAccountCreate": {
        "properties": {
          "email": {
            "format": "email",
            "maxLength": 253,
            "minLength": 3,
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "AllowedAccountCreate",
        "type": "object"
      },
      "AllowedAccountRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "created_at"
        ],
        "title": "AllowedAccountRead",
        "type": "object"
      },
      "ApiKeyCreate": {
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "ApiKeyCreate",
        "type": "object"
      },
      "ApiKeyCreated": {
        "description": "Returned once, on creation. `key` is the one chance to copy it.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "created_at",
          "last_used_at",
          "expires_at",
          "key"
        ],
        "title": "ApiKeyCreated",
        "type": "object"
      },
      "ApiKeyRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "created_at",
          "last_used_at",
          "expires_at"
        ],
        "title": "ApiKeyRead",
        "type": "object"
      },
      "AssistantList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/AssistantObject"
            },
            "title": "Data",
            "type": "array"
          },
          "first_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Id"
          },
          "has_more": {
            "default": false,
            "title": "Has More",
            "type": "boolean"
          },
          "last_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Id"
          },
          "object": {
            "const": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "AssistantList",
        "type": "object"
      },
      "AssistantObject": {
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "model": {
            "default": "good-place-agent",
            "title": "Model",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "object": {
            "const": "assistant",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at"
        ],
        "title": "AssistantObject",
        "type": "object"
      },
      "AuditLogRead": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip"
          },
          "meta": {
            "title": "Meta",
            "type": "object"
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "tenant_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          },
          "user_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "user_id",
          "agent_id",
          "action",
          "resource_type",
          "resource_id",
          "ip",
          "user_agent",
          "meta",
          "created_at"
        ],
        "title": "AuditLogRead",
        "type": "object"
      },
      "AuditSessionDetailResponse": {
        "description": "Full debug data for a single session (issue #513).\n\nWraps the existing ``TaskSessionDebugRead`` fields plus ``user_name``\nso the admin view can render without a second lookup.",
        "properties": {
          "completion_tokens": {
            "default": 0,
            "title": "Completion Tokens",
            "type": "integer"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/TaskMessageRead"
            },
            "title": "Messages",
            "type": "array"
          },
          "prompt_tokens": {
            "default": 0,
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "session": {
            "$ref": "#/components/schemas/TaskSessionRead"
          },
          "total_cost_cents": {
            "default": 0,
            "title": "Total Cost Cents",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Name"
          }
        },
        "required": [
          "session",
          "messages",
          "total_tokens"
        ],
        "title": "AuditSessionDetailResponse",
        "type": "object"
      },
      "AuditSessionListItem": {
        "description": "One row in the paginated session audit list.\n\nCarries the agent name and user name so the audit table can render them\nwithout N+1 lookups. ``message_count`` is the total message count in the\nsession \u2014 useful for at-a-glance triaging.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "message_count": {
            "default": 0,
            "title": "Message Count",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Name"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "status",
          "created_at"
        ],
        "title": "AuditSessionListItem",
        "type": "object"
      },
      "AuditSessionListResponse": {
        "description": "Paginated response for ``GET /v1/tenants/{tenant_id}/sessions``.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditSessionListItem"
            },
            "title": "Items",
            "type": "array"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "per_page": {
            "title": "Per Page",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "per_page"
        ],
        "title": "AuditSessionListResponse",
        "type": "object"
      },
      "AutocompleteItem": {
        "description": "A single autocomplete suggestion returned by the mention search endpoints.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MentionType"
          }
        },
        "required": [
          "id",
          "label",
          "type"
        ],
        "title": "AutocompleteItem",
        "type": "object"
      },
      "BenchmarkCreate": {
        "properties": {
          "dataset_uri": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Dataset Uri",
            "type": "string"
          },
          "default_harness": {
            "$ref": "#/components/schemas/BenchmarkHarness",
            "default": "claude_code"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Display Name",
            "type": "string"
          },
          "evaluator_config": {
            "title": "Evaluator Config",
            "type": "object"
          },
          "evaluator_strategy": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Evaluator Strategy",
            "type": "string"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "read_only": {
            "default": false,
            "title": "Read Only",
            "type": "boolean"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9-]+$",
            "title": "Slug",
            "type": "string"
          },
          "trajectory_builder": {
            "$ref": "#/components/schemas/TrajectoryBuilder",
            "default": "prefix_merging"
          }
        },
        "required": [
          "slug",
          "display_name",
          "dataset_uri",
          "evaluator_strategy"
        ],
        "title": "BenchmarkCreate",
        "type": "object"
      },
      "BenchmarkHarness": {
        "description": "Polar's built-in agent harnesses. See ``src/polar/agent/factory.py`` upstream.",
        "enum": [
          "claude_code",
          "codex",
          "qwen_code",
          "opencode",
          "pi",
          "gemini_cli",
          "openhands_sdk",
          "shell"
        ],
        "title": "BenchmarkHarness",
        "type": "string"
      },
      "BenchmarkRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "dataset_uri": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Dataset Uri",
            "type": "string"
          },
          "default_harness": {
            "$ref": "#/components/schemas/BenchmarkHarness",
            "default": "claude_code"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Display Name",
            "type": "string"
          },
          "evaluator_config": {
            "title": "Evaluator Config",
            "type": "object"
          },
          "evaluator_strategy": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Evaluator Strategy",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "read_only": {
            "default": false,
            "title": "Read Only",
            "type": "boolean"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9-]+$",
            "title": "Slug",
            "type": "string"
          },
          "trajectory_builder": {
            "$ref": "#/components/schemas/TrajectoryBuilder",
            "default": "prefix_merging"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "display_name",
          "dataset_uri",
          "evaluator_strategy",
          "id",
          "created_at",
          "updated_at"
        ],
        "title": "BenchmarkRead",
        "type": "object"
      },
      "BenchmarkUpdate": {
        "properties": {
          "dataset_uri": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataset Uri"
          },
          "default_harness": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BenchmarkHarness"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "evaluator_config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluator Config"
          },
          "evaluator_strategy": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluator Strategy"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "read_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read Only"
          },
          "trajectory_builder": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TrajectoryBuilder"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "BenchmarkUpdate",
        "type": "object"
      },
      "BillingPortalRedirect": {
        "description": "Stripe Billing Portal Session URL \u2014 front-end redirects to ``url``.",
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "BillingPortalRedirect",
        "type": "object"
      },
      "Body_admin_upload_platform_favicon": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_admin_upload_platform_favicon",
        "type": "object"
      },
      "Body_admin_upload_use_case_icon": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_admin_upload_use_case_icon",
        "type": "object"
      },
      "Body_files_scan_upload": {
        "properties": {
          "resource_type": {
            "default": "file",
            "title": "Resource Type",
            "type": "string"
          },
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_files_scan_upload",
        "type": "object"
      },
      "Body_mail_upload_attachment": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_mail_upload_attachment",
        "type": "object"
      },
      "Body_marketplace_publish_version": {
        "properties": {
          "bundle": {
            "contentMediaType": "application/octet-stream",
            "title": "Bundle",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "bundle",
          "version"
        ],
        "title": "Body_marketplace_publish_version",
        "type": "object"
      },
      "Body_memory_export_import_import_memory": {
        "properties": {
          "file": {
            "anyOf": [
              {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File"
          },
          "gcs_uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Uri"
          }
        },
        "title": "Body_memory_export_import_import_memory",
        "type": "object"
      },
      "Body_skills_import_skill": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_skills_import_skill",
        "type": "object"
      },
      "Body_tasks_upload_session_attachment": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_tasks_upload_session_attachment",
        "type": "object"
      },
      "Body_tenant_brand_upload_favicon": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_tenant_brand_upload_favicon",
        "type": "object"
      },
      "Body_tenant_brand_upload_logo": {
        "properties": {
          "upload": {
            "contentMediaType": "application/octet-stream",
            "title": "Upload",
            "type": "string"
          }
        },
        "required": [
          "upload"
        ],
        "title": "Body_tenant_brand_upload_logo",
        "type": "object"
      },
      "CallbackResponse": {
        "description": "Returned by the OAuth callback once the link has been persisted.",
        "properties": {
          "linked_identity": {
            "$ref": "#/components/schemas/LinkedIdentityRead"
          }
        },
        "required": [
          "linked_identity"
        ],
        "title": "CallbackResponse",
        "type": "object"
      },
      "CheckoutSessionRedirect": {
        "description": "Stripe Checkout Session URL \u2014 front-end issues a 303 to ``url``.",
        "properties": {
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "session_id"
        ],
        "title": "CheckoutSessionRedirect",
        "type": "object"
      },
      "CheckoutSessionStart": {
        "description": "Caller-supplied price; we look up the rest server-side.",
        "properties": {
          "price_id": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Price Id",
            "type": "string"
          }
        },
        "required": [
          "price_id"
        ],
        "title": "CheckoutSessionStart",
        "type": "object"
      },
      "ConnectAgentIntegrationResponse": {
        "description": "Returned by ``connect``/``rotate``; ``url`` is what the browser redirects to.",
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "ConnectAgentIntegrationResponse",
        "type": "object"
      },
      "ConnectIntegrationResponse": {
        "description": "Returned by ``connect``/``rotate``. ``url`` is what the front-end's\nsubmit handler redirects the browser to.",
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "ConnectIntegrationResponse",
        "type": "object"
      },
      "ConnectOnboardingLink": {
        "description": "One-shot Stripe onboarding URL \u2014 opaque, expires per Stripe's TTL.",
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "ConnectOnboardingLink",
        "type": "object"
      },
      "ConnectStatusRead": {
        "description": "Marketplace seller Connect Express status for the calling user.",
        "properties": {
          "charges_enabled": {
            "title": "Charges Enabled",
            "type": "boolean"
          },
          "connected": {
            "title": "Connected",
            "type": "boolean"
          },
          "payouts_enabled": {
            "title": "Payouts Enabled",
            "type": "boolean"
          },
          "stripe_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Account Id"
          }
        },
        "required": [
          "connected",
          "stripe_account_id",
          "charges_enabled",
          "payouts_enabled"
        ],
        "title": "ConnectStatusRead",
        "type": "object"
      },
      "ConnectorToolSync": {
        "properties": {
          "description": {
            "title": "Description",
            "type": "string"
          },
          "description_long": {
            "title": "Description Long",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "display_name",
          "description",
          "description_long"
        ],
        "title": "ConnectorToolSync",
        "type": "object"
      },
      "CostPeriod": {
        "description": "Inclusive start, exclusive end.  UTC.",
        "properties": {
          "end": {
            "format": "date-time",
            "title": "End",
            "type": "string"
          },
          "start": {
            "format": "date-time",
            "title": "Start",
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "title": "CostPeriod",
        "type": "object"
      },
      "CredentialSubmit": {
        "description": "Body the browser sends to store the credential value.\n\nSubmitted directly to the skill-config encryption endpoint. The value\nMUST NOT be written to ``session_message`` or conversation history.",
        "properties": {
          "config_key": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Config Key",
            "type": "string"
          },
          "request_id": {
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          },
          "skill_id": {
            "minLength": 1,
            "title": "Skill Id",
            "type": "string"
          },
          "value": {
            "description": "The raw credential value. Encrypted immediately; never persisted in cleartext.",
            "minLength": 1,
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "skill_id",
          "config_key",
          "value"
        ],
        "title": "CredentialSubmit",
        "type": "object"
      },
      "CronBlackoutCreate": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "end_date": {
            "format": "date",
            "title": "End Date",
            "type": "string"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "recurring_yearly": {
            "default": false,
            "title": "Recurring Yearly",
            "type": "boolean"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "timezone": {
            "default": "UTC",
            "maxLength": 64,
            "title": "Timezone",
            "type": "string"
          }
        },
        "required": [
          "name",
          "start_date",
          "end_date"
        ],
        "title": "CronBlackoutCreate",
        "type": "object"
      },
      "CronBlackoutRead": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "end_date": {
            "format": "date",
            "title": "End Date",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "recurring_yearly": {
            "title": "Recurring Yearly",
            "type": "boolean"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "name",
          "reason",
          "start_date",
          "end_date",
          "timezone",
          "recurring_yearly",
          "created_by_user_id",
          "created_at",
          "updated_at"
        ],
        "title": "CronBlackoutRead",
        "type": "object"
      },
      "CronBlackoutUpdate": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "recurring_yearly": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recurring Yearly"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "CronBlackoutUpdate",
        "type": "object"
      },
      "CronJobCreate": {
        "properties": {
          "body_bytes": {
            "anyOf": [
              {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Bytes"
          },
          "cron_expr": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "fire_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fire At"
          },
          "headers": {
            "title": "Headers",
            "type": "object"
          },
          "interval_minutes": {
            "anyOf": [
              {
                "maximum": 525960.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Minutes"
          },
          "kind": {
            "pattern": "^(one_shot|recurring)$",
            "title": "Kind",
            "type": "string"
          },
          "max_retries": {
            "default": 3,
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Max Retries",
            "type": "integer"
          },
          "method": {
            "default": "POST",
            "pattern": "^(GET|POST|PUT|DELETE|PATCH)$",
            "title": "Method",
            "type": "string"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "retry_backoff": {
            "default": "exponential",
            "maxLength": 32,
            "title": "Retry Backoff",
            "type": "string"
          },
          "schedule_type": {
            "default": "interval",
            "pattern": "^(interval|daily)$",
            "title": "Schedule Type",
            "type": "string"
          },
          "start_time": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "target": {
            "minLength": 1,
            "title": "Target",
            "type": "string"
          },
          "target_kind": {
            "pattern": "^(internal_agent|external_url)$",
            "title": "Target Kind",
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "required": [
          "name",
          "kind",
          "target_kind",
          "target"
        ],
        "title": "CronJobCreate",
        "type": "object"
      },
      "CronJobRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "cron_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "fire_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fire At"
          },
          "headers": {
            "title": "Headers",
            "type": "object"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "last_fired_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Fired At"
          },
          "last_status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status Code"
          },
          "max_retries": {
            "title": "Max Retries",
            "type": "integer"
          },
          "method": {
            "title": "Method",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "next_fire_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Fire At"
          },
          "retry_backoff": {
            "title": "Retry Backoff",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "target": {
            "title": "Target",
            "type": "string"
          },
          "target_kind": {
            "title": "Target Kind",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "created_by_user_id",
          "name",
          "kind",
          "fire_at",
          "cron_expr",
          "timezone",
          "next_fire_at",
          "method",
          "target_kind",
          "target",
          "headers",
          "max_retries",
          "retry_backoff",
          "status",
          "last_fired_at",
          "last_status_code",
          "created_at",
          "updated_at"
        ],
        "title": "CronJobRead",
        "type": "object"
      },
      "CronJobUpdate": {
        "properties": {
          "body_bytes": {
            "anyOf": [
              {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Bytes"
          },
          "cron_expr": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron Expr"
          },
          "headers": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headers"
          },
          "interval_minutes": {
            "anyOf": [
              {
                "maximum": 525960.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Minutes"
          },
          "max_retries": {
            "anyOf": [
              {
                "maximum": 10.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Retries"
          },
          "method": {
            "anyOf": [
              {
                "pattern": "^(GET|POST|PUT|DELETE|PATCH)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "retry_backoff": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry Backoff"
          },
          "schedule_type": {
            "anyOf": [
              {
                "pattern": "^(interval|daily)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Type"
          },
          "start_time": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "target": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "CronJobUpdate",
        "type": "object"
      },
      "CustomRedactionPattern": {
        "description": "A tenant-supplied regex pattern + replacement tag.",
        "properties": {
          "pattern": {
            "maxLength": 1024,
            "minLength": 1,
            "title": "Pattern",
            "type": "string"
          },
          "tag": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Tag",
            "type": "string"
          }
        },
        "required": [
          "pattern",
          "tag"
        ],
        "title": "CustomRedactionPattern",
        "type": "object"
      },
      "DatabaseCredentialAdd": {
        "description": "Request body for adding or rotating a PostgreSQL database credential.\n\nThe password is encrypted immediately and never returned via the API.\nProvider is stored as ``db:postgres:<host>`` so each target host has a\ndistinct linked_identity row.",
        "properties": {
          "database": {
            "description": "Database name to connect to. Colons are not allowed.",
            "maxLength": 63,
            "minLength": 1,
            "pattern": "^[^:]+$",
            "title": "Database",
            "type": "string"
          },
          "host": {
            "description": "Hostname or IP address of the database server. Only letters, digits, dots, hyphens, and underscores are allowed \u2014 must match what the `db_query` connector accepts.",
            "maxLength": 52,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._-]+$",
            "title": "Host",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable label (defaults to username@host:port/database)",
            "title": "Label"
          },
          "password": {
            "description": "Database password. Encrypted at rest; never returned.",
            "minLength": 1,
            "title": "Password",
            "type": "string"
          },
          "port": {
            "default": 5432,
            "description": "PostgreSQL port (default 5432)",
            "maximum": 65535.0,
            "minimum": 1.0,
            "title": "Port",
            "type": "integer"
          },
          "ssl_mode": {
            "description": "SSL mode: 'require' (SSL mandatory), 'prefer' (try SSL, fall back to plaintext), or 'disable' (plaintext). Default: 'prefer'.",
            "enum": [
              "require",
              "prefer",
              "disable"
            ],
            "title": "Ssl Mode",
            "type": "string"
          },
          "username": {
            "description": "Database username.",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._@-]+$",
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "host",
          "username",
          "database",
          "password"
        ],
        "title": "DatabaseCredentialAdd",
        "type": "object"
      },
      "DefaultPermissionsRead": {
        "description": "Tenant-wide default permissions.",
        "properties": {
          "can_create_agents": {
            "default": true,
            "title": "Can Create Agents",
            "type": "boolean"
          },
          "can_create_skills": {
            "default": true,
            "title": "Can Create Skills",
            "type": "boolean"
          },
          "can_invite_users": {
            "default": false,
            "title": "Can Invite Users",
            "type": "boolean"
          },
          "can_manage_settings": {
            "default": false,
            "title": "Can Manage Settings",
            "type": "boolean"
          },
          "can_view_billing": {
            "default": false,
            "title": "Can View Billing",
            "type": "boolean"
          }
        },
        "title": "DefaultPermissionsRead",
        "type": "object"
      },
      "DefaultPermissionsUpdate": {
        "description": "Update body for tenant default permissions.",
        "properties": {
          "can_create_agents": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Create Agents"
          },
          "can_create_skills": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Create Skills"
          },
          "can_invite_users": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Invite Users"
          },
          "can_manage_settings": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Manage Settings"
          },
          "can_view_billing": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can View Billing"
          }
        },
        "title": "DefaultPermissionsUpdate",
        "type": "object"
      },
      "DelegationCreate": {
        "description": "Request body for granting an agent read-only delegation.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 1,
            "title": "Agent Id",
            "type": "string"
          },
          "channels": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional channel/folder filter. E.g. {'channels': ['#general', '#eng']} for Slack, or {'folders': ['INBOX']} for email.",
            "title": "Channels"
          },
          "provider": {
            "description": "Provider slug matching the user's linked_identity (e.g. 'slack', 'email:google').",
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider",
            "type": "string"
          },
          "scope": {
            "const": "read",
            "description": "Delegation scope. Only 'read' is supported in this release.",
            "title": "Scope",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "provider"
        ],
        "title": "DelegationCreate",
        "type": "object"
      },
      "DelegationRead": {
        "description": "Public projection of a delegation (linked_identity with delegated_agent_id set).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "delegated_agent_id": {
            "title": "Delegated Agent Id",
            "type": "string"
          },
          "delegated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delegated At"
          },
          "delegation_channels": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delegation Channels"
          },
          "delegation_scope": {
            "title": "Delegation Scope",
            "type": "string"
          },
          "display_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Label"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "provider",
          "delegated_agent_id",
          "delegation_scope",
          "delegation_channels",
          "delegated_at",
          "display_label",
          "scopes",
          "created_at"
        ],
        "title": "DelegationRead",
        "type": "object"
      },
      "DocumentSearchHit": {
        "properties": {
          "chunk_id": {
            "title": "Chunk Id",
            "type": "string"
          },
          "content": {
            "title": "Content",
            "type": "string"
          },
          "end_char": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Char"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "mode": {
            "enum": [
              "semantic",
              "keyword"
            ],
            "title": "Mode",
            "type": "string"
          },
          "ordinal": {
            "title": "Ordinal",
            "type": "integer"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "score": {
            "title": "Score",
            "type": "number"
          },
          "start_char": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Char"
          }
        },
        "required": [
          "chunk_id",
          "file_id",
          "project_id",
          "ordinal",
          "content",
          "score",
          "mode"
        ],
        "title": "DocumentSearchHit",
        "type": "object"
      },
      "DocumentSearchRequest": {
        "properties": {
          "limit": {
            "default": 10,
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "semantic",
              "keyword"
            ],
            "title": "Mode",
            "type": "string"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id"
          },
          "query": {
            "minLength": 1,
            "title": "Query",
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "title": "DocumentSearchRequest",
        "type": "object"
      },
      "DocumentSearchResponse": {
        "properties": {
          "hits": {
            "items": {
              "$ref": "#/components/schemas/DocumentSearchHit"
            },
            "title": "Hits",
            "type": "array"
          }
        },
        "required": [
          "hits"
        ],
        "title": "DocumentSearchResponse",
        "type": "object"
      },
      "FineTuneJobCreate": {
        "properties": {
          "base_model_id": {
            "maxLength": 25,
            "minLength": 25,
            "title": "Base Model Id",
            "type": "string"
          },
          "benchmark_id": {
            "maxLength": 25,
            "minLength": 25,
            "title": "Benchmark Id",
            "type": "string"
          },
          "harness": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Harness"
          },
          "hparams": {
            "title": "Hparams",
            "type": "object"
          },
          "trainer": {
            "default": "slime",
            "title": "Trainer",
            "type": "string"
          }
        },
        "required": [
          "benchmark_id",
          "base_model_id"
        ],
        "title": "FineTuneJobCreate",
        "type": "object"
      },
      "FineTuneJobPromoteRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "FineTuneJobPromoteRequest",
        "type": "object"
      },
      "FineTuneJobRead": {
        "properties": {
          "base_model_id": {
            "title": "Base Model Id",
            "type": "string"
          },
          "benchmark_id": {
            "title": "Benchmark Id",
            "type": "string"
          },
          "checkpoint_uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checkpoint Uri"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "harness": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Harness"
          },
          "hparams": {
            "title": "Hparams",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "k8s_job_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "K8S Job Name"
          },
          "k8s_namespace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "K8S Namespace"
          },
          "progress_pct": {
            "title": "Progress Pct",
            "type": "integer"
          },
          "promoted_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promoted Model Id"
          },
          "reward_mean": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reward Mean"
          },
          "status": {
            "$ref": "#/components/schemas/FineTuneJobStatus"
          },
          "step": {
            "title": "Step",
            "type": "integer"
          },
          "trainer": {
            "title": "Trainer",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "benchmark_id",
          "base_model_id",
          "harness",
          "trainer",
          "hparams",
          "status",
          "step",
          "progress_pct",
          "reward_mean",
          "checkpoint_uri",
          "promoted_model_id",
          "error",
          "k8s_job_name",
          "k8s_namespace",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "title": "FineTuneJobRead",
        "type": "object"
      },
      "FineTuneJobStatus": {
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "promoted"
        ],
        "title": "FineTuneJobStatus",
        "type": "string"
      },
      "FlowisePromoteRequest": {
        "description": "Request body for ``POST .../flowise/chatflows/{chatflow_id}/promote``.",
        "properties": {
          "agent_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name for the promoted agent. Defaults to the chatflow name.",
            "title": "Agent Name"
          },
          "agent_slug": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[a-z0-9][a-z0-9-]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL-safe slug. Defaults to a slugified version of the chatflow name.",
            "title": "Agent Slug"
          },
          "overwrite": {
            "default": true,
            "description": "If True (the default), overwrite the agent repo's seed Agent.md / Soul.md / main.py with the translated chatflow output. Set False to keep any pre-existing files in place \u2014 useful when re-running promotion against an agent whose source has already been edited.",
            "title": "Overwrite",
            "type": "boolean"
          }
        },
        "title": "FlowisePromoteRequest",
        "type": "object"
      },
      "FlowisePromoteResponse": {
        "description": "Response from a successful chatflow promotion.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "agent_slug": {
            "title": "Agent Slug",
            "type": "string"
          },
          "files_written": {
            "items": {
              "type": "string"
            },
            "title": "Files Written",
            "type": "array"
          },
          "repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Url"
          }
        },
        "required": [
          "agent_id",
          "agent_slug",
          "repo_url",
          "files_written"
        ],
        "title": "FlowisePromoteResponse",
        "type": "object"
      },
      "GitHubAppInstallRequest": {
        "description": "Tenant admin supplies the GitHub App installation_id after completing the\nGitHub App install flow in the browser. The API stores it on\n``tenant_identity`` (provider ``github:app``); access tokens are minted\non-demand later from the App's private key and this installation id.",
        "properties": {
          "installation_id": {
            "description": "GitHub App installation ID from the install callback.",
            "title": "Installation Id",
            "type": "integer"
          }
        },
        "required": [
          "installation_id"
        ],
        "title": "GitHubAppInstallRequest",
        "type": "object"
      },
      "GitHubAppInstallResponse": {
        "description": "Confirmation that the GitHub App installation token was stored.",
        "properties": {
          "installation_id": {
            "title": "Installation Id",
            "type": "integer"
          },
          "provider": {
            "default": "github:app",
            "title": "Provider",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "installation_id"
        ],
        "title": "GitHubAppInstallResponse",
        "type": "object"
      },
      "GitHubRepoWebhookCreate": {
        "description": "Wire a specific GitHub repo to an agent via a webhook route.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "auto_start": {
            "default": true,
            "title": "Auto Start",
            "type": "boolean"
          },
          "branches": {
            "description": "Branch filter for push events. Empty means all branches.",
            "items": {
              "type": "string"
            },
            "title": "Branches",
            "type": "array"
          },
          "event_types": {
            "description": "GitHub event types to subscribe to.",
            "items": {
              "type": "string"
            },
            "title": "Event Types",
            "type": "array"
          },
          "repo_full_name": {
            "description": "GitHub repo in owner/repo format.",
            "examples": [
              "octocat/Hello-World"
            ],
            "title": "Repo Full Name",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "repo_full_name"
        ],
        "title": "GitHubRepoWebhookCreate",
        "type": "object"
      },
      "GitHubRepoWebhookRead": {
        "description": "Webhook route enriched with GitHub-specific filter data.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "auto_start": {
            "title": "Auto Start",
            "type": "boolean"
          },
          "branches": {
            "items": {
              "type": "string"
            },
            "title": "Branches",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "event_types": {
            "items": {
              "type": "string"
            },
            "title": "Event Types",
            "type": "array"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "path_token": {
            "title": "Path Token",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "repo_full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Full Name"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "provider",
          "path_token",
          "is_active",
          "auto_start",
          "created_at",
          "updated_at"
        ],
        "title": "GitHubRepoWebhookRead",
        "type": "object"
      },
      "GitHubWebhookEventRead": {
        "description": "Read-only view of a GitHub webhook delivery (dedup table row).",
        "properties": {
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action"
          },
          "delivery_id": {
            "title": "Delivery Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "processed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Processed At"
          },
          "received_at": {
            "format": "date-time",
            "title": "Received At",
            "type": "string"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ref"
          },
          "repo_full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo Full Name"
          },
          "route_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Route Id",
            "type": "string"
          }
        },
        "required": [
          "delivery_id",
          "route_id",
          "event_type",
          "received_at"
        ],
        "title": "GitHubWebhookEventRead",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HfDownloadRead": {
        "properties": {
          "bytes_downloaded": {
            "title": "Bytes Downloaded",
            "type": "integer"
          },
          "bytes_total": {
            "title": "Bytes Total",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "gcs_uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Uri"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "model_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "repo_id": {
            "title": "Repo Id",
            "type": "string"
          },
          "requested_by": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By"
          },
          "revision": {
            "title": "Revision",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "repo_id",
          "revision",
          "filename",
          "state",
          "bytes_downloaded",
          "bytes_total",
          "gcs_uri",
          "error",
          "model_id",
          "requested_by",
          "created_at",
          "updated_at"
        ],
        "title": "HfDownloadRead",
        "type": "object"
      },
      "HfPullRequest": {
        "properties": {
          "filename": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Filename",
            "type": "string"
          },
          "license_acknowledged": {
            "default": false,
            "title": "License Acknowledged",
            "type": "boolean"
          },
          "repo_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Repo Id",
            "type": "string"
          },
          "revision": {
            "default": "main",
            "maxLength": 128,
            "title": "Revision",
            "type": "string"
          }
        },
        "required": [
          "repo_id",
          "filename"
        ],
        "title": "HfPullRequest",
        "type": "object"
      },
      "HfRepoDetail": {
        "properties": {
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author"
          },
          "gated": {
            "default": false,
            "title": "Gated",
            "type": "boolean"
          },
          "gguf_files": {
            "items": {
              "$ref": "#/components/schemas/HfRepoFile"
            },
            "title": "Gguf Files",
            "type": "array"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "repo_id": {
            "title": "Repo Id",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "repo_id"
        ],
        "title": "HfRepoDetail",
        "type": "object"
      },
      "HfRepoFile": {
        "properties": {
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "quantization": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantization"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "filename",
          "size_bytes"
        ],
        "title": "HfRepoFile",
        "type": "object"
      },
      "HfSearchResultItem": {
        "properties": {
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author"
          },
          "downloads": {
            "default": 0,
            "title": "Downloads",
            "type": "integer"
          },
          "last_modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Modified"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "likes": {
            "default": 0,
            "title": "Likes",
            "type": "integer"
          },
          "pipeline_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pipeline Tag"
          },
          "repo_id": {
            "title": "Repo Id",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "repo_id"
        ],
        "title": "HfSearchResultItem",
        "type": "object"
      },
      "IdentityProviderCreate": {
        "properties": {
          "alias": {
            "description": "Tenant-visible alias. The realm-wide alias is namespaced as tenant-<tenant_id>-<alias>.",
            "maxLength": 40,
            "minLength": 2,
            "pattern": "^[a-z0-9][a-z0-9-]{0,38}[a-z0-9]$",
            "title": "Alias",
            "type": "string"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "display_name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Display Name",
            "type": "string"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "provider_id": {
            "enum": [
              "oidc",
              "saml",
              "google",
              "microsoft",
              "github"
            ],
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "alias",
          "provider_id",
          "display_name"
        ],
        "title": "IdentityProviderCreate",
        "type": "object"
      },
      "IdentityProviderRead": {
        "description": "Returned to API callers. Hides the ``tenant-<id>-`` alias prefix.\n\n``provider_id`` is a plain ``str`` here (vs the ``ProviderId`` Literal on\ncreate/update) so an unrecognised ``providerId`` from Keycloak \u2014 e.g. an\nIdP created directly in the realm or a provider type added later \u2014 does\nnot 500 the read path. The Literal still gates writes.",
        "properties": {
          "alias": {
            "title": "Alias",
            "type": "string"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "alias",
          "provider_id",
          "display_name",
          "enabled",
          "config"
        ],
        "title": "IdentityProviderRead",
        "type": "object"
      },
      "IdentityProviderUpdate": {
        "properties": {
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          }
        },
        "title": "IdentityProviderUpdate",
        "type": "object"
      },
      "ImpersonateTenantResponse": {
        "description": "Response payload for ``POST /admin/tenants/{tenant_id}/impersonate``.\n\nThe client navigates to ``redirect_url`` after the active-tenant cookie is set.",
        "properties": {
          "redirect_url": {
            "title": "Redirect Url",
            "type": "string"
          }
        },
        "required": [
          "redirect_url"
        ],
        "title": "ImpersonateTenantResponse",
        "type": "object"
      },
      "InviteCreate": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "MEMBER",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "InviteCreate",
        "type": "object"
      },
      "InviteCreated": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "tenant_id",
          "role",
          "created"
        ],
        "title": "InviteCreated",
        "type": "object"
      },
      "InviteTenantAdminRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "InviteTenantAdminRequest",
        "type": "object"
      },
      "JsonObject": {
        "description": "Arbitrary JSON object. Mirrors `dict[str, Any]` on the Python side; codegen emits a model class with no required fields.",
        "type": "object"
      },
      "LinkedIdentityPurpose": {
        "enum": [
          "tool",
          "auth_mirror"
        ],
        "title": "LinkedIdentityPurpose",
        "type": "string"
      },
      "LinkedIdentityRead": {
        "description": "Public projection of a ``linked_identity`` row. Never includes tokens.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Label"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provider_subject": {
            "title": "Provider Subject",
            "type": "string"
          },
          "purpose": {
            "$ref": "#/components/schemas/LinkedIdentityPurpose"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "provider",
          "provider_subject",
          "display_label",
          "purpose",
          "scopes",
          "expires_at",
          "created_at"
        ],
        "title": "LinkedIdentityRead",
        "type": "object"
      },
      "ListenModeUpdate": {
        "description": "Body for `POST /tenant/{t}/agent/{a}/sessions/{s}/listen`.\n\nDrives the chat composer's \"listen\" toggle. `on=True` enters the silent\nloop (user messages buffer, the agent is not invoked); `on=False` exits\nand flushes the buffered messages as one combined prompt. See\ndocs/content/chat-listen-mode.md.",
        "properties": {
          "on": {
            "title": "On",
            "type": "boolean"
          }
        },
        "required": [
          "on"
        ],
        "title": "ListenModeUpdate",
        "type": "object"
      },
      "ListingKind": {
        "enum": [
          "skill",
          "agent"
        ],
        "title": "ListingKind",
        "type": "string"
      },
      "ListingVisibility": {
        "enum": [
          "public",
          "unlisted"
        ],
        "title": "ListingVisibility",
        "type": "string"
      },
      "LoginRequest": {
        "properties": {
          "password": {
            "minLength": 1,
            "title": "Password",
            "type": "string"
          },
          "username": {
            "minLength": 1,
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "username",
          "password"
        ],
        "title": "LoginRequest",
        "type": "object"
      },
      "LoginResponse": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "token_type": {
            "title": "Token Type",
            "type": "string"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "user_id",
          "email",
          "expires_in",
          "token_type"
        ],
        "title": "LoginResponse",
        "type": "object"
      },
      "MailboxKind": {
        "enum": [
          "internal",
          "external"
        ],
        "title": "MailboxKind",
        "type": "string"
      },
      "MarketplaceListingBrowse": {
        "description": "Lightweight projection for the public browse endpoint.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "slug",
          "description",
          "price_cents",
          "currency",
          "created_at"
        ],
        "title": "MarketplaceListingBrowse",
        "type": "object"
      },
      "MarketplaceListingCreate": {
        "description": "Body for POST /tenant/{tenant_id}/marketplace/listings.",
        "properties": {
          "currency": {
            "default": "USD",
            "title": "Currency",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "kind": {
            "$ref": "#/components/schemas/ListingKind"
          },
          "price_cents": {
            "default": 0,
            "minimum": 0.0,
            "title": "Price Cents",
            "type": "integer"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "source_agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Agent Id"
          },
          "source_skill_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Skill Id"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/ListingVisibility",
            "default": "public"
          }
        },
        "required": [
          "kind",
          "title",
          "slug"
        ],
        "title": "MarketplaceListingCreate",
        "type": "object"
      },
      "MarketplaceListingDetail": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "seller_user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Seller User Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceVersionRead"
            },
            "title": "Versions",
            "type": "array"
          },
          "visibility": {
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "seller_user_id",
          "kind",
          "title",
          "slug",
          "description",
          "price_cents",
          "currency",
          "status",
          "visibility",
          "created_at",
          "updated_at"
        ],
        "title": "MarketplaceListingDetail",
        "type": "object"
      },
      "MarketplaceListingRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "seller_user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Seller User Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "visibility": {
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "seller_user_id",
          "kind",
          "title",
          "slug",
          "description",
          "price_cents",
          "currency",
          "status",
          "visibility",
          "created_at",
          "updated_at"
        ],
        "title": "MarketplaceListingRead",
        "type": "object"
      },
      "MarketplacePayoutRead": {
        "description": "Response schema for payout history.",
        "properties": {
          "amount_cents": {
            "title": "Amount Cents",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "seller_user_id": {
            "title": "Seller User Id",
            "type": "string"
          },
          "stripe_transfer_id": {
            "title": "Stripe Transfer Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "seller_user_id",
          "stripe_transfer_id",
          "amount_cents",
          "currency",
          "created_at"
        ],
        "title": "MarketplacePayoutRead",
        "type": "object"
      },
      "MarketplaceVersionRead": {
        "properties": {
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "listing_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Listing Id",
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "id",
          "listing_id",
          "version",
          "sha256",
          "published_at"
        ],
        "title": "MarketplaceVersionRead",
        "type": "object"
      },
      "MeResponse": {
        "properties": {
          "active_tenant_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Tenant Id"
          },
          "is_super_admin": {
            "title": "Is Super Admin",
            "type": "boolean"
          },
          "user": {
            "$ref": "#/components/schemas/UserRead"
          }
        },
        "required": [
          "user",
          "active_tenant_id",
          "is_super_admin"
        ],
        "title": "MeResponse",
        "type": "object"
      },
      "MemberRoleUpdate": {
        "properties": {
          "role": {
            "pattern": "^(ADMIN|MEMBER|GUEST)$",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "MemberRoleUpdate",
        "type": "object"
      },
      "MemoryCitation": {
        "description": "``ctx.memory.cite`` response \u2014 full memory record + optional transcript.\n\nReturned by ``GET /api/internal/sessions/{s}/memory/{memory_id}``. The\n``source_message`` field is populated when the memory was written with a\n``source_message_id`` AND the target transcript row is still visible to\nthe calling session (cross-session reads return ``source_message=None``\nrather than 403 so the citation chain degrades gracefully).",
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "source_message": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TranscriptTurn"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Message Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "content",
          "kind"
        ],
        "title": "MemoryCitation",
        "type": "object"
      },
      "MemoryConflictListResponse": {
        "properties": {
          "conflicts": {
            "items": {
              "$ref": "#/components/schemas/MemoryConflictRead"
            },
            "title": "Conflicts",
            "type": "array"
          }
        },
        "required": [
          "conflicts"
        ],
        "title": "MemoryConflictListResponse",
        "type": "object"
      },
      "MemoryConflictRead": {
        "description": "A dream-cycle-detected pair of contradictory memories.\n\nMirrors ``models.agent_memory_conflict.AgentMemoryConflict`` minus\nthe FK columns. Used by both the tenant-admin route\n(``GET /tenant/{t}/agent/{a}/conflicts``) and the agent-side\ninternal route (``GET /sessions/{s}/memory/conflicts``).",
        "properties": {
          "detected_at": {
            "format": "date-time",
            "title": "Detected At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "memory_a_id": {
            "title": "Memory A Id",
            "type": "string"
          },
          "memory_b_id": {
            "title": "Memory B Id",
            "type": "string"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          }
        },
        "required": [
          "id",
          "memory_a_id",
          "memory_b_id",
          "detected_at"
        ],
        "title": "MemoryConflictRead",
        "type": "object"
      },
      "MemoryConflictResolve": {
        "description": "Body for ``POST .../conflicts/{id}/resolve``.\n\n``keep`` must be one of the conflict's two memory ids; the loser is\ndropped from Valkey and the conflict row is marked resolved with\n``resolution = {\"kept\": <keep>, \"dropped\": <loser>, \"reason\": <reason>}``.",
        "properties": {
          "keep": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Keep",
            "type": "string"
          },
          "reason": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "keep",
          "reason"
        ],
        "title": "MemoryConflictResolve",
        "type": "object"
      },
      "MemoryExportResponse": {
        "description": "Response from ``POST /tenant/{t}/agent/{a}/memory/export``.\n\nThe export lands at ``gcs_uri`` (per-agent workspace folder, decision\n#11). ``download_url`` is a short-lived V4 signed URL \u2014 None in\nenvironments where signing isn't wired (local kind), so the UI falls\nback to the ``gs://`` URI for direct access from the cluster.",
        "properties": {
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Url"
          },
          "exported": {
            "title": "Exported",
            "type": "integer"
          },
          "gcs_uri": {
            "title": "Gcs Uri",
            "type": "string"
          },
          "include_embeddings": {
            "title": "Include Embeddings",
            "type": "boolean"
          }
        },
        "required": [
          "gcs_uri",
          "exported",
          "include_embeddings"
        ],
        "title": "MemoryExportResponse",
        "type": "object"
      },
      "MemoryImportRequest": {
        "description": "JSON body for ``POST /tenant/{t}/agent/{a}/memory/import-from-gcs``.\n\nThe ``/import`` endpoint is multipart-only \u2014 its ``gcs_uri`` is\naccepted as a form field alongside the optional ``file`` upload. This\nschema is the dedicated JSON entry point that re-imports an existing\nexport (e.g. service-to-service callers that already have the\n``gs://`` URI of a prior export).",
        "properties": {
          "gcs_uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Uri"
          }
        },
        "title": "MemoryImportRequest",
        "type": "object"
      },
      "MemoryImportResponse": {
        "description": "Counts for ``POST /tenant/{t}/agent/{a}/memory/import``.\n\n``scanned`` is the number of JSONL rows the schema validator looked at;\n``imported`` is the subset that landed in Valkey; ``skipped`` is\nwell-formed rows the caller filtered out (e.g. duplicate ids); and\n``failed`` is rows that broke schema or re-embedding.",
        "properties": {
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "imported": {
            "title": "Imported",
            "type": "integer"
          },
          "scanned": {
            "title": "Scanned",
            "type": "integer"
          },
          "skipped": {
            "title": "Skipped",
            "type": "integer"
          }
        },
        "required": [
          "scanned",
          "imported",
          "skipped",
          "failed"
        ],
        "title": "MemoryImportResponse",
        "type": "object"
      },
      "MemorySummaryRead": {
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "generated_from_count": {
            "title": "Generated From Count",
            "type": "integer"
          },
          "summary_markdown": {
            "title": "Summary Markdown",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "summary_markdown",
          "as_of",
          "generated_from_count"
        ],
        "title": "MemorySummaryRead",
        "type": "object"
      },
      "MemorySummaryUpdate": {
        "properties": {
          "summary_markdown": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Summary Markdown",
            "type": "string"
          }
        },
        "required": [
          "summary_markdown"
        ],
        "title": "MemorySummaryUpdate",
        "type": "object"
      },
      "MentionItem": {
        "description": "A single resolved mention inside a chat message.",
        "properties": {
          "display": {
            "description": "Human-readable label shown in the chip",
            "minLength": 1,
            "title": "Display",
            "type": "string"
          },
          "id": {
            "description": "CUID (agent/user) or Slack channel id",
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MentionType"
          }
        },
        "required": [
          "type",
          "id",
          "display"
        ],
        "title": "MentionItem",
        "type": "object"
      },
      "MentionType": {
        "enum": [
          "agent",
          "user",
          "slack_channel"
        ],
        "title": "MentionType",
        "type": "string"
      },
      "MergeCallbackRequest": {
        "properties": {
          "category": {
            "examples": [
              "hris"
            ],
            "title": "Category",
            "type": "string"
          },
          "public_token": {
            "title": "Public Token",
            "type": "string"
          }
        },
        "required": [
          "public_token",
          "category"
        ],
        "title": "MergeCallbackRequest",
        "type": "object"
      },
      "MergeCallbackResponse": {
        "properties": {
          "external_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Account Id"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "title": "MergeCallbackResponse",
        "type": "object"
      },
      "MergeLinkTokenRequest": {
        "properties": {
          "category": {
            "examples": [
              "hris",
              "accounting",
              "crm"
            ],
            "title": "Category",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "organization_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Name"
          }
        },
        "required": [
          "category"
        ],
        "title": "MergeLinkTokenRequest",
        "type": "object"
      },
      "MergeLinkTokenResponse": {
        "properties": {
          "integration": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Integration"
          },
          "link_token": {
            "title": "Link Token",
            "type": "string"
          }
        },
        "required": [
          "link_token"
        ],
        "title": "MergeLinkTokenResponse",
        "type": "object"
      },
      "MessageContentText": {
        "properties": {
          "text": {
            "title": "Text",
            "type": "object"
          },
          "type": {
            "const": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "MessageContentText",
        "type": "object"
      },
      "MessageCreateRequest": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "role": {
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "MessageCreateRequest",
        "type": "object"
      },
      "MessageFeedbackCreate": {
        "description": "Body for POST .../messages/{message_id}/feedback.",
        "properties": {
          "rating": {
            "enum": [
              -1,
              1
            ],
            "title": "Rating",
            "type": "integer"
          }
        },
        "required": [
          "rating"
        ],
        "title": "MessageFeedbackCreate",
        "type": "object"
      },
      "MessageFeedbackRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "message_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Message Id",
            "type": "string"
          },
          "rating": {
            "title": "Rating",
            "type": "integer"
          },
          "session_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Session Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "message_id",
          "session_id",
          "agent_id",
          "user_id",
          "rating",
          "created_at",
          "updated_at"
        ],
        "title": "MessageFeedbackRead",
        "type": "object"
      },
      "MessageList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/MessageObject"
            },
            "title": "Data",
            "type": "array"
          },
          "first_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Id"
          },
          "has_more": {
            "default": false,
            "title": "Has More",
            "type": "boolean"
          },
          "last_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Id"
          },
          "object": {
            "const": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "MessageList",
        "type": "object"
      },
      "MessageObject": {
        "properties": {
          "assistant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assistant Id"
          },
          "content": {
            "items": {
              "$ref": "#/components/schemas/MessageContentText"
            },
            "title": "Content",
            "type": "array"
          },
          "created_at": {
            "title": "Created At",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "object": {
            "const": "thread.message",
            "title": "Object",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "thread_id": {
            "title": "Thread Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at",
          "thread_id",
          "role",
          "content"
        ],
        "title": "MessageObject",
        "type": "object"
      },
      "ModelConflictRead": {
        "properties": {
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          }
        },
        "required": [
          "model_id",
          "display_name"
        ],
        "title": "ModelConflictRead",
        "type": "object"
      },
      "ModelCreate": {
        "properties": {
          "config": {
            "title": "Config",
            "type": "object"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "kind": {
            "enum": [
              "local",
              "openrouter",
              "anthropic",
              "openai",
              "google",
              "mistral",
              "cohere",
              "custom_http"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "pricing": {
            "title": "Pricing",
            "type": "object"
          }
        },
        "required": [
          "name",
          "kind"
        ],
        "title": "ModelCreate",
        "type": "object"
      },
      "ModelEndpointCreate": {
        "description": "Register a new self-hosted model endpoint.",
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "context_window": {
            "default": 4096,
            "minimum": 1.0,
            "title": "Context Window",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "endpoint_url": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Endpoint Url",
            "type": "string"
          },
          "input_cost_per_1k": {
            "default": 0.0,
            "minimum": 0.0,
            "title": "Input Cost Per 1K",
            "type": "number"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "output_cost_per_1k": {
            "default": 0.0,
            "minimum": 0.0,
            "title": "Output Cost Per 1K",
            "type": "number"
          },
          "supports_streaming": {
            "default": false,
            "title": "Supports Streaming",
            "type": "boolean"
          },
          "supports_tools": {
            "default": false,
            "title": "Supports Tools",
            "type": "boolean"
          },
          "supports_vision": {
            "default": false,
            "title": "Supports Vision",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "endpoint_url"
        ],
        "title": "ModelEndpointCreate",
        "type": "object"
      },
      "ModelEndpointHealthResult": {
        "description": "Result of a health check against a self-hosted endpoint.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          },
          "reachable": {
            "title": "Reachable",
            "type": "boolean"
          }
        },
        "required": [
          "model_id",
          "reachable"
        ],
        "title": "ModelEndpointHealthResult",
        "type": "object"
      },
      "ModelEndpointRead": {
        "description": "Response for a self-hosted model endpoint. ``api_key`` is never returned.",
        "properties": {
          "context_window": {
            "title": "Context Window",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "endpoint_url": {
            "title": "Endpoint Url",
            "type": "string"
          },
          "health_checked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Health Checked At"
          },
          "health_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Health Latency Ms"
          },
          "health_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Health Status"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "input_cost_per_1k": {
            "title": "Input Cost Per 1K",
            "type": "number"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "output_cost_per_1k": {
            "title": "Output Cost Per 1K",
            "type": "number"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "supports_streaming": {
            "title": "Supports Streaming",
            "type": "boolean"
          },
          "supports_tools": {
            "title": "Supports Tools",
            "type": "boolean"
          },
          "supports_vision": {
            "title": "Supports Vision",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "endpoint_url",
          "status",
          "input_cost_per_1k",
          "output_cost_per_1k",
          "context_window",
          "supports_tools",
          "supports_vision",
          "supports_streaming",
          "created_at",
          "updated_at"
        ],
        "title": "ModelEndpointRead",
        "type": "object"
      },
      "ModelEndpointUpdate": {
        "description": "Partial update of a self-hosted model endpoint.",
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "context_window": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "endpoint_url": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint Url"
          },
          "input_cost_per_1k": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Cost Per 1K"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "output_cost_per_1k": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Cost Per 1K"
          },
          "supports_streaming": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Streaming"
          },
          "supports_tools": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Tools"
          },
          "supports_vision": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Vision"
          }
        },
        "title": "ModelEndpointUpdate",
        "type": "object"
      },
      "ModelRead": {
        "properties": {
          "available_to_all_tenants": {
            "default": false,
            "title": "Available To All Tenants",
            "type": "boolean"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "failover_chain": {
            "items": {
              "maxLength": 25,
              "minLength": 25,
              "pattern": "^c[a-z0-9]{24}$",
              "type": "string"
            },
            "title": "Failover Chain",
            "type": "array"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_free": {
            "title": "Is Free",
            "type": "boolean"
          },
          "is_system_default": {
            "default": false,
            "title": "Is System Default",
            "type": "boolean"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Owner User Id",
            "type": "string"
          },
          "pricing": {
            "title": "Pricing",
            "type": "object"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_user_id",
          "name",
          "description",
          "kind",
          "status",
          "is_free",
          "config",
          "pricing",
          "endpoint",
          "created_at",
          "updated_at"
        ],
        "title": "ModelRead",
        "type": "object"
      },
      "ModelUpdate": {
        "properties": {
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "pricing": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "disabled",
                  "experimental",
                  "deprecated"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "ModelUpdate",
        "type": "object"
      },
      "PendingTenantInviteRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "invited_by_user_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By User Id"
          }
        },
        "required": [
          "id",
          "email",
          "invited_by_user_id",
          "created_at"
        ],
        "title": "PendingTenantInviteRead",
        "type": "object"
      },
      "PlanChangeRequest": {
        "properties": {
          "plan_code": {
            "maxLength": 32,
            "minLength": 1,
            "title": "Plan Code",
            "type": "string"
          }
        },
        "required": [
          "plan_code"
        ],
        "title": "PlanChangeRequest",
        "type": "object"
      },
      "PlanRead": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "features": {
            "title": "Features",
            "type": "object"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_super_admin": {
            "title": "Is Super Admin",
            "type": "boolean"
          },
          "max_agents": {
            "title": "Max Agents",
            "type": "integer"
          },
          "max_concurrent_sessions": {
            "title": "Max Concurrent Sessions",
            "type": "integer"
          },
          "max_connections_per_agent": {
            "title": "Max Connections Per Agent",
            "type": "integer"
          },
          "max_mailboxes_per_agent": {
            "title": "Max Mailboxes Per Agent",
            "type": "integer"
          },
          "max_messages_per_mailbox": {
            "title": "Max Messages Per Mailbox",
            "type": "integer"
          },
          "max_storage_gb": {
            "title": "Max Storage Gb",
            "type": "integer"
          },
          "max_tasks_per_day": {
            "title": "Max Tasks Per Day",
            "type": "integer"
          },
          "price_cents": {
            "title": "Price Cents",
            "type": "integer"
          },
          "stripe_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Price Id"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "display_name",
          "is_super_admin",
          "max_agents",
          "max_tasks_per_day",
          "max_concurrent_sessions",
          "max_storage_gb",
          "max_mailboxes_per_agent",
          "max_messages_per_mailbox",
          "max_connections_per_agent",
          "price_cents",
          "stripe_price_id",
          "features",
          "created_at",
          "updated_at"
        ],
        "title": "PlanRead",
        "type": "object"
      },
      "PlanUpdateRequest": {
        "properties": {
          "max_connections_per_agent": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Connections Per Agent"
          }
        },
        "title": "PlanUpdateRequest",
        "type": "object"
      },
      "PlatformBrandFaviconUploaded": {
        "properties": {
          "favicon_content_type": {
            "title": "Favicon Content Type",
            "type": "string"
          },
          "favicon_sha256": {
            "title": "Favicon Sha256",
            "type": "string"
          },
          "favicon_size_bytes": {
            "title": "Favicon Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "favicon_sha256",
          "favicon_content_type",
          "favicon_size_bytes"
        ],
        "title": "PlatformBrandFaviconUploaded",
        "type": "object"
      },
      "PlatformBrandRead": {
        "properties": {
          "favicon_content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Content Type"
          },
          "favicon_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Sha256"
          },
          "favicon_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Size Bytes"
          },
          "has_favicon": {
            "title": "Has Favicon",
            "type": "boolean"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "required": [
          "has_favicon"
        ],
        "title": "PlatformBrandRead",
        "type": "object"
      },
      "PlatformSecretRevealRead": {
        "properties": {
          "last_rotated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Rotated At"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "value",
          "last_rotated_at"
        ],
        "title": "PlatformSecretRevealRead",
        "type": "object"
      },
      "PlatformSecretRow": {
        "properties": {
          "is_set": {
            "title": "Is Set",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "last_rotated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Rotated At"
          },
          "masked": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Masked"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "rotated_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rotated By User Id"
          }
        },
        "required": [
          "provider",
          "label",
          "is_set",
          "last_rotated_at",
          "rotated_by_user_id",
          "masked"
        ],
        "title": "PlatformSecretRow",
        "type": "object"
      },
      "PlatformSecretSetRequest": {
        "description": "Body for PUT /admin/platform-secrets/{provider}.\n\n``label`` is required when creating a new provider; it's optional when\nrotating the value of an existing one (omit to keep the existing label).",
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "title": "PlatformSecretSetRequest",
        "type": "object"
      },
      "PolicyCreate": {
        "properties": {
          "act": {
            "title": "Act",
            "type": "string"
          },
          "eft": {
            "default": "allow",
            "title": "Eft",
            "type": "string"
          },
          "obj": {
            "title": "Obj",
            "type": "string"
          },
          "sub": {
            "title": "Sub",
            "type": "string"
          }
        },
        "required": [
          "sub",
          "obj",
          "act"
        ],
        "title": "PolicyCreate",
        "type": "object"
      },
      "PolicyRead": {
        "properties": {
          "act": {
            "title": "Act",
            "type": "string"
          },
          "dom": {
            "title": "Dom",
            "type": "string"
          },
          "eft": {
            "title": "Eft",
            "type": "string"
          },
          "obj": {
            "title": "Obj",
            "type": "string"
          },
          "sub": {
            "title": "Sub",
            "type": "string"
          }
        },
        "required": [
          "sub",
          "dom",
          "obj",
          "act",
          "eft"
        ],
        "title": "PolicyRead",
        "type": "object"
      },
      "ProjectRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "slug",
          "created_at",
          "updated_at"
        ],
        "title": "ProjectRead",
        "type": "object"
      },
      "RBACCheckRequest": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "action"
        ],
        "title": "RBACCheckRequest",
        "type": "object"
      },
      "RBACCheckResponse": {
        "properties": {
          "allowed": {
            "title": "Allowed",
            "type": "boolean"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "allowed",
          "reason"
        ],
        "title": "RBACCheckResponse",
        "type": "object"
      },
      "ReassignAgentTenantRequest": {
        "properties": {
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id"
        ],
        "title": "ReassignAgentTenantRequest",
        "type": "object"
      },
      "ReassignAgentTenantResponse": {
        "description": "Response from ``PUT /admin/agents/{agent_id}/tenant``.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "integration_warnings": {
            "items": {
              "type": "string"
            },
            "title": "Integration Warnings",
            "type": "array"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_seed": {
            "title": "Is Seed",
            "type": "boolean"
          },
          "model_conflicts": {
            "items": {
              "$ref": "#/components/schemas/ModelConflictRead"
            },
            "title": "Model Conflicts",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "slug",
          "is_active",
          "is_seed",
          "created_at",
          "updated_at",
          "model_conflicts",
          "integration_warnings"
        ],
        "title": "ReassignAgentTenantResponse",
        "type": "object"
      },
      "ReorderItem": {
        "properties": {
          "display_order": {
            "minimum": 0.0,
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_order"
        ],
        "title": "ReorderItem",
        "type": "object"
      },
      "ReorderRequest": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ReorderItem"
            },
            "minItems": 1,
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "ReorderRequest",
        "type": "object"
      },
      "RunCreateRequest": {
        "properties": {
          "additional_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Instructions"
          },
          "additional_messages": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MessageCreateRequest"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Messages"
          },
          "assistant_id": {
            "title": "Assistant Id",
            "type": "string"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "stream": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stream"
          }
        },
        "required": [
          "assistant_id"
        ],
        "title": "RunCreateRequest",
        "type": "object"
      },
      "RunObject": {
        "properties": {
          "assistant_id": {
            "title": "Assistant Id",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "model": {
            "default": "good-place-agent",
            "title": "Model",
            "type": "string"
          },
          "object": {
            "const": "thread.run",
            "title": "Object",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "thread_id": {
            "title": "Thread Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at",
          "thread_id",
          "assistant_id",
          "status"
        ],
        "title": "RunObject",
        "type": "object"
      },
      "SSOConfigRead": {
        "description": "SSO configuration surface for the tenant Organization > Security page.",
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "identity_providers": {
            "items": {
              "$ref": "#/components/schemas/SSOIdentityProviderSummary"
            },
            "title": "Identity Providers",
            "type": "array"
          },
          "issuer_url": {
            "title": "Issuer Url",
            "type": "string"
          },
          "realm": {
            "title": "Realm",
            "type": "string"
          }
        },
        "required": [
          "active",
          "realm",
          "issuer_url",
          "identity_providers"
        ],
        "title": "SSOConfigRead",
        "type": "object"
      },
      "SSOIdentityProviderSummary": {
        "description": "Minimal IdP projection for the SSO config overview.",
        "properties": {
          "alias": {
            "title": "Alias",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "alias",
          "display_name",
          "provider_id",
          "enabled"
        ],
        "title": "SSOIdentityProviderSummary",
        "type": "object"
      },
      "SampleUseCaseCreate": {
        "properties": {
          "category": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Category",
            "type": "string"
          },
          "description": {
            "maxLength": 5000,
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "title": {
            "maxLength": 500,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title",
          "description",
          "category"
        ],
        "title": "SampleUseCaseCreate",
        "type": "object"
      },
      "SampleUseCaseIconUploaded": {
        "properties": {
          "icon_content_type": {
            "title": "Icon Content Type",
            "type": "string"
          },
          "icon_sha256": {
            "title": "Icon Sha256",
            "type": "string"
          },
          "icon_size_bytes": {
            "title": "Icon Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "icon_sha256",
          "icon_content_type",
          "icon_size_bytes"
        ],
        "title": "SampleUseCaseIconUploaded",
        "type": "object"
      },
      "SampleUseCaseRead": {
        "properties": {
          "category": {
            "title": "Category",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "has_icon": {
            "title": "Has Icon",
            "type": "boolean"
          },
          "icon_content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Content Type"
          },
          "icon_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Sha256"
          },
          "icon_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Size Bytes"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "category",
          "has_icon",
          "icon_content_type",
          "icon_sha256",
          "icon_size_bytes",
          "display_order",
          "is_active",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "title": "SampleUseCaseRead",
        "type": "object"
      },
      "SampleUseCaseUpdate": {
        "properties": {
          "category": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 5000,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "SampleUseCaseUpdate",
        "type": "object"
      },
      "SelfEditBranchRead": {
        "description": "One row in the agent code-tab \"self-edit branches\" table.\n\n``mr_url`` is ``None`` when the SDK has pushed the branch but no merge\nrequest has been opened yet. The front-end renders the \"review MR\" link\nonly when the field is present.",
        "properties": {
          "author": {
            "title": "Author",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "mr_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mr Url"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "sha": {
            "title": "Sha",
            "type": "string"
          }
        },
        "required": [
          "name",
          "sha",
          "author",
          "created_at"
        ],
        "title": "SelfEditBranchRead",
        "type": "object"
      },
      "ServiceStatusRead": {
        "properties": {
          "bars": {
            "items": {
              "enum": [
                "green",
                "yellow",
                "red",
                "gray"
              ],
              "type": "string"
            },
            "title": "Bars",
            "type": "array"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "kind": {
            "enum": [
              "internal",
              "connector"
            ],
            "title": "Kind",
            "type": "string"
          },
          "service_key": {
            "title": "Service Key",
            "type": "string"
          }
        },
        "required": [
          "service_key",
          "display_name",
          "kind",
          "bars"
        ],
        "title": "ServiceStatusRead",
        "type": "object"
      },
      "SessionAttachmentRead": {
        "description": "Response for a successfully uploaded session attachment.\n\n``kind`` is constrained to the values of the ``AttachmentKind`` ORM enum so\nthe OpenAPI snapshot (which feeds the mobile Dart client) carries the\nallowed values rather than a free-form string.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "gcs_path": {
            "title": "Gcs Path",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "image",
              "document"
            ],
            "title": "Kind",
            "type": "string"
          },
          "session_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Session Id",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "session_id",
          "tenant_id",
          "agent_id",
          "filename",
          "content_type",
          "size_bytes",
          "sha256",
          "gcs_path",
          "kind",
          "created_at"
        ],
        "title": "SessionAttachmentRead",
        "type": "object"
      },
      "SessionTitleUpdate": {
        "description": "Body for ``PATCH /tenant/{t}/agent/{a}/sessions/{s}``.\n\nLets a user rename the current session from the chat header. The auto-namer\n(``services.session_naming``) still runs on every 5th user message and will\noverwrite a stale title, but a user-supplied title takes effect immediately\nand survives until the next auto-rename boundary.",
        "properties": {
          "title": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "SessionTitleUpdate",
        "type": "object"
      },
      "SiemConfigRead": {
        "description": "Response schema for GET /settings/siem.",
        "properties": {
          "custom_redaction_patterns": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CustomRedactionPattern"
            },
            "title": "Custom Redaction Patterns",
            "type": "array"
          },
          "destinations": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/SiemDestinationRead"
            },
            "title": "Destinations",
            "type": "array"
          }
        },
        "title": "SiemConfigRead",
        "type": "object"
      },
      "SiemConfigUpdate": {
        "description": "Request schema for PUT /settings/siem.",
        "properties": {
          "custom_redaction_patterns": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CustomRedactionPattern"
            },
            "title": "Custom Redaction Patterns",
            "type": "array"
          },
          "destinations": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/SiemDestination"
            },
            "title": "Destinations",
            "type": "array"
          }
        },
        "title": "SiemConfigUpdate",
        "type": "object"
      },
      "SiemDestination": {
        "description": "A single SIEM forwarding destination.",
        "properties": {
          "destination_type": {
            "$ref": "#/components/schemas/SiemDestinationType"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "endpoint_url": {
            "maxLength": 2048,
            "minLength": 1,
            "title": "Endpoint Url",
            "type": "string"
          },
          "token": {
            "anyOf": [
              {
                "maxLength": 4096,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token"
          }
        },
        "required": [
          "destination_type",
          "endpoint_url"
        ],
        "title": "SiemDestination",
        "type": "object"
      },
      "SiemDestinationRead": {
        "description": "Read-only view of a SIEM destination (token masked).",
        "properties": {
          "destination_type": {
            "$ref": "#/components/schemas/SiemDestinationType"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "endpoint_url": {
            "title": "Endpoint Url",
            "type": "string"
          },
          "has_token": {
            "title": "Has Token",
            "type": "boolean"
          }
        },
        "required": [
          "destination_type",
          "enabled",
          "endpoint_url",
          "has_token"
        ],
        "title": "SiemDestinationRead",
        "type": "object"
      },
      "SiemDestinationType": {
        "description": "Supported SIEM destination types.",
        "enum": [
          "splunk_hec",
          "datadog",
          "syslog",
          "webhook"
        ],
        "title": "SiemDestinationType",
        "type": "string"
      },
      "SkillAdminRead": {
        "description": "Extended skill view for tenant admins \u2014 includes derived fields.",
        "properties": {
          "agent_count": {
            "title": "Agent Count",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entrypoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entrypoint"
          },
          "forked_from_skill_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Skill Id"
          },
          "forked_from_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Version"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "instruction_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction Content"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "network_enabled": {
            "title": "Network Enabled",
            "type": "boolean"
          },
          "owner_agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Agent Id"
          },
          "owner_agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Agent Name"
          },
          "review_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Notes"
          },
          "review_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Status"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewer_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewer Id"
          },
          "skill_type": {
            "title": "Skill Type",
            "type": "string"
          },
          "source_repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repo Url"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "string"
          },
          "visibility": {
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_agent_id",
          "name",
          "description",
          "summary",
          "skill_type",
          "source_repo_url",
          "entrypoint",
          "instruction_content",
          "version",
          "visibility",
          "status",
          "review_status",
          "reviewer_id",
          "reviewed_at",
          "review_notes",
          "network_enabled",
          "tags",
          "created_at",
          "owner_agent_name",
          "agent_count"
        ],
        "title": "SkillAdminRead",
        "type": "object"
      },
      "SkillAgentRead": {
        "description": "Lightweight agent summary for the per-skill agents list.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "is_enabled": {
            "title": "Is Enabled",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "name",
          "is_enabled"
        ],
        "title": "SkillAgentRead",
        "type": "object"
      },
      "SkillCreate": {
        "properties": {
          "description": {
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "entrypoint": {
            "default": "skill:run",
            "title": "Entrypoint",
            "type": "string"
          },
          "instruction_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction Content"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "network_enabled": {
            "default": false,
            "title": "Network Enabled",
            "type": "boolean"
          },
          "owner_agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Owner Agent Id",
            "type": "string"
          },
          "skill_type": {
            "enum": [
              "executable",
              "text"
            ],
            "title": "Skill Type",
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "visibility": {
            "enum": [
              "public",
              "private"
            ],
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "owner_agent_id"
        ],
        "title": "SkillCreate",
        "type": "object"
      },
      "SkillCredentialCreate": {
        "description": "Body for ``PUT /\u2026/skill-credentials/skill/{skill_id}`` \u2014 upsert on a triple.\n\nThe plaintext ``payload`` is encrypted immediately via the per-tenant\nFernet key and never written to the database in clear. Idempotent on the\ntriple \u2014 a second call with the same ``(agent_id, skill_id)`` overwrites\nthe previous row's ciphertext (rotation).",
        "properties": {
          "agent_id": {
            "minLength": 1,
            "title": "Agent Id",
            "type": "string"
          },
          "credential_kind": {
            "$ref": "#/components/schemas/SkillCredentialKind"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "payload": {
            "description": "Plaintext credential material. Encrypted immediately and never stored in clear. Treat as write-only.",
            "minLength": 1,
            "title": "Payload",
            "type": "string"
          },
          "skill_id": {
            "minLength": 1,
            "title": "Skill Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "skill_id",
          "credential_kind",
          "payload"
        ],
        "title": "SkillCredentialCreate",
        "type": "object"
      },
      "SkillCredentialKind": {
        "description": "Discriminator for the encrypted payload shape.\n\nStorage is opaque ``bytes`` either way; ``kind`` is metadata the skill\nruntime uses to interpret the plaintext (e.g. \"this is a JSON\n``{access_token, refresh_token}`` blob\" vs \"this is a raw API key\").",
        "enum": [
          "oauth_token",
          "pat",
          "api_key",
          "totp_seed"
        ],
        "title": "SkillCredentialKind",
        "type": "string"
      },
      "SkillCredentialRead": {
        "description": "Public projection \u2014 metadata only, never the payload.",
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "credential_kind": {
            "$ref": "#/components/schemas/SkillCredentialKind"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "skill_id": {
            "title": "Skill Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "agent_id",
          "skill_id",
          "credential_kind",
          "created_at",
          "updated_at",
          "last_used_at",
          "expires_at",
          "revoked_at"
        ],
        "title": "SkillCredentialRead",
        "type": "object"
      },
      "SkillCredentialReveal": {
        "description": "Returned by the read endpoint. Contains the decrypted payload.",
        "properties": {
          "credential_kind": {
            "$ref": "#/components/schemas/SkillCredentialKind"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "payload": {
            "title": "Payload",
            "type": "string"
          }
        },
        "required": [
          "id",
          "credential_kind",
          "payload"
        ],
        "title": "SkillCredentialReveal",
        "type": "object"
      },
      "SkillExecuteRequest": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "duration_ms": {
            "default": 0,
            "description": "Wall-clock ms, reported by the agent SDK",
            "minimum": 0.0,
            "title": "Duration Ms",
            "type": "integer"
          },
          "input_args": {
            "title": "Input Args",
            "type": "object"
          },
          "session_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "agent_id"
        ],
        "title": "SkillExecuteRequest",
        "type": "object"
      },
      "SkillForkRead": {
        "description": "Response from POST /skills/{skill_id}/fork \u2014 the newly created skill.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entrypoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entrypoint"
          },
          "forked_from_skill_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Skill Id"
          },
          "forked_from_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Version"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "instruction_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction Content"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "network_enabled": {
            "title": "Network Enabled",
            "type": "boolean"
          },
          "owner_agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Agent Id"
          },
          "skill_type": {
            "title": "Skill Type",
            "type": "string"
          },
          "source_repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repo Url"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "string"
          },
          "visibility": {
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_agent_id",
          "name",
          "description",
          "summary",
          "skill_type",
          "source_repo_url",
          "entrypoint",
          "instruction_content",
          "version",
          "visibility",
          "status",
          "network_enabled",
          "tags",
          "forked_from_skill_id",
          "forked_from_version",
          "created_at"
        ],
        "title": "SkillForkRead",
        "type": "object"
      },
      "SkillForkRequest": {
        "description": "Request body for POST /skills/{skill_id}/fork.",
        "properties": {
          "target_agent_id": {
            "description": "Agent that will own the forked skill",
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Target Agent Id",
            "type": "string"
          }
        },
        "required": [
          "target_agent_id"
        ],
        "title": "SkillForkRequest",
        "type": "object"
      },
      "SkillGlobalSummary": {
        "properties": {
          "by_status": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "By Status",
            "type": "object"
          },
          "by_type": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "By Type",
            "type": "object"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "by_status",
          "by_type"
        ],
        "title": "SkillGlobalSummary",
        "type": "object"
      },
      "SkillImportResult": {
        "description": "Response from POST /skills/import.",
        "properties": {
          "allowed_tools": {
            "items": {
              "type": "string"
            },
            "title": "Allowed Tools",
            "type": "array"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "entrypoint": {
            "title": "Entrypoint",
            "type": "string"
          },
          "env_vars": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Env Vars",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instructions": {
            "title": "Instructions",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "network_enabled": {
            "title": "Network Enabled",
            "type": "boolean"
          },
          "source_repo_url": {
            "title": "Source Repo Url",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "entrypoint",
          "version",
          "status",
          "source_repo_url",
          "instructions",
          "network_enabled",
          "env_vars",
          "allowed_tools"
        ],
        "title": "SkillImportResult",
        "type": "object"
      },
      "SkillInvocationRead": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "duration_ms": {
            "title": "Duration Ms",
            "type": "integer"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "session_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Session Id",
            "type": "string"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          },
          "skill_platform_secret_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Platform Secret Name"
          },
          "skill_platform_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Platform Token"
          },
          "skill_version": {
            "title": "Skill Version",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "enum": [
              "success",
              "error",
              "timeout"
            ],
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "skill_id",
          "skill_version",
          "agent_id",
          "user_id",
          "session_id",
          "tenant_id",
          "status",
          "duration_ms",
          "error_message",
          "started_at",
          "created_at"
        ],
        "title": "SkillInvocationRead",
        "type": "object"
      },
      "SkillPublishRequest": {
        "properties": {
          "version": {
            "description": "Git tag or ref to publish",
            "maxLength": 128,
            "minLength": 1,
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "version"
        ],
        "title": "SkillPublishRequest",
        "type": "object"
      },
      "SkillRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "entrypoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entrypoint"
          },
          "forked_from_skill_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Skill Id"
          },
          "forked_from_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Forked From Version"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "instruction_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction Content"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "network_enabled": {
            "title": "Network Enabled",
            "type": "boolean"
          },
          "owner_agent_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Agent Id"
          },
          "review_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Notes"
          },
          "review_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Status"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewer_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewer Id"
          },
          "skill_type": {
            "title": "Skill Type",
            "type": "string"
          },
          "source_repo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repo Url"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "string"
          },
          "visibility": {
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_agent_id",
          "name",
          "description",
          "summary",
          "skill_type",
          "source_repo_url",
          "entrypoint",
          "instruction_content",
          "version",
          "visibility",
          "status",
          "review_status",
          "reviewer_id",
          "reviewed_at",
          "review_notes",
          "network_enabled",
          "tags",
          "created_at"
        ],
        "title": "SkillRead",
        "type": "object"
      },
      "SkillReviewDecision": {
        "description": "Admin decision on a pending skill review.",
        "properties": {
          "decision": {
            "enum": [
              "approved",
              "rejected"
            ],
            "title": "Decision",
            "type": "string"
          },
          "review_notes": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Notes"
          }
        },
        "required": [
          "decision"
        ],
        "title": "SkillReviewDecision",
        "type": "object"
      },
      "SkillReviewResponse": {
        "description": "Response after a review action.",
        "properties": {
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "review_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Notes"
          },
          "review_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Status"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewer_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewer Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "review_status",
          "reviewer_id",
          "reviewed_at",
          "review_notes",
          "status"
        ],
        "title": "SkillReviewResponse",
        "type": "object"
      },
      "SkillTransferRequest": {
        "description": "Request body for POST /skills/{skill_id}/transfer.",
        "properties": {
          "target_agent_id": {
            "description": "Agent to transfer ownership to",
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Target Agent Id",
            "type": "string"
          }
        },
        "required": [
          "target_agent_id"
        ],
        "title": "SkillTransferRequest",
        "type": "object"
      },
      "SkillUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "instruction_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction Content"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "network_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Network Enabled"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "draft",
                  "active",
                  "deprecated",
                  "archived",
                  "pending_review"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "title": "SkillUpdate",
        "type": "object"
      },
      "SkillWebhookCreated": {
        "description": "Returned only on create/rotate \u2014 includes the raw bearer token (shown once).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "webhook_id": {
            "title": "Webhook Id",
            "type": "string"
          },
          "webhook_url": {
            "title": "Webhook Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "skill_id",
          "tenant_id",
          "webhook_id",
          "webhook_url",
          "created_at",
          "updated_at",
          "token"
        ],
        "title": "SkillWebhookCreated",
        "type": "object"
      },
      "SkillWebhookRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "skill_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Skill Id",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "webhook_id": {
            "title": "Webhook Id",
            "type": "string"
          },
          "webhook_url": {
            "title": "Webhook Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "skill_id",
          "tenant_id",
          "webhook_id",
          "webhook_url",
          "created_at",
          "updated_at"
        ],
        "title": "SkillWebhookRead",
        "type": "object"
      },
      "SshKeyAdd": {
        "description": "Request body for adding or rotating an SSH private key.\n\nThe key is encrypted immediately and never returned via the API.\nProvider is stored as ``ssh:<host>`` so each target host has a distinct\nlinked_identity row.",
        "properties": {
          "host": {
            "description": "Hostname or IP address of the target server. Only letters, digits, dots, hyphens, and underscores are allowed \u2014 must match what the `ssh` connector accepts at exec time.",
            "maxLength": 59,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._-]+$",
            "title": "Host",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable label for this key (defaults to username@host:port)",
            "title": "Label"
          },
          "port": {
            "default": 22,
            "description": "SSH port (default 22)",
            "maximum": 65535.0,
            "minimum": 1.0,
            "title": "Port",
            "type": "integer"
          },
          "private_key": {
            "description": "PEM or OpenSSH private key material (Ed25519, RSA, ECDSA, or DSS)",
            "minLength": 40,
            "title": "Private Key",
            "type": "string"
          },
          "username": {
            "description": "SSH username (letters, digits, dots, hyphens, underscores).",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9._-]+$",
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "host",
          "username",
          "private_key"
        ],
        "title": "SshKeyAdd",
        "type": "object"
      },
      "StartLinkResponse": {
        "description": "Returned by the ``start`` route.\n\n``authorize_url`` is the full upstream URL the browser must follow to begin\nthe OAuth dance. ``state`` is included so a JSON client (mobile, integration\ntests) can verify it matches the eventual callback \u2014 browser SPAs normally\nonly need the URL.",
        "properties": {
          "authorize_url": {
            "title": "Authorize Url",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "authorize_url",
          "state"
        ],
        "title": "StartLinkResponse",
        "type": "object"
      },
      "StatusAlertCreate": {
        "properties": {
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "platform_wide": {
            "default": false,
            "description": "If true, alert applies to all tenants. SuperAdmin only.",
            "title": "Platform Wide",
            "type": "boolean"
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "error",
              "critical"
            ],
            "title": "Severity",
            "type": "string"
          },
          "title": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "StatusAlertCreate",
        "type": "object"
      },
      "StatusAlertPatch": {
        "properties": {
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "severity": {
            "anyOf": [
              {
                "enum": [
                  "info",
                  "warning",
                  "error",
                  "critical"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "resolved"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "StatusAlertPatch",
        "type": "object"
      },
      "StatusAlertRead": {
        "properties": {
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Agent Id"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "severity",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "StatusAlertRead",
        "type": "object"
      },
      "StatusAlertTimelineRead": {
        "properties": {
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Agent Id"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "updates": {
            "items": {
              "$ref": "#/components/schemas/StatusAlertUpdateRead"
            },
            "title": "Updates",
            "type": "array"
          }
        },
        "required": [
          "id",
          "title",
          "severity",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "StatusAlertTimelineRead",
        "type": "object"
      },
      "StatusAlertUpdateCreate": {
        "properties": {
          "body": {
            "minLength": 1,
            "title": "Body",
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "title": "StatusAlertUpdateCreate",
        "type": "object"
      },
      "StatusAlertUpdateRead": {
        "properties": {
          "alert_id": {
            "title": "Alert Id",
            "type": "string"
          },
          "body": {
            "title": "Body",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Agent Id"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "alert_id",
          "body",
          "created_at"
        ],
        "title": "StatusAlertUpdateRead",
        "type": "object"
      },
      "SubscriptionRead": {
        "description": "Current plan + Stripe lifecycle status for a tenant.",
        "properties": {
          "plan_code": {
            "title": "Plan Code",
            "type": "string"
          },
          "plan_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Plan Id",
            "type": "string"
          },
          "plan_status": {
            "enum": [
              "trialing",
              "active",
              "past_due",
              "canceled"
            ],
            "title": "Plan Status",
            "type": "string"
          },
          "stripe_customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Customer Id"
          },
          "stripe_enterprise_subscription_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Enterprise Subscription Id"
          },
          "stripe_subscription_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Subscription Id"
          },
          "stripe_support_subscription_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Support Subscription Id"
          }
        },
        "required": [
          "plan_id",
          "plan_code",
          "plan_status",
          "stripe_customer_id",
          "stripe_subscription_id"
        ],
        "title": "SubscriptionRead",
        "type": "object"
      },
      "SystemDefaultModelSet": {
        "description": "Request body for PUT /admin/models/system-default.",
        "properties": {
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          }
        },
        "required": [
          "model_id"
        ],
        "title": "SystemDefaultModelSet",
        "type": "object"
      },
      "TaskMessageCreate": {
        "description": "Body for `POST /tenant/{t}/agent/{a}/sessions/{s}/messages`.\n\nContent is jsonb \u2014 typically `{\"text\": \"...\"}` for plain user messages but\ncan carry structured payloads (tool results, attachments). Role is locked\nto ``user``: browser-bound callers can't forge `assistant` / `system` /\n`tool` history. Internal callers (the agent SDK) inject those roles via\nthe internal API surface, not this route.",
        "properties": {
          "content": {
            "title": "Content",
            "type": "object"
          },
          "mentions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MentionItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mentions"
          },
          "role": {
            "const": "user",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "TaskMessageCreate",
        "type": "object"
      },
      "TaskMessageOut": {
        "description": "Response shape for a single persisted message.",
        "properties": {
          "content": {
            "title": "Content",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_seed": {
            "default": false,
            "title": "Is Seed",
            "type": "boolean"
          },
          "mentions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MentionItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mentions"
          },
          "role": {
            "$ref": "#/components/schemas/TaskMessageRole"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "token_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Count"
          }
        },
        "required": [
          "id",
          "session_id",
          "role",
          "content",
          "token_count",
          "created_at"
        ],
        "title": "TaskMessageOut",
        "type": "object"
      },
      "TaskMessageRead": {
        "properties": {
          "completion_tokens": {
            "default": 0,
            "title": "Completion Tokens",
            "type": "integer"
          },
          "content": {
            "title": "Content",
            "type": "object"
          },
          "cost_cents": {
            "default": 0,
            "title": "Cost Cents",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "mentions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MentionItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mentions"
          },
          "prompt_tokens": {
            "default": 0,
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "session_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Session Id",
            "type": "string"
          },
          "token_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Count"
          }
        },
        "required": [
          "id",
          "session_id",
          "role",
          "content",
          "created_at"
        ],
        "title": "TaskMessageRead",
        "type": "object"
      },
      "TaskMessageRole": {
        "enum": [
          "system",
          "user",
          "assistant",
          "tool"
        ],
        "title": "TaskMessageRole",
        "type": "string"
      },
      "TaskSessionCreate": {
        "description": "Body for `POST /tenant/{t}/agent/{a}/sessions`.\n\n`initial_message` is optional \u2014 callers can create an idle session and post\nthe first message separately. `read_only` is propagated to the agent pod\nvia the `READ_ONLY` env var (decision #32) and blocks memory writes / repo\ncommits / cron mutations server-side.",
        "properties": {
          "initial_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Message"
          },
          "read_only": {
            "default": false,
            "title": "Read Only",
            "type": "boolean"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "TaskSessionCreate",
        "type": "object"
      },
      "TaskSessionDebugRead": {
        "description": "Full session dump for the tenant-admin debug view.",
        "properties": {
          "completion_tokens": {
            "default": 0,
            "title": "Completion Tokens",
            "type": "integer"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/TaskMessageRead"
            },
            "title": "Messages",
            "type": "array"
          },
          "prompt_tokens": {
            "default": 0,
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "session": {
            "$ref": "#/components/schemas/TaskSessionRead"
          },
          "total_cost_cents": {
            "default": 0,
            "title": "Total Cost Cents",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "session",
          "messages",
          "total_tokens"
        ],
        "title": "TaskSessionDebugRead",
        "type": "object"
      },
      "TaskSessionRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "boot_phase": {
            "anyOf": [
              {
                "enum": [
                  "not_yet_created",
                  "scheduling",
                  "pulling_image",
                  "cloning_repo",
                  "mounting_workspace",
                  "booting_agent",
                  "running",
                  "failed",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Boot Phase"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          },
          "failure_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Detail"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "listen_mode": {
            "default": false,
            "title": "Listen Mode",
            "type": "boolean"
          },
          "next_retry_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At"
          },
          "pod_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pod Name"
          },
          "read_only": {
            "title": "Read Only",
            "type": "boolean"
          },
          "retry_count": {
            "default": 0,
            "title": "Retry Count",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_state": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task State"
          },
          "task_state_version": {
            "default": 0,
            "title": "Task State Version",
            "type": "integer"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "status",
          "read_only",
          "created_at",
          "updated_at"
        ],
        "title": "TaskSessionRead",
        "type": "object"
      },
      "TaskSummary30d": {
        "properties": {
          "total_messages": {
            "title": "Total Messages",
            "type": "integer"
          },
          "total_sessions": {
            "title": "Total Sessions",
            "type": "integer"
          }
        },
        "required": [
          "total_sessions",
          "total_messages"
        ],
        "title": "TaskSummary30d",
        "type": "object"
      },
      "TenantAgentRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "invocations_30d": {
            "title": "Invocations 30D",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_seed": {
            "title": "Is Seed",
            "type": "boolean"
          },
          "last_invoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Invoked At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "created_by_id",
          "is_active",
          "is_seed",
          "created_at",
          "last_invoked_at",
          "invocations_30d"
        ],
        "title": "TenantAgentRead",
        "type": "object"
      },
      "TenantAllowedAccountCreate": {
        "properties": {
          "auto_role": {
            "minLength": 1,
            "title": "Auto Role",
            "type": "string"
          },
          "pattern": {
            "maxLength": 253,
            "minLength": 1,
            "title": "Pattern",
            "type": "string"
          }
        },
        "required": [
          "pattern",
          "auto_role"
        ],
        "title": "TenantAllowedAccountCreate",
        "type": "object"
      },
      "TenantAllowedAccountRead": {
        "properties": {
          "auto_role": {
            "title": "Auto Role",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "pattern": {
            "title": "Pattern",
            "type": "string"
          }
        },
        "required": [
          "id",
          "pattern",
          "auto_role",
          "created_at"
        ],
        "title": "TenantAllowedAccountRead",
        "type": "object"
      },
      "TenantBrandFaviconUploaded": {
        "description": "Returned by the favicon-upload endpoint.",
        "properties": {
          "favicon_content_type": {
            "title": "Favicon Content Type",
            "type": "string"
          },
          "favicon_sha256": {
            "title": "Favicon Sha256",
            "type": "string"
          },
          "favicon_size_bytes": {
            "title": "Favicon Size Bytes",
            "type": "integer"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "favicon_sha256",
          "favicon_content_type",
          "favicon_size_bytes"
        ],
        "title": "TenantBrandFaviconUploaded",
        "type": "object"
      },
      "TenantBrandLogoUploaded": {
        "description": "Returned by the logo-upload endpoint.",
        "properties": {
          "logo_content_type": {
            "title": "Logo Content Type",
            "type": "string"
          },
          "logo_sha256": {
            "title": "Logo Sha256",
            "type": "string"
          },
          "logo_size_bytes": {
            "title": "Logo Size Bytes",
            "type": "integer"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "logo_sha256",
          "logo_content_type",
          "logo_size_bytes"
        ],
        "title": "TenantBrandLogoUploaded",
        "type": "object"
      },
      "TenantBrandRead": {
        "properties": {
          "accent_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Color"
          },
          "background_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Background Color"
          },
          "favicon_content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Content Type"
          },
          "favicon_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Sha256"
          },
          "favicon_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Favicon Size Bytes"
          },
          "has_favicon": {
            "default": false,
            "title": "Has Favicon",
            "type": "boolean"
          },
          "has_logo": {
            "title": "Has Logo",
            "type": "boolean"
          },
          "logo_content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Content Type"
          },
          "logo_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Sha256"
          },
          "logo_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Size Bytes"
          },
          "primary_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Color"
          },
          "secondary_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secondary Color"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "text_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Color"
          },
          "theme_extra": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Extra"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "required": [
          "tenant_id",
          "has_logo"
        ],
        "title": "TenantBrandRead",
        "type": "object"
      },
      "TenantBrandUpdate": {
        "description": "Partial-update for theme tokens. Logo is uploaded via the separate\nmultipart endpoint. Pass ``null`` for a colour field to clear it.",
        "properties": {
          "accent_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Color"
          },
          "background_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Background Color"
          },
          "primary_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Color"
          },
          "secondary_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secondary Color"
          },
          "text_color": {
            "anyOf": [
              {
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text Color"
          },
          "theme_extra": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Extra"
          }
        },
        "title": "TenantBrandUpdate",
        "type": "object"
      },
      "TenantCreate": {
        "properties": {
          "billing_email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "plan_code": {
            "default": "FREE",
            "title": "Plan Code",
            "type": "string"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug"
        ],
        "title": "TenantCreate",
        "type": "object"
      },
      "TenantIdentityCreate": {
        "description": "Body for saving a BYOK credential in tenant_identity.\n\n`provider` must match the `tenant_identity.provider` convention:\n`model:<vendor>` for model BYOK keys (e.g. `model:openrouter`).\nThe plaintext `access_token` is encrypted immediately and never persisted\nin clear (CLAUDE.md decision #14).",
        "properties": {
          "access_token": {
            "minLength": 1,
            "title": "Access Token",
            "type": "string"
          },
          "external_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Account Id"
          },
          "provider": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "access_token"
        ],
        "title": "TenantIdentityCreate",
        "type": "object"
      },
      "TenantIdentityRead": {
        "description": "Public projection of `tenant_identity`. Never includes tokens.",
        "properties": {
          "external_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Account Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "provider",
          "external_account_id",
          "scopes"
        ],
        "title": "TenantIdentityRead",
        "type": "object"
      },
      "TenantIntegrationRead": {
        "description": "Public projection of a tenant-wide integration.\n\nMirrors the ``TenantIntegration`` interface in\n``front-end/src/pages/tenants/[tenantId]/organization/integrations.astro``.",
        "properties": {
          "connected": {
            "title": "Connected",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "scope": {
            "title": "Scope",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "label",
          "connected",
          "scope"
        ],
        "title": "TenantIntegrationRead",
        "type": "object"
      },
      "TenantMailboxRow": {
        "description": "One mailbox row for the tenant-admin Mail page.\n\n``is_paused`` mirrors the SuperAdmin schema: paused == ``mailbox.is_active``\nis false. Tenant admins can see the state but cannot toggle it from this\nsurface (decision per ``mail.md``: \"Tenant admins cannot create or delete\nmailboxes\" \u2014 pause is a SuperAdmin lever).",
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "bounce_count_7d": {
            "title": "Bounce Count 7D",
            "type": "integer"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_paused": {
            "title": "Is Paused",
            "type": "boolean"
          },
          "message_count_7d": {
            "title": "Message Count 7D",
            "type": "integer"
          },
          "service": {
            "enum": [
              "internal",
              "external"
            ],
            "title": "Service",
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "service",
          "agent_name",
          "message_count_7d",
          "bounce_count_7d",
          "is_paused"
        ],
        "title": "TenantMailboxRow",
        "type": "object"
      },
      "TenantMember": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "joined_at": {
            "format": "date-time",
            "title": "Joined At",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "invited"
            ],
            "title": "Status",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "status",
          "joined_at"
        ],
        "title": "TenantMember",
        "type": "object"
      },
      "TenantMemberRead": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "is_super_admin": {
            "title": "Is Super Admin",
            "type": "boolean"
          },
          "joined_at": {
            "format": "date-time",
            "title": "Joined At",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "display_name",
          "role",
          "is_super_admin",
          "joined_at"
        ],
        "title": "TenantMemberRead",
        "type": "object"
      },
      "TenantMembershipRead": {
        "properties": {
          "is_default": {
            "title": "Is Default",
            "type": "boolean"
          },
          "joined_at": {
            "format": "date-time",
            "title": "Joined At",
            "type": "string"
          },
          "plan_code": {
            "title": "Plan Code",
            "type": "string"
          },
          "plan_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Plan Id",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "tenant_name": {
            "title": "Tenant Name",
            "type": "string"
          },
          "tenant_slug": {
            "title": "Tenant Slug",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "tenant_name",
          "tenant_slug",
          "plan_id",
          "plan_code",
          "role",
          "is_default",
          "joined_at"
        ],
        "title": "TenantMembershipRead",
        "type": "object"
      },
      "TenantModelGrant": {
        "properties": {
          "status": {
            "enum": [
              "active",
              "disabled",
              "experimental",
              "deprecated"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "title": "TenantModelGrant",
        "type": "object"
      },
      "TenantModelListItem": {
        "description": "``ModelRead`` plus the per-tenant grant status. The tenant org models\npage needs both: ``status`` is the global ``Model.status`` (drives the\n\"globally disabled \u2014 not toggleable\" affordance) and ``tenant_status``\nis the ``tenant_model.status`` override the tenant admin flips on/off.",
        "properties": {
          "available_to_all_tenants": {
            "default": false,
            "title": "Available To All Tenants",
            "type": "boolean"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "failover_chain": {
            "items": {
              "maxLength": 25,
              "minLength": 25,
              "pattern": "^c[a-z0-9]{24}$",
              "type": "string"
            },
            "title": "Failover Chain",
            "type": "array"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_free": {
            "title": "Is Free",
            "type": "boolean"
          },
          "is_system_default": {
            "default": false,
            "title": "Is System Default",
            "type": "boolean"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Owner User Id",
            "type": "string"
          },
          "pricing": {
            "title": "Pricing",
            "type": "object"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_status": {
            "title": "Tenant Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_user_id",
          "name",
          "description",
          "kind",
          "status",
          "is_free",
          "config",
          "pricing",
          "endpoint",
          "created_at",
          "updated_at",
          "tenant_status"
        ],
        "title": "TenantModelListItem",
        "type": "object"
      },
      "TenantModelRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "model_id",
          "status",
          "created_at"
        ],
        "title": "TenantModelRead",
        "type": "object"
      },
      "TenantPaidRequest": {
        "properties": {
          "paid": {
            "title": "Paid",
            "type": "boolean"
          }
        },
        "required": [
          "paid"
        ],
        "title": "TenantPaidRequest",
        "type": "object"
      },
      "TenantRead": {
        "properties": {
          "allow_superadmin_access": {
            "default": true,
            "title": "Allow Superadmin Access",
            "type": "boolean"
          },
          "billing_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "default_skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Default Skill Visibility Scope",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_suspended": {
            "default": false,
            "title": "Is Suspended",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "paid": {
            "default": false,
            "title": "Paid",
            "type": "boolean"
          },
          "plan_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Plan Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TenantStatus",
            "default": "active"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan_id",
          "billing_email",
          "created_at",
          "updated_at"
        ],
        "title": "TenantRead",
        "type": "object"
      },
      "TenantSkillVisibilityScopeUpdate": {
        "description": "PUT body for ``/tenants/{tenant_id}/skill-visibility-scope-default``.\n\nSets the tenant-wide default that seeds ``skill_visibility_scope`` on\nnewly created agents. Existing agents are not retroactively changed.\nSee issue #550 and SkillVisibilityScope in models/agent.py.",
        "properties": {
          "default_skill_visibility_scope": {
            "enum": [
              "private_only",
              "tenant_allowed"
            ],
            "title": "Default Skill Visibility Scope",
            "type": "string"
          }
        },
        "required": [
          "default_skill_visibility_scope"
        ],
        "title": "TenantSkillVisibilityScopeUpdate",
        "type": "object"
      },
      "TenantStatus": {
        "description": "Tenant lifecycle status, orthogonal to the Stripe subscription state.\n\n``pending_payment`` \u2014 tenant created but Stripe checkout not yet completed.\n``active`` \u2014 fully usable (FREE auto-activates; paid activates on checkout).\n``suspended`` \u2014 administratively suspended; all mutating operations blocked.",
        "enum": [
          "pending_payment",
          "active",
          "suspended"
        ],
        "title": "TenantStatus",
        "type": "string"
      },
      "TenantUpdate": {
        "properties": {
          "allow_superadmin_access": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Superadmin Access"
          },
          "billing_email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "TenantUpdate",
        "type": "object"
      },
      "TenantUserPermissionRead": {
        "description": "Effective permissions for a user in a tenant.",
        "properties": {
          "can_create_agents": {
            "default": true,
            "title": "Can Create Agents",
            "type": "boolean"
          },
          "can_create_skills": {
            "default": true,
            "title": "Can Create Skills",
            "type": "boolean"
          },
          "can_invite_users": {
            "default": false,
            "title": "Can Invite Users",
            "type": "boolean"
          },
          "can_manage_settings": {
            "default": false,
            "title": "Can Manage Settings",
            "type": "boolean"
          },
          "can_view_billing": {
            "default": false,
            "title": "Can View Billing",
            "type": "boolean"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "anyOf": [
              {
                "maxLength": 25,
                "minLength": 25,
                "pattern": "^c[a-z0-9]{24}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "user_id"
        ],
        "title": "TenantUserPermissionRead",
        "type": "object"
      },
      "TenantUserPermissionUpdate": {
        "description": "Update body \u2014 all fields optional so callers can patch a subset.",
        "properties": {
          "can_create_agents": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Create Agents"
          },
          "can_create_skills": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Create Skills"
          },
          "can_invite_users": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Invite Users"
          },
          "can_manage_settings": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Manage Settings"
          },
          "can_view_billing": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can View Billing"
          }
        },
        "title": "TenantUserPermissionUpdate",
        "type": "object"
      },
      "ThreadCreateRequest": {
        "properties": {
          "metadata": {
            "title": "Metadata",
            "type": "object"
          }
        },
        "title": "ThreadCreateRequest",
        "type": "object"
      },
      "ThreadObject": {
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "title": "Metadata",
            "type": "object"
          },
          "object": {
            "const": "thread",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at"
        ],
        "title": "ThreadObject",
        "type": "object"
      },
      "ToolAdminRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "has_embedding": {
            "title": "Has Embedding",
            "type": "boolean"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "display_name",
          "description",
          "is_active",
          "has_embedding",
          "created_at",
          "updated_at"
        ],
        "title": "ToolAdminRead",
        "type": "object"
      },
      "ToolSyncResult": {
        "properties": {
          "embedded": {
            "title": "Embedded",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "id",
          "embedded"
        ],
        "title": "ToolSyncResult",
        "type": "object"
      },
      "ToolToggleRequest": {
        "properties": {
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          }
        },
        "required": [
          "is_active"
        ],
        "title": "ToolToggleRequest",
        "type": "object"
      },
      "TrajectoryBuilder": {
        "enum": [
          "per_request",
          "prefix_merging"
        ],
        "title": "TrajectoryBuilder",
        "type": "string"
      },
      "TranscriptTurn": {
        "description": "One ``task_message`` row attached to a citation record (issue #1661).\n\nReturned by ``GET /api/internal/sessions/{s}/memory/{memory_id}`` when the\nmemory was pinned to a transcript turn via ``source_message_id``. ``role``\nis the raw ``task_message_role`` enum value (``user`` / ``assistant`` /\n``tool`` / ``system``); ``content`` is the message JSON exactly as\npersisted so the trace viewer can render whichever shape it expects\n(plain text, tool call, file view, etc.) without a server-side\ntranslation step.",
        "properties": {
          "content": {
            "title": "Content",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "session_id",
          "role",
          "content",
          "created_at"
        ],
        "title": "TranscriptTurn",
        "type": "object"
      },
      "UsageBucket": {
        "properties": {
          "call_count": {
            "title": "Call Count",
            "type": "integer"
          },
          "completion_tokens": {
            "title": "Completion Tokens",
            "type": "integer"
          },
          "cost_cents": {
            "title": "Cost Cents",
            "type": "integer"
          },
          "prompt_tokens": {
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "ts": {
            "format": "date-time",
            "title": "Ts",
            "type": "string"
          }
        },
        "required": [
          "ts",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_cents",
          "call_count"
        ],
        "title": "UsageBucket",
        "type": "object"
      },
      "UsageRead": {
        "description": "Month-to-date model-broker usage rollup. Tracked, not billed in v1.\n\nSee decision #25 / docs/content/billing.md: per-token charges are not part\nof the v1 invoice, but the rollup powers the in-app usage widget.",
        "properties": {
          "completion_tokens": {
            "title": "Completion Tokens",
            "type": "integer"
          },
          "cost_cents": {
            "title": "Cost Cents",
            "type": "integer"
          },
          "prompt_tokens": {
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "request_count": {
            "title": "Request Count",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          },
          "window": {
            "$ref": "#/components/schemas/UsageWindow"
          }
        },
        "required": [
          "window",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_cents",
          "request_count"
        ],
        "title": "UsageRead",
        "type": "object"
      },
      "UsageReportRead": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/UsageBucket"
            },
            "title": "Buckets",
            "type": "array"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageTotals"
          }
        },
        "required": [
          "buckets",
          "totals"
        ],
        "title": "UsageReportRead",
        "type": "object"
      },
      "UsageSummary30d": {
        "properties": {
          "total_calls": {
            "title": "Total Calls",
            "type": "integer"
          },
          "total_completion_tokens": {
            "title": "Total Completion Tokens",
            "type": "integer"
          },
          "total_cost_cents": {
            "title": "Total Cost Cents",
            "type": "integer"
          },
          "total_prompt_tokens": {
            "title": "Total Prompt Tokens",
            "type": "integer"
          }
        },
        "required": [
          "total_calls",
          "total_prompt_tokens",
          "total_completion_tokens",
          "total_cost_cents"
        ],
        "title": "UsageSummary30d",
        "type": "object"
      },
      "UsageTotals": {
        "properties": {
          "call_count": {
            "title": "Call Count",
            "type": "integer"
          },
          "completion_tokens": {
            "title": "Completion Tokens",
            "type": "integer"
          },
          "cost_cents": {
            "title": "Cost Cents",
            "type": "integer"
          },
          "prompt_tokens": {
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_cents",
          "call_count"
        ],
        "title": "UsageTotals",
        "type": "object"
      },
      "UsageWindow": {
        "description": "Inclusive start, exclusive end. UTC.",
        "properties": {
          "end": {
            "format": "date-time",
            "title": "End",
            "type": "string"
          },
          "start": {
            "format": "date-time",
            "title": "Start",
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "title": "UsageWindow",
        "type": "object"
      },
      "UserApiKeyCreate": {
        "properties": {
          "label": {
            "title": "Label",
            "type": "string"
          },
          "scopes": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "label"
        ],
        "title": "UserApiKeyCreate",
        "type": "object"
      },
      "UserApiKeyCreated": {
        "description": "Returned once, on creation. `key` is the one chance to copy it.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "label",
          "scopes",
          "last_used_at",
          "created_at",
          "revoked_at",
          "key"
        ],
        "title": "UserApiKeyCreated",
        "type": "object"
      },
      "UserApiKeyRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "label",
          "scopes",
          "last_used_at",
          "created_at",
          "revoked_at"
        ],
        "title": "UserApiKeyRead",
        "type": "object"
      },
      "UserModelGrant": {
        "properties": {
          "access": {
            "enum": [
              "full",
              "read_only"
            ],
            "title": "Access",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "UserModelGrant",
        "type": "object"
      },
      "UserModelRead": {
        "properties": {
          "access": {
            "title": "Access",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "model_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Model Id",
            "type": "string"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "model_id",
          "access",
          "created_at"
        ],
        "title": "UserModelRead",
        "type": "object"
      },
      "UserRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image"
          },
          "is_super_admin": {
            "title": "Is Super Admin",
            "type": "boolean"
          },
          "is_suspended": {
            "title": "Is Suspended",
            "type": "boolean"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "image",
          "timezone",
          "is_super_admin",
          "is_suspended",
          "created_at"
        ],
        "title": "UserRead",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "type": "string"
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "ValkeyMemoryCreate": {
        "description": "Body for ``POST /memories`` \u2014 the ``remember`` action of ``manage_memory``.\n\n``kind`` follows the memory-kind taxonomy (issue #1653): one of\n``episodic`` / ``semantic`` / ``procedural`` / ``reflective`` or a\nwell-formed ``custom:<slug>`` value. Unknown bare kinds 422.",
        "properties": {
          "content": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "kind": {
            "default": "episodic",
            "maxLength": 64,
            "minLength": 1,
            "title": "Kind",
            "type": "string"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "triggers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Triggers"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "maximum": 31536000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ttl Seconds"
          }
        },
        "required": [
          "content"
        ],
        "title": "ValkeyMemoryCreate",
        "type": "object"
      },
      "ValkeyMemoryCreated": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ValkeyMemoryCreated",
        "type": "object"
      },
      "ValkeyMemoryKindUpdate": {
        "description": "Body for ``PATCH /memories/{id}/kind`` \u2014 the ``update_kind`` action.\n\n``kind`` follows the taxonomy in :class:`ValkeyMemoryCreate` (issue #1653);\na 422 fires on unknown bare kinds. ``custom:*`` reclassification is\naccepted (e.g. promoting a ``custom:billing-note`` to ``semantic``).",
        "properties": {
          "kind": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "title": "ValkeyMemoryKindUpdate",
        "type": "object"
      },
      "ValkeyMemoryListResponse": {
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "memories": {
            "items": {
              "$ref": "#/components/schemas/ValkeyMemoryRead"
            },
            "title": "Memories",
            "type": "array"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "memories",
          "total",
          "offset",
          "limit"
        ],
        "title": "ValkeyMemoryListResponse",
        "type": "object"
      },
      "ValkeyMemoryRead": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "content",
          "kind"
        ],
        "title": "ValkeyMemoryRead",
        "type": "object"
      },
      "ValkeyMemorySearchHit": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "score": {
            "title": "Score",
            "type": "number"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "content",
          "kind",
          "score"
        ],
        "title": "ValkeyMemorySearchHit",
        "type": "object"
      },
      "ValkeyMemorySearchResponse": {
        "properties": {
          "hits": {
            "items": {
              "$ref": "#/components/schemas/ValkeyMemorySearchHit"
            },
            "title": "Hits",
            "type": "array"
          }
        },
        "required": [
          "hits"
        ],
        "title": "ValkeyMemorySearchResponse",
        "type": "object"
      },
      "ValkeyMemoryUpdate": {
        "properties": {
          "content": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "ValkeyMemoryUpdate",
        "type": "object"
      },
      "VideoRouteCreate": {
        "properties": {
          "config": {
            "title": "Config",
            "type": "object"
          },
          "direction": {
            "pattern": "^(in|out)$",
            "title": "Direction",
            "type": "string"
          },
          "recording_enabled": {
            "default": false,
            "title": "Recording Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "direction"
        ],
        "title": "VideoRouteCreate",
        "type": "object"
      },
      "VideoRouteRead": {
        "description": "Read shape for `video:read` callers. Excludes the RTMP `token`, which\nis a publish/egress credential and is only returned from write-gated\noperations (POST). See schemas/CLAUDE.md.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "direction": {
            "title": "Direction",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "recording_enabled": {
            "title": "Recording Enabled",
            "type": "boolean"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "direction",
          "recording_enabled",
          "config",
          "created_at"
        ],
        "title": "VideoRouteRead",
        "type": "object"
      },
      "VideoRouteUpdate": {
        "properties": {
          "config": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "recording_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Enabled"
          }
        },
        "title": "VideoRouteUpdate",
        "type": "object"
      },
      "VideoRouteWithToken": {
        "description": "Returned only by `video:write` operations that mint or rotate a token.",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "config": {
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "direction": {
            "title": "Direction",
            "type": "string"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "recording_enabled": {
            "title": "Recording Enabled",
            "type": "boolean"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "direction",
          "recording_enabled",
          "config",
          "created_at",
          "token"
        ],
        "title": "VideoRouteWithToken",
        "type": "object"
      },
      "VoiceConfigRead": {
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "speed": {
            "title": "Speed",
            "type": "number"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "voice_id": {
            "title": "Voice Id",
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "user_id",
          "provider",
          "voice_id",
          "speed"
        ],
        "title": "VoiceConfigRead",
        "type": "object"
      },
      "VoiceConfigUpsert": {
        "properties": {
          "provider": {
            "maxLength": 50,
            "title": "Provider",
            "type": "string"
          },
          "speed": {
            "default": 1.0,
            "maximum": 4.0,
            "minimum": 0.25,
            "title": "Speed",
            "type": "number"
          },
          "voice_id": {
            "maxLength": 200,
            "title": "Voice Id",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "voice_id"
        ],
        "title": "VoiceConfigUpsert",
        "type": "object"
      },
      "WebhookAck": {
        "description": "Stripe wants 2xx; the body is purely diagnostic.",
        "properties": {
          "status": {
            "enum": [
              "ok",
              "already_processed",
              "ignored"
            ],
            "title": "Status",
            "type": "string"
          },
          "stripe_event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Event Id"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          }
        },
        "required": [
          "status"
        ],
        "title": "WebhookAck",
        "type": "object"
      },
      "WebhookProvider": {
        "description": "Inbound webhook providers we verify end-to-end.\n\nEach entry corresponds to a provider adapter in\n``services/webhook_providers.py``. ``generic`` is the fallback for\nintegrations that just send a plain HMAC-SHA256 hex digest in\n``X-Webhook-Signature``.",
        "enum": [
          "github",
          "slack",
          "stripe",
          "zoom",
          "twilio",
          "generic"
        ],
        "title": "WebhookProvider",
        "type": "string"
      },
      "WebhookRouteCreate": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "auto_start": {
            "default": true,
            "title": "Auto Start",
            "type": "boolean"
          },
          "filters": {
            "title": "Filters",
            "type": "object"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "provider": {
            "$ref": "#/components/schemas/WebhookProvider"
          }
        },
        "required": [
          "agent_id",
          "provider"
        ],
        "title": "WebhookRouteCreate",
        "type": "object"
      },
      "WebhookRouteCreated": {
        "description": "Returned only on create \u2014 includes the raw secret (shown once).",
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "auto_start": {
            "title": "Auto Start",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "filters": {
            "title": "Filters",
            "type": "object"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "path_token": {
            "title": "Path Token",
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/WebhookProvider"
          },
          "secret": {
            "title": "Secret",
            "type": "string"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "provider",
          "path_token",
          "filters",
          "is_active",
          "auto_start",
          "created_at",
          "updated_at",
          "secret"
        ],
        "title": "WebhookRouteCreated",
        "type": "object"
      },
      "WebhookRouteRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "auto_start": {
            "title": "Auto Start",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "filters": {
            "title": "Filters",
            "type": "object"
          },
          "id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "path_token": {
            "title": "Path Token",
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/WebhookProvider"
          },
          "tenant_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Tenant Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "agent_id",
          "provider",
          "path_token",
          "filters",
          "is_active",
          "auto_start",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookRouteRead",
        "type": "object"
      },
      "WidgetMessageCreate": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "WidgetMessageCreate",
        "type": "object"
      },
      "WidgetMessageOut": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "role",
          "content",
          "created_at"
        ],
        "title": "WidgetMessageOut",
        "type": "object"
      },
      "WidgetSessionCreate": {
        "properties": {
          "initial_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Message"
          }
        },
        "title": "WidgetSessionCreate",
        "type": "object"
      },
      "WidgetSessionOut": {
        "properties": {
          "agent_name": {
            "title": "Agent Name",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "widget_token": {
            "title": "Widget Token",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "widget_token",
          "agent_name"
        ],
        "title": "WidgetSessionOut",
        "type": "object"
      },
      "_CredentialStatus": {
        "description": "Response for ``GET /admin/openrouter/credential``.\n\n``available`` is True iff a non-empty key was successfully resolved.\n``source`` is ``\"tenant\"`` for a BYOK row, ``\"platform\"`` for the\nGSM / env fallback, and ``None`` when nothing is configured.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "source": {
            "anyOf": [
              {
                "enum": [
                  "tenant",
                  "platform"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "required": [
          "available"
        ],
        "title": "_CredentialStatus",
        "type": "object"
      },
      "_SyncBody": {
        "description": "Body for the catalogue-sync endpoint.\n\nSuperAdmin may paste an OpenRouter API key in the request body \u2014 when\nsupplied, it is forwarded through the broker to OpenRouter and never\npersisted. When omitted, the API resolves a stored credential via the\nBYOK cascade (tenant BYOK row \u2192 platform-pool \u2192 Google Secret Manager\n``gp-or-key``) so the operator can sync without re-typing the key on\nevery visit.",
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          }
        },
        "title": "_SyncBody",
        "type": "object"
      },
      "good_place_api__schemas__identity__AgentGrantRead": {
        "description": "Public projection of an ``agent_user_identity`` row.",
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "granted_by_user_id": {
            "title": "Granted By User Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "linked_identity_id": {
            "title": "Linked Identity Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "agent_id",
          "linked_identity_id",
          "granted_by_user_id",
          "created_at"
        ],
        "title": "AgentGrantRead",
        "type": "object"
      },
      "good_place_api__schemas__rbac__AgentGrantRead": {
        "properties": {
          "agent_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "Agent Id",
            "type": "string"
          },
          "role": {
            "anyOf": [
              {
                "enum": [
                  "VIEWER",
                  "EDITOR"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "user_id": {
            "maxLength": 25,
            "minLength": 25,
            "pattern": "^c[a-z0-9]{24}$",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "agent_id",
          "role"
        ],
        "title": "AgentGrantRead",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "good-place API",
    "version": "0.0.2"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/healthz": {
      "get": {
        "operationId": "healthz",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Healthz",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Healthz"
      }
    },
    "/api/sample-use-cases": {
      "get": {
        "description": "Public endpoint: return active sample use cases ordered by display_order.",
        "operationId": "sample_use_cases_list_active_use_cases",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SampleUseCaseRead"
                  },
                  "title": "Response Sample Use Cases List Active Use Cases",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Active Use Cases",
        "tags": [
          "sample-use-cases"
        ]
      }
    },
    "/api/sample-use-cases/{use_case_id}/icon": {
      "get": {
        "description": "Public endpoint: stream the icon bytes for a sample use case.\n\n``stream_icon`` prefetches the first chunk, so an open / read failure\nagainst GCS lands here as :class:`BrandStorageError` before the\n``StreamingResponse`` is constructed \u2014 we map that to a 502 instead of\na half-sent 200.",
        "operationId": "sample_use_cases_fetch_use_case_icon",
        "parameters": [
          {
            "in": "path",
            "name": "use_case_id",
            "required": true,
            "schema": {
              "title": "Use Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Use Case Icon",
        "tags": [
          "sample-use-cases"
        ]
      }
    },
    "/api/status/timeline": {
      "get": {
        "operationId": "status_alerts_list_timeline",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/StatusAlertTimelineRead"
                  },
                  "title": "Response Status Alerts List Timeline",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Timeline",
        "tags": [
          "status-alerts"
        ]
      }
    },
    "/api/v1/admin/agents/{agent_id}/tenant": {
      "put": {
        "description": "SuperAdmin: reassign an agent to a different tenant.\n\nValidates the target tenant, re-evaluates model assignments and\ntenant-scoped integrations, updates ``agent.tenant_id``, and returns\nthe updated agent together with model conflicts and integration warnings.",
        "operationId": "admin_reassign_agent_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReassignAgentTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReassignAgentTenantResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reassign Agent Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/allowed-accounts": {
      "get": {
        "operationId": "admin_list_allowed_accounts",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AllowedAccountRead"
                  },
                  "title": "Response Admin List Allowed Accounts",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Allowed Accounts",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "operationId": "admin_create_allowed_account",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllowedAccountCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllowedAccountRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Allowed Account",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/allowed-accounts/{account_id}": {
      "delete": {
        "operationId": "admin_delete_allowed_account",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Allowed Account",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/audit": {
      "get": {
        "operationId": "admin_read_audit",
        "parameters": [
          {
            "in": "query",
            "name": "tenant_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tenant Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AuditLogRead"
                  },
                  "title": "Response Admin Read Audit",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Audit",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/benchmarks": {
      "get": {
        "operationId": "admin_benchmarks_list_benchmarks",
        "parameters": [
          {
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Active Only",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BenchmarkRead"
                  },
                  "title": "Response Admin Benchmarks List Benchmarks",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Benchmarks",
        "tags": [
          "admin-benchmarks"
        ]
      },
      "post": {
        "operationId": "admin_benchmarks_create_benchmark",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BenchmarkCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BenchmarkRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Benchmark",
        "tags": [
          "admin-benchmarks"
        ]
      }
    },
    "/api/v1/admin/benchmarks/{benchmark_id}": {
      "get": {
        "operationId": "admin_benchmarks_get_benchmark",
        "parameters": [
          {
            "in": "path",
            "name": "benchmark_id",
            "required": true,
            "schema": {
              "title": "Benchmark Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BenchmarkRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Benchmark",
        "tags": [
          "admin-benchmarks"
        ]
      },
      "patch": {
        "operationId": "admin_benchmarks_update_benchmark",
        "parameters": [
          {
            "in": "path",
            "name": "benchmark_id",
            "required": true,
            "schema": {
              "title": "Benchmark Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BenchmarkUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BenchmarkRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Benchmark",
        "tags": [
          "admin-benchmarks"
        ]
      }
    },
    "/api/v1/admin/brand": {
      "get": {
        "operationId": "admin_get_platform_brand",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformBrandRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Platform Brand",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/brand/favicon": {
      "delete": {
        "operationId": "admin_delete_platform_favicon",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Platform Favicon",
        "tags": [
          "admin"
        ]
      },
      "get": {
        "description": "Stream the platform-default favicon bytes (operator preview).\n\nThe user-facing fallback path streams through the tenant-scoped\n``GET /tenants/{id}/brand/favicon`` instead \u2014 this endpoint exists so\nSuperAdmins can preview the bytes from the operator UI even when no\ntenant context is selected.",
        "operationId": "admin_fetch_platform_favicon",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Platform Favicon",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "operationId": "admin_upload_platform_favicon",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_admin_upload_platform_favicon"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformBrandFaviconUploaded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Platform Favicon",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/fine-tune/jobs": {
      "get": {
        "operationId": "admin_fine_tune_list_jobs",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FineTuneJobRead"
                  },
                  "title": "Response Admin Fine Tune List Jobs",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Jobs",
        "tags": [
          "admin-fine-tune"
        ]
      },
      "post": {
        "operationId": "admin_fine_tune_create_job",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FineTuneJobCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuneJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Job",
        "tags": [
          "admin-fine-tune"
        ]
      }
    },
    "/api/v1/admin/fine-tune/jobs/{job_id}": {
      "get": {
        "operationId": "admin_fine_tune_get_job",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuneJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Job",
        "tags": [
          "admin-fine-tune"
        ]
      }
    },
    "/api/v1/admin/fine-tune/jobs/{job_id}/promote": {
      "post": {
        "operationId": "admin_fine_tune_promote_job",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FineTuneJobPromoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuneJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Promote Job",
        "tags": [
          "admin-fine-tune"
        ]
      }
    },
    "/api/v1/admin/huggingface/pull": {
      "post": {
        "operationId": "admin_huggingface_pull_model",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HfPullRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HfDownloadRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Pull Model",
        "tags": [
          "admin-huggingface"
        ]
      }
    },
    "/api/v1/admin/huggingface/pulls": {
      "get": {
        "operationId": "admin_huggingface_list_pulls",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HfDownloadRead"
                  },
                  "title": "Response Admin Huggingface List Pulls",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pulls",
        "tags": [
          "admin-huggingface"
        ]
      }
    },
    "/api/v1/admin/huggingface/repos/{repo_id}": {
      "get": {
        "operationId": "admin_huggingface_get_repo_detail",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HfRepoDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Repo Detail",
        "tags": [
          "admin-huggingface"
        ]
      }
    },
    "/api/v1/admin/huggingface/search": {
      "get": {
        "operationId": "admin_huggingface_search_hf",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": [
                "downloads",
                "likes",
                "trendingScore",
                "lastModified"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HfSearchResultItem"
                  },
                  "title": "Response Admin Huggingface Search Hf",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Hf",
        "tags": [
          "admin-huggingface"
        ]
      }
    },
    "/api/v1/admin/invite-tenant-admin": {
      "post": {
        "operationId": "admin_invite_tenant_admin",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteTenantAdminRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PendingTenantInviteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invite Tenant Admin",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/mail/heal": {
      "post": {
        "description": "Trigger an on-demand backfill of internal mailboxes.\n\nCreates an internal mailbox for every agent that doesn't have one yet.\nSame logic as the periodic reconciler, but callable from the SuperAdmin\nconsole without waiting for the 5-minute loop.",
        "operationId": "admin_mail_heal_mailboxes",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminMailHealResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Heal Mailboxes",
        "tags": [
          "admin-mail"
        ]
      }
    },
    "/api/v1/admin/mail/mailboxes": {
      "get": {
        "description": "Cluster-wide mailbox roster for the SuperAdmin console.\n\n`service` filters by `mailbox.kind` (internal vs external). Omit to\nreturn both. FastAPI validates the enum, so an unknown value is a 422.",
        "operationId": "admin_mail_list_admin_mailboxes",
        "parameters": [
          {
            "in": "query",
            "name": "service",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MailboxKind"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Service"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 200,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminMailboxRow"
                  },
                  "title": "Response Admin Mail List Admin Mailboxes",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Admin Mailboxes",
        "tags": [
          "admin-mail"
        ]
      }
    },
    "/api/v1/admin/model-endpoints": {
      "get": {
        "description": "List all self-hosted model endpoints with cached health status.",
        "operationId": "admin_model_endpoints_list_model_endpoints",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ModelEndpointRead"
                  },
                  "title": "Response Admin Model Endpoints List Model Endpoints",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Model Endpoints",
        "tags": [
          "admin-model-endpoints"
        ]
      },
      "post": {
        "description": "Register a new self-hosted model endpoint.",
        "operationId": "admin_model_endpoints_create_model_endpoint",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelEndpointCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelEndpointRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Model Endpoint",
        "tags": [
          "admin-model-endpoints"
        ]
      }
    },
    "/api/v1/admin/model-endpoints/{model_id}": {
      "delete": {
        "description": "Disable a self-hosted model endpoint (soft delete).",
        "operationId": "admin_model_endpoints_delete_model_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Model Endpoint",
        "tags": [
          "admin-model-endpoints"
        ]
      },
      "patch": {
        "description": "Update a self-hosted model endpoint configuration.",
        "operationId": "admin_model_endpoints_update_model_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelEndpointUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelEndpointRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Model Endpoint",
        "tags": [
          "admin-model-endpoints"
        ]
      }
    },
    "/api/v1/admin/model-endpoints/{model_id}/health-check": {
      "post": {
        "description": "Send a lightweight completion request to verify endpoint reachability.",
        "operationId": "admin_model_endpoints_health_check_model_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelEndpointHealthResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Health Check Model Endpoint",
        "tags": [
          "admin-model-endpoints"
        ]
      }
    },
    "/api/v1/admin/models": {
      "get": {
        "operationId": "admin_models_list_models",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ModelRead"
                  },
                  "title": "Response Admin Models List Models",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Models",
        "tags": [
          "admin-models"
        ]
      },
      "post": {
        "description": "Register a model (local llama.cpp weights, OpenRouter slug, vendor API, etc.).",
        "operationId": "admin_models_register_model",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Model",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/system-default": {
      "get": {
        "description": "Return the model currently flagged as the system-wide default, or null.\n\nBelt-and-braces SuperAdmin gate on top of Casbin \u2014 the system default is a\nplatform-wide setting, not a tenant-scoped one, so access mustn't silently\nwiden via a future policy change.",
        "operationId": "admin_models_get_system_default",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ModelRead"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Admin Models Get System Default"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get System Default",
        "tags": [
          "admin-models"
        ]
      },
      "put": {
        "description": "Designate a model as the system-wide default (unsets any previous default).\n\nBelt-and-braces SuperAdmin gate \u2014 see ``get_system_default`` above for rationale.",
        "operationId": "admin_models_set_system_default",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SystemDefaultModelSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set System Default",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}": {
      "patch": {
        "description": "SuperAdmin-only PATCH. Accepts every field tenant admins can set, plus\n`is_free` (the platform operator's call \u2014 drives free-tier filtering).",
        "operationId": "admin_models_update_model_admin",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminModelUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Model Admin",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}/deploy": {
      "post": {
        "description": "Force the broker to create/refresh the K8s Deployment for a `local` model.",
        "operationId": "admin_models_deploy_model",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Models Deploy Model",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deploy Model",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}/grants/tenant/{tenant_id}": {
      "delete": {
        "description": "SuperAdmin: remove a per-tenant grant (or per-tenant override row).",
        "operationId": "admin_models_revoke_from_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke From Tenant",
        "tags": [
          "admin-models"
        ]
      },
      "post": {
        "operationId": "admin_models_grant_to_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TenantModelGrant"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant To Tenant",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}/grants/tenants": {
      "get": {
        "description": "SuperAdmin: list the explicit per-tenant grants/overrides for a model.",
        "operationId": "admin_models_list_tenant_grants",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantModelRead"
                  },
                  "title": "Response Admin Models List Tenant Grants",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Grants",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}/scale-to-zero": {
      "post": {
        "description": "Alias for undeploy \u2014 scales to zero replicas.",
        "operationId": "admin_models_scale_to_zero",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Models Scale To Zero",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Scale To Zero",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/models/{model_id}/undeploy": {
      "post": {
        "description": "Scale a local model to zero replicas, keeping weights on GCS.",
        "operationId": "admin_models_undeploy_model",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Models Undeploy Model",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Undeploy Model",
        "tags": [
          "admin-models"
        ]
      }
    },
    "/api/v1/admin/openrouter/catalogue": {
      "get": {
        "description": "Full OR catalogue + each slug's system-enabled state.",
        "operationId": "admin_openrouter_list_catalogue",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/JsonObject"
                  },
                  "title": "Response Admin Openrouter List Catalogue",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Catalogue",
        "tags": [
          "admin-openrouter"
        ]
      }
    },
    "/api/v1/admin/openrouter/credential": {
      "get": {
        "description": "Report whether an OpenRouter key is resolvable without prompting the user.\n\nNever returns the key itself; only whether one is available and where it\ncame from. Drives the SuperAdmin page's \"credential is configured\" hint\nso the operator doesn't have to paste a key every time.",
        "operationId": "admin_openrouter_credential_status",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/_CredentialStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Credential Status",
        "tags": [
          "admin-openrouter"
        ]
      }
    },
    "/api/v1/admin/openrouter/sync": {
      "post": {
        "description": "Refresh the system-wide OpenRouter catalogue via the broker.\n\nIf ``body.api_key`` is omitted, the API resolves a stored credential via\nthe BYOK cascade (tenant BYOK row \u2192 platform-pool / GSM ``gp-or-key``).\nReturns 400 when nothing is configured so the UI can prompt for a key.",
        "operationId": "admin_openrouter_sync_catalogue",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/_SyncBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Openrouter Sync Catalogue",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sync Catalogue",
        "tags": [
          "admin-openrouter"
        ]
      }
    },
    "/api/v1/admin/openrouter/{slug}/disable": {
      "post": {
        "description": "Disable an OR slug system-wide (status=disabled).",
        "operationId": "admin_openrouter_disable_slug",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Openrouter Disable Slug",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Disable Slug",
        "tags": [
          "admin-openrouter"
        ]
      }
    },
    "/api/v1/admin/openrouter/{slug}/enable": {
      "post": {
        "description": "Enable an OR slug system-wide.\n\nSlug uses ``:path`` so vendor-prefixed slugs like\n``anthropic/claude-3.5-sonnet`` survive routing.",
        "operationId": "admin_openrouter_enable_slug",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Admin Openrouter Enable Slug",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enable Slug",
        "tags": [
          "admin-openrouter"
        ]
      }
    },
    "/api/v1/admin/pending-invites": {
      "get": {
        "operationId": "admin_list_pending_invites",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PendingTenantInviteRead"
                  },
                  "title": "Response Admin List Pending Invites",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pending Invites",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/pending-invites/{invite_id}": {
      "delete": {
        "operationId": "admin_delete_pending_invite",
        "parameters": [
          {
            "in": "path",
            "name": "invite_id",
            "required": true,
            "schema": {
              "title": "Invite Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Pending Invite",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/plans": {
      "get": {
        "operationId": "admin_list_plans",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PlanRead"
                  },
                  "title": "Response Admin List Plans",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Plans",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/plans/{plan_id}": {
      "patch": {
        "description": "SuperAdmin: update mutable fields on a plan.\n\nCurrently supports ``max_connections_per_agent``. On change, propagates\nthe new CONNECTION LIMIT to all existing agent Postgres roles on tenants\nsubscribed to this plan.",
        "operationId": "admin_update_plan",
        "parameters": [
          {
            "in": "path",
            "name": "plan_id",
            "required": true,
            "schema": {
              "title": "Plan Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Plan",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/platform-secrets": {
      "get": {
        "description": "List all known platform secrets (metadata only \u2014 no plaintext, no ciphertext).",
        "operationId": "admin_list_platform_secrets",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PlatformSecretRow"
                  },
                  "title": "Response Admin List Platform Secrets",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Platform Secrets",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/platform-secrets/{provider}": {
      "delete": {
        "description": "Clear the stored value of a platform secret. SuperAdmin only.\n\nThe row is preserved (``value_enc`` set to NULL) so the SuperAdmin page\nstill shows the provider slot as \"missing\". The cache is invalidated\nimmediately. An ``admin.platform_secrets.delete`` audit row is written.",
        "operationId": "admin_delete_platform_secret",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Platform Secret",
        "tags": [
          "admin"
        ]
      },
      "put": {
        "description": "Create or rotate a platform secret. Plaintext is encrypted at rest.\n\nAudit metadata records the provider (never the value) and whether the\noperation was a create (``new=True``) or a rotation (``new=False``).",
        "operationId": "admin_set_platform_secret",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformSecretSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformSecretRow"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Platform Secret",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/platform-secrets/{provider}/reveal": {
      "get": {
        "description": "Reveal the plaintext value of a single platform secret. SuperAdmin only.\n\nEvery call is recorded in the audit log so reveals are traceable.",
        "operationId": "admin_reveal_platform_secret",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformSecretRevealRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reveal Platform Secret",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants": {
      "get": {
        "operationId": "admin_list_all_tenants",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminTenantRead"
                  },
                  "title": "Response Admin List All Tenants",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List All Tenants",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "description": "SuperAdmin: create an empty tenant (no members yet).\n\nJanet + Michael are seeded as usual so the tenant matches the standard\nshape. Use this before the first tenant admin exists \u2014 typically paired\nwith ``POST /tenant/{tenant_id}/identities/idp`` to pre-provision SAML /\nOIDC / Okta federation in Keycloak so the customer's first admin signs in\nthrough their corporate IdP.",
        "operationId": "admin_create_empty_tenant",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Empty Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}": {
      "get": {
        "operationId": "admin_get_tenant_detail",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminTenantDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tenant Detail",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/agents": {
      "get": {
        "operationId": "admin_list_tenant_agents",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantAgentRead"
                  },
                  "title": "Response Admin List Tenant Agents",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Agents",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/archive": {
      "post": {
        "description": "SuperAdmin: archive a tenant and enqueue async teardown.\n\nImmediately suspends the tenant so no further API calls succeed, then\nenqueues an ``archive:tenant`` event for the **archive worker**\n(``services.tenant_archiver.run_archive_worker``) to tear down Langfuse,\nFlowise, Stripe subscriptions, Keycloak IdPs, GitLab groups, GCS storage,\nValkey memory indices, and mail domains. The archive worker is a separate\nbackground task from the tenant provisioner worker.\n\nIdempotent: calling again on an already-archived tenant re-enqueues the\nteardown so a partially-failed first run retries.",
        "operationId": "admin_archive_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Archive Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/impersonate": {
      "post": {
        "description": "Switch the SuperAdmin's active tenant cookie and return a redirect URL.\n\nCalled via fetch() from the SuperAdmin tenants page. Sets the active-tenant\ncookie and returns a JSON body with ``redirect_url`` so the client can\nnavigate.",
        "operationId": "admin_impersonate_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpersonateTenantResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Impersonate Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/members": {
      "get": {
        "operationId": "admin_list_tenant_members",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantMemberRead"
                  },
                  "title": "Response Admin List Tenant Members",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Members",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/paid": {
      "patch": {
        "operationId": "admin_set_tenant_paid",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantPaidRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Tenant Paid",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/plan": {
      "patch": {
        "operationId": "admin_change_plan",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Change Plan",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/resume": {
      "post": {
        "operationId": "admin_resume_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resume Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/suspend": {
      "post": {
        "operationId": "admin_suspend_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Suspend Tenant",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tenants/{tenant_id}/usage": {
      "get": {
        "operationId": "admin_get_tenant_usage",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "in": "query",
            "name": "grain",
            "required": false,
            "schema": {
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "title": "Grain",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "enum": [
                "model",
                "agent",
                "user",
                "none"
              ],
              "title": "Group By",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tenant Usage",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tools": {
      "get": {
        "description": "Return every registered tool for the SuperAdmin inventory.",
        "operationId": "admin_list_tools",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ToolAdminRead"
                  },
                  "title": "Response Admin List Tools",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tools",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tools/skills-summary": {
      "get": {
        "description": "Cross-tenant skill counts for the SuperAdmin dashboard.",
        "operationId": "admin_skills_summary",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillGlobalSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Skills Summary",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tools/sync-connectors": {
      "post": {
        "description": "Upsert tool rows from a connector catalog and compute embeddings.\n\nSuperAdmin only. The tools-service pushes its connector registry here\nat deploy time so each connector's description is embedded into pgvector\nfor the hybrid retrieval pass (decision #31).",
        "operationId": "admin_sync_connector_catalog",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/ConnectorToolSync"
                },
                "title": "Body",
                "type": "array"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ToolSyncResult"
                  },
                  "title": "Response Admin Sync Connector Catalog",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sync Connector Catalog",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/tools/{tool_id}": {
      "patch": {
        "description": "Enable or disable a tool globally.",
        "operationId": "admin_toggle_tool",
        "parameters": [
          {
            "in": "path",
            "name": "tool_id",
            "required": true,
            "schema": {
              "title": "Tool Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolToggleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolAdminRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Toggle Tool",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/users": {
      "get": {
        "description": "All-platform users, optionally restricted to members of ``tenant_id``.\n\nPowers the SuperAdmin \"Users\" sub-tab. See ``docs/content/navigation.md``.",
        "operationId": "admin_list_all_users",
        "parameters": [
          {
            "in": "query",
            "name": "tenant_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tenant Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminUserRow"
                  },
                  "title": "Response Admin List All Users",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List All Users",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/users/{user_id}/resume": {
      "post": {
        "operationId": "admin_resume_user",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resume User",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/users/{user_id}/suspend": {
      "post": {
        "description": "SuperAdmin: mark a user as suspended.\n\nRefuses to suspend the calling user (so a SuperAdmin can't accidentally\nlock themselves out) and refuses to suspend any SuperAdmin. Once\nsuspended, the user's authenticated requests are rejected with HTTP 403\nby ``_build_request_context``.",
        "operationId": "admin_suspend_user",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Suspend User",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/api/widget/sessions": {
      "post": {
        "description": "Create a new widget session against the platform demo agent.\n\nRate-limited per IP. Returns a one-time widget token that the client must\ninclude on all subsequent requests for this session.",
        "operationId": "widget_create_widget_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSessionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSessionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Widget Session",
        "tags": [
          "widget"
        ]
      }
    },
    "/api/v1/api/widget/sessions/{session_id}/messages": {
      "get": {
        "description": "Full message history for a widget session (for page-reload rehydration).",
        "operationId": "widget_list_widget_messages",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-widget-token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Widget-Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WidgetMessageOut"
                  },
                  "title": "Response Widget List Widget Messages",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Widget Messages",
        "tags": [
          "widget"
        ]
      },
      "post": {
        "description": "Send a user message to the widget session.",
        "operationId": "widget_add_widget_message",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-widget-token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Widget-Token"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetMessageCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetMessageOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Widget Message",
        "tags": [
          "widget"
        ]
      }
    },
    "/api/v1/assistants": {
      "get": {
        "operationId": "assistants_shim_list_assistants",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Assistants",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/assistants/{assistant_id}": {
      "get": {
        "operationId": "assistants_shim_get_assistant",
        "parameters": [
          {
            "in": "path",
            "name": "assistant_id",
            "required": true,
            "schema": {
              "title": "Assistant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Assistant",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "description": "Exchange username/password for a session cookie via Keycloak Direct Grant.\n\nIn stub mode (``keycloak_mode != \"real\"``), `login_with_password` returns a\nsynthetic token bundle and we skip `validate_browser_jwt` \u2014 the Principal\nis constructed directly from the submitted username so dev/CI flows don't\nrequire a running Keycloak.",
        "operationId": "auth_login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "auth_logout",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Auth Logout",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Logout",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/session": {
      "post": {
        "description": "Exchange a Keycloak auth code for a session cookie. Called by Astro SSR, not the browser.",
        "operationId": "auth_exchange_code",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Auth Exchange Code",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Exchange Code",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/marketplace": {
      "get": {
        "operationId": "marketplace_browse",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ListingKind"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Kind"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceListingBrowse"
                  },
                  "title": "Response Marketplace Browse",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Browse",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/marketplace/listings/{slug}": {
      "get": {
        "operationId": "marketplace_get_listing",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Listing",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "me_get_me",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Me",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/active-tenant": {
      "post": {
        "description": "Swap the session's active tenant. SuperAdmins may target any tenant.",
        "operationId": "me_set_active_tenant",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Payload",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Me Set Active Tenant",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Active Tenant",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/api-keys": {
      "get": {
        "operationId": "me_list_api_keys",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyRead"
                  },
                  "title": "Response Me List Api Keys",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Api Keys",
        "tags": [
          "me"
        ]
      },
      "post": {
        "operationId": "me_create_api_key",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Api Key",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/api-keys/{key_id}": {
      "delete": {
        "operationId": "me_delete_api_key",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Api Key",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/linked-identities": {
      "get": {
        "description": "List the caller's tool-only linked identities.",
        "operationId": "identities_list_links",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LinkedIdentityRead"
                  },
                  "title": "Response Identities List Links",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Links",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/database": {
      "post": {
        "description": "Store (or rotate) a PostgreSQL password for use with the ``db_query`` connector.\n\nThe password is encrypted immediately at rest. Re-posting for the same\nhost, username, port, and database rotates the stored credential in-place.\n\nOnce added, agents granted access to the identity can call\n``db_query.query(host=..., sql=...)`` and other db_query actions.\nThe password is never returned via the API.",
        "operationId": "identities_add_database_credential",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseCredentialAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedIdentityRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add or rotate a PostgreSQL database credential",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/ssh": {
      "post": {
        "description": "Store (or rotate) an SSH private key for use with the ``ssh`` connector.\n\nThe key is encrypted immediately at rest.  Re-posting for the same host,\nusername, and port rotates the stored key in-place.\n\nOnce added, agents granted access to the identity can call\n``ssh.exec(host=..., command=...)`` to run commands on the remote server.\nThe private key is never returned via the API.",
        "operationId": "identities_add_ssh_key",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SshKeyAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedIdentityRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add or rotate an SSH private key",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/{linked_id}": {
      "delete": {
        "description": "Revoke a linked identity. ``agent_user_identity`` grants cascade-delete.\n\nPer docs/content/identity-linking.md, in-flight tool calls aren't cancelled.",
        "operationId": "identities_revoke_link",
        "parameters": [
          {
            "in": "path",
            "name": "linked_id",
            "required": true,
            "schema": {
              "title": "Linked Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Identities Revoke Link",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Link",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/{linked_id}/grants": {
      "get": {
        "description": "List the agents currently authorised to act as the given linked identity.",
        "operationId": "identities_list_agent_grants",
        "parameters": [
          {
            "in": "path",
            "name": "linked_id",
            "required": true,
            "schema": {
              "title": "Linked Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/good_place_api__schemas__identity__AgentGrantRead"
                  },
                  "title": "Response Identities List Agent Grants",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Grants",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/{linked_id}/grants/agent/{agent_id}": {
      "delete": {
        "description": "Revoke ``agent_id``'s permission to use ``linked_id``.",
        "operationId": "identities_revoke_agent_grant",
        "parameters": [
          {
            "in": "path",
            "name": "linked_id",
            "required": true,
            "schema": {
              "title": "Linked Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Identities Revoke Agent Grant",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Agent Grant",
        "tags": [
          "identities"
        ]
      },
      "post": {
        "description": "Authorise ``agent_id`` to use the linked identity ``linked_id``.",
        "operationId": "identities_grant_to_agent",
        "parameters": [
          {
            "in": "path",
            "name": "linked_id",
            "required": true,
            "schema": {
              "title": "Linked Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/good_place_api__schemas__identity__AgentGrantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant To Agent",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/{provider}/callback": {
      "get": {
        "description": "Exchange the upstream ``code`` for tokens and persist a linked_identity row.\n\nIdempotent on ``(user_id, provider, provider_subject)`` \u2014 re-linking the\nsame upstream account replaces the encrypted tokens rather than inserting\na duplicate.",
        "operationId": "identities_complete_link",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "title": "Code",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "title": "State",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete Link",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/linked-identities/{provider}/start": {
      "post": {
        "description": "Issue an OAuth authorize URL the browser should redirect the user to.\n\nThe caller follows ``authorize_url``; the upstream provider sends the user\nback to ``/{provider}/callback`` with the same ``state`` we issued here.\n\nTenant-scoped providers (e.g. ``google:workspace``) are rejected with 404 so\na user cannot bypass the per-user catalogue and obtain a tenant-only scope\nset through ``linked_identity``. Tenant integrations go through the\n``/tenant/{tenant_id}/integrations`` route which resolves from its own\ncatalogue (``routes/tenant_integrations.py``).",
        "operationId": "identities_start_link",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartLinkResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Link",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/me/seller/connect": {
      "get": {
        "operationId": "seller_get_connect_status",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectStatusRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Connect Status",
        "tags": [
          "seller",
          "seller"
        ]
      },
      "post": {
        "description": "Create or refresh a Stripe Connect Express onboarding link for the user.\n\nTwo-step: if the user doesn't yet have a ``stripe_connect_account`` row,\ncreate a Stripe Express ``Account`` first and persist its ``acct_...`` id\nso subsequent ``account.updated`` webhooks have a row to update. Then\ncreate the AccountLink against that ``acct_...`` id \u2014 Stripe rejects the\nrequest if ``account`` isn't a real Stripe id.",
        "operationId": "seller_start_connect_onboarding",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectOnboardingLink"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Connect Onboarding",
        "tags": [
          "seller",
          "seller"
        ]
      }
    },
    "/api/v1/me/sessions": {
      "get": {
        "description": "Return task sessions the current user created in their active tenant.\n\nPowers the multi-task side rail. Optional ``status`` query param filters\nby TaskSessionStatus value (e.g. ``in_progress``, ``pending``).\nComma-separated lists are accepted (e.g. ``in_progress,waiting_for_user``).",
        "operationId": "me_list_my_sessions",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TaskSessionRead"
                  },
                  "title": "Response Me List My Sessions",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List My Sessions",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/sessions/events": {
      "get": {
        "description": "SSE stream of session updates for the current user's active tenant.\n\nPowers the multi-task side rail's live updates. The front-end opens an\n``EventSource`` against this path and listens for ``update`` events\ncarrying a ``TaskSessionRead``-shaped payload. Resume via\n``Last-Event-ID`` per decision #27.",
        "operationId": "me_stream_session_events",
        "parameters": [
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Server-Sent Events stream of session updates."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Session Events",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/tenants": {
      "get": {
        "operationId": "me_list_my_tenants",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantMembershipRead"
                  },
                  "title": "Response Me List My Tenants",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List My Tenants",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/user-api-keys": {
      "get": {
        "operationId": "me_list_user_api_keys",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserApiKeyRead"
                  },
                  "title": "Response Me List User Api Keys",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List User Api Keys",
        "tags": [
          "me"
        ]
      },
      "post": {
        "operationId": "me_create_user_api_key",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create User Api Key",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/me/user-api-keys/{key_id}": {
      "delete": {
        "operationId": "me_delete_user_api_key",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete User Api Key",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/rbac/agent-grant": {
      "post": {
        "description": "Create / update / revoke an agent-user grant from the RBAC matrix UI.\n\nAlways returns ``AgentGrantRead`` so clients see one shape: ``role`` is the\nnew role on create/update, and ``null`` after a revoke.",
        "operationId": "rbac_set_agent_grant",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentGrantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/good_place_api__schemas__rbac__AgentGrantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Agent Grant",
        "tags": [
          "rbac"
        ]
      }
    },
    "/api/v1/rbac/check": {
      "post": {
        "description": "Browser-friendly twin of ``/tenant/{id}/rbac/check``.\n\nUses the active-tenant cookie. Requires ``rbac:read``.",
        "operationId": "rbac_simulate_browser",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RBACCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RBACCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Simulate Browser",
        "tags": [
          "rbac"
        ]
      }
    },
    "/api/v1/status/active": {
      "get": {
        "operationId": "status_alerts_list_active_alerts",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/StatusAlertRead"
                  },
                  "title": "Response Status Alerts List Active Alerts",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Active Alerts",
        "tags": [
          "status-alerts"
        ]
      }
    },
    "/api/v1/status/alerts": {
      "post": {
        "operationId": "status_alerts_create_alert",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusAlertCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusAlertRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Alert",
        "tags": [
          "status-alerts"
        ]
      }
    },
    "/api/v1/status/alerts/{alert_id}": {
      "patch": {
        "operationId": "status_alerts_patch_alert",
        "parameters": [
          {
            "in": "path",
            "name": "alert_id",
            "required": true,
            "schema": {
              "title": "Alert Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusAlertPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusAlertRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Alert",
        "tags": [
          "status-alerts"
        ]
      }
    },
    "/api/v1/status/alerts/{alert_id}/updates": {
      "post": {
        "operationId": "status_alerts_add_alert_update",
        "parameters": [
          {
            "in": "path",
            "name": "alert_id",
            "required": true,
            "schema": {
              "title": "Alert Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusAlertUpdateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusAlertUpdateRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Alert Update",
        "tags": [
          "status-alerts"
        ]
      }
    },
    "/api/v1/status/global": {
      "get": {
        "operationId": "admin_get_global_status",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ServiceStatusRead"
                  },
                  "title": "Response Admin Get Global Status",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Global Status",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/status/tenant/{tenant_id}": {
      "get": {
        "description": "Tenant-scoped health: internal services this tenant depends on plus\nits linked connectors. Gated by ``tenant:read``, which in the seed\n``policy.csv`` is granted via the ``/{tenant_id}/*`` wildcard to\nOWNER and ADMIN (and SUPER_ADMIN bypasses Casbin entirely). MEMBER\nand GUEST cannot satisfy this check \u2014 matching the OWNER/ADMIN-only\ngate in ``front-end/src/layouts/OrgLayout.astro``.",
        "operationId": "admin_get_tenant_status",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ServiceStatusRead"
                  },
                  "title": "Response Admin Get Tenant Status",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tenant Status",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/super-admin/sample-use-cases": {
      "get": {
        "operationId": "admin_list_all_use_cases",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SampleUseCaseRead"
                  },
                  "title": "Response Admin List All Use Cases",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List All Use Cases",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "operationId": "admin_create_use_case",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SampleUseCaseCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SampleUseCaseRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Use Case",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/super-admin/sample-use-cases/reorder": {
      "put": {
        "operationId": "admin_reorder_use_cases",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reorder Use Cases",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/super-admin/sample-use-cases/{use_case_id}": {
      "delete": {
        "operationId": "admin_delete_use_case",
        "parameters": [
          {
            "in": "path",
            "name": "use_case_id",
            "required": true,
            "schema": {
              "title": "Use Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Use Case",
        "tags": [
          "admin"
        ]
      },
      "patch": {
        "operationId": "admin_update_use_case",
        "parameters": [
          {
            "in": "path",
            "name": "use_case_id",
            "required": true,
            "schema": {
              "title": "Use Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SampleUseCaseUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SampleUseCaseRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Use Case",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/super-admin/sample-use-cases/{use_case_id}/icon": {
      "delete": {
        "operationId": "admin_delete_use_case_icon",
        "parameters": [
          {
            "in": "path",
            "name": "use_case_id",
            "required": true,
            "schema": {
              "title": "Use Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Use Case Icon",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "operationId": "admin_upload_use_case_icon",
        "parameters": [
          {
            "in": "path",
            "name": "use_case_id",
            "required": true,
            "schema": {
              "title": "Use Case Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_admin_upload_use_case_icon"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SampleUseCaseIconUploaded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Use Case Icon",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent-grants": {
      "get": {
        "description": "All agent-user grants for the tenant. Used by the RBAC matrix page.",
        "operationId": "rbac_list_agent_grants",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/good_place_api__schemas__rbac__AgentGrantRead"
                  },
                  "title": "Response Rbac List Agent Grants",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Grants",
        "tags": [
          "rbac"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/billing/zoom-checkout": {
      "post": {
        "description": "Open a Stripe Checkout Session to enable Zoom-as-a-Service for this agent.",
        "operationId": "billing_start_zoom_checkout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionRedirect"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Zoom Checkout",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/code-ref": {
      "patch": {
        "description": "Pin ``agent.code_ref`` to a branch or tag on the agent's GitLab project.\n\nThe chosen ref is validated against the project's real branch + tag set\nso a typo (or a stale UI tab) can't pin the orchestrator's clone target\nto a ref that doesn't exist. Unknown refs return 422 with an actionable\nmessage; the next ``start_agent`` would otherwise fail at init-container\nclone time with a far less helpful error. Issue #1835.\n\nValidation has three modes:\n\n* **Complete listing** (``refs.complete == True``) \u2014 the cached set is\n  authoritative; any ref outside it is rejected with 422.\n* **Partial listing** (``refs.complete == False`` but the project does\n  exist) \u2014 the cache might be missing the candidate (truncated past\n  :data:`_REPO_REFS_BRANCH_HARD_CAP` / :data:`_REPO_REFS_TAG_HARD_CAP`,\n  or one listing errored). Fall back to a direct single-ref GitLab\n  lookup; only reject when GitLab definitively answers 404 on both\n  branch and tag.\n* **Unavailable** (project lookup itself failed) \u2014 fail open so the\n  operator isn't trapped by an upstream outage. The init container\n  catches a genuinely bad ref on the next start.",
        "operationId": "agents_pin_code_ref",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCodeRefUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Pin Code Ref",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/conflicts": {
      "get": {
        "description": "Every still-open conflict for this (tenant, agent).\n\nRead-only by nature (decision #32 allows it). Returns ``[]`` when no\nunresolved rows exist \u2014 the dream-cycle detector (issue #1656) writes\nthese on its nightly pass.",
        "operationId": "memories_list_conflicts",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryConflictListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Conflicts",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/conflicts/{conflict_id}/resolve": {
      "post": {
        "description": "Drop the loser memory and mark the conflict resolved.\n\nAdmin (or tenant member with ``memory:write``) resolution surface.\nThe agent-side counterpart is ``ctx.memory.resolve_conflict(...)`` which\nlands at ``POST /api/internal/sessions/{s}/memory/conflicts/{id}/resolve``.\nBoth call into ``services.memory_conflicts.resolve``.",
        "operationId": "memories_resolve_conflict_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "conflict_id",
            "required": true,
            "schema": {
              "title": "Conflict Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemoryConflictResolve"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryConflictRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Conflict Route",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/cron/jobs": {
      "get": {
        "operationId": "cron_list_jobs",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CronJobRead"
                  },
                  "title": "Response Cron List Jobs",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Jobs",
        "tags": [
          "cron"
        ]
      },
      "post": {
        "operationId": "cron_create_job",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronJobCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Job",
        "tags": [
          "cron"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/cron/jobs/{job_id}": {
      "delete": {
        "operationId": "cron_delete_job",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Job",
        "tags": [
          "cron"
        ]
      },
      "get": {
        "operationId": "cron_get_job",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Job",
        "tags": [
          "cron"
        ]
      },
      "patch": {
        "operationId": "cron_update_job",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronJobUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Job",
        "tags": [
          "cron"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/cron/jobs/{job_id}/pause": {
      "post": {
        "operationId": "cron_pause_job",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronJobRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Pause Job",
        "tags": [
          "cron"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/documents/projects": {
      "get": {
        "operationId": "documents_list_projects",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProjectRead"
                  },
                  "title": "Response Documents List Projects",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Projects",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/documents/search": {
      "post": {
        "operationId": "documents_search_documents",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentSearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Documents",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/attachments": {
      "post": {
        "description": "Upload and scan an attachment. Returns attachment metadata on success.\n\nThe file is ClamAV-scanned; an infected verdict results in a 422 response\nwith a sanitized error. On clean scan, returns MailAttachment-shaped dict\nwith ref, scan_id, filename, size_bytes, sha256.",
        "operationId": "mail_upload_attachment",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filename",
            "required": true,
            "schema": {
              "title": "Filename",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_mail_upload_attachment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Upload Attachment",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Attachment",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/mailboxes": {
      "get": {
        "description": "Return live mailboxes for this agent.",
        "operationId": "mail_list_mailboxes",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentMailboxRow"
                  },
                  "title": "Response Mail List Mailboxes",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Mailboxes",
        "tags": [
          "mail"
        ]
      },
      "post": {
        "description": "Create a new internal mailbox for this agent.\n\nDelegates to the proxy \u2192 mail-internal provisioning handler (decision #29:\n``provision.py`` is the sole writer of ``mail.mailbox`` rows).",
        "operationId": "mail_create_mailbox",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Body",
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Create Mailbox",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Mailbox",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/mailboxes/{mailbox_id}": {
      "delete": {
        "description": "Delete a mailbox.",
        "operationId": "mail_delete_mailbox",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "mailbox_id",
            "required": true,
            "schema": {
              "title": "Mailbox Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Delete Mailbox",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Mailbox",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/mailboxes/{mailbox_id}/messages/{message_id}/attachments": {
      "get": {
        "description": "List attachment metadata for a message. Verifies mailbox ownership.",
        "operationId": "mail_list_attachments",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "mailbox_id",
            "required": true,
            "schema": {
              "title": "Mailbox Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentAttachmentRow"
                  },
                  "title": "Response Mail List Attachments",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Attachments",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/mailboxes/{mailbox_id}/messages/{message_id}/attachments/{attachment_id}": {
      "get": {
        "description": "Returns attachment metadata + a signed GCS download URL.",
        "operationId": "mail_get_attachment",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "mailbox_id",
            "required": true,
            "schema": {
              "title": "Mailbox Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "title": "Attachment Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Get Attachment",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Attachment",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/messages": {
      "get": {
        "description": "List messages in a folder. Calls proxy \u2192 mail-internal JMAP endpoint.",
        "operationId": "mail_list_messages",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "folder",
            "required": false,
            "schema": {
              "default": "inbox",
              "title": "Folder",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unread_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Unread Only",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/JsonObject"
                  },
                  "title": "Response Mail List Messages",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Messages",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/messages/{message_id}": {
      "delete": {
        "description": "Delete a message (soft-delete to trash).",
        "operationId": "mail_delete_message",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Delete Message",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Message",
        "tags": [
          "mail"
        ]
      },
      "get": {
        "description": "Fetch a full message by id. Calls proxy \u2192 mail-internal JMAP endpoint.",
        "operationId": "mail_get_message",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Get Message",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Message",
        "tags": [
          "mail"
        ]
      },
      "patch": {
        "description": "Move to folder, mark read/unread.",
        "operationId": "mail_update_message",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Body",
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Update Message",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Message",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/mail/send": {
      "post": {
        "description": "Send mail. Internal targets go to mail-internal; external flag routes to mail-external.",
        "operationId": "mail_send_message",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "title": "Body",
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Mail Send Message",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Message",
        "tags": [
          "mail"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memories": {
      "get": {
        "operationId": "memories_list_memories",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "filter_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter Kind"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValkeyMemoryListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Memories",
        "tags": [
          "memories"
        ]
      },
      "post": {
        "description": "Write a memory to Valkey. Backs the ``manage_memory.remember`` action.\n\nRead-only gating happens via the Casbin ``memory:write`` permission combined\nwith the proxy's read-only enforcement (decision #32) on the inbound prompt\nthat prompted the agent to call the tool.",
        "operationId": "memories_create_memory",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValkeyMemoryCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValkeyMemoryCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Memory",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memories/search": {
      "get": {
        "description": "Vector-rank memories nearest to ``q``. Backs ``manage_memory.recall``.",
        "operationId": "memories_search_memories",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "maxLength": 50000,
              "minLength": 1,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "top_k",
            "required": false,
            "schema": {
              "default": 8,
              "maximum": 50,
              "minimum": 1,
              "title": "Top K",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "radius",
            "required": false,
            "schema": {
              "default": 0.5,
              "maximum": 2.0,
              "minimum": 0.0,
              "title": "Radius",
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "filter_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Filter Kind"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValkeyMemorySearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Memories",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memories/{memory_id}": {
      "delete": {
        "description": "Drop a memory by id. Backs the ``manage_memory.delete`` action.",
        "operationId": "memories_delete_memory",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memory_id",
            "required": true,
            "schema": {
              "title": "Memory Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Memory",
        "tags": [
          "memories"
        ]
      },
      "put": {
        "operationId": "memories_update_memory",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memory_id",
            "required": true,
            "schema": {
              "title": "Memory Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValkeyMemoryUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValkeyMemoryRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Memory",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memories/{memory_id}/kind": {
      "patch": {
        "description": "Change a memory's ``kind`` without re-embedding. Backs ``manage_memory.update_kind``.",
        "operationId": "memories_update_memory_kind",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memory_id",
            "required": true,
            "schema": {
              "title": "Memory Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValkeyMemoryKindUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValkeyMemoryRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Memory Kind",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memory-summary": {
      "get": {
        "operationId": "memories_get_memory_summary",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MemorySummaryRead"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Memories Get Memory Summary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Memory Summary",
        "tags": [
          "memories"
        ]
      },
      "put": {
        "operationId": "memories_update_memory_summary",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemorySummaryUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemorySummaryRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Memory Summary",
        "tags": [
          "memories"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memory/export": {
      "post": {
        "description": "Dump every Valkey memory for the agent as JSONL on GCS.\n\n``include_embeddings`` is False by default; set it true to round-trip\nembeddings as base64-packed float32 buffers (one per row). Even with\nthem included the import path *always* re-embeds via the broker, so\nthe field is for archival completeness, not for skipping embed cost.",
        "operationId": "memory_export_import_export_memory",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include_embeddings",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Embeddings",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryExportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Memory",
        "tags": [
          "memory-export-import"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memory/import": {
      "post": {
        "description": "Reload memories from a JSONL artefact.\n\nThe endpoint is multipart-only:\n\n- ``file=<jsonl>`` \u2014 upload the artefact directly (admin UI path).\n- ``gcs_uri=<gs://...>`` \u2014 re-import a prior export without re-uploading.\n\nA JSON body is intentionally NOT accepted; combining JSON and\nmultipart parsing on one FastAPI route is brittle. Service-to-service\ncallers that want to re-import an existing export use the dedicated\nJSON sibling :func:`import_memory_from_gcs` below.",
        "operationId": "memory_export_import_import_memory",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_memory_export_import_import_memory"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryImportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Memory",
        "tags": [
          "memory-export-import"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/memory/import-from-gcs": {
      "post": {
        "description": "JSON sibling of :func:`import_memory` for re-importing an existing export.\n\n``body.gcs_uri`` is required. Same downstream pipeline as ``/import``\n(ClamAV \u2192 JSONL schema \u2192 re-embed \u2192 HSET).",
        "operationId": "memory_export_import_import_memory_from_gcs",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemoryImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryImportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Memory From Gcs",
        "tags": [
          "memory-export-import"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/refs": {
      "get": {
        "description": "List every branch + tag on the agent's GitLab project.\n\nFeeds the code-tab ``code_ref`` typeahead so the operator can only pin\n``agent.code_ref`` to a ref that actually exists (issue #1835).\n\nReturns empty lists when GitLab is unreachable or the project is\nmissing \u2014 the front-end falls back to a free-form input with a clear\nbanner in that case, so a transient GitLab outage doesn't lock the user\nout of pinning a ref they know is valid.",
        "operationId": "agents_list_repo_refs",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRepoRefs"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Repo Refs",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/self-edit-branches": {
      "get": {
        "description": "List ``agent/self-edit-*`` branches on the agent's GitLab repo.\n\nReturns ``[]`` when GitLab isn't reachable or the project is missing \u2014\nthe front-end already renders an honest \"No self-edit branches yet\"\nstate, so we never surface 502s for ops noise here.",
        "operationId": "agents_list_self_edit_branches",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SelfEditBranchRead"
                  },
                  "title": "Response Agents List Self Edit Branches",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Self Edit Branches",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions": {
      "get": {
        "operationId": "tasks_list_sessions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TaskSessionRead"
                  },
                  "title": "Response Tasks List Sessions",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Sessions",
        "tags": [
          "tasks"
        ]
      },
      "post": {
        "description": "Create a task session and spawn its agent pod.\n\nReturns 201 with the persisted row (status=PENDING). The next reconcile\ncall will lift status to IN_PROGRESS once the K8s Job's pod becomes\nactive. Errors:\n- 404 if the agent doesn't exist in this tenant.\n- 402 when the tenant has hit its concurrent-session quota.\n- 409 if the agent has no provisioned GitLab repo yet.\n- 503 if the K8s API rejects the Job creation.",
        "operationId": "tasks_create_session",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskSessionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Session",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}": {
      "delete": {
        "description": "Permanently delete a session, its messages, and per-session usage.\n\nActive pods are torn down before the row is removed (same K8s path as\ncancel); the per-session GitLab deploy key is deprovisioned best-effort.\n404 if the session doesn't belong to this (tenant, agent) pair; 503 if\nthe K8s API rejects the pod teardown.",
        "operationId": "tasks_delete_session_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Session Route",
        "tags": [
          "tasks"
        ]
      },
      "get": {
        "operationId": "tasks_get_session_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Session Route",
        "tags": [
          "tasks"
        ]
      },
      "patch": {
        "description": "Rename the session from the chat header.\n\nReuses the ``tasks:create`` gate \u2014 anyone who can create a session in this\n(tenant, agent) pair can rename one. The auto-namer\n(``services.session_naming``) still runs on every 5th user message and may\noverwrite the user-supplied title on the next boundary; the user can\nalways rename again.",
        "operationId": "tasks_update_session_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTitleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Session Route",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/attachments": {
      "get": {
        "description": "List every file attachment uploaded in this session, oldest-first.\n\nThe browser uses this to build the \"files in this session\" panel so\nusers can reference prior uploads. The agent SDK uses the internal twin\nof this endpoint via ``ctx.attachments.list()`` (issue #497).",
        "operationId": "tasks_list_session_attachments",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionAttachmentRead"
                  },
                  "title": "Response Tasks List Session Attachments",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Session Attachments",
        "tags": [
          "tasks"
        ]
      },
      "post": {
        "description": "Upload a file attachment for a session.\n\nThe file is ClamAV-scanned and stored in the session's GCS workspace folder\nbefore the attachment row is created. Two downstream paths:\n- Images (jpg/jpeg/png/gif/webp): sent as multimodal content blocks to the model broker.\n- Documents (everything else): the GCS path is embedded in message metadata\n  so the agent can pass it to tools such as ``docworker.upload_files``.\n\nReturns 422 for an infected file or an empty upload, 413 for oversized\nuploads, 503 if the AV scanner or GCS is unavailable.",
        "operationId": "tasks_upload_session_attachment",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_tasks_upload_session_attachment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionAttachmentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Session Attachment",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/cancel": {
      "post": {
        "description": "Stop the agent pod and mark the session terminal.\n\n503 surfaces a K8s-side delete failure; 404 means the session doesn't\nbelong to this (tenant, agent) pair.",
        "operationId": "tasks_cancel_session",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Session",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/citations/{citation_id}": {
      "get": {
        "description": "Resolve a ``[m_xxxx]`` citation back to the memory + (optional) source turn.\n\nUser-facing twin of the agent-SDK\n``GET /api/internal/sessions/{s}/memory/{memory_id}`` lookup (issue #1661):\nthe chat-message renderer and the trace inspector page call this when a\nuser clicks a citation badge so the side-panel can render the memory's\nkind / content / created_at plus the originating transcript turn when\nvisible. See issue #1679 and ``docs/content/memories.md`` (Citations).\n\nAccepts the three citation shapes the user might have in hand (rendered\n``[m_abc]``, bare ``m_abc``, raw ``abc``) \u2014 normalised by\n:func:`memory_citations.normalize_citation_id`. ``s_*`` (scenario) ids\nreturn 400 to keep the cross-grammar mistake from silently 404ing.\n\nCross-session degradation: when the memory was pinned to a turn that\nbelongs to a different session, ``source_message_id`` is returned but\n``source_message`` is ``None`` so the UI can render the \"pinned to\nmsg_X \u2014 not visible in this session\" hint (acceptance criterion #6).",
        "operationId": "tasks_get_session_citation",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "citation_id",
            "required": true,
            "schema": {
              "title": "Citation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryCitation"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Session Citation",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/credential-submit": {
      "post": {
        "description": "Browser submits a credential value from the masked input widget.\n\nThe value is stored directly in ``agent_skill.config_enc`` (encrypted at\nrest) and NEVER written to ``session_message`` or conversation history\n(issue #551). Reuses the ``tasks:message`` RBAC gate \u2014 anyone who can\nsend a message in a session can submit a requested credential.\n\nAfter storage a ``credential_stored`` SSE event is published so the\nagent can proceed, and a non-sensitive history message\n(\"Credential stored: [config_key]\") is persisted.",
        "operationId": "tasks_submit_credential",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialSubmit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Tasks Submit Credential",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Credential",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/debug": {
      "get": {
        "description": "Full session dump for the tenant-admin debug view.\n\nReturns the session metadata plus every message (with content and\ntoken counts) in chronological order. Read-only \u2014 no mutations.",
        "operationId": "tasks_debug_session",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionDebugRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Debug Session",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/listen": {
      "post": {
        "description": "Toggle the chat \"shut up and listen\" loop for this session.\n\n`on=True` enters the loop (user messages buffer, the agent is not invoked);\n`on=False` exits and flushes the buffered messages as one combined prompt.\nReuses the `tasks:message` gate \u2014 it's the same actor driving the same\nsession's conversational input. See docs/content/chat-listen-mode.md.",
        "operationId": "tasks_set_listen_mode",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListenModeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Listen Mode",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/messages": {
      "get": {
        "description": "Return the full message history for a session, ordered oldest-first.\n\nIncludes tool-call turns, tool results, and all intermediate agent turns so that\na page refresh during an active task shows complete progress. See #641.",
        "operationId": "tasks_list_messages",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TaskMessageOut"
                  },
                  "title": "Response Tasks List Messages",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Messages",
        "tags": [
          "tasks"
        ]
      },
      "post": {
        "description": "Persist the user's message and enqueue it on the agent's task stream.\n\nRead-only sessions still accept user messages \u2014 the read-only flag blocks\nside-effecting *agent* writes (memory / repo / cron), not conversational\ninput that drives the agent. See decision #32 / `docs/read-only-mode.md`.",
        "operationId": "tasks_add_message",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskMessageCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskMessageRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Message",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/messages/{message_id}/feedback": {
      "delete": {
        "description": "Remove the calling user's feedback on a message.",
        "operationId": "feedback_delete_feedback",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Feedback",
        "tags": [
          "feedback"
        ]
      },
      "get": {
        "description": "Return the calling user's feedback on a message, or 404.",
        "operationId": "feedback_get_feedback",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageFeedbackRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Feedback",
        "tags": [
          "feedback"
        ]
      },
      "post": {
        "description": "Create or update feedback on an agent message.",
        "operationId": "feedback_upsert_feedback",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageFeedbackCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageFeedbackRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upsert Feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/sessions/{session_id}/resume": {
      "post": {
        "description": "Spawn a new pod bound to the same `gcs_workdir`. The previous pod must\nalready be gone (terminal status) \u2014 typically after a completed run or a\ncancel. Status flips back to PENDING; the next reconcile lifts it.",
        "operationId": "tasks_resume_session",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSessionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resume Session",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/skill-credentials": {
      "get": {
        "description": "List the caller's live (non-revoked) credentials for the given agent.\n\nMetadata only \u2014 never the payload. Use the per-skill reveal endpoint to\nfetch plaintext (audited).",
        "operationId": "skill_credentials_list_skill_credentials",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillCredentialRead"
                  },
                  "title": "Response Skill Credentials List Skill Credentials",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skill Credentials",
        "tags": [
          "skill-credentials"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/skill-credentials/skill/{skill_id}": {
      "delete": {
        "description": "Soft-revoke the credential. Returns 404 if no live row exists.\n\nSets ``revoked_at`` rather than dropping the row so audit history can\nstill explain \"this credential resolved here through date X\".",
        "operationId": "skill_credentials_revoke_skill_credential",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Skill Credential",
        "tags": [
          "skill-credentials"
        ]
      },
      "put": {
        "description": "Create or rotate the credential for ``(ctx.user_id, agent_id, skill_id)``.\n\nIdempotent on the triple \u2014 a second call overwrites the ciphertext and\nrefreshes ``updated_at``. The body's ``agent_id`` / ``skill_id`` must\nmatch the path values (defence in depth against the wrong triple landing\nin the table on a buggy client).",
        "operationId": "skill_credentials_upsert_skill_credential",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillCredentialCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillCredentialRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upsert Skill Credential",
        "tags": [
          "skill-credentials"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/skill-credentials/skill/{skill_id}/reveal": {
      "get": {
        "description": "Decrypt and return the credential for the triple. Audited on every call.\n\nReturns 404 if the row is missing, revoked, or expired \u2014 the caller\nnever learns *which* of the three failed (an attacker could otherwise\nuse the distinction to probe for valid triples).",
        "operationId": "skill_credentials_read_skill_credential",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillCredentialReveal"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Skill Credential",
        "tags": [
          "skill-credentials"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/video/routes": {
      "get": {
        "operationId": "video_list_routes",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/VideoRouteRead"
                  },
                  "title": "Response Video List Routes",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Routes",
        "tags": [
          "video"
        ]
      },
      "post": {
        "operationId": "video_create_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRouteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoRouteWithToken"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Route",
        "tags": [
          "video"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/video/routes/{route_id}": {
      "delete": {
        "operationId": "video_delete_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Route",
        "tags": [
          "video"
        ]
      },
      "get": {
        "operationId": "video_get_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoRouteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Route",
        "tags": [
          "video"
        ]
      },
      "patch": {
        "operationId": "video_update_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRouteUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoRouteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Route",
        "tags": [
          "video"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agent/{agent_id}/voice": {
      "delete": {
        "description": "Delete the calling user's voice config, reverting to defaults.",
        "operationId": "voice_delete_voice_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Voice Config",
        "tags": [
          "voice"
        ]
      },
      "get": {
        "description": "Get the calling user's voice config for this agent, or null if unset.",
        "operationId": "voice_get_voice_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/VoiceConfigRead"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Voice Get Voice Config"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Voice Config",
        "tags": [
          "voice"
        ]
      },
      "put": {
        "description": "Set or update the calling user's voice config for this agent.",
        "operationId": "voice_upsert_voice_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceConfigUpsert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upsert Voice Config",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents": {
      "get": {
        "operationId": "agents_list_agents",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "favorites",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 1,
              "minimum": 0,
              "title": "Favorites",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Owner"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "name_asc",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentListRead"
                  },
                  "title": "Response Agents List Agents",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agents",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "operationId": "agents_create_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}": {
      "delete": {
        "operationId": "agents_delete_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Agent",
        "tags": [
          "agents"
        ]
      },
      "get": {
        "operationId": "agents_get_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent",
        "tags": [
          "agents"
        ]
      },
      "patch": {
        "operationId": "agents_update_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/budget": {
      "get": {
        "operationId": "agents_get_budget",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBudgetRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Budget",
        "tags": [
          "agents"
        ]
      },
      "patch": {
        "operationId": "agents_set_budget",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentBudgetUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBudgetRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Budget",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/can-author-skills": {
      "put": {
        "description": "Toggle the agent-level skill authoring permission.\n\nThe path, body field, and audit action all use ``can_author_skills`` so\nthey match the column name exposed by ``AgentRead``. No second name for\nthe same boolean.",
        "operationId": "agents_update_can_author_skills",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCanAuthorSkillsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Can Author Skills",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/clone": {
      "post": {
        "description": "Clone an existing agent into a new independent agent.",
        "operationId": "agents_clone_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentClone"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Clone Agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/favorite": {
      "delete": {
        "operationId": "agents_remove_favorite",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Favorite",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "operationId": "agents_add_favorite",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentFavoriteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Favorite",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/files/{file_path}": {
      "get": {
        "description": "Serve an agent workspace file via a short-lived signed GCS URL.\n\n1. Verify user has read access to this agent (via ``require(\"agent:read\")``)\n2. Resolve the file in the agent's GCS workspace\n3. Check for an existing clean ``file_scan`` row; if none, trigger a\n   synchronous ClamAV scan\n4. If clean, redirect to a 15-min signed GCS URL\n5. Return 404 (not found), 403 (access denied / tenant mismatch),\n   422 (infected)",
        "operationId": "agent_files_serve_agent_file",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_path",
            "required": true,
            "schema": {
              "title": "File Path",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to a short-lived signed GCS URL"
          },
          "400": {
            "description": "Invalid file path"
          },
          "403": {
            "description": "Tenant mismatch or access denied"
          },
          "404": {
            "description": "Agent or file not found"
          },
          "422": {
            "description": "File failed virus scan"
          },
          "503": {
            "description": "Virus scanner unavailable"
          }
        },
        "summary": "Serve Agent File",
        "tags": [
          "agent-files"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/integrations": {
      "get": {
        "description": "Return the set of supported per-agent integrations with connected status.",
        "operationId": "integrations_list_agent_integrations",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentIntegrationRead"
                  },
                  "title": "Response Integrations List Agent Integrations",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/integrations/slack": {
      "delete": {
        "description": "Revoke this agent's Slack bot token.\n\nDeletes the ``tenant_identity`` row with provider ``slack:bot:{slug}``.\nDoes nothing and returns 204 if the token was never installed.",
        "operationId": "integrations_revoke_agent_slack",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Agent Slack",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/integrations/slack/connect": {
      "post": {
        "description": "Begin the Slack OAuth flow to install a bot token for this agent.\n\nIssues an agent-scoped state token and returns the Slack authorize URL.\nThe browser must redirect to that URL; Slack will bounce back to the\ncallback endpoint when the user completes the install.",
        "operationId": "integrations_connect_agent_slack",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAgentIntegrationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Connect Agent Slack",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/integrations/slack/rotate": {
      "post": {
        "description": "Re-run the Slack OAuth flow to rotate the agent's bot token.\n\nSame machinery as ``connect``; the callback's upsert is idempotent.",
        "operationId": "integrations_rotate_agent_slack",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAgentIntegrationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Agent Slack",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/model-chain": {
      "get": {
        "description": "Return the agent's model grants ordered by priority (ascending).",
        "operationId": "agents_get_model_chain",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentModelRead"
                  },
                  "title": "Response Agents Get Model Chain",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Model Chain",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "description": "Replace the agent's model chain with an ordered list of model IDs.",
        "operationId": "agents_set_model_chain",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentModelChainUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentModelRead"
                  },
                  "title": "Response Agents Set Model Chain",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Model Chain",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/openrouter/models": {
      "get": {
        "description": "List tenant-active OR models with the agent's enable toggle.",
        "operationId": "openrouter_list_agent_models",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/JsonObject"
                  },
                  "title": "Response Openrouter List Agent Models",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Models",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/openrouter/models/{model_id}/disable": {
      "post": {
        "description": "Agent owner: disable an OR model for an agent. Idempotent.",
        "operationId": "openrouter_disable_for_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Openrouter Disable For Agent",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Disable For Agent",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/openrouter/models/{model_id}/enable": {
      "post": {
        "description": "Agent owner: enable an OR model for an agent. Idempotent.",
        "operationId": "openrouter_enable_for_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Openrouter Enable For Agent",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enable For Agent",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/roles": {
      "get": {
        "description": "List all role assignments for an agent.",
        "operationId": "agent_roles_list_roles",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentRoleAssignmentRead"
                  },
                  "title": "Response Agent Roles List Roles",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Roles",
        "tags": [
          "agent-roles"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/roles/permissions-grid": {
      "get": {
        "description": "Return the permissions grid metadata for the frontend.",
        "operationId": "agent_roles_get_permissions_grid",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRolePermissionGrid"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Permissions Grid",
        "tags": [
          "agent-roles"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/roles/{user_id}": {
      "delete": {
        "description": "Remove a user's role assignment for this agent.",
        "operationId": "agent_roles_remove_role",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Role",
        "tags": [
          "agent-roles"
        ]
      },
      "put": {
        "description": "Set a user's role for this agent. Creates or updates the assignment.",
        "operationId": "agent_roles_set_role",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentRoleAssignmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRoleAssignmentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Role",
        "tags": [
          "agent-roles"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/skill-permissions": {
      "get": {
        "description": "Return all skill permission rows for an agent.",
        "operationId": "agents_list_skill_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentSkillPermissionRead"
                  },
                  "title": "Response Agents List Skill Permissions",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skill Permissions",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "description": "Replace the skill permission allowlist for an agent.",
        "operationId": "agents_update_skill_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSkillPermissionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentSkillPermissionRead"
                  },
                  "title": "Response Agents Update Skill Permissions",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Skill Permissions",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/skill-visibility-scope": {
      "put": {
        "description": "Set the skill-authoring visibility scope for this agent.\n\n``private_only`` \u2014 agent may only author ``visibility='private'`` skills.\n``tenant_allowed`` \u2014 agent may also author ``visibility='public'`` skills.\n\nRequires ``agent:update`` (OWNER/ADMIN only). See issue #550.",
        "operationId": "agents_update_skill_visibility_scope",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSkillVisibilityScopeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Skill Visibility Scope",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/skills": {
      "get": {
        "operationId": "agents_list_agent_skills",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentSkillRead"
                  },
                  "title": "Response Agents List Agent Skills",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Skills",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "operationId": "agents_add_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSkillGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Skill",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/skills/{skill_id}": {
      "delete": {
        "operationId": "agents_remove_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Skill",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/skills/{skill_id}/config": {
      "get": {
        "description": "Decrypted per-attachment config blob.\n\nGated behind ``agent:skills:write`` because the blob may carry sensitive\nsettings (and we don't want it on the cheap read RBAC path). Returns\n``config=None`` when no blob has been set.",
        "operationId": "agents_get_agent_skill_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSkillConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent Skill Config",
        "tags": [
          "agents"
        ]
      },
      "patch": {
        "description": "Replace the per-attachment config blob (or clear it).\n\nA ``config`` field that is ``null`` or omitted clears the column.\nOtherwise the dict is JSON-serialised and encrypted with the tenant's\nFernet key before persisting.\n\nSecrets should still flow through ``linked_identity`` /\n``tenant_identity`` and ``request_credential`` (#551) so they never reach\nchat history \u2014 but the column is encrypted regardless to keep accidental\nwrites out of plaintext on disk.",
        "operationId": "agents_update_agent_skill_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSkillConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Agent Skill Config",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/slack-config": {
      "get": {
        "operationId": "agents_get_slack_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSlackConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Slack Config",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "operationId": "agents_update_slack_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSlackConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSlackConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Slack Config",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/tools": {
      "get": {
        "operationId": "agents_list_agent_tools",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentToolRead"
                  },
                  "title": "Response Agents List Agent Tools",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Tools",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "operationId": "agents_add_tool",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentToolGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentToolRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Tool",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/tools/{tool_id}": {
      "delete": {
        "operationId": "agents_remove_tool",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tool_id",
            "required": true,
            "schema": {
              "title": "Tool Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Tool",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/transfer-ownership": {
      "post": {
        "operationId": "agents_transfer_ownership",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentOwnershipTransfer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Transfer Ownership",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/agents/{agent_id}/users": {
      "post": {
        "description": "Add or update an agent_user grant \u2014 the AGENT side of the RBAC intersection.",
        "operationId": "agents_grant_user",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentUserGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentUserGrantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant User",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/agent-costs": {
      "get": {
        "description": "Per-agent cost breakdown for the requested time window.\n\nRequires ``tenant:billing:read`` (OWNER / ADMIN wildcard covers it).",
        "operationId": "billing_get_agent_costs",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month"
              ],
              "title": "Period",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "start",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "in": "query",
            "name": "end",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCostsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent Costs",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/checkout-session": {
      "post": {
        "description": "Open a Stripe Checkout Session for a subscription upgrade.",
        "operationId": "billing_start_checkout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutSessionStart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionRedirect"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Checkout",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/enterprise-checkout": {
      "post": {
        "description": "Open a Stripe Checkout Session for the Enterprise add-on.",
        "operationId": "billing_start_enterprise_checkout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionRedirect"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Enterprise Checkout",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/portal-session": {
      "post": {
        "description": "Create a Stripe Billing Portal session so the tenant can manage their subscription.",
        "operationId": "billing_create_portal_session",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPortalRedirect"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Portal Session",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/subscription": {
      "get": {
        "operationId": "billing_get_subscription",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Subscription",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/support-checkout": {
      "post": {
        "description": "Open a Stripe Checkout Session for the Support add-on.",
        "operationId": "billing_start_support_checkout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionRedirect"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start Support Checkout",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/billing/usage": {
      "get": {
        "description": "Month-to-date model-broker rollup for the calling tenant.",
        "operationId": "billing_get_usage",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Usage",
        "tags": [
          "billing",
          "billing"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/cron/blackouts": {
      "get": {
        "operationId": "cron_list_blackouts",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CronBlackoutRead"
                  },
                  "title": "Response Cron List Blackouts",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Blackouts",
        "tags": [
          "cron"
        ]
      },
      "post": {
        "operationId": "cron_create_blackout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronBlackoutCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronBlackoutRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Blackout",
        "tags": [
          "cron"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/cron/blackouts/{blackout_id}": {
      "delete": {
        "operationId": "cron_delete_blackout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blackout_id",
            "required": true,
            "schema": {
              "title": "Blackout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Blackout",
        "tags": [
          "cron"
        ]
      },
      "get": {
        "operationId": "cron_get_blackout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blackout_id",
            "required": true,
            "schema": {
              "title": "Blackout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronBlackoutRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Blackout",
        "tags": [
          "cron"
        ]
      },
      "patch": {
        "operationId": "cron_update_blackout",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blackout_id",
            "required": true,
            "schema": {
              "title": "Blackout Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronBlackoutUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronBlackoutRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Blackout",
        "tags": [
          "cron"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/delegations": {
      "get": {
        "description": "Return all delegation entries owned by the calling user.",
        "operationId": "delegations_list_delegations",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DelegationRead"
                  },
                  "title": "Response Delegations List Delegations",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List delegations for the current user",
        "tags": [
          "delegations"
        ]
      },
      "post": {
        "description": "Create a delegation entry granting *agent_id* read-only access to the\ncalling user's linked identity for *provider*.",
        "operationId": "delegations_grant_delegation",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DelegationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DelegationRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant an agent read-only access to a linked identity",
        "tags": [
          "delegations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/delegations/{delegation_id}": {
      "delete": {
        "description": "Revoke a delegation. The owning user or a tenant admin can revoke.",
        "operationId": "delegations_revoke_delegation",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "delegation_id",
            "required": true,
            "schema": {
              "title": "Delegation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Delegations Revoke Delegation",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke a delegation",
        "tags": [
          "delegations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/files/scan": {
      "post": {
        "description": "Server-side ClamAV gate for a browser upload.\n\n``resource_type`` defaults to ``file`` and accepts ``attachment`` /\n``bundle`` for callers that already know what the upload is for. The\nresponse shape mirrors :class:`good_place_api.routes.internal.file_scan.FileScanRead`\nminus the row id (the front-end never needs to look it up later).\n\nPer-tenant size cap is enforced via ``settings.max_upload_mb``; bigger\nuploads return 413 instead of being scanned (clamd would still scan\nthem, but the cost belongs in the agent / DocWorker flow that knows\nwhy the file is large).",
        "operationId": "files_scan_upload",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_files_scan_upload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Files Scan Upload",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Scan Upload",
        "tags": [
          "files"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/files/{attachment_id}/content": {
      "get": {
        "description": "Return file content for a session attachment.\n\nWithout ``?raw=true``: returns the file with ``Content-Disposition:\nattachment`` so the browser triggers a download.\n\nWith ``?raw=true``: returns the body as ``text/plain; charset=utf-8``\nwithout a download prompt. Currently restricted to ``.md`` files;\nnon-markdown files return 400.",
        "operationId": "files_get_file_content",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "title": "Attachment Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "raw",
            "required": false,
            "schema": {
              "default": false,
              "title": "Raw",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "File content (text/plain with `?raw=true`; the stored MIME type otherwise, as an attachment download)."
          },
          "400": {
            "description": "Raw mode is only supported for `.md` files."
          },
          "403": {
            "description": "Tenant mismatch or permission denied."
          },
          "404": {
            "description": "Attachment not found."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "GCS unavailable."
          }
        },
        "summary": "Get File Content",
        "tags": [
          "files"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/flowise/chatflows/{chatflow_id}/promote": {
      "post": {
        "description": "Promote a Flowise chatflow to a first-class LangChain agent.\n\nFetches the chatflow definition from Flowise, translates it into LangChain\nagent source files (``Agent.md``, ``Soul.md``, ``main.py``), creates an\n``Agent`` row, provisions a GitLab repo, and commits the generated files.",
        "operationId": "flowise_promote_flowise_chatflow",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "chatflow_id",
            "required": true,
            "schema": {
              "title": "Chatflow Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowisePromoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowisePromoteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Promote Flowise Chatflow",
        "tags": [
          "flowise"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/github/install": {
      "post": {
        "description": "Store the GitHub App installation_id for this tenant.\n\nThe tenant admin completes the GitHub App install flow in the browser and\nprovides the ``installation_id`` returned by GitHub's callback. The API\npersists this in ``tenant_identity`` (provider ``github:app``).\n\nThe access token exchange (installation \u2192 token) is deferred to the first\nAPI call that needs it (e.g. listing repos), following the same lazy-refresh\npattern used by other tenant_identity providers.",
        "operationId": "github_webhooks_register_github_app_install",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitHubAppInstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubAppInstallResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Github App Install",
        "tags": [
          "github-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/github/repos": {
      "get": {
        "description": "List all GitHub-provider webhook routes for this tenant.",
        "operationId": "github_webhooks_list_github_repo_webhooks",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GitHubRepoWebhookRead"
                  },
                  "title": "Response Github Webhooks List Github Repo Webhooks",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Github Repo Webhooks",
        "tags": [
          "github-webhooks"
        ]
      },
      "post": {
        "description": "Create a webhook route wired to a specific GitHub repo + event types.",
        "operationId": "github_webhooks_create_github_repo_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitHubRepoWebhookCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRouteCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Github Repo Webhook",
        "tags": [
          "github-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/github/repos/{route_id}": {
      "delete": {
        "description": "Delete a GitHub repo webhook route.",
        "operationId": "github_webhooks_delete_github_repo_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Github Repo Webhook",
        "tags": [
          "github-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/github/repos/{route_id}/events": {
      "get": {
        "description": "List recent GitHub webhook deliveries for a route.",
        "operationId": "github_webhooks_list_github_webhook_events",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GitHubWebhookEventRead"
                  },
                  "title": "Response Github Webhooks List Github Webhook Events",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Github Webhook Events",
        "tags": [
          "github-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/github/repos/{route_id}/rotate-secret": {
      "post": {
        "description": "Rotate the HMAC secret for a GitHub webhook route.",
        "operationId": "github_webhooks_rotate_github_webhook_secret",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRouteCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Github Webhook Secret",
        "tags": [
          "github-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities": {
      "get": {
        "description": "List outbound OAuth identities the tenant has linked.",
        "operationId": "identities_list_tenant_identities",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantIdentityRead"
                  },
                  "title": "Response Identities List Tenant Identities",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Identities",
        "tags": [
          "identities"
        ]
      },
      "post": {
        "description": "Save or rotate a BYOK credential in `tenant_identity`.\n\nThe plaintext access_token is encrypted immediately via `services/secrets`\nand never written to the database in clear.",
        "operationId": "identities_upsert_tenant_identity",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantIdentityCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantIdentityRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upsert Tenant Identity",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities/idp": {
      "get": {
        "operationId": "identities_list_identity_providers",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/IdentityProviderRead"
                  },
                  "title": "Response Identities List Identity Providers",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Identity Providers",
        "tags": [
          "identities"
        ]
      },
      "post": {
        "operationId": "identities_create_identity_provider",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityProviderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Identity Provider",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities/idp/{alias}": {
      "delete": {
        "operationId": "identities_delete_identity_provider",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "alias",
            "required": true,
            "schema": {
              "title": "Alias",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Identity Provider",
        "tags": [
          "identities"
        ]
      },
      "get": {
        "operationId": "identities_get_identity_provider",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "alias",
            "required": true,
            "schema": {
              "title": "Alias",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Identity Provider",
        "tags": [
          "identities"
        ]
      },
      "put": {
        "operationId": "identities_update_identity_provider",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "alias",
            "required": true,
            "schema": {
              "title": "Alias",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityProviderUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Identity Provider",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities/merge/callback": {
      "post": {
        "description": "Complete a merge.dev Link \u2014 exchange the ``public_token`` for the\nlong-lived ``account_token`` and persist it (encrypted) in\n``tenant_identity``. Idempotent per ``(tenant_id, merge:<category>)``.",
        "operationId": "identities_merge_callback",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeCallbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeCallbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Merge Callback",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities/merge/link-token": {
      "post": {
        "description": "Begin the merge.dev Link flow \u2014 return a short-lived link token.",
        "operationId": "identities_merge_link_token",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeLinkTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeLinkTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Merge Link Token",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/identities/{identity_id}": {
      "delete": {
        "description": "Delete the `tenant_identity` row, revoking broker access to this credential.",
        "operationId": "identities_revoke_tenant_identity",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "identity_id",
            "required": true,
            "schema": {
              "title": "Identity Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Tenant Identity",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/integrations": {
      "get": {
        "description": "Return the catalogue of supported integrations with connected status.",
        "operationId": "integrations_list_tenant_integrations",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantIntegrationRead"
                  },
                  "title": "Response Integrations List Tenant Integrations",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/integrations/{provider}/connect": {
      "post": {
        "description": "Begin the per-provider link flow.\n\nFor OAuth providers this issues a tenant-bound state token and returns\nthe upstream authorize URL. For merge.dev categories it asks merge.dev\nfor a Magic Link URL bound to our callback. Either way the front-end\nsees a ``{url}`` payload and redirects the browser.",
        "operationId": "integrations_connect_tenant_integration",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectIntegrationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Connect Tenant Integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/integrations/{provider}/rotate": {
      "post": {
        "description": "Re-run the link flow for an already-connected integration.\n\nSame machinery as ``connect``; on callback ``upsert_from_oauth`` /\n``merge.complete_link`` are idempotent on ``(tenant_id, provider)`` and\noverwrite the encrypted tokens in place.",
        "operationId": "integrations_rotate_tenant_integration",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectIntegrationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Tenant Integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/marketplace/listings": {
      "post": {
        "description": "Create a draft listing from an existing skill or agent.",
        "operationId": "marketplace_create_listing",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceListingCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Listing",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/marketplace/listings/{listing_id}/versions": {
      "post": {
        "description": "Freeze a bundle, ClamAV-scan, upload to GCS, persist the version row.\n\nDecision #26 + #24: every marketplace bundle goes through ClamAV before\nit can become buyable. ``scanned_by_service='marketplace'`` lands in\n``file_scan`` for audit. The bundle bytes are uploaded to\n``gs://<tenant-bucket>/marketplace/<listing>/<version>.bundle`` *before*\nthe version row is committed \u2014 a successful row means the GCS object\nexists, so listings never point at a missing bundle.",
        "operationId": "marketplace_publish_version",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listing_id",
            "required": true,
            "schema": {
              "title": "Listing Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_marketplace_publish_version"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceVersionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Publish Version",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/marketplace/payouts": {
      "get": {
        "description": "List Stripe Connect transfer history for the calling seller.",
        "operationId": "marketplace_list_payouts",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MarketplacePayoutRead"
                  },
                  "title": "Response Marketplace List Payouts",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Payouts",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/marketplace/purchase/{listing_id}": {
      "post": {
        "description": "Start Stripe Checkout for a marketplace listing; install on webhook completion.",
        "operationId": "marketplace_purchase",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "listing_id",
            "required": true,
            "schema": {
              "title": "Listing Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Marketplace Purchase",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Purchase",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/mentions/agents": {
      "get": {
        "description": "Return agents visible to the caller, filtered by name/slug substring.",
        "operationId": "mentions_autocomplete_agents",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "maxLength": 100,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutocompleteItem"
                  },
                  "title": "Response Mentions Autocomplete Agents",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Autocomplete Agents",
        "tags": [
          "mentions"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/mentions/slack-channels": {
      "get": {
        "description": "Return Slack channels for the tenant's connected Slack workspace.\n\nReturns an empty list when no Slack identity is connected so the UI can\nshow a \"connect Slack\" empty state. Live channel fetch is a follow-up\nonce the tools-service Slack connector is wired (must go through the\nproxy per decision #14).",
        "operationId": "mentions_autocomplete_slack_channels",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "maxLength": 100,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutocompleteItem"
                  },
                  "title": "Response Mentions Autocomplete Slack Channels",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Autocomplete Slack Channels",
        "tags": [
          "mentions"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/mentions/users": {
      "get": {
        "description": "Return workspace members, filtered by name/email substring.",
        "operationId": "mentions_autocomplete_users",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "maxLength": 100,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutocompleteItem"
                  },
                  "title": "Response Mentions Autocomplete Users",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Autocomplete Users",
        "tags": [
          "mentions"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models": {
      "get": {
        "description": "List models available in the tenant (via tenant_model).\n\nFree-tier tenants only see models marked ``is_free=True``. SuperAdmins\nbypass the filter so they can debug paid models in any tenant.\n\nEach row carries both ``status`` (the global ``Model.status``) and\n``tenant_status`` (the per-tenant ``tenant_model.status`` override). The\ntenant org models page uses ``status`` to decide whether the toggle is\ninteractive at all \u2014 globally ``disabled`` / ``deprecated`` models stay\nun-toggleable per decision #13 \u2014 and ``tenant_status`` to drive the\nswitch's on/off state.",
        "operationId": "models_list_models",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantModelListItem"
                  },
                  "title": "Response Models List Models",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Models",
        "tags": [
          "models"
        ]
      },
      "post": {
        "description": "Create a model owned by the authenticated user.\n\nThe created model is auto-granted to the calling tenant (`tenant_model`).\nCross-tenant / impersonation flows are not supported here \u2014 admins use\n`routes/admin_models.py` for those.",
        "operationId": "models_create_model",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Model",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}": {
      "delete": {
        "operationId": "models_delete_model",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Model",
        "tags": [
          "models"
        ]
      },
      "get": {
        "operationId": "models_get_model",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Model",
        "tags": [
          "models"
        ]
      },
      "patch": {
        "description": "403 when the acting principal has read_only access (gated separately\nfrom Casbin). Casbin's `model:update` decides whether the principal is\nallowed at all \u2014 tenant admins, model owners, and super-admins per the\npolicy in `docs/content/models.md`.",
        "operationId": "models_update_model",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Model",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/disable": {
      "post": {
        "description": "Tenant admin: flip the per-tenant grant to ``disabled``. Idempotent.",
        "operationId": "models_disable_for_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantModelListItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Disable For Tenant",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/enable": {
      "post": {
        "description": "Tenant admin: flip the per-tenant grant to ``active``. Idempotent.\n\nBlocked when the SuperAdmin has globally disabled the model \u2014 that's\nlayer 1 of decision #13's cascade and a tenant admin can't override it.",
        "operationId": "models_enable_for_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantModelListItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enable For Tenant",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/grants/agents": {
      "post": {
        "description": "Model owner: grant a model to an agent (access=full|read_only).\n\nCasbin's `model:grant:agent` policy is what decides \"can this caller\ngrant this model?\" \u2014 owner-only, owner-or-tenant-admin, etc. \u2014 per\n`docs/content/models.md`. This route does not duplicate the check.",
        "operationId": "models_grant_to_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentModelGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant To Agent",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/grants/agents/{agent_id}": {
      "delete": {
        "description": "Model owner: revoke a model grant from an agent.",
        "operationId": "models_revoke_from_agent",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke From Agent",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/grants/users": {
      "post": {
        "description": "Tenant admin: grant a model to a user (access=full|read_only).",
        "operationId": "models_grant_to_user",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserModelGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserModelRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant To User",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/models/{model_id}/grants/users/{user_id}": {
      "delete": {
        "description": "Tenant admin: revoke a model grant from a user.",
        "operationId": "models_revoke_from_user",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke From User",
        "tags": [
          "models"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/openrouter/models": {
      "get": {
        "description": "List system-active OR models with the tenant's enable toggle.",
        "operationId": "openrouter_list_tenant_models",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/JsonObject"
                  },
                  "title": "Response Openrouter List Tenant Models",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Models",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/openrouter/models/{model_id}/disable": {
      "post": {
        "description": "Tenant admin: disable an OR model for the tenant. Idempotent.",
        "operationId": "openrouter_disable_for_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Openrouter Disable For Tenant",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Disable For Tenant",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/openrouter/models/{model_id}/enable": {
      "post": {
        "description": "Tenant admin: enable an OR model for the tenant. Idempotent.",
        "operationId": "openrouter_enable_for_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Openrouter Enable For Tenant",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enable For Tenant",
        "tags": [
          "openrouter"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/rbac/check": {
      "post": {
        "description": "What can user X + agent Y actually do? Drives the UI simulator.",
        "operationId": "rbac_simulate",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RBACCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RBACCheckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Simulate",
        "tags": [
          "rbac"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/rbac/policies": {
      "get": {
        "description": "Return all Casbin policies applicable to this tenant (tenant-scoped + global).",
        "operationId": "rbac_list_policies",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PolicyRead"
                  },
                  "title": "Response Rbac List Policies",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Policies",
        "tags": [
          "rbac"
        ]
      },
      "post": {
        "description": "Add a Casbin policy rule scoped to this tenant.",
        "operationId": "rbac_create_policy",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Policy",
        "tags": [
          "rbac"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/sessions": {
      "get": {
        "description": "All task sessions across every agent in this tenant, newest first.\n\nPowers the agents+tasks panes on the org billing page. The response model\nis ``TaskSessionRead`` with ``agent_name`` populated.",
        "operationId": "tasks_list_tenant_sessions_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TaskSessionRead"
                  },
                  "title": "Response Tasks List Tenant Sessions Route",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Sessions Route",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/settings/siem": {
      "get": {
        "description": "List configured SIEM destinations and custom redaction patterns.",
        "operationId": "siem_get_siem_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiemConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Siem Config",
        "tags": [
          "siem"
        ]
      },
      "put": {
        "description": "Replace SIEM destinations and custom redaction patterns.",
        "operationId": "siem_update_siem_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiemConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiemConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Siem Config",
        "tags": [
          "siem"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills": {
      "get": {
        "operationId": "skills_list_skills",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by lifecycle status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by lifecycle status",
              "title": "Status"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillRead"
                  },
                  "title": "Response Skills List Skills",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skills",
        "tags": [
          "skills"
        ]
      },
      "post": {
        "description": "Create a skill.\n\nFor executable skills a GitLab repo is scaffolded automatically and the\nresulting clone URL is stored on the row.\nFor text skills no repo is created; ``instruction_content`` is stored\ndirectly and the skill starts in ``draft`` status ready for immediate use\nonce activated.",
        "operationId": "skills_create_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/admin": {
      "get": {
        "description": "Tenant-admin view of all skills \u2014 no visibility filter, with agent count.\n\nReturns every skill owned by an agent in this tenant plus all global skills,\nregardless of ``visibility``.  Requires the ``skills:admin`` Casbin permission\n(OWNER / ADMIN inherit it via their wildcard; MEMBER / GUEST do not).",
        "operationId": "skills_list_skills_admin",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by lifecycle status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by lifecycle status",
              "title": "Status"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillAdminRead"
                  },
                  "title": "Response Skills List Skills Admin",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skills Admin",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/import": {
      "post": {
        "description": "Import a skill from an external zip package (Anthropic-format compatible).\n\nValidates package structure, ClamAV-scans all files (decision #24), creates\nthe skill in ``draft`` status, and pushes contents to a new GitLab repo.\nAdmin approval is required before the skill can be activated.",
        "operationId": "skills_import_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_skills_import_skill"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/pending-reviews": {
      "get": {
        "description": "List all skills pending admin review in this tenant.\n\nRequires ``skills:review`` permission (OWNER / ADMIN).",
        "operationId": "skills_list_pending_reviews",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillRead"
                  },
                  "title": "Response Skills List Pending Reviews",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pending Reviews",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}": {
      "delete": {
        "operationId": "skills_delete_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Skill",
        "tags": [
          "skills"
        ]
      },
      "get": {
        "description": "Return skill metadata. Private skills are only accessible to their owner.",
        "operationId": "skills_get_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Skill",
        "tags": [
          "skills"
        ]
      },
      "patch": {
        "operationId": "skills_update_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/agents": {
      "get": {
        "description": "Return agents in this tenant that have this skill attached.\n\nAuthorization is OR-logic, matching the admin inventory contract:\n  1. Allow if the caller holds ``skills:admin`` (OWNER / ADMIN), OR\n  2. Allow if the caller created the skill's owning agent (private-skill\n     owner). Global skills (``owner_agent_id IS NULL``) cannot satisfy\n     path (2) because there is no owning agent \u2014 they require\n     ``skills:admin``.\n\nReturns a list of ``{agent_id, name, is_enabled}`` objects ordered by name.",
        "operationId": "skills_list_skill_agents",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillAgentRead"
                  },
                  "title": "Response Skills List Skill Agents",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skill Agents",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/execute": {
      "post": {
        "description": "Execute a skill on behalf of an agent session.\n\nValidates the agent has an ``agent_skill`` grant, then records the invocation.\nActual dispatch into the agent runtime (loading the skill as a LangChain tool)\nis handled by the agent SDK; this endpoint is the API-side hook that writes the\n``skill_invocation`` audit row.",
        "operationId": "skills_execute_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillExecuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillInvocationRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Execute Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/fork": {
      "post": {
        "description": "Fork a skill \u2014 create an independent copy under an agent the caller owns.\n\nThe fork gets ``visibility='private'`` and ``status='draft'``. Lineage is\nstored via ``forked_from_skill_id`` / ``forked_from_version``.\n\nAuthorization is two-sided to match the per-agent ownership model:\n\n  - Source skill: same gate as ``GET /skills/{skill_id}`` \u2014 a private\n    skill the caller can't read returns 403.\n  - Target agent: caller must be the agent's creator, *or* an org admin.\n    Without this, any user holding ``skills:fork`` could attach a skill\n    to someone else's private agent via the auto-attach side-effect.",
        "operationId": "skills_fork_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillForkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillForkRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fork Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/invocations": {
      "get": {
        "description": "List invocations for a skill, newest first by execution start time.",
        "operationId": "skills_list_skill_invocations",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "user_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "in": "query",
            "name": "session_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Session Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SkillInvocationRead"
                  },
                  "title": "Response Skills List Skill Invocations",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Skill Invocations",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/publish": {
      "post": {
        "description": "Publish a new version: regenerate embedding + summary, flip status to active.\n\nThe skill's ``description`` field (= the Skill.md body) is used to generate\nthe embedding and summary via the model broker.  ClamAV scans the description\nbytes before broker calls (decision #24).",
        "operationId": "skills_publish_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillPublishRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Publish Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/review": {
      "post": {
        "description": "Admin approves or rejects a pending skill.\n\nRequires ``skills:review`` permission (OWNER / ADMIN via wildcard).\nOn approval the skill transitions to ``active``; on rejection it\nreturns to ``draft`` for revision.",
        "operationId": "skills_review_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillReviewDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillReviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Review Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/submit-review": {
      "post": {
        "description": "Submit a draft skill for admin review.\n\nOnly the skill owner (or a user with ``skills:update``) may submit.\nThe skill must be in ``draft`` status.",
        "operationId": "skills_submit_skill_for_review",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillReviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Skill For Review",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/transfer": {
      "post": {
        "description": "Transfer skill ownership to another agent. Only org admins may transfer.\n\nThe single authorization gate is the ``skills:transfer`` ``require(...)``\ndep on this route. ``skills:transfer`` is admin-only by design \u2014 OWNER /\nADMIN inherit it via their ``/{tenant_id}/*, *`` wildcard in\n``policy.csv`` and MEMBER / GUEST are not granted it (issue #544). The\nseed migration for ``skills:fork`` (``0099_seed_skill_fork_policy``)\nintentionally does NOT seed ``skills:transfer`` for any non-admin role\nfor the same reason. No defence-in-depth ``skills:admin`` re-check is\nneeded here \u2014 and adding one is actively confusing because it would 403\neven SUPER_ADMIN callers if the wildcard ever drifted.",
        "operationId": "skills_transfer_skill",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillTransferRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Transfer Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/webhook": {
      "delete": {
        "operationId": "skill_webhooks_delete_skill_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Skill Webhook",
        "tags": [
          "skill-webhooks"
        ]
      },
      "get": {
        "operationId": "skill_webhooks_get_skill_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillWebhookRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Skill Webhook",
        "tags": [
          "skill-webhooks"
        ]
      },
      "post": {
        "operationId": "skill_webhooks_create_skill_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillWebhookCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Skill Webhook",
        "tags": [
          "skill-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/skills/{skill_id}/webhook/rotate": {
      "post": {
        "operationId": "skill_webhooks_rotate_skill_webhook_token",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillWebhookCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Skill Webhook Token",
        "tags": [
          "skill-webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/sso-config": {
      "get": {
        "description": "Return the SSO / Keycloak realm configuration for this tenant.",
        "operationId": "identities_get_sso_config",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SSOConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Sso Config",
        "tags": [
          "identities"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/webhooks": {
      "get": {
        "operationId": "webhooks_list_routes",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookRouteRead"
                  },
                  "title": "Response Webhooks List Routes",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Routes",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "operationId": "webhooks_create_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRouteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRouteCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Route",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/webhooks/{route_id}": {
      "delete": {
        "operationId": "webhooks_delete_route",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Route",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/tenant/{tenant_id}/webhooks/{route_id}/rotate-secret": {
      "post": {
        "operationId": "webhooks_rotate_secret",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "route_id",
            "required": true,
            "schema": {
              "title": "Route Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRouteCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate Secret",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/tenants": {
      "post": {
        "description": "Any authenticated user can create a tenant \u2014 they become its OWNER.\n\n``tenant:create`` isn't checked via Casbin because there's no tenant to anchor it\nagainst yet; it's a platform-level action available to every authenticated user.",
        "operationId": "tenants_create_tenant",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Tenant",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}": {
      "get": {
        "operationId": "tenants_get_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tenant",
        "tags": [
          "tenants"
        ]
      },
      "patch": {
        "operationId": "tenants_update_tenant",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Tenant",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/allowed-accounts": {
      "get": {
        "operationId": "tenant_allowed_accounts_list_allowed_accounts",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantAllowedAccountRead"
                  },
                  "title": "Response Tenant Allowed Accounts List Allowed Accounts",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Allowed Accounts",
        "tags": [
          "tenant-allowed-accounts"
        ]
      },
      "post": {
        "operationId": "tenant_allowed_accounts_create_allowed_account",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantAllowedAccountCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantAllowedAccountRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Allowed Account",
        "tags": [
          "tenant-allowed-accounts"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/allowed-accounts/{account_id}": {
      "delete": {
        "operationId": "tenant_allowed_accounts_delete_allowed_account",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "account_id",
            "required": true,
            "schema": {
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Allowed Account",
        "tags": [
          "tenant-allowed-accounts"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/brand": {
      "get": {
        "operationId": "tenant_brand_get_brand",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBrandRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Brand",
        "tags": [
          "tenant-brand"
        ]
      },
      "put": {
        "description": "Upsert the colour theme. Fields left unset are not touched; passing\nexplicit ``null`` clears a single field.",
        "operationId": "tenant_brand_update_brand_theme",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantBrandUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBrandRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Brand Theme",
        "tags": [
          "tenant-brand"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/brand/favicon": {
      "delete": {
        "operationId": "tenant_brand_delete_favicon",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Favicon",
        "tags": [
          "tenant-brand"
        ]
      },
      "get": {
        "description": "Stream the effective favicon for this tenant.\n\nFalls back to the platform default when the tenant hasn't uploaded\none, so the same URL is safe for layouts to embed unconditionally.\nA 404 means no tenant favicon AND no platform default.",
        "operationId": "tenant_brand_fetch_favicon",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Favicon",
        "tags": [
          "tenant-brand"
        ]
      },
      "post": {
        "description": "Upload a brand favicon. ClamAV-scanned before storage.",
        "operationId": "tenant_brand_upload_favicon",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_tenant_brand_upload_favicon"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBrandFaviconUploaded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Favicon",
        "tags": [
          "tenant-brand"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/brand/logo": {
      "delete": {
        "operationId": "tenant_brand_delete_logo",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Logo",
        "tags": [
          "tenant-brand"
        ]
      },
      "get": {
        "description": "Stream the logo bytes back to the browser.\n\nAuth-gated by ``tenant:brand:read`` so non-members can't enumerate\narbitrary tenants' logos. The bytes come straight from the tenant's\nGCS bucket; we never hand out signed URIs.",
        "operationId": "tenant_brand_fetch_logo",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Fetch Logo",
        "tags": [
          "tenant-brand"
        ]
      },
      "post": {
        "description": "Upload a brand logo. Scanned via ClamAV before storage; a non-clean\nverdict returns 422 and no DB row is written.",
        "operationId": "tenant_brand_upload_logo",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_tenant_brand_upload_logo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBrandLogoUploaded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Logo",
        "tags": [
          "tenant-brand"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/default-permissions": {
      "get": {
        "description": "Return the tenant-wide default permission set.",
        "operationId": "tenants_get_default_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultPermissionsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Default Permissions",
        "tags": [
          "tenants"
        ]
      },
      "put": {
        "description": "Update tenant-wide default permissions (tenant admin only).",
        "operationId": "tenants_update_default_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefaultPermissionsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultPermissionsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Default Permissions",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/invites": {
      "post": {
        "operationId": "tenants_invite_user",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invite User",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/mail/mailboxes": {
      "get": {
        "description": "Read-only roster of this tenant's mailboxes (internal + external).\n\nBoth kinds are returned in a single call so the front-end can render one\ntable; the ``service`` column on each row tells them apart. Active\nmailboxes come first, then internal-vs-external, then alphabetical by\naddress \u2014 see ``services.tenant_mail.list_tenant_mailboxes``.\n\nCasbin gates this on ``tenant:mail:read``; OWNER/ADMIN inherit it from\ntheir ``/{tenant_id}/*`` wildcard in ``policy.csv``, MEMBER/GUEST/VIEWER\ndon't (mailbox addresses leak which agents exist, so the roster stays\ntenant-admin only).",
        "operationId": "tenant_mail_list_tenant_mailboxes",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantMailboxRow"
                  },
                  "title": "Response Tenant Mail List Tenant Mailboxes",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Mailboxes",
        "tags": [
          "tenant-mail"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/members": {
      "get": {
        "operationId": "tenants_list_members",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TenantMember"
                  },
                  "title": "Response Tenants List Members",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Members",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/members/{user_id}": {
      "delete": {
        "operationId": "tenants_remove_member",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Member",
        "tags": [
          "tenants"
        ]
      },
      "patch": {
        "description": "Change a member's role. Cannot change the OWNER's role.",
        "operationId": "tenants_update_member_role",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRoleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantMember"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Member Role",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/sessions/audit": {
      "get": {
        "description": "Paginated list of all sessions across all agents in this tenant.\n\nPowers the Organization > Sessions audit page. Query params support\nfiltering by agent, user, date range, and keyword search on session title.\nRequires tenant admin role (OWNER/ADMIN).",
        "operationId": "session_audit_list_sessions_audit",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "user_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "in": "query",
            "name": "start",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "in": "query",
            "name": "end",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditSessionListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Sessions Audit",
        "tags": [
          "session-audit"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/sessions/audit-export": {
      "get": {
        "description": "Export filtered session list as CSV or JSON.\n\nUses the same filters as the list endpoint. Fetches up to 10 000 rows\n(hard cap) to keep the export bounded.",
        "operationId": "session_audit_export_sessions_audit",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "json"
              ],
              "title": "Format",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "user_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "in": "query",
            "name": "start",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "in": "query",
            "name": "end",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Sessions Audit",
        "tags": [
          "session-audit"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/sessions/audit/{session_id}": {
      "get": {
        "description": "Full debug data for a single session, including all messages with tool\ncalls, system prompts, token usage, and cost attribution.\n\nEvery call writes an ``audit_log`` entry so there's a trail of who\ninspected which session's debug data.",
        "operationId": "session_audit_get_session_audit_detail",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditSessionDetailResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Session Audit Detail",
        "tags": [
          "session-audit"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/skill-visibility-scope-default": {
      "put": {
        "description": "Set the tenant-wide default skill-authoring visibility scope.\n\nSeeds ``skill_visibility_scope`` on newly created agents. Existing agents\nare not retroactively changed. Requires ``tenant:update`` (OWNER/ADMIN only).\nSee issue #550.",
        "operationId": "tenants_update_skill_visibility_scope_default",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantSkillVisibilityScopeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Skill Visibility Scope Default",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/tenants/{tenant_id}/users/{user_id}/permissions": {
      "get": {
        "description": "Return effective permissions for a user in this tenant.",
        "operationId": "tenants_get_user_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUserPermissionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get User Permissions",
        "tags": [
          "tenants"
        ]
      },
      "put": {
        "description": "Update per-user capability overrides (tenant admin only).",
        "operationId": "tenants_update_user_permissions",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantUserPermissionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUserPermissionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update User Permissions",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v1/threads": {
      "post": {
        "operationId": "assistants_shim_create_thread",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ThreadCreateRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Thread",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/threads/{thread_id}": {
      "get": {
        "operationId": "assistants_shim_get_thread",
        "parameters": [
          {
            "in": "path",
            "name": "thread_id",
            "required": true,
            "schema": {
              "title": "Thread Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Thread",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/threads/{thread_id}/messages": {
      "get": {
        "operationId": "assistants_shim_list_messages",
        "parameters": [
          {
            "in": "path",
            "name": "thread_id",
            "required": true,
            "schema": {
              "title": "Thread Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "title": "Order",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Messages",
        "tags": [
          "assistants-shim"
        ]
      },
      "post": {
        "operationId": "assistants_shim_create_message",
        "parameters": [
          {
            "in": "path",
            "name": "thread_id",
            "required": true,
            "schema": {
              "title": "Thread Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Message",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/threads/{thread_id}/runs": {
      "post": {
        "operationId": "assistants_shim_create_run",
        "parameters": [
          {
            "in": "path",
            "name": "thread_id",
            "required": true,
            "schema": {
              "title": "Thread Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Run",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/v1/threads/{thread_id}/runs/{run_id}": {
      "get": {
        "operationId": "assistants_shim_get_run",
        "parameters": [
          {
            "in": "path",
            "name": "thread_id",
            "required": true,
            "schema": {
              "title": "Thread Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Run",
        "tags": [
          "assistants-shim"
        ]
      }
    },
    "/api/webhooks/skills/{webhook_id}": {
      "post": {
        "description": "Public endpoint. Auth is bearer token; webhook_id resolves the skill.\n\nOn a verified call we cold-start a session for the skill's owner agent and\nforward the raw payload through ``proxy_client.inbound`` so the inbound\nguardrails run and the work item lands on the agent's Valkey stream\n(decision #16).",
        "operationId": "skill_webhooks_public_invoke_skill_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Skill Webhooks Public Invoke Skill Webhook",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invoke Skill Webhook",
        "tags": [
          "skill-webhooks-public"
        ]
      }
    },
    "/api/webhooks/stripe/{path_token}": {
      "post": {
        "description": "Public Stripe webhook receiver.\n\n1. Validate path_token.\n2. HMAC-verify the body.\n3. Insert StripeEvent row (idempotency).\n4. Dispatch to per-event handler.",
        "operationId": "stripe_webhooks_stripe_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "path_token",
            "required": true,
            "schema": {
              "title": "Path Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookAck"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stripe Webhook",
        "tags": [
          "stripe-webhooks",
          "stripe-webhooks"
        ]
      }
    },
    "/api/webhooks/{provider}/{path_token}": {
      "post": {
        "description": "Public endpoint. Auth is HMAC via provider signature; path_token resolves the route.",
        "operationId": "webhooks_public_receive_webhook",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path_token",
            "required": true,
            "schema": {
              "title": "Path Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Receive Webhook",
        "tags": [
          "webhooks-public"
        ]
      }
    },
    "/tenant/{tenant_id}/agent/{agent_id}/session/{session_id}/events": {
      "get": {
        "description": "SSE stream of agent events sourced from Valkey ``events:<session_id>``.\n\nA reconnecting client sends ``Last-Event-ID: <cursor>``; we resume from\nthere. Without the header we start at ``$`` \u2014 only events written after\nthe subscription begins, which avoids replaying the full history on a\nfresh open. The internal twin at ``/api/v1/internal/...`` exists for\nservice-JWT callers that need the same fan-out without going through\nthe browser auth surface.",
        "operationId": "agent_proxy_stream_events",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Dev-User-Email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Dev-User-Email"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Events",
        "tags": [
          "agent-proxy"
        ]
      }
    }
  }
}
